[CoordGraphics] Fix compilation errors around USE(COORDINATED_GRAPHICS)
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-06-07  Don Olmstead  <don.olmstead@sony.com>
2
3         [CoordGraphics] Fix compilation errors around USE(COORDINATED_GRAPHICS)
4         https://bugs.webkit.org/show_bug.cgi?id=186374
5
6         Reviewed by Žan Doberšek.
7
8         No new tests. No change in behavior.
9
10         * page/scrolling/AsyncScrollingCoordinator.cpp:
11         (WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
12         (WebCore::AsyncScrollingCoordinator::reconcileViewportConstrainedLayerPositions):
13         * page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp:
14         * page/scrolling/coordinatedgraphics/ScrollingTreeFixedNode.cpp:
15         * page/scrolling/coordinatedgraphics/ScrollingTreeStickyNode.cpp:
16         * platform/PlatformWheelEvent.h:
17         * platform/graphics/nicosia/NicosiaPaintingEngineThreaded.cpp:
18         * platform/graphics/nicosia/NicosiaPaintingEngineThreaded.h:
19         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
20         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h:
21
22 2018-06-07  Thibault Saunier  <tsaunier@igalia.com> and Alejandro G. Castro  <alex@igalia.com>
23
24         [GTK][WPE] Start implementing MediaStream API
25         https://bugs.webkit.org/show_bug.cgi?id=185787
26
27         Reviewed by Philippe Normand.
28
29         We are adding all the required classes to make the
30         MediaStream API work, that means our own RealtimeMediaSourceCenterLibWebRTC
31         for the platform, the GStreamerCaptureDeviceManager, the audio/video capturers
32         and their respective audio/video sources as well as a dedicated GStreamer Source
33         that adds support for using MediaStream stream inside playbin3.
34         We are using the GstDeviceMonitor to list devices on the devices.
35
36         Enable mediastream tests.
37
38         * platform/GStreamer.cmake: Added the new files to the compilation.
39         * platform/audio/AudioStreamDescription.h: Added new GStreamer type.
40         * platform/audio/PlatformAudioData.h: Added new GStreamer type for
41         the GStreamerAudioData class.
42         * platform/graphics/gstreamer/GStreamerCommon.cpp:
43         (WebCore::simpleBusMessageCallback): This function and the next
44         one help us to connect a monitoring callback to a pipeline for
45         debugging.
46         (WebCore::connectSimpleBusMessageCallback): Ditto.
47         * platform/graphics/gstreamer/GStreamerCommon.h: Ditto
48         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
49         (WebCore::MediaPlayerPrivateGStreamer::load): Make use of the loadFull() method.
50         (WebCore::MediaPlayerPrivateGStreamer::loadFull): Very similar to load()
51         but allows specifying what pipeline type to use (null to let the function determine
52         which one should be used). This is required as we force to always use playbin3 for the
53         mediastream source as it relies on the GstStream API.
54         (WebCore::MediaPlayerPrivateGStreamer::playbackPosition const): Style fix.
55         (WebCore::MediaPlayerPrivateGStreamer::naturalSize const): Added, use MediaStream specific information if available.
56         (WebCore::MediaPlayerPrivateGStreamer::updateTracks): Some style fixes.
57         (WebCore::MediaPlayerPrivateGStreamer::handleMessage): Enhance dotfiles names.
58         (WebCore::MediaPlayerPrivateGStreamer::processTableOfContentsEntry): Minor formatting fix.
59         (WebCore::MediaPlayerPrivateGStreamer::sourceSetup): Set MediaStream on WebKitMediaStreamSource when setting it up.
60         (WebCore::MediaPlayerPrivateGStreamer::supportsType): Advertise that we support MediaStream if support is built.
61         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin): Make sure playbin3 is forced when loading a MediaStream.
62         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: Add a reference to the MediaStream object and declare loadFull and naturalSize override.
63         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
64         (WebCore::registerWebKitGStreamerElements): Register the new MediaStreamSrc element.
65         * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp:
66         (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.
67         * platform/mediastream/RealtimeMediaSource.h: Make CaptureFailed a virtual method as in our mocks we require need to make
68         * platform/mediastream/RealtimeMediaSourceCenter.cpp:
69         (WebCore::RealtimeMediaSourceCenter::singleton): Remove the code
70         used for compilation for the platform when we do not have a
71         RealtimeMediaSourceCenterLibWebRTC. Now we return the proper class
72         for the platform.
73         * platform/mediastream/gstreamer/GStreamerAudioCaptureSource.cpp:
74         Added class representing the RealtimeMediaSource for the Audio
75         with GStreamer.
76         * platform/mediastream/gstreamer/GStreamerAudioCaptureSource.h:
77         Ditto.
78         * platform/mediastream/gstreamer/GStreamerAudioCapturer.cpp: Added
79         this class that represents the GStreamer pipeline that captures
80         audio from the system devices, it inherits from GStreamerCapturer.
81         * platform/mediastream/gstreamer/GStreamerAudioCapturer.h: Dito.
82         * platform/mediastream/gstreamer/GStreamerAudioData.h: Added this
83         class implementing PlatformAudioData for the GStreamer platform,
84         used to pass the samples information.
85         * platform/mediastream/gstreamer/GStreamerAudioStreamDescription.h:
86         Added this class implementing AudioStreamDescription to export the
87         information about the audio stream to libwebrtc.
88         * platform/mediastream/gstreamer/GStreamerCaptureDevice.h: Added
89         this base class for the audio and video capturing devices, it
90         implements general WebKit CaptureDevice class.
91         * platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.cpp:
92         Added this class that implements the system monitor to get the
93         list of available devices in the system. It uses GstDeviceMonitor
94         to handle the operation. It uses two singleton device managers one
95         for audio and another one for video, as required by the
96         RealtimeMediaSourceCenter design.
97         * platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.h: Ditto.
98         * platform/mediastream/gstreamer/GStreamerCapturer.cpp: Added this
99         base class representing how GStreamer captures the media from the
100         input devices in the system. Two classes inherit from this one to
101         capture audio and video. It setups the GStreamer pipeline and adds
102         functions to control it.
103         * platform/mediastream/gstreamer/GStreamerCapturer.h: Ditto.
104         * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp: Added.
105         Implements a subclass of GstBin as a source element that will contain several
106         GstAppSrc, basically one per MediaStreamTrackPrivate of the MediaStreamPrivate
107         passed in parameter. It adds Observers on the MediaStreamTracks and
108         pushes the data to the sources as required. The element implements the GstURIHandler
109         interface so it can be used in playbin. The MediaPlayerPrivateGStreamer is responsible
110         for passing the MediaStreamPrivate object to the source when required.
111         (WebCore::webkitMediaStreamSrcPadProbeCb): Event probe that fixes stream_start events (setting the ID etc)
112         and finally add src pads to the pipeline.
113         * platform/mediastream/gstreamer/GStreamerMediaStreamSource.h: Ditto.
114         * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
115         Added this RealtimeMediaSource representing the source of the
116         video data for the GStreamer platform. It handles the settings and
117         capabilities of the source and creates the capturer used to
118         control the operation of the stream.
119         * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h: Ditto.
120         * platform/mediastream/gstreamer/GStreamerVideoCapturer.cpp: Added
121         this class that inherits from the GStreamerCapturer and controls
122         the GStreamer pipelines of the video streams of the system.
123         * platform/mediastream/gstreamer/GStreamerVideoCapturer.h: Ditto.
124         * platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.cpp: Added. Implementation of a Mock capturer for audio stream.
125         Subclasses GStreamerAudioCapturer and wraps a MockRealtimeAudioSource so that the behaviour is the same a MockRealtimeAudioSource
126         but still the GStreamer implementation code paths are tested.
127         * platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.h: Ditto.
128         * platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.cpp: Added. Implementation of a Mock capturer for video stream.
129         Subclasses GStreamerVideoCapturer and wraps a MockRealtimeVideoSource so that the behaviour is the same a MockRealtimeVideoSource
130         but still the GStreamer implementation code paths are tested.
131         * platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.h: Ditto.
132         * platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.cpp:
133         Added this class that implements the key RealtimeMediaSourceCenter
134         functions to configure the base class for the platform, using the
135         other GStreamer classes.
136         * platform/mock/MockRealtimeAudioSource.cpp: Do not build ::create if GStreamer implementation is built
137         * platform/mock/MockRealtimeVideoSource.cpp: Do not build ::create if GStreamer implementation is built
138
139 2018-06-07  Brent Fulgham  <bfulgham@apple.com>
140
141         Handle Storage Access API calls in the absence of an attached frame
142         https://bugs.webkit.org/show_bug.cgi?id=186373
143         <rdar://problem/40028265>
144
145         Reviewed by Daniel Bates.
146
147         Tests: http/tests/storageAccess/has-storage-access-crash.html
148                http/tests/storageAccess/request-storage-access-crash.html
149
150         The new frame-specific storage access checks were done without confirming a
151         frame was present, although the frame state was validated in other parts of
152         the same method.
153         
154         This patch checks for a non-null frame before making frame-specific calls.
155
156         * dom/Document.cpp:
157         (WebCore::Document::hasStorageAccess):
158         (WebCore::Document::requestStorageAccess):
159
160 2018-06-07  Zalan Bujtas  <zalan@apple.com>
161
162         [LFC] Merge height and vertical margin computation
163         https://bugs.webkit.org/show_bug.cgi?id=186394
164
165         Reviewed by Antti Koivisto.
166
167         To match the spec (and the width/horizontal margin computation). -currently with default values.
168
169         * layout/FormattingContext.cpp:
170         (WebCore::Layout::FormattingContext::computeFloatingHeightAndMargin const):
171         (WebCore::Layout::FormattingContext::computeOutOfFlowHeight const):
172         (WebCore::Layout::FormattingContext::computeFloatingHeight const): Deleted.
173         * layout/FormattingContext.h:
174         * layout/FormattingContextGeometry.cpp:
175         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHeightAndMargin):
176         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHeightAndMargin):
177         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedHeightAndMargin):
178         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin):
179         (WebCore::Layout::FormattingContext::Geometry::outOfFlowHeightAndMargin):
180         (WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin):
181         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
182         (WebCore::Layout::outOfFlowNonReplacedHeight): Deleted.
183         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHeight): Deleted.
184         (WebCore::Layout::floatingNonReplacedHeight): Deleted.
185         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeight): Deleted.
186         (WebCore::Layout::FormattingContext::Geometry::outOfFlowHeight): Deleted.
187         (WebCore::Layout::FormattingContext::Geometry::floatingHeight): Deleted.
188         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeight): Deleted.
189         * layout/blockformatting/BlockFormattingContext.cpp:
190         (WebCore::Layout::BlockFormattingContext::layout const):
191         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
192         (WebCore::Layout::BlockFormattingContext::computeInFlowHeightAndMargin const):
193         (WebCore::Layout::BlockFormattingContext::computeHeight const): Deleted.
194         (WebCore::Layout::BlockFormattingContext::computeInFlowHeight const): Deleted.
195         * layout/blockformatting/BlockFormattingContext.h:
196         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
197         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
198         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
199         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeight): Deleted.
200         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeight): Deleted.
201
202 2018-06-07  Antti Koivisto  <antti@apple.com>
203
204         Don't start service worker fetch when there is substitute data
205         https://bugs.webkit.org/show_bug.cgi?id=186349
206         <rdar://problem/38881568>
207
208         Reviewed by Youenn Fablet.
209
210         Loading content via WKWebView.loadData may also end up starting a main resource service worker fetch.
211         This breaks DocumentWriter assumptions.
212
213         * loader/DocumentLoader.cpp:
214         (WebCore::DocumentLoader::tryLoadingRequestFromApplicationCache):
215         (WebCore::DocumentLoader::tryLoadingSubstituteData):
216
217         Factor substitute resource loading out from tryLoadingRequestFromApplicationCache.
218
219         (WebCore::DocumentLoader::startLoadingMainResource):
220
221         If we have substitute data already (typically from WKWebView.loadData), allow service worker registration
222         but load the main resource using the substitute data.
223
224         (WebCore::DocumentLoader::handleSubstituteDataLoadSoon): Deleted.
225
226         Merge to tryLoadingSubstituteData.
227
228         * loader/DocumentLoader.h:
229
230 2018-06-07  Thibault Saunier  <tsaunier@igalia.com>
231
232         [GStreamer] Fix the way GstStreamCollection is handled
233         https://bugs.webkit.org/show_bug.cgi?id=184588
234
235         Reviewed by Philippe Normand.
236
237         The stream collection message replaces the collection of stream previously
238         advertised, this means that we should rebuild our set of Track from scratch
239         and not update previously exposed tracks.
240
241         In the end, this simplifies the code as we do not care about what
242         tracks existed previously, we just need to expose what GStreamer tells
243         us, deleting any previous state.
244
245         Handle the STREAM_COLLECTION message from the sync handler so that tracks
246         are updated before we mark the pipeline as READY for the live case (everything
247         happen synchronously with the call to the `load()` method in that case),
248         the update still always happens on the main thread.
249
250         No new tests is added as this is mostly refactoring, it is already tested and it
251         will fix MediaStream tests that are currently disabled as the support is being
252         implemented in #185787.
253
254         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
255         (WebCore::MediaPlayerPrivateGStreamer::clearTracks): Removes all tracks.
256         (WebCore::MediaPlayerPrivateGStreamer::updateTracks): Updates configured tracks from the new GstStreamColection track.
257         (WebCore::MediaPlayerPrivateGStreamer::handleMessage): Stop handling GST_STREAM_COLLECTION event.
258         (WebCore::MediaPlayerPrivateGStreamer::handleSyncMessage): Handle stream collection event synchronously.
259         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: Add handleSyncMessage
260
261 2018-06-07  Michael Catanzaro  <mcatanzaro@igalia.com>
262
263         Remove unused image encoders
264         https://bugs.webkit.org/show_bug.cgi?id=186365
265
266         Reviewed by Carlos Garcia Campos.
267
268         * platform/image-encoders/JPEGImageEncoder.cpp: Removed.
269         * platform/image-encoders/JPEGImageEncoder.h: Removed.
270         * platform/image-encoders/PNGImageEncoder.cpp: Removed.
271         * platform/image-encoders/PNGImageEncoder.h: Removed.
272
273 2018-06-06  Youenn Fablet  <youenn@apple.com>
274
275         HTTP Header values validation is too strict
276         https://bugs.webkit.org/show_bug.cgi?id=167112
277
278         Reviewed by Alex Christensen.
279
280         Moving header values and names from DOMString to ByteString as per spec.
281         Updating WebCore::isValidHTTPHeaderValue as per https://fetch.spec.whatwg.org/#terminology-headers.
282
283         Covered by rebased and updated tests.
284         Updated test is now also passing in other browsers.
285
286         * platform/network/HTTPParsers.cpp:
287         (WebCore::isValidHTTPHeaderValue):
288
289 2018-06-06  Youenn Fablet  <youenn@apple.com>
290
291         Add Accept-Encoding: identity to Range requests
292         https://bugs.webkit.org/show_bug.cgi?id=186335
293         <rdar://problem/40837190>
294
295         Reviewed by Eric Carlson.
296
297         Tests: imported/w3c/web-platform-tests/fetch/range/general.any.html
298                imported/w3c/web-platform-tests/fetch/range/general.any.worker.html
299
300         * loader/cache/CachedResourceLoader.cpp:
301         (WebCore::CachedResourceLoader::updateHTTPRequestHeaders):
302         * loader/cache/CachedResourceRequest.cpp:
303         (WebCore::CachedResourceRequest::updateAcceptEncodingHeader):
304         * loader/cache/CachedResourceRequest.h:
305
306 2018-06-06  Per Arne Vollan  <pvollan@apple.com>
307
308         Display links are sometimes not notifying WebCore when fired.
309         https://bugs.webkit.org/show_bug.cgi?id=186367
310         <rdar://problem/40439109>
311
312         Reviewed by Brent Fulgham.
313
314         When the WebContent process is receiving an IPC message notifying about a screen update, all display refresh monitors
315         are notified by the manager in DisplayRefreshMonitorManager::displayWasUpdated(). The manager checks that the monitor
316         is scheduled before notifying. This is a problem, since the scheduled flag is always set to false in the
317         DisplayRefreshMonitor::displayDidRefresh() method, when the monitor is first notified about a screen update. This can
318         lead to display links running without notifying the monitors, causing extra CPU usage. It can also prevent them from
319         being deleted, since the monitors are not notified. Instead, we can check that the display refresh monitor is active
320         before notifying it. This matches the original display link implementation used when the WebContent process has
321         WindowServer access, where the monitors are always notified.
322
323         No new tests, since I have not been able to reproduce this in a test case yet.
324
325         * platform/graphics/DisplayRefreshMonitorManager.cpp:
326         (WebCore::DisplayRefreshMonitorManager::displayWasUpdated):
327
328 2018-06-06  Antoine Quint  <graouts@apple.com>
329
330         Rename color-filter to -apple-color-filter and do not expose it to Web content
331         https://bugs.webkit.org/show_bug.cgi?id=186306
332         <rdar://problem/39874167>
333
334         Reviewed by Simon Fraser.
335
336         Rename the color-filter CSS property to -apple-color-filter.
337
338         * animation/KeyframeEffectReadOnly.cpp:
339         (WebCore::KeyframeEffectReadOnly::checkForMatchingColorFilterFunctionLists):
340         * css/CSSComputedStyleDeclaration.cpp:
341         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
342         * css/CSSGradientValue.cpp:
343         (WebCore::CSSGradientValue::image):
344         (WebCore::CSSGradientValue::computeStops):
345         (WebCore::CSSGradientValue::knownToBeOpaque const):
346         * css/CSSProperties.json:
347         * css/parser/CSSPropertyParser.cpp:
348         (WebCore::CSSPropertyParser::parseSingleValue):
349         * page/animation/CSSPropertyAnimation.cpp:
350         (WebCore::blendFunc):
351         (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
352         * page/animation/ImplicitAnimation.cpp:
353         (WebCore::ImplicitAnimation::checkForMatchingColorFilterFunctionLists):
354         * page/animation/KeyframeAnimation.cpp:
355         (WebCore::KeyframeAnimation::checkForMatchingColorFilterFunctionLists):
356         * rendering/InlineTextBox.cpp:
357         (WebCore::InlineTextBox::paintMarkedTextForeground):
358         (WebCore::InlineTextBox::paintMarkedTextDecoration):
359         * rendering/style/RenderStyle.cpp:
360         (WebCore::RenderStyle::changeRequiresRepaint const):
361         (WebCore::RenderStyle::visitedDependentColorWithColorFilter const):
362         (WebCore::RenderStyle::colorByApplyingColorFilter const):
363         * rendering/style/RenderStyle.h:
364         (WebCore::RenderStyle::mutableAppleColorFilter):
365         (WebCore::RenderStyle::appleColorFilter const):
366         (WebCore::RenderStyle::hasAppleColorFilter const):
367         (WebCore::RenderStyle::setAppleColorFilter):
368         (WebCore::RenderStyle::initialAppleColorFilter):
369         (WebCore::RenderStyle::mutableColorFilter): Deleted.
370         (WebCore::RenderStyle::colorFilter const): Deleted.
371         (WebCore::RenderStyle::hasColorFilter const): Deleted.
372         (WebCore::RenderStyle::setColorFilter): Deleted.
373         (WebCore::RenderStyle::initialColorFilter): Deleted.
374         * rendering/style/StyleRareInheritedData.cpp:
375         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
376         (WebCore::StyleRareInheritedData::operator== const):
377         (WebCore::StyleRareInheritedData::hasColorFilters const):
378         * rendering/style/StyleRareInheritedData.h:
379
380 2018-06-06  Jer Noble  <jer.noble@apple.com>
381
382         REGRESSION (r231817?): Layout Test media/track/track-delete-during-setup.html is a flaky timeout
383         https://bugs.webkit.org/show_bug.cgi?id=185889
384         <rdar://problem/40583180>
385
386         Reviewed by Eric Carlson.
387
388         Explicitly update the network and ready states when detaching the AVPlayerItem
389         from the AVPlayer.
390
391         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
392         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldBufferData):
393
394 2018-06-06  Antoine Quint  <graouts@apple.com>
395
396         Use the default label for snapshotted plug-ins if no mime-type is available
397         https://bugs.webkit.org/show_bug.cgi?id=186348
398
399         Reviewed by Jon Lee.
400
401         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.
402
403         * html/HTMLPlugInImageElement.cpp:
404         (WebCore::titleText):
405         (WebCore::subtitleText):
406
407 2018-06-06  Timothy Hatcher  <timothy@apple.com>
408
409         Wrong NSVisualEffectMaterial used for exit full screen overlay in dark mode.
410
411         https://bugs.webkit.org/show_bug.cgi?id=186350
412         rdar://problem/39135535
413
414         Reviewed by Anders Carlsson.
415
416         * platform/mac/WebCoreFullScreenPlaceholderView.mm:
417         (-[WebCoreFullScreenPlaceholderView initWithFrame:]):
418         Use the NSVisualEffectMaterialFullScreenUI on macOS 10.14 and don't
419         set an explicit NSAppearance.
420
421 2018-06-06  Jer Noble  <jer.noble@apple.com>
422
423         Regions outside of the fullscreen window are exposed during zoom operations
424         https://bugs.webkit.org/show_bug.cgi?id=186330
425         <rdar://problem/34698009>
426
427         Reviewed by Simon Fraser.
428
429         Test: fullscreen/full-screen-layer-dump.html
430
431         Introduce the concept of "requiresBackgroundLayer" to RenderLayerBacking, for use by
432         RenderFullScreen. Previously, the backgroundLayer in RenderLayerBacking was only used
433         by the root renderer with fixed backgrounds. Give the RenderFullScreen a background layer
434         that's approximately 3x as tall and wide as the renderer itself, so nothing is exposed
435         during pinch operations.
436
437         * rendering/RenderLayerBacking.cpp:
438         (WebCore::RenderLayerBacking::RenderLayerBacking):
439         (WebCore::RenderLayerBacking::updateConfiguration):
440         (WebCore::RenderLayerBacking::updateGeometry):
441         (WebCore::RenderLayerBacking::updateDrawsContent):
442         (WebCore::RenderLayerBacking::setRequiresBackgroundLayer):
443         (WebCore::RenderLayerBacking::updateBackgroundLayer):
444         (WebCore::RenderLayerBacking::updateDirectlyCompositedBackgroundColor):
445         (WebCore::RenderLayerBacking::paintIntoLayer):
446         * rendering/RenderLayerBacking.h:
447
448 2018-06-06  Jer Noble  <jer.noble@apple.com>
449
450         Set the AVAssetResourceLoaderRequest's contentType to AVStreamingKeyDeliveryContentKeyType in the case of a FPS key request.
451         https://bugs.webkit.org/show_bug.cgi?id=186328
452         <rdar://problem/40829228>
453
454         Reviewed by Eric Carlson.
455
456         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
457         (WebCore::MediaPlayerPrivateAVFoundationObjC::attemptToDecryptWithInstance):
458
459 2018-06-06  Zalan Bujtas  <zalan@apple.com>
460
461         [LFC] Add margin computation for floating, replaced elements.
462         https://bugs.webkit.org/show_bug.cgi?id=186337
463
464         Reviewed by Antti Koivisto.
465
466         If 'margin-left' or 'margin-right' are computed as 'auto', their used value is '0'.
467
468         * layout/FormattingContext.h:
469         * layout/FormattingContextGeometry.cpp:
470         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
471         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
472
473 2018-06-06  Zalan Bujtas  <zalan@apple.com>
474
475         [LFC] Add margin computation for floating, no-replaced elements.
476         https://bugs.webkit.org/show_bug.cgi?id=186334
477
478         Reviewed by Antti Koivisto.
479
480         If 'margin-left', or 'margin-right' are computed as 'auto', their used value is '0'.
481
482         * layout/FormattingContextGeometry.cpp:
483         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
484
485 2018-06-06  Antti Koivisto  <antti@apple.com>
486
487         Use minimal coverage rect for tiled layers when under memory pressure
488         https://bugs.webkit.org/show_bug.cgi?id=186185
489         <rdar://problem/40713608>
490
491         Reviewed by Darin Adler.
492
493         We do this for the main content layer already.
494
495         * platform/graphics/ca/GraphicsLayerCA.cpp:
496         (WebCore::GraphicsLayerCA::adjustTiledLayerVisibleRect):
497
498 2018-06-05  Antoine Quint  <graouts@apple.com>
499
500         [Web Animations] Only expose CSSAnimation and CSSTransition if the WebAnimationsCSSIntegration runtime flag is enabled
501         https://bugs.webkit.org/show_bug.cgi?id=186305
502
503         Reviewed by Dean Jackson.
504
505         * animation/CSSAnimation.idl:
506         * animation/CSSTransition.idl:
507
508 2018-06-05  Per Arne Vollan  <pvollan@apple.com>
509
510         Move OpenGL display mask to screen data struct.
511         https://bugs.webkit.org/show_bug.cgi?id=186198
512         <rdar://problem/40724854>
513
514         Reviewed by Brent Fulgham.
515
516         Currently, the OpenGL display mask is a global in the WebContent process. This is not correct in all cases, since
517         it is possible to have two Web views in the same WebContent process, displayed on different displays. This can be
518         resolved by moving the OpenGL display mask to a new ScreenData struct, containing information specific to each
519         display. The display ID of the host window is used to find the OpenGL display mask when needed. This patch makes
520         the host window available when creating an IOSurface, in order to find the right OpenGL display mask. If no host
521         window is available, the OpenGL display mask of the main display is used.
522
523         No new tests, since testing this requires two Web views in the same WebContent process, displayed on
524         two different monitors.
525
526         * html/HTMLCanvasElement.cpp:
527         (WebCore::HTMLCanvasElement::createImageBuffer const):
528         * platform/PlatformScreen.h:
529         * platform/ScreenProperties.h:
530         (WebCore::ScreenProperties::encode const):
531         (WebCore::ScreenProperties::decode):
532         (WebCore::ScreenData::encode const):
533         (WebCore::ScreenData::decode):
534         * platform/graphics/GraphicsContext3D.h:
535         * platform/graphics/ImageBuffer.cpp:
536         (WebCore::ImageBuffer::create):
537         * platform/graphics/ImageBuffer.h:
538         * platform/graphics/cg/ImageBufferCG.cpp:
539         (WebCore::ImageBuffer::createCompatibleBuffer):
540         (WebCore::ImageBuffer::ImageBuffer):
541         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
542         (WebCore::GraphicsContext3D::GraphicsContext3D):
543         (WebCore::GraphicsContext3D::allowOfflineRenderers const):
544         (WebCore::GraphicsContext3D::setOpenGLDisplayMask): Deleted.
545         (WebCore::GraphicsContext3D::getOpenGLDisplayMask): Deleted.
546         * platform/graphics/cocoa/IOSurface.h:
547         * platform/graphics/cocoa/IOSurface.mm:
548         (WebCore::IOSurface::ensurePlatformContext):
549         * platform/mac/PlatformScreenMac.mm:
550         (WebCore::screenProperties):
551         (WebCore::collectScreenProperties):
552         (WebCore::setScreenProperties):
553         (WebCore::screenData):
554         (WebCore::primaryOpenGLDisplayMask):
555         (WebCore::displayMaskForDisplay):
556         (WebCore::getScreenProperties):
557         (WebCore::screenIsMonochrome):
558         (WebCore::screenHasInvertedColors):
559         (WebCore::screenDepth):
560         (WebCore::screenDepthPerComponent):
561         (WebCore::screenRectForDisplay):
562         (WebCore::screenRect):
563         (WebCore::screenAvailableRect):
564         (WebCore::screenColorSpace):
565         (WebCore::screenSupportsExtendedColor):
566
567 2018-06-05  Jer Noble  <jer.noble@apple.com>
568
569         REGRESSION (231817): Videos permanently blank out after switching out of a tab and back in
570         https://bugs.webkit.org/show_bug.cgi?id=186326
571         <rdar://problem/40778157>
572
573         Reviewed by Eric Carlson.
574
575         Check whether the element is visible in the viewport when the web view itself becomes visible, and if so, clear the m_elementIsHiddenUntilVisibleInViewport flag.
576
577         * html/MediaElementSession.cpp:
578         (WebCore::MediaElementSession::visibilityChanged):
579         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
580
581 2018-06-05  Zalan Bujtas  <zalan@apple.com>
582
583         [LFC] Move inflow, replaced width and margin computation to a dedicated function.
584         https://bugs.webkit.org/show_bug.cgi?id=186327
585
586         Reviewed by Sam Weinig.
587
588         I was searching for the function inFlowReplacedWidthAndMargin() and there was none.
589
590         * layout/blockformatting/BlockFormattingContext.h:
591         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
592         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
593         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):
594
595 2018-06-05  Zalan Bujtas  <zalan@apple.com>
596
597         [LFC] Add missing margins for inflow, non replaced block and replaced inline elements
598         https://bugs.webkit.org/show_bug.cgi?id=186332
599
600         Reviewed by Darin Adler.
601
602         * layout/FormattingContextGeometry.cpp:
603         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
604         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
605         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
606
607 2018-06-05  Wenson Hsieh  <wenson_hsieh@apple.com>
608
609         [macOS] Spelling errors in the middle of an inserted paragraph are not displayed
610         https://bugs.webkit.org/show_bug.cgi?id=185584
611         <rdar://problem/38676081>
612
613         Reviewed by Ryosuke Niwa.
614
615         Currently when typing, we only consider the range of adjacent words when determining where to place spelling
616         correction markers, even though we provide NSSpellChecker with the full context of the sentence (and get back
617         results encompassing the full range). In macOS Mojave, NSSpellChecker may now return spell checking results that
618         include correctly spelled words that are misused in the context of the sentence. This means that while typing a
619         sentence, a different part of the sentence may gain or lose spelling markers as a result.
620
621         To support this, WebKit needs to mark or unmark spelling corrections in the full range of the sentence whenever
622         a full word is typed (since the context of other words within the sentence may have changed, resulting in
623         different platform spellchecking results). In markMisspellingsAfterTypingToWord, we expand the spell checking
624         range past the adjacent words so that it encompasses the largest subrange of the full sentence that includes the
625         start of the typed word, and does not include any position that is under an element with `spellcheck=false`.
626
627         This guarantees that we don't erroneously place spelling document markers under elements where spellchecking is
628         disabled, while allowing for sentence retro corrections when spellchecking is enabled. However, this doesn't
629         handle the case where an element with spellchecking disabled lies between a sentence retro correction range and
630         the currently typed word. In the future, we could fix this by refactoring SpellCheckRequest to track a list of
631         non-contiguous spelling correction ranges — see the FIXME in markMisspellingsAfterTypingToWord for more detail.
632
633         Covered by 2 new layout tests, as well as an existing spell-checking test that should now be passing.
634
635         Tests: editing/spelling/retro-correction-spelling-markers.html
636                editing/spelling/spelling-markers-after-pasting-sentence.html
637
638         * editing/Editor.cpp:
639         (WebCore::Editor::markMisspellingsAfterTypingToWord):
640         * testing/Internals.h:
641         * testing/Internals.idl:
642
643         Add an internal testing helper to determine whether retro sentence corrections are enabled.
644
645 2018-06-05  Darin Adler  <darin@apple.com>
646
647         [Cocoa] Retire DispatchPtr, and add more move semantics and simpler #ifs to other smart pointers
648         https://bugs.webkit.org/show_bug.cgi?id=186324
649
650         Reviewed by Anders Carlsson.
651
652         * platform/FileMonitor.h: Use OSObjectPtr instead of DispatchPtr.
653         * platform/cocoa/FileMonitorCocoa.mm:
654         (WebCore::FileMonitor::FileMonitor): Ditto.
655
656 2018-06-05  Ryan Haddad  <ryanhaddad@apple.com>
657
658         Unreviewed, fix the macOS build with recent SDKs.
659
660         * page/mac/ServicesOverlayController.mm:
661         (WebCore::ServicesOverlayController::Highlight::paintContents):
662
663 2018-06-05  Brent Fulgham  <bfulgham@apple.com>
664
665         Adjust compile and runtime flags to match shippable state of features
666         https://bugs.webkit.org/show_bug.cgi?id=186319
667         <rdar://problem/40352045>
668
669         Reviewed by Maciej Stachowiak, Jon Lee, and others.
670
671         * Configurations/FeatureDefines.xcconfig: Don't build ENABLE_INPUT_TYPE_COLOR
672         or ENABLE_INPUT_TYPE_COLOR_POPOVER.
673
674 2018-06-05  Timothy Hatcher  <timothy@apple.com>
675
676         Clean up LocalDefaultSystemAppearance and prefers-dark-interface media query
677
678         https://bugs.webkit.org/show_bug.cgi?id=186323
679         rdar://problem/38382252
680
681         Reviewed by Tim Horton.
682
683         * css/MediaFeatureNames.h:
684         * css/MediaQueryEvaluator.cpp:
685         (WebCore::prefersDarkInterfaceEvaluate):
686         (WebCore::defaultAppearanceEvaluate): Deleted.
687         * css/MediaQueryExpression.cpp:
688         (WebCore::featureWithValidIdent):
689         (WebCore::isFeatureValidWithoutValue):
690         * platform/mac/LocalDefaultSystemAppearance.mm:
691         (WebCore::LocalDefaultSystemAppearance::LocalDefaultSystemAppearance):
692
693 2018-06-05  Darin Adler  <darin@apple.com>
694
695         [Cocoa] Improve some soft linking compatibility with ARC
696         https://bugs.webkit.org/show_bug.cgi?id=186309
697
698         Reviewed by Anders Carlsson.
699
700         * platform/audio/ios/AudioSessionIOS.mm: Use SOFT_LINK_CONSTANT instead of SOFT_LINK_POINTER
701         for NSString constants.
702         * platform/audio/ios/MediaSessionManagerIOS.mm: Ditto.
703         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm: Ditto.
704         * platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.mm: Ditto.
705         * platform/graphics/avfoundation/objc/InbandTextTrackPrivateLegacyAVFObjC.mm: Ditto.
706         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: Ditto.
707         (WebCore::MediaPlayerPrivateAVFoundationObjC::synchronizeTextTrackState): Use __bridge for
708         some bridging casts.
709         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL): Ditto.
710         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateLastImage): Ditto.
711         (WebCore::MediaPlayerPrivateAVFoundationObjC::processCue): Ditto.
712         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: Use
713         SOFT_LINK_CONSTANT instead of SOFT_LINK_POINTER for NSString constants.
714         * platform/mediastream/ios/CoreAudioCaptureSourceIOS.mm: Ditto.
715         * platform/mediastream/mac/AVCaptureDeviceManager.mm: Ditto.
716         * platform/mediastream/mac/AVMediaCaptureSource.mm: Ditto.
717         * platform/mediastream/mac/AVVideoCaptureSource.mm: Ditto.
718
719 2018-06-05  Youenn Fablet  <youenn@apple.com>
720
721         ServiceWorker registration should store any script fetched through importScripts
722         https://bugs.webkit.org/show_bug.cgi?id=182444
723         <rdar://problem/37164835>
724
725         Reviewed by Chris Dumez.
726
727         Covered by added test http/wpt/service-workers/persistent-importScripts.html.
728
729         Update importScripts implementation to look for/update the resource map in case of service worker scope.
730         This resource map is stored persistently and sent when running the service worker.
731
732         Add support to persistent storage of this resource map.
733         This requires updating the schema database.
734         The schema version is bumped to 2 and we delete any data related to old registrations.
735
736         When updating the service worker, the resource map is currently flushed so that all scripts will be retrieved from the network.
737
738         Did some limited refactoring to put more loading handling in WorkerScriptLoader.
739
740         * workers/WorkerGlobalScope.cpp:
741         (WebCore::WorkerGlobalScope::importScripts):
742         * workers/WorkerScriptLoader.cpp:
743         (WebCore::WorkerScriptLoader::loadSynchronously):
744         (WebCore::WorkerScriptLoader::script):
745         * workers/WorkerScriptLoader.h:
746         * workers/service/ServiceWorkerContextData.cpp:
747         (WebCore::ServiceWorkerContextData::isolatedCopy const):
748         * workers/service/ServiceWorkerContextData.h:
749         (WebCore::ServiceWorkerContextData::ImportedScript::isolatedCopy const):
750         (WebCore::ServiceWorkerContextData::ImportedScript::encode const):
751         (WebCore::ServiceWorkerContextData::ImportedScript::decode):
752         (WebCore::ServiceWorkerContextData::encode const):
753         (WebCore::ServiceWorkerContextData::decode):
754         * workers/service/ServiceWorkerGlobalScope.cpp:
755         (WebCore::ServiceWorkerGlobalScope::scriptResource const):
756         (WebCore::ServiceWorkerGlobalScope::setScriptResource):
757         * workers/service/ServiceWorkerGlobalScope.h:
758         * workers/service/context/SWContextManager.h:
759         * workers/service/server/RegistrationDatabase.cpp:
760         (WebCore::v1RecordsTableSchema):
761         (WebCore::RegistrationDatabase::doPushChanges):
762         (WebCore::RegistrationDatabase::importRecords):
763         * workers/service/server/SWServer.cpp:
764         (WebCore::SWServer::addRegistrationFromStore):
765         (WebCore::SWServer::updateWorker):
766         (WebCore::SWServer::installContextData):
767         * workers/service/server/SWServer.h:
768         * workers/service/server/SWServerJobQueue.cpp:
769         (WebCore::SWServerJobQueue::scriptFetchFinished):
770         * workers/service/server/SWServerToContextConnection.cpp:
771         (WebCore::SWServerToContextConnection::setScriptResource):
772         * workers/service/server/SWServerToContextConnection.h:
773         * workers/service/server/SWServerWorker.cpp:
774         (WebCore::SWServerWorker::SWServerWorker):
775         (WebCore::m_scriptResourceMap):
776         (WebCore::SWServerWorker::contextData const):
777         (WebCore::SWServerWorker::setScriptResource):
778         * workers/service/server/SWServerWorker.h:
779
780 2018-06-05  Brent Fulgham  <bfulgham@apple.com>
781
782         Revise DEFAULT_EXPERIMENTAL_FEATURES_ENABLED to work properly on Apple builds
783         https://bugs.webkit.org/show_bug.cgi?id=186286
784         <rdar://problem/40782992>
785
786         Reviewed by Dan Bernstein.
787
788         Use the WK_RELOCATABLE_FRAMEWORKS flag (which is always defined for non-production builds)
789         to define ENABLE(EXPERIMENTAL_FEATURES) so that we do not need to manually
790         change this flag when preparing for a production release.
791
792         * Configurations/FeatureDefines.xcconfig: Use WK_RELOCATABLE_FRAMEWORKS to determine
793         whether experimental features should be enabled, and use it to properly define the
794         feature flag.
795
796 2018-06-05  Brent Fulgham  <bfulgham@apple.com>
797
798         Unreviewed build fix after r232511.
799         https://bugs.webkit.org/show_bug.cgi?id=186304
800
801         * platform/ios/WebItemProviderPasteboard.mm: Add missing include.
802
803 2018-06-05  Antoine Quint  <graouts@apple.com>
804
805         Fix the iOS build after r232496
806         https://bugs.webkit.org/show_bug.cgi?id=186304
807
808         Reviewed by Brent Fulgham.
809
810         The changes in r232496 changed the InputType::element() signature from HTMLInputElement&
811         to HTMLInputElement* and some call sites did not expect that.
812
813         * html/BaseChooserOnlyDateAndTimeInputType.cpp:
814         (WebCore::BaseChooserOnlyDateAndTimeInputType::handleDOMActivateEvent):
815         (WebCore::BaseChooserOnlyDateAndTimeInputType::createShadowSubtree):
816         (WebCore::BaseChooserOnlyDateAndTimeInputType::updateInnerTextValue):
817         (WebCore::BaseChooserOnlyDateAndTimeInputType::didChooseValue):
818         (WebCore::BaseChooserOnlyDateAndTimeInputType::handleKeydownEvent):
819         (WebCore::BaseChooserOnlyDateAndTimeInputType::handleKeypressEvent):
820         (WebCore::BaseChooserOnlyDateAndTimeInputType::accessKeyAction):
821         (WebCore::BaseChooserOnlyDateAndTimeInputType::isMouseFocusable const):
822         * html/BaseDateAndTimeInputType.cpp:
823         (WebCore::BaseDateAndTimeInputType::setValueAsDate const):
824         (WebCore::BaseDateAndTimeInputType::valueAsDouble const):
825         (WebCore::BaseDateAndTimeInputType::setValueAsDecimal const):
826         (WebCore::BaseDateAndTimeInputType::typeMismatch const):
827         (WebCore::BaseDateAndTimeInputType::serializeWithComponents const):
828         (WebCore::BaseDateAndTimeInputType::localizeValue const):
829         (WebCore::BaseDateAndTimeInputType::visibleValue const):
830         (WebCore::BaseDateAndTimeInputType::valueMissing const):
831         (WebCore::BaseDateAndTimeInputType::isKeyboardFocusable const):
832         * html/DateInputType.cpp:
833         (WebCore::DateInputType::createStepRange const):
834         * html/DateTimeLocalInputType.cpp:
835         (WebCore::DateTimeLocalInputType::createStepRange const):
836         * html/MonthInputType.cpp:
837         (WebCore::MonthInputType::valueAsDate const):
838         (WebCore::MonthInputType::createStepRange const):
839         * html/TimeInputType.cpp:
840         (WebCore::TimeInputType::createStepRange const):
841         * html/WeekInputType.cpp:
842         (WebCore::WeekInputType::createStepRange const):
843
844 2018-06-03  Darin Adler  <darin@apple.com>
845
846         Simplify and remove some unused video element code (helpful for ARC-compatibility)
847         https://bugs.webkit.org/show_bug.cgi?id=186258
848
849         Reviewed by Daniel Bates.
850
851         My main mission was to remove the PlatformMedia struct, which had a union
852         of Objective-C object pointers in it, which doesn't work in ARC. However, I
853         found some other unused code to remove and simple mistakes to fix.
854
855         * Modules/mediasource/VideoPlaybackQuality.cpp:
856         (WebCore::VideoPlaybackQuality::create): Use unsigned instead of unsigned long,
857         since IDL "unsigned long" really means unsigned.
858         (WebCore::VideoPlaybackQuality::VideoPlaybackQuality): Ditto.
859         * Modules/mediasource/VideoPlaybackQuality.h: Updated for the above.
860
861         * html/HTMLMediaElement.cpp:
862         (WebCore::HTMLMediaElement::platformMedia const): Deleted.
863         * html/HTMLMediaElement.h: Updated for the above.
864
865         * platform/graphics/MediaPlayer.cpp:
866         (WebCore::MediaPlayer::MediaPlayer): Moved initialization of many data members
867         to the class definition.
868         (WebCore::MediaPlayer::load): Use nullptr instead of 0.
869         (WebCore::MediaPlayer::platformMedia const): Deleted.
870         (WebCore::MediaPlayer::videoPlaybackQualityMetrics): Updated name of return type.
871         (WebCore::MediaPlayer::objCAVFoundationAVPlayer const): Added. Replaces
872         platformMedia for the one case where it was being used.
873         * platform/graphics/MediaPlayer.h: Removed unneeded includes. Re-sorted things.
874         Updated for the above. Removed PlatformMedia struct and NoPlatformMedia constant.
875         Removed explicit constructor in MediaEngineSupportParameters. Renamed
876         PlatformVideoPlaybackQualityMetrics struct to VideoPlaybackQualityMetrics,
877         removed its constructor, and changed types from unsigned long to unsigned.
878         Un-nested #if statements. Removed some Chromium-specific comments.
879
880         * platform/graphics/MediaPlayerPrivate.h: Removed unneeded includes and
881         forward declarations. Removed platformMedia. Updated return type for
882         videoPlaybackQualityMetrics. Added objCAVFoundationAVPlayer.
883
884         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
885         Removed platformMedia.
886
887         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
888         (WebCore::MediaPlayerPrivateAVFoundation::platformMedia const): Deleted.
889         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:
890         Updated for the above.
891
892         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
893         Added override of objCAVFoundationAVPlayer. Removed platformMedia.
894         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
895         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformMedia const): Deleted.
896
897         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
898         Removed platformMedia. Updated return type for videoPlaybackQualityMetrics.
899         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
900         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::platformMedia const): Deleted.
901         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::videoPlaybackQualityMetrics):
902         Updated return type, changed to use aggregate initialization instead of
903         calling a constructor, and added casts to unsigned.
904
905         * platform/graphics/cocoa/WebCoreDecompressionSession.h: Switched from
906         unsigned long to unsigned for frame counts and from long to int for
907         quality of service tier.
908
909         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
910         (WebCore::MediaPlayerPrivateGStreamerBase::platformMedia): Deleted.
911         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
912         Updated for the above.
913
914         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
915         Removed videoPlaybackQualityMetrics since it was overriding a derived function
916         without changing its behavior, and the type has changed.
917
918         * platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:
919         (WebCore::MockMediaPlayerMediaSource::load): Pass two references.
920         (WebCore::MockMediaPlayerMediaSource::videoPlaybackQualityMetrics):
921         Updated return type.
922         * platform/mock/mediasource/MockMediaPlayerMediaSource.h: Updated for the above.
923
924         * platform/mock/mediasource/MockMediaSourcePrivate.cpp:
925         (WebCore::MockMediaSourcePrivate::create): Return a Ref, take references.
926         (WebCore::MockMediaSourcePrivate::MockMediaSourcePrivate): Moved most data
927         member initialization into the class definition. Take references.
928         (WebCore::MockMediaSourcePrivate::~MockMediaSourcePrivate): Use a modern for loop.
929         (WebCore::MockMediaSourcePrivate::durationChanged): Update since m_player is a
930         reference.
931         (WebCore::MockMediaSourcePrivate::markEndOfStream): Ditto.
932         (WebCore::MockMediaSourcePrivate::readyState): Ditto.
933         (WebCore::MockMediaSourcePrivate::setReadyState): Ditto.
934         (WebCore::MockMediaSourcePrivate::waitForSeekCompleted): Ditto.
935         (WebCore::MockMediaSourcePrivate::seekCompleted): Ditto.
936         (WebCore::MockMediaSourcePrivate::removeSourceBuffer): Use Vector::removeFirst
937         instead of find/remove pairs.
938         (WebCore::MockMediaSourcePrivate::sourceBufferPrivateDidChangeActiveState): Ditto.
939         (WebCore::MockMediaSourcePrivate::seekToTime): Use modern for loop.
940         (WebCore::MockMediaSourcePrivate::videoPlaybackQualityMetrics): Updated return
941         type, changed to use aggregate initialization instead of calling a constructor.
942         * platform/mock/mediasource/MockMediaSourcePrivate.h: Updated for the above.
943
944         * platform/mock/mediasource/MockSourceBufferPrivate.cpp:
945         (WebCore::MockSourceBufferPrivate::readyState): Updated since player is now
946         a reference.
947         (WebCore::MockSourceBufferPrivate::setReadyState): Ditto.
948
949 2018-06-04  Darin Adler  <darin@apple.com>
950
951         [Cocoa] Improve smart pointer support for ARC (OSObjectPtr/DispatchPtr)
952         https://bugs.webkit.org/show_bug.cgi?id=186300
953
954         Reviewed by Daniel Bates.
955
956         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm: Removed unnecessary
957         include of OSObjectPtr.h.
958         * platform/ios/WebItemProviderPasteboard.mm: Ditto.
959
960 2018-06-05  Joanmarie Diggs  <jdiggs@igalia.com>
961
962         AX: Implement support for new blockquote, caption, and paragraph ARIA roles
963         https://bugs.webkit.org/show_bug.cgi?id=186274
964
965         Reviewed by Chris Fleizach.
966
967         Add the three new ARIA roles to the internal rolemap so that they are treated in
968         the same fashion as their HTML element counterparts. Also ensure that an element
969         with an explicit caption role does not get pruned from the macOS accessibility tree.
970
971         No new tests. Instead add the roles to the existing role-exposure tests.
972
973         * accessibility/AccessibilityObject.cpp:
974         (WebCore::initializeRoleMap):
975         * accessibility/mac/AccessibilityObjectMac.mm:
976         (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject const):
977         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
978         (createAccessibilityRoleMap):
979
980 2018-06-05  Zalan Bujtas  <zalan@apple.com>
981
982         [LFC] Merge width and margin computation for block-level, replaced elements in normal flow
983         https://bugs.webkit.org/show_bug.cgi?id=186270
984
985         Reviewed by Sam Weinig.
986
987         https://www.w3.org/TR/CSS22/visudet.html#block-replaced-width
988         10.3.4 Block-level, replaced elements in normal flow
989
990         The used value of 'width' is determined as for inline replaced elements.
991         Then the rules for non-replaced block-level elements are applied to determine the margins.
992
993         * layout/blockformatting/BlockFormattingContext.h:
994         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
995         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
996         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):
997
998 2018-06-04  Enrique Ocaña González  <eocanha@igalia.com>
999
1000         [GStreamer][MSE] MediaPlayerPrivateGStreamerMSE.h includes and forward declares PlaybackPipeline
1001         https://bugs.webkit.org/show_bug.cgi?id=186190
1002
1003         Reviewed by Xabier Rodriguez-Calvar.
1004
1005         This is just a compilation improvement.
1006
1007         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
1008         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
1009         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
1010
1011 2018-06-03  Darin Adler  <darin@apple.com>
1012
1013         [Cocoa] Update more code to be more ARC-compatible to prepare for future ARC adoption
1014         https://bugs.webkit.org/show_bug.cgi?id=186245
1015
1016         Reviewed by Daniel Bates.
1017
1018         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
1019         (convertToNSArray): Explicitly cast to WebAccessibilityObjectWrapperBase so we don't
1020         make method calls on WebAccessibilityObjectWrapper, a forward-declared class.
1021         (-[WebAccessibilityObjectWrapperBase convertPathToScreenSpace:]): Use CFAutorelease
1022         for the CGPathRef return value instead of Objective-C autorelease. Another option
1023         would be to use RetainPtr for the return type instead.
1024
1025         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1026         (AXObjectIsTextMarker): Use __bridge for bridging typecast.
1027         (AXObjectIsTextMarkerRange): Ditto.
1028         (AXTextMarkerRange): Ditto.
1029         (AXTextMarkerRangeStart): Ditto.
1030         (AXTextMarkerRangeEnd): Ditto.
1031         (isTextMarkerIgnored): Ditto.
1032         (accessibilityObjectForTextMarker): Ditto.
1033         (-[WebAccessibilityObjectWrapper characterOffsetForTextMarker:]): Ditto.
1034         (-[WebAccessibilityObjectWrapper visiblePositionForTextMarker:]): Ditto.
1035         (visiblePositionForStartOfTextMarkerRange): Ditto.
1036         (visiblePositionForEndOfTextMarkerRange): Ditto.
1037         (AXAttributeStringSetFont): Ditto. Also use @{} syntax to make NSDictionary
1038         and @() to make NSNumber.
1039         (AXAttributeStringSetColor): Use __bridge for bridging typecast, rearranging
1040         code so that the typecasts are on function arguments, not local variables,
1041         which makes lifetimes clearer.
1042         (AXAttributeStringSetElement): Use __bridge for bridging typecast.
1043         (WebTransformCGPathToNSBezierPath):
1044         (-[WebAccessibilityObjectWrapper bezierPathFromPath:]): Added a bridging
1045         typecast when passing an NSBezierPath through as a void* context argument;
1046         silent conversion to void* is not compatible with ARC.
1047         (createAccessibilityRoleMap): Use __unsafe_unretained for a table of
1048         NSString constants.
1049
1050         * bindings/js/ScriptControllerMac.mm:
1051         (WebCore::ScriptController::createScriptInstanceForWidget): Use __bridge
1052         for bridging typecast.
1053
1054         * bridge/objc/objc_class.mm:
1055         (JSC::Bindings::ObjcClass::classForIsA): Added bridging typecasts
1056         to convert a Class into a CFTypeRef.
1057         (JSC::Bindings::ObjcClass::methodNamed const): Use __bridge for bridging
1058         typecast.
1059         (JSC::Bindings::ObjcClass::fieldNamed const): Ditto.
1060         * bridge/objc/objc_instance.mm:
1061         (ObjcInstance::invokeObjcMethod): Ditto.
1062         * bridge/objc/objc_runtime.mm:
1063         (JSC::Bindings::ObjcField::valueFromInstance const): Ditto.
1064         (JSC::Bindings::ObjcField::setValueToInstance const): Ditto.
1065         * bridge/objc/objc_utility.mm:
1066         (JSC::Bindings::convertObjcValueToValue): Ditto. Also add a missing const
1067         to make it clearer to the compiler that the code is correct.
1068         * crypto/mac/SerializedCryptoKeyWrapMac.mm:
1069         (WebCore::createAndStoreMasterKey): Ditto.
1070         (WebCore::findMasterKey): Ditto.
1071         * editing/cocoa/DataDetection.mm:
1072         (WebCore::detectItemAtPositionWithRange): Ditto.
1073         * editing/cocoa/EditorCocoa.mm:
1074         (WebCore::Editor::fontAttributesForSelectionStart const): Ditto.
1075         * editing/cocoa/HTMLConverter.mm:
1076         (_font): Ditto.
1077         (fileWrapperForElement): Ditto.
1078         * fileapi/FileCocoa.mm:
1079         (WebCore::File::shouldReplaceFile): Ditto.
1080         * loader/archive/cf/LegacyWebArchiveMac.mm:
1081         (WebCore::LegacyWebArchive::createResourceResponseFromMacArchivedData): Ditto.
1082         * page/mac/TextIndicatorWindow.mm:
1083         (-[WebTextIndicatorView initWithFrame:textIndicator:margin:offset:]): Ditto.
1084         (createContentCrossfadeAnimation): Ditto.
1085         * platform/cocoa/LocalizedStringsCocoa.mm:
1086         (WebCore::localizedString): Ditto.
1087         * platform/cocoa/SharedBufferCocoa.mm:
1088         (WebCore::SharedBuffer::create): Ditto.
1089         (WebCore::SharedBuffer::append): Ditto.
1090         * platform/graphics/FontPlatformData.h:
1091         (WebCore::toCTFont): Ditto.
1092         (WebCore::toNSFont): Ditto.
1093         * platform/graphics/avfoundation/objc/AVAssetTrackUtilities.mm:
1094         (WebCore::assetTrackMeetsHardwareDecodeRequirements): Ditto.
1095         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
1096         (WebCore::ImageDecoderAVFObjC::storeSampleBuffer): Ditto.
1097         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1098         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::updateLastImage): Ditto.
1099         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
1100         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateCurrentFrameImage): Ditto.
1101         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1102         (WebCore::MediaDescriptionAVFObjC::MediaDescriptionAVFObjC): Ditto.
1103         (WebCore::bufferWasConsumedCallback): Ditto.
1104         (WebCore::SourceBufferPrivateAVFObjC::enqueueSample): Ditto.
1105         * platform/graphics/avfoundation/objc/VideoFullscreenLayerManagerObjC.mm:
1106         (WebCore::VideoFullscreenLayerManagerObjC::updateVideoFullscreenInlineImage): Ditto.
1107         (WebCore::VideoFullscreenLayerManagerObjC::setVideoFullscreenLayer): Ditto.
1108         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
1109         (PlatformCALayerCocoa::create): Ditto.
1110         (PlatformCALayer::platformCALayer): Ditto.
1111         (PlatformCALayerCocoa::superlayer const): Ditto.
1112         (PlatformCALayerCocoa::contents const): Ditto.
1113         (PlatformCALayerCocoa::setContents): Ditto.
1114         * platform/graphics/cocoa/IOSurface.h: Ditto.
1115         * platform/graphics/cocoa/TextTrackRepresentationCocoa.mm:
1116         (TextTrackRepresentationCocoa::update): Ditto.
1117         * platform/graphics/cocoa/WebCoreDecompressionSession.mm:
1118         (WebCore::WebCoreDecompressionSession::ensureDecompressionSessionForSample): Ditto.
1119         (WebCore::WebCoreDecompressionSession::resetQosTier): Ditto.
1120         * platform/graphics/cocoa/WebGLLayer.mm:
1121         (-[WebGLLayer display]): Ditto.
1122         * platform/graphics/mac/ImageMac.mm:
1123         (WebCore::BitmapImage::nsImage): Ditto.
1124         (WebCore::BitmapImage::snapshotNSImage): Ditto.
1125         * platform/graphics/mac/WebLayer.mm:
1126         (-[WebLayer drawInContext:]): Ditto.
1127         (-[WebSimpleLayer setNeedsDisplay]): Ditto.
1128         (-[WebSimpleLayer setNeedsDisplayInRect:]): Ditto.
1129         (-[WebSimpleLayer display]): Ditto.
1130         (-[WebSimpleLayer drawInContext:]): Ditto.
1131
1132         * platform/mac/CursorMac.mm:
1133         (WebCore::cursor): Mark pointer __strong to match the globals it points to.
1134
1135         * platform/mac/FileSystemMac.mm:
1136         (WebCore::FileSystem::setMetadataURL): Use RetainPtr instead of autorelease.
1137
1138         * platform/mac/PlatformPasteboardMac.mm:
1139         (WebCore::PlatformPasteboard::bufferForType): Use __bridge for bridging
1140         typecast.
1141         * platform/mac/PlatformSpeechSynthesizerMac.mm:
1142         (WebCore::speechSynthesisGetVoiceIdentifiers): Ditto.
1143         (WebCore::speechSynthesisGetDefaultVoiceIdentifierForLocale): Ditto.
1144
1145         * platform/mac/PluginBlacklist.h: Use RetainPtr instead of explicit retain
1146         and release for NSDictionary and NSSet.
1147         * platform/mac/PluginBlacklist.mm:
1148         (WebCore::PluginBlacklist::create): Use __bridge for bridging typecast.
1149         (WebCore::PluginBlacklist::~PluginBlacklist): Remove explicit CFRelease calls.
1150         (WebCore::PluginBlacklist::PluginBlacklist): Add adoptNS calls and remove
1151         explciit CFRetain/release pairs.
1152
1153         * platform/mac/PublicSuffixMac.mm:
1154         (WebCore::isPublicSuffix): Use __bridge for bridging typecast.
1155         * platform/mac/RemoteCommandListenerMac.mm:
1156         (WebCore::RemoteCommandListenerMac::RemoteCommandListenerMac): Ditto.
1157         * platform/mac/SerializedPlatformRepresentationMac.mm:
1158         (WebCore::jsValueWithDictionaryInContext): Ditto.
1159         * platform/mac/URLMac.mm:
1160         (WebCore::URL::URL): Ditto.
1161         (WebCore::URL::createCFURL const): Ditto.
1162
1163         * platform/mac/WebCoreNSURLExtras.mm:
1164         (WebCore::collectRangesThatNeedMapping): Mark pointer __strong to match the
1165         local variable it eventually points to.
1166         (WebCore::stringByTrimmingWhitespace): Use __bridge for bridging typecast.
1167         (WebCore::URLByTruncatingOneCharacterBeforeComponent): Use
1168         CFBridgingRelease instead of autorelease, reducing typecasts.
1169         (WebCore::URLByRemovingComponentAndSubsequentCharacter): Ditto.
1170         (WebCore::userVisibleString): Use __bridge for bridging typecast.
1171         (WebCore::isUserVisibleURL): Ditto.
1172
1173         * platform/mac/WebGLBlacklist.mm:
1174         (WebCore::WebGLBlacklist::create): Use __bridge for bridging typecast.
1175         * platform/mediastream/mac/AVVideoCaptureSource.mm:
1176         (WebCore::AVVideoCaptureSource::setPreset): Ditto.
1177         (WebCore::AVVideoCaptureSource::setupCaptureSession): Ditto. Also use @()
1178         instead of NSNumber.
1179         * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
1180         (WebCore::MockRealtimeVideoSourceMac::CMSampleBufferFromPixelBuffer): Ditto.
1181         * platform/network/cocoa/ResourceRequestCocoa.mm:
1182         (WebCore::ResourceRequest::doUpdatePlatformHTTPBody): Ditto.
1183
1184         * platform/network/cocoa/ResourceResponseCocoa.mm: Use CFStringRef and
1185         CFSTR for constant string array commonHeaderFields rather than using
1186         NSString * and then relying on implicit bridging conversion.
1187
1188         * platform/network/mac/CertificateInfoMac.mm:
1189         (WebCore::CertificateInfo::dump const): Use __bridge for bridging typecast.
1190         * platform/network/mac/FormDataStreamMac.mm:
1191         (WebCore::createHTTPBodyNSInputStream): Ditto.
1192         (WebCore::httpBodyFromStream): Ditto.
1193         * platform/network/mac/ResourceErrorMac.mm:
1194         (WebCore::ResourceError::ResourceError): Ditto.
1195         (WebCore::ResourceError::cfError const): Ditto.
1196
1197         * rendering/RenderThemeMac.mm:
1198         (-[WebCoreTextFieldCell _coreUIDrawOptionsWithFrame:inView:includeFocus:]):
1199         Use CFSTR("") instead of @"" for a string that is passed to CFDIctionaryRef.
1200         (WebCore::AttachmentLayout::layOutTitle): Use __bridge for bridging typecast.
1201         (WebCore::AttachmentLayout::layOutSubtitle): Ditto.
1202
1203         * testing/cocoa/WebArchiveDumpSupport.mm:
1204         (WebCoreTestSupport::createCFURLResponseFromResponseData): Use __bridge for
1205         bridging typecast.
1206         (WebCoreTestSupport::supportedNonImageMIMETypes): Deleted.
1207         (WebCoreTestSupport::convertWebResourceDataToString): Use the
1208         MIMETypeRegistry::isSupportedNonImageMIMEType function directly instead of
1209         building a CFArray out of MIMETypeRegistry::getSupportedNonImageMIMETypes
1210         and using CFArrayContainsValue. This is both much more direct and much more
1211         efficient as well.
1212
1213 2018-06-04  Timothy Hatcher  <timothy@apple.com>
1214
1215         [Win] REGRESSION(r232486) 'WebCore::RenderTheme::activeListBoxSelectionBackgroundColor': function does not take 0 arguments
1216         https://bugs.webkit.org/show_bug.cgi?id=186296
1217
1218         Unreviewed build fix.
1219
1220         * platform/win/PopupMenuWin.cpp:
1221         (WebCore::PopupMenuWin::paint):
1222         * rendering/RenderThemeWin.cpp:
1223         (WebCore::RenderThemeWin::platformInactiveSelectionForegroundColor const):
1224
1225 2018-06-04  Chris Dumez  <cdumez@apple.com>
1226
1227         Rename "Cross-Origin-Options" HTTP header to "Cross-Origin-Window-Policy"
1228         https://bugs.webkit.org/show_bug.cgi?id=186287
1229         <rdar://problem/40783352>
1230
1231         Reviewed by Youenn Fablet.
1232
1233         Tests: http/wpt/cross-origin-window-policy/allow-postmessage-from-deny.html
1234                http/wpt/cross-origin-window-policy/allow-postmessage.html
1235                http/wpt/cross-origin-window-policy/cross-origin-window-policy-header.html
1236                http/wpt/cross-origin-window-policy/navigation-from-opener-via-open-target.html
1237                http/wpt/cross-origin-window-policy/navigation-from-subframe-via-anchor-target.html
1238
1239         * bindings/js/JSDOMBindingSecurity.cpp:
1240         (WebCore::BindingSecurity::shouldAllowAccessToDOMWindowGivenMinimumCrossOriginWindowPolicy):
1241         * bindings/js/JSDOMBindingSecurity.h:
1242         * bindings/js/JSDOMWindowCustom.cpp:
1243         (WebCore::effectiveCrossOriginWindowPolicyForAccess):
1244         (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
1245         (WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
1246         (WebCore::addCrossOriginWindowPropertyNames):
1247         (WebCore::addScopedChildrenIndexes):
1248         * bindings/scripts/CodeGeneratorJS.pm:
1249         (GenerateAttributeGetterBodyDefinition):
1250         (GetCrossOriginsOptionsFromExtendedAttributeValue):
1251         (GenerateAttributeSetterBodyDefinition):
1252         (GenerateOperationBodyDefinition):
1253         * bindings/scripts/IDLAttributes.json:
1254         * dom/Document.cpp:
1255         (WebCore::Document::canNavigate):
1256         * loader/FrameLoader.cpp:
1257         (WebCore::FrameLoader::didBeginDocument):
1258         * page/AbstractDOMWindow.cpp:
1259         (WebCore::AbstractDOMWindow::AbstractDOMWindow):
1260         * page/AbstractDOMWindow.h:
1261         (WebCore::AbstractDOMWindow::crossOriginWindowPolicy):
1262         (WebCore::AbstractDOMWindow::setCrossOriginWindowPolicy):
1263         * page/DOMWindow.idl:
1264         * page/Settings.yaml:
1265         * platform/network/HTTPHeaderNames.in:
1266         * platform/network/HTTPParsers.cpp:
1267         (WebCore::parseCrossOriginWindowPolicyHeader):
1268         * platform/network/HTTPParsers.h:
1269
1270 2018-06-04  Brent Fulgham  <bfulgham@apple.com>
1271
1272         REGRESSION(r231291): InputType should hold a WeakPtr to its HTMLInputElement
1273         https://bugs.webkit.org/show_bug.cgi?id=186096
1274         <rdar://problem/40651015>
1275
1276         Reviewed by Ryosuke Niwa.
1277
1278         Now that the InputType may be kept alive as part of in-flight form submissions, we
1279         shouldn't assume that the referenced HTMLInputElement is still valid before using it.
1280
1281         The only time we should be lacking a referencing element is in cases where the InputType
1282         is changing, either through a change in the HTMLInputElement's type attribute. In those
1283         cases we should check for a valid HTMLInputElement. In other cases, we should ASSERT.
1284
1285         * html/BaseButtonInputType.cpp:
1286         (WebCore::BaseButtonInputType::createInputRenderer):
1287         (WebCore::BaseButtonInputType::setValue):
1288         * html/BaseCheckableInputType.cpp:
1289         (WebCore::BaseCheckableInputType::saveFormControlState const):
1290         (WebCore::BaseCheckableInputType::restoreFormControlState):
1291         (WebCore::BaseCheckableInputType::appendFormData const):
1292         (WebCore::BaseCheckableInputType::handleKeydownEvent):
1293         (WebCore::BaseCheckableInputType::accessKeyAction):
1294         (WebCore::BaseCheckableInputType::setValue):
1295         * html/BaseChooserOnlyDateAndTimeInputType.cpp:
1296         (WebCore::BaseChooserOnlyDateAndTimeInputType::attributeChanged): Add a nullptr check
1297         here, since this is called directly by code that causes the old InputType to be removed,
1298         which could leave us with a nullptr element().
1299         * html/BaseClickableWithKeyInputType.cpp:
1300         (WebCore::BaseClickableWithKeyInputType::handleKeydownEvent):
1301         (WebCore::BaseClickableWithKeyInputType::handleKeypressEvent):
1302         (WebCore::BaseClickableWithKeyInputType::accessKeyAction):
1303         * html/BaseDateAndTimeInputType.cpp:
1304         (WebCore::BaseDateAndTimeInputType::attributeChanged): Add a nullptr check
1305         here, since this is called directly by code that causes the old InputType to be removed,
1306         which could leave us with a nullptr element().
1307         * html/BaseTextInputType.cpp:
1308         (WebCore::BaseTextInputType::patternMismatch const):
1309         * html/CheckboxInputType.cpp:
1310         (WebCore::CheckboxInputType::valueMissing const):
1311         (WebCore::CheckboxInputType::willDispatchClick):
1312         (WebCore::CheckboxInputType::didDispatchClick):
1313         (WebCore::CheckboxInputType::shouldAppearIndeterminate const):
1314         * html/ColorInputType.cpp:
1315         (WebCore::ColorInputType::valueAsColor const):
1316         (WebCore::ColorInputType::createShadowSubtree):
1317         (WebCore::ColorInputType::handleDOMActivateEvent):
1318         (WebCore::ColorInputType::didChooseColor):
1319         (WebCore::ColorInputType::updateColorSwatch):
1320         (WebCore::ColorInputType::shadowColorSwatch const):
1321         (WebCore::ColorInputType::elementRectRelativeToRootView const):
1322         (WebCore::ColorInputType::shouldShowSuggestions const):
1323         (WebCore::ColorInputType::suggestions const):
1324         * html/EmailInputType.cpp:
1325         (WebCore::EmailInputType::typeMismatchFor const):
1326         (WebCore::EmailInputType::typeMismatch const):
1327         (WebCore::EmailInputType::typeMismatchText const):
1328         (WebCore::EmailInputType::sanitizeValue const):
1329         * html/FileInputType.cpp:
1330         (WebCore::FileInputType::appendFormData const):
1331         (WebCore::FileInputType::attributeChanged): Add a nullptr check here, since
1332         this is called directly by code that causes the old InputType to be removed,
1333         which could leave us with a nullptr element().
1334         (WebCore::FileInputType::valueMissing const):
1335         (WebCore::FileInputType::valueMissingText const):
1336         (WebCore::FileInputType::handleDOMActivateEvent):
1337         (WebCore::FileInputType::createInputRenderer):
1338         (WebCore::FileInputType::setValue):
1339         (WebCore::FileInputType::createShadowSubtree):
1340         (WebCore::FileInputType::disabledAttributeChanged):
1341         (WebCore::FileInputType::multipleAttributeChanged):
1342         (WebCore::FileInputType::allowsDirectories const):
1343         (WebCore::FileInputType::setFiles):
1344         (WebCore::FileInputType::iconLoaded):
1345         (WebCore::FileInputType::receiveDroppedFiles):
1346         (WebCore::FileInputType::defaultToolTip const):
1347         * html/HTMLInputElement.h:
1348         (WebCore::HTMLInputElement::weakPtrFactory const):
1349         * html/HiddenInputType.cpp:
1350         (WebCore::HiddenInputType::saveFormControlState const):
1351         (WebCore::HiddenInputType::restoreFormControlState):
1352         (WebCore::HiddenInputType::setValue):
1353         (WebCore::HiddenInputType::appendFormData const):
1354         * html/ImageInputType.cpp:
1355         (WebCore::ImageInputType::appendFormData const):
1356         (WebCore::ImageInputType::handleDOMActivateEvent):
1357         (WebCore::ImageInputType::createInputRenderer):
1358         (WebCore::ImageInputType::altAttributeChanged):
1359         (WebCore::ImageInputType::srcAttributeChanged):
1360         (WebCore::ImageInputType::attach):
1361         (WebCore::ImageInputType::height const):
1362         (WebCore::ImageInputType::width const):
1363         * html/InputType.cpp:
1364         (WebCore::InputType::saveFormControlState const):
1365         (WebCore::InputType::restoreFormControlState):
1366         (WebCore::InputType::isFormDataAppendable const):
1367         (WebCore::InputType::appendFormData const):
1368         (WebCore::InputType::sizeShouldIncludeDecoration const):
1369         (WebCore::InputType::validationMessage const):
1370         (WebCore::InputType::createInputRenderer):
1371         (WebCore::InputType::blur):
1372         (WebCore::InputType::destroyShadowSubtree):
1373         (WebCore::InputType::dispatchSimulatedClickIfActive const):
1374         (WebCore::InputType::chrome const):
1375         (WebCore::InputType::isKeyboardFocusable const):
1376         (WebCore::InputType::isMouseFocusable const):
1377         (WebCore::InputType::accessKeyAction):
1378         (WebCore::InputType::setValue):
1379         (WebCore::InputType::visibleValue const):
1380         (WebCore::InputType::applyStep):
1381         (WebCore::InputType::stepUpFromRenderer):
1382         * html/InputType.h:
1383         (WebCore::InputType::InputType):
1384         (WebCore::InputType::element const):
1385         * html/NumberInputType.cpp:
1386         (WebCore::NumberInputType::attributeChanged): Add a nullptr check here, since
1387         this is called directly by code that causes the old InputType to be removed,
1388         which could leave us with a nullptr element().
1389         (WebCore::NumberInputType::setValue):
1390         (WebCore::NumberInputType::valueAsDouble const):
1391         (WebCore::NumberInputType::setValueAsDouble const):
1392         (WebCore::NumberInputType::setValueAsDecimal const):
1393         (WebCore::NumberInputType::typeMismatch const):
1394         (WebCore::NumberInputType::createStepRange const):
1395         (WebCore::NumberInputType::sizeShouldIncludeDecoration const):
1396         (WebCore::NumberInputType::decorationWidth const):
1397         (WebCore::NumberInputType::localizeValue const):
1398         (WebCore::NumberInputType::visibleValue const):
1399         (WebCore::NumberInputType::convertFromVisibleValue const):
1400         (WebCore::NumberInputType::hasBadInput const):
1401         (WebCore::NumberInputType::minOrMaxAttributeChanged):
1402         (WebCore::NumberInputType::stepAttributeChanged):
1403         * html/RadioInputType.cpp:
1404         (WebCore::RadioInputType::valueMissing const):
1405         (WebCore::RadioInputType::handleKeydownEvent):
1406         (WebCore::RadioInputType::handleKeyupEvent):
1407         (WebCore::RadioInputType::isKeyboardFocusable const):
1408         (WebCore::RadioInputType::shouldSendChangeEventAfterCheckedChanged):
1409         (WebCore::RadioInputType::willDispatchClick):
1410         (WebCore::RadioInputType::didDispatchClick):
1411         (WebCore::RadioInputType::matchesIndeterminatePseudoClass const):
1412         * html/RangeInputType.cpp:
1413         (WebCore::RangeInputType::attributeChanged): Add a nullptr check here, since
1414         this is called directly by code that causes the old InputType to be removed,
1415         which could leave us with a nullptr element().
1416         (WebCore::RangeInputType::valueAsDouble const):
1417         (WebCore::RangeInputType::setValueAsDecimal const):
1418         (WebCore::RangeInputType::createStepRange const):
1419         (WebCore::RangeInputType::handleMouseDownEvent):
1420         (WebCore::RangeInputType::handleTouchEvent):
1421         (WebCore::RangeInputType::handleKeydownEvent):
1422         (WebCore::RangeInputType::createShadowSubtree):
1423         (WebCore::RangeInputType::sliderTrackElement const):
1424         (WebCore::RangeInputType::createInputRenderer):
1425         (WebCore::RangeInputType::accessKeyAction):
1426         (WebCore::RangeInputType::minOrMaxAttributeChanged):
1427         (WebCore::RangeInputType::setValue):
1428         (WebCore::RangeInputType::updateTickMarkValues):
1429         * html/ResetInputType.cpp:
1430         (WebCore::ResetInputType::handleDOMActivateEvent):
1431         * html/SearchInputType.cpp:
1432         (WebCore::SearchInputType::addSearchResult):
1433         (WebCore::SearchInputType::maxResultsAttributeChanged):
1434         (WebCore::SearchInputType::createInputRenderer):
1435         (WebCore::SearchInputType::createShadowSubtree):
1436         (WebCore::SearchInputType::handleKeydownEvent):
1437         (WebCore::SearchInputType::startSearchEventTimer):
1438         (WebCore::SearchInputType::searchEventTimerFired):
1439         (WebCore::SearchInputType::searchEventsShouldBeDispatched const):
1440         (WebCore::SearchInputType::didSetValueByUserEdit):
1441         (WebCore::SearchInputType::sizeShouldIncludeDecoration const):
1442         * html/SubmitInputType.cpp:
1443         (WebCore::SubmitInputType::appendFormData const):
1444         (WebCore::SubmitInputType::handleDOMActivateEvent):
1445         * html/TextFieldInputType.cpp:
1446         (WebCore::TextFieldInputType::attributeChanged): Add a nullptr check here, since
1447         this is called directly by code that causes the old InputType to be removed,
1448         which could leave us with a nullptr element().
1449         (WebCore::TextFieldInputType::isKeyboardFocusable const):
1450         (WebCore::TextFieldInputType::isMouseFocusable const):
1451         (WebCore::TextFieldInputType::valueMissing const):
1452         (WebCore::TextFieldInputType::setValue):
1453         (WebCore::TextFieldInputType::handleKeydownEvent):
1454         (WebCore::TextFieldInputType::handleKeydownEventForSpinButton):
1455         (WebCore::TextFieldInputType::forwardEvent):
1456         (WebCore::TextFieldInputType::elementDidBlur):
1457         (WebCore::TextFieldInputType::handleFocusEvent):
1458         (WebCore::TextFieldInputType::handleBlurEvent):
1459         (WebCore::TextFieldInputType::createInputRenderer):
1460         (WebCore::TextFieldInputType::shouldHaveSpinButton const):
1461         (WebCore::TextFieldInputType::shouldHaveCapsLockIndicator const):
1462         (WebCore::TextFieldInputType::createShadowSubtree):
1463         (WebCore::TextFieldInputType::handleBeforeTextInsertedEvent):
1464         (WebCore::TextFieldInputType::updatePlaceholderText):
1465         (WebCore::TextFieldInputType::appendFormData const):
1466         (WebCore::TextFieldInputType::subtreeHasChanged):
1467         (WebCore::TextFieldInputType::didSetValueByUserEdit):
1468         (WebCore::TextFieldInputType::updateInnerTextValue):
1469         (WebCore::TextFieldInputType::focusAndSelectSpinButtonOwner):
1470         (WebCore::TextFieldInputType::shouldSpinButtonRespondToMouseEvents):
1471         (WebCore::TextFieldInputType::shouldSpinButtonRespondToWheelEvents):
1472         (WebCore::TextFieldInputType::shouldDrawCapsLockIndicator const):
1473         (WebCore::TextFieldInputType::shouldDrawAutoFillButton const):
1474         (WebCore::TextFieldInputType::autoFillButtonElementWasClicked):
1475         (WebCore::TextFieldInputType::createContainer):
1476         (WebCore::TextFieldInputType::createAutoFillButton):
1477         (WebCore::TextFieldInputType::updateAutoFillButton):
1478         * html/URLInputType.cpp:
1479         (WebCore::URLInputType::typeMismatch const):
1480
1481 2018-06-04  Chris Dumez  <cdumez@apple.com>
1482
1483         Unreviewed iOS build fix with recent SDKs.
1484
1485         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
1486         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
1487
1488 2018-06-04  Dean Jackson  <dino@apple.com>
1489
1490         AR Badging on transparent thumbnail images makes the glyph look really dark
1491         https://bugs.webkit.org/show_bug.cgi?id=186289
1492         <rdar://problem/40627111>
1493
1494         Reviewed by Anders Carlsson.
1495
1496         Clip out the shape for the drop shadow, so that it isn't visible if
1497         there is transparent pixel data on top of it.
1498
1499         * rendering/RenderThemeIOS.mm:
1500         (WebCore::RenderThemeIOS::paintSystemPreviewBadge):
1501
1502 2018-06-04  Timothy Hatcher  <timothy@apple.com>
1503
1504         Selection color is dark when using Safari in dark mode.
1505
1506         https://bugs.webkit.org/show_bug.cgi?id=186288
1507         rdar://problem/38438625
1508
1509         Reviewed by Simon Fraser.
1510
1511         Pass StyleColor::Options to all of the selection color functions.
1512         Removed supportsSelectionForegroundColors() from RenderThemeMac,
1513         to get the default of true, since the forground colors in dark mode
1514         can be different now. Use new semantic color methods on NSColor.
1515
1516         * rendering/RenderElement.cpp:
1517         (WebCore::RenderElement::selectionColor const):
1518         (WebCore::RenderElement::selectionBackgroundColor const):
1519         * rendering/RenderListBox.cpp:
1520         (WebCore::RenderListBox::paintItemForeground):
1521         (WebCore::RenderListBox::paintItemBackground):
1522         * rendering/RenderTheme.cpp:
1523         (WebCore::RenderTheme::activeSelectionBackgroundColor const):
1524         (WebCore::RenderTheme::inactiveSelectionBackgroundColor const):
1525         (WebCore::RenderTheme::activeSelectionForegroundColor const):
1526         (WebCore::RenderTheme::inactiveSelectionForegroundColor const):
1527         (WebCore::RenderTheme::activeListBoxSelectionBackgroundColor const):
1528         (WebCore::RenderTheme::activeListBoxSelectionForegroundColor const):
1529         (WebCore::RenderTheme::inactiveListBoxSelectionForegroundColor const):
1530         (WebCore::RenderTheme::platformActiveSelectionBackgroundColor const):
1531         (WebCore::RenderTheme::platformActiveSelectionForegroundColor const):
1532         (WebCore::RenderTheme::platformInactiveSelectionBackgroundColor const):
1533         (WebCore::RenderTheme::platformInactiveSelectionForegroundColor const):
1534         (WebCore::RenderTheme::platformActiveListBoxSelectionBackgroundColor const):
1535         (WebCore::RenderTheme::platformActiveListBoxSelectionForegroundColor const):
1536         (WebCore::RenderTheme::platformInactiveListBoxSelectionBackgroundColor const):
1537         (WebCore::RenderTheme::platformInactiveListBoxSelectionForegroundColor const):
1538         * rendering/RenderTheme.h:
1539         * rendering/RenderThemeGtk.cpp:
1540         (WebCore::RenderThemeGtk::platformActiveSelectionBackgroundColor const):
1541         (WebCore::RenderThemeGtk::platformInactiveSelectionBackgroundColor const):
1542         (WebCore::RenderThemeGtk::platformActiveSelectionForegroundColor const):
1543         (WebCore::RenderThemeGtk::platformInactiveSelectionForegroundColor const):
1544         (WebCore::RenderThemeGtk::platformActiveListBoxSelectionBackgroundColor const):
1545         (WebCore::RenderThemeGtk::platformActiveListBoxSelectionForegroundColor const):
1546         (WebCore::RenderThemeGtk::platformInactiveListBoxSelectionForegroundColor const):
1547         * rendering/RenderThemeGtk.h:
1548         * rendering/RenderThemeIOS.h:
1549         * rendering/RenderThemeIOS.mm:
1550         (WebCore::RenderThemeIOS::platformActiveSelectionBackgroundColor const):
1551         (WebCore::RenderThemeIOS::platformInactiveSelectionBackgroundColor const):
1552         * rendering/RenderThemeMac.h:
1553         * rendering/RenderThemeMac.mm:
1554         (WebCore::RenderThemeMac::platformActiveSelectionBackgroundColor const):
1555         (WebCore::RenderThemeMac::platformInactiveSelectionBackgroundColor const):
1556         (WebCore::RenderThemeMac::platformActiveSelectionForegroundColor const):
1557         (WebCore::RenderThemeMac::platformInactiveSelectionForegroundColor const):
1558         (WebCore::RenderThemeMac::platformActiveListBoxSelectionBackgroundColor const):
1559         (WebCore::RenderThemeMac::platformInactiveListBoxSelectionBackgroundColor const):
1560         (WebCore::RenderThemeMac::platformActiveListBoxSelectionForegroundColor const):
1561         (WebCore::RenderThemeMac::platformInactiveListBoxSelectionForegroundColor const):
1562         * rendering/RenderThemeWin.cpp:
1563         (WebCore::RenderThemeWin::platformActiveSelectionBackgroundColor const):
1564         (WebCore::RenderThemeWin::platformInactiveSelectionBackgroundColor const):
1565         (WebCore::RenderThemeWin::platformActiveSelectionForegroundColor const):
1566         (WebCore::RenderThemeWin::platformInactiveSelectionForegroundColor const):
1567         * rendering/RenderThemeWin.h:
1568
1569 2018-06-04  Chris Dumez  <cdumez@apple.com>
1570
1571         Update Fetch code to provide more useful exception messages
1572         https://bugs.webkit.org/show_bug.cgi?id=186156
1573
1574         Reviewed by Youenn Fablet.
1575
1576         Provide more useful error messages in our Loading / Fetch code.
1577
1578         * Modules/fetch/FetchBodyOwner.cpp:
1579         (WebCore::FetchBodyOwner::arrayBuffer):
1580         (WebCore::FetchBodyOwner::blob):
1581         (WebCore::FetchBodyOwner::consumeOnceLoadingFinished):
1582         (WebCore::FetchBodyOwner::formData):
1583         (WebCore::FetchBodyOwner::json):
1584         (WebCore::FetchBodyOwner::text):
1585         * Modules/fetch/FetchHeaders.cpp:
1586         (WebCore::canWriteHeader):
1587         (WebCore::FetchHeaders::get const):
1588         (WebCore::FetchHeaders::has const):
1589         * Modules/fetch/FetchRequest.cpp:
1590         (WebCore::FetchRequest::setBody):
1591         (WebCore::FetchRequest::clone):
1592         * Modules/fetch/FetchResponse.cpp:
1593         (WebCore::FetchResponse::redirect):
1594         (WebCore::FetchResponse::clone):
1595         * workers/service/context/ServiceWorkerFetch.cpp:
1596         (WebCore::ServiceWorkerFetch::processResponse):
1597         (WebCore::ServiceWorkerFetch::dispatchFetchEvent):
1598         * workers/service/context/ServiceWorkerFetch.h:
1599
1600 2018-06-04  Daniel Bates  <dabates@apple.com>
1601
1602         Update Strong Password appearance
1603         https://bugs.webkit.org/show_bug.cgi?id=186239
1604         <rdar://problem/38183795>
1605
1606         Reviewed by Brent Fulgham.
1607
1608         Fix up the gradient mask to start half-way through the visible text and size it to the
1609         width of the visible text. Also change the color of the Strong Password label to 80% black.
1610
1611         We achieve sizing of the gradient to the width of the visible text by changing the CSS display
1612         of the inner text element to be an inline-block and specifying "max-width: 100%" so that
1613         its maximum width is less than or equal to the width of its containing block. Additionally,
1614         only apply strong password-specific inner text element styles when the field is not disabled
1615         or read-only and has a strong password appearance. Otherwise these styles, specifically the
1616         display type, will adversely effect rendering of the text when the field is disabled or readonly.
1617
1618         * css/html.css:
1619         (input::-webkit-strong-password-auto-fill-button):
1620         * html/HTMLInputElement.cpp:
1621         (WebCore::autoFillStrongPasswordMaskImage):
1622         (WebCore::HTMLInputElement::createInnerTextStyle):
1623
1624 2018-06-04  Wenson Hsieh  <wenson_hsieh@apple.com>
1625
1626         [WebKit on watchOS] Remove all uses of the EXTRA_ZOOM_MODE compiler flag
1627         https://bugs.webkit.org/show_bug.cgi?id=186279
1628
1629         Reviewed by Tim Horton.
1630
1631         Replaces uses of ENABLE(EXTRA_ZOOM_MODE) with PLATFORM(WATCHOS). No change in behavior.
1632
1633         * Modules/mediacontrols/MediaControlsHost.cpp:
1634         (WebCore::MediaControlsHost::compactMode const):
1635         * html/HTMLMediaElement.cpp:
1636         (WebCore::HTMLMediaElement::updatePlayState):
1637         * page/Page.cpp:
1638         (WebCore::relevantViewRect):
1639         * page/SettingsBase.cpp:
1640         (WebCore::SettingsBase::defaultMinimumZoomFontSize):
1641         (WebCore::SettingsBase::defaultDownloadableBinaryFontsEnabled):
1642         * page/ViewportConfiguration.cpp:
1643         (WebCore::platformDeviceWidthOverride):
1644         (WebCore::shouldOverrideShrinkToFitArgument):
1645         (WebCore::needsUpdateAfterChangingDisabledAdaptations):
1646         * platform/LocalizedStrings.cpp:
1647         * platform/LocalizedStrings.h:
1648         * platform/audio/ios/MediaSessionManagerIOS.mm:
1649         (WebCore::MediaSessionManageriOS::configureWireLessTargetMonitoring):
1650         (-[WebMediaSessionHelper dealloc]):
1651         (-[WebMediaSessionHelper hasWirelessTargetsAvailable]):
1652         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1653         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer):
1654         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem):
1655         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenMode):
1656         * platform/ios/PlaybackSessionInterfaceAVKit.mm:
1657         (WebCore::PlaybackSessionInterfaceAVKit::seekableRangesChanged):
1658         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
1659         (-[WebAVPlayerViewController initWithFullscreenInterface:]):
1660         (-[WebAVPlayerViewController enterFullScreenAnimated:completionHandler:]):
1661         (-[WebAVPlayerViewController exitFullScreenAnimated:completionHandler:]):
1662         (-[WebAVPlayerViewController MY_NO_RETURN]):
1663         (-[WebAVPlayerViewController isPictureInPicturePossible]):
1664         (-[WebAVPlayerViewController isPictureInPictureActive]):
1665         (-[WebAVPlayerViewController pictureInPictureActive]):
1666         (-[WebAVPlayerViewController pictureInPictureWasStartedWhenEnteringBackground]):
1667         (-[WebAVPlayerViewController showsPlaybackControls]):
1668         (-[WebAVPlayerViewController setShowsPlaybackControls:]):
1669         (-[WebAVPlayerViewController setAllowsPictureInPicturePlayback:]):
1670         (-[WebAVPlayerViewController setDelegate:]):
1671         (VideoFullscreenInterfaceAVKit::setupFullscreen):
1672         (VideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):
1673         (VideoFullscreenInterfaceAVKit::doSetup):
1674         (WebCore::supportsPictureInPicture):
1675         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
1676         (VideoFullscreenControllerContext::willExitFullscreen):
1677         * rendering/RenderThemeIOS.h:
1678         * rendering/RenderThemeIOS.mm:
1679
1680 2018-06-04  Youenn Fablet  <youenn@apple.com>
1681
1682         [WK1] Add an option to restrict communication to localhost sockets
1683         https://bugs.webkit.org/show_bug.cgi?id=186249
1684
1685         Reviewed by Eric Carlson.
1686
1687         Covered by existing tests.
1688         Set explicitly webrtc socket IP address to 127.0.0.1 in testing mode.
1689         For that purpose, we need WK1 to create a wrapper around a socket factory,
1690         this wrapper being responsible of setting or not the IP address to 127.0.0.1.
1691
1692         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
1693         (WebCore::prepareSocketAddress):
1694         (WebCore::BasicPacketSocketFactory::BasicPacketSocketFactory):
1695         (WebCore::BasicPacketSocketFactory::setDisableNonLocalhostConnections):
1696         (WebCore::BasicPacketSocketFactory::CreateClientTcpSocket):
1697         (WebCore::LibWebRTCProvider::createPeerConnection):
1698         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
1699
1700 2018-06-04  Zalan Bujtas  <zalan@apple.com>
1701
1702         [LFC] Merge width and margin computation for block-level, non-replaced and inline,replaced element in normal flow
1703         https://bugs.webkit.org/show_bug.cgi?id=186225
1704
1705         Reviewed by Antti Koivisto.
1706
1707         This patch merges the width and horizontal margin computation for
1708         https://www.w3.org/TR/CSS22/visudet.html#inline-replaced-width and https://www.w3.org/TR/CSS22/visudet.html#blockwidth
1709
1710         * layout/FormattingContextGeometry.cpp:
1711         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
1712         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1713         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
1714
1715 2018-06-01  Zalan Bujtas  <zalan@apple.com>
1716
1717         [LFC] Merge width and horizontal margin computation
1718         https://bugs.webkit.org/show_bug.cgi?id=186217
1719
1720         Reviewed by Antti Koivisto.
1721
1722         We could certainly compute width and maring separately, but to match each steps defined
1723         at https://www.w3.org/TR/CSS22/visudet.html, we should just merge width and horizontal margin computations
1724         (followed by height and vertical margins).
1725         Use 0 computed marings for now.
1726
1727         * layout/FormattingContext.cpp:
1728         (WebCore::Layout::FormattingContext::computeFloatingWidthAndMargin const):
1729         (WebCore::Layout::FormattingContext::computeOutOfFlowWidthAndMargin const):
1730         (WebCore::Layout::FormattingContext::computeOutOfFlowHeight const):
1731         (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
1732         (WebCore::Layout::FormattingContext::computeOutOfFlowWidth const): Deleted.
1733         (WebCore::Layout::FormattingContext::computeFloatingWidth const): Deleted.
1734         * layout/FormattingContext.h:
1735         * layout/FormattingContextGeometry.cpp:
1736         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedWidthAndMargin):
1737         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedWidthAndMargin):
1738         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
1739         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
1740         (WebCore::Layout::FormattingContext::Geometry::outOfFlowWidthAndMargin):
1741         (WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin):
1742         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
1743         (WebCore::Layout::FormattingContext::Geometry::computedPadding):
1744         (WebCore::Layout::outOfFlowNonReplacedWidth): Deleted.
1745         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedWidth): Deleted.
1746         (WebCore::Layout::floatingNonReplacedWidth): Deleted.
1747         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidth): Deleted.
1748         (WebCore::Layout::FormattingContext::Geometry::outOfFlowWidth): Deleted.
1749         (WebCore::Layout::FormattingContext::Geometry::floatingWidth): Deleted.
1750         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidth): Deleted.
1751         * layout/LayoutContext.cpp:
1752         (WebCore::Layout::LayoutContext::initializeRoot):
1753         * layout/blockformatting/BlockFormattingContext.cpp:
1754         (WebCore::Layout::BlockFormattingContext::layout const):
1755         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
1756         (WebCore::Layout::BlockFormattingContext::computeInFlowWidthAndMargin const):
1757         (WebCore::Layout::BlockFormattingContext::computeWidth const): Deleted.
1758         (WebCore::Layout::BlockFormattingContext::computeInFlowWidth const): Deleted.
1759         (WebCore::Layout::BlockFormattingContext::computeMargin const): Deleted.
1760         * layout/blockformatting/BlockFormattingContext.h:
1761         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1762         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
1763         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):
1764         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidth): Deleted.
1765         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidth): Deleted.
1766         (WebCore::Layout::BlockFormattingContext::Geometry::computedMargin): Deleted.
1767         * layout/displaytree/DisplayBox.cpp:
1768         (WebCore::Display::Box::marginBox const):
1769         * layout/displaytree/DisplayBox.h:
1770         (WebCore::Display::Box::setHasValidVerticalMargin):
1771         (WebCore::Display::Box::setHasValidHorizontalMargin):
1772         (WebCore::Display::Box::invalidateMargin):
1773         (WebCore::Display::Box::setHorizontalMargin):
1774         (WebCore::Display::Box::setVerticalMargin):
1775         (WebCore::Display::Box::marginTop const):
1776         (WebCore::Display::Box::marginLeft const):
1777         (WebCore::Display::Box::marginBottom const):
1778         (WebCore::Display::Box::marginRight const):
1779         (WebCore::Display::Box::Edges::Edges): Deleted.
1780         (WebCore::Display::Box::setHasValidMargin): Deleted.
1781         (WebCore::Display::Box::setMargin): Deleted.
1782
1783 2018-06-03  Michael Catanzaro  <mcatanzaro@igalia.com>
1784
1785         REGRESSION(r232338): [GTK] Broke a few layout tests
1786         https://bugs.webkit.org/show_bug.cgi?id=186244
1787
1788         Unreviewed, also rollout r232392.
1789
1790         * rendering/RenderTheme.cpp:
1791         (WebCore::RenderTheme::adjustStyle):
1792         * rendering/RenderTheme.h:
1793         (WebCore::RenderTheme::adjustListboxStyle const): Deleted.
1794         * rendering/RenderThemeGtk.cpp:
1795         (WebCore::RenderThemeGtk::adjustListboxStyle const): Deleted.
1796         * rendering/RenderThemeGtk.h:
1797
1798 2018-06-03  Michael Catanzaro  <mcatanzaro@igalia.com>
1799
1800         REGRESSION(r232338): [GTK] Broke a few layout tests
1801         https://bugs.webkit.org/show_bug.cgi?id=186244
1802
1803         Unreviewed, rollout r232338.
1804
1805         * platform/gtk/RenderThemeGadget.cpp:
1806         (WebCore::RenderThemeGadget::RenderThemeGadget):
1807         (WebCore::baseStyleContext): Deleted.
1808         * rendering/RenderThemeGtk.cpp:
1809         (WebCore::RenderThemeGtk::adjustButtonStyle const):
1810         (WebCore::RenderThemeGtk::adjustTextFieldStyle const):
1811         (WebCore::RenderThemeGtk::adjustSearchFieldStyle const):
1812         (WebCore::styleColor):
1813         (WebCore::RenderThemeGtk::adjustTextAreaStyle const): Deleted.
1814         * rendering/RenderThemeGtk.h:
1815
1816 2018-06-03  Eric Carlson  <eric.carlson@apple.com>
1817
1818         [iOS] MediaPlayer.framework is not always available
1819         https://bugs.webkit.org/show_bug.cgi?id=186220
1820         <rdar://problem/40571286>
1821
1822         Reviewed by Tim Horton.
1823
1824         * platform/ios/RemoteCommandListenerIOS.mm:
1825         (WebCore::RemoteCommandListener::create):
1826
1827 2018-06-02  Darin Adler  <darin@apple.com>
1828
1829         [Cocoa] Update some code to be more ARC-compatible to prepare for future ARC adoption
1830         https://bugs.webkit.org/show_bug.cgi?id=186227
1831
1832         Reviewed by Dan Bernstein.
1833
1834         * bridge/objc/objc_instance.mm:
1835         (ObjcInstance::~ObjcInstance): Use @autoreleasepool instead of NSAutoreleasePool.
1836         * platform/ios/wak/WAKView.mm:
1837         (-[WAKView _appendDescriptionToString:atLevel:]): Ditto.
1838
1839 2018-06-03  Zan Dobersek  <zdobersek@igalia.com>
1840
1841         [WebGL] GL_EXT_robustness utilization should depend on CONTEXT_ROBUST_ACCESS value
1842         https://bugs.webkit.org/show_bug.cgi?id=186187
1843
1844         Reviewed by Carlos Garcia Campos.
1845
1846         Don't utilize the GL_EXT_robustness extension for reading pixels from
1847         the GPU if the underlying OpenGL context did not enable robust access
1848         support upon creation. For EGL contexts, this would be done by passing
1849         EGL_CONTEXT_OPENGL_ROBUST_ACCESS_EXT and EGL_TRUE key-value pair in the
1850         attribute list passed to eglCreateContext() (as specified in the
1851         EGL_EXT_create_context_robustness extension), but at the moment this
1852         capability is not utilized.
1853
1854         As such, on drivers that implement GL_EXT_robustness support, pixel
1855         reads done in WebGLRenderingContextBase end up using glReadnPixels(),
1856         but that fails to successfully read anything due to the context
1857         rejecting such calls.
1858
1859         GL_EXT_robustness is specific to OpenGL ES versions, so to fix this,
1860         Extensions3DOpenGLES overrides the isEnabled() method. That override
1861         returns false immediately if the inherited isEnabled() implementation
1862         returns false. Otherwise it returns true, unless the tested extension
1863         is GL_EXT_robustness, in which case we now check that the context's
1864         CONTEXT_ROBUST_ACCESS state value is true, meaning the context was
1865         created with robust access support enabled.
1866
1867         No new tests are possible because this is optional driver-provided
1868         functionality that Web content cannot have effect on.
1869
1870         * platform/graphics/Extensions3D.h:
1871         * platform/graphics/opengl/Extensions3DOpenGLES.cpp:
1872         (WebCore::Extensions3DOpenGLES::isEnabled):
1873         * platform/graphics/opengl/Extensions3DOpenGLES.h:
1874
1875 2018-06-01  Ryosuke Niwa  <rniwa@webkit.org>
1876
1877         Editor can hold references to Documents after you navigate away
1878         https://bugs.webkit.org/show_bug.cgi?id=186215
1879
1880         Reviewed by Simon Fraser.
1881
1882         Clear the various member variables that can hold onto a document in Editor::clear and FrameSelection::prepareForDestruction.
1883
1884         Test: editing/selection/navigation-clears-editor-state.html
1885
1886         * editing/Editor.cpp:
1887         (WebCore::Editor::clear):
1888         * editing/Editor.h:
1889         * editing/FrameSelection.cpp:
1890         (WebCore::FrameSelection::FrameSelection):
1891         (WebCore::FrameSelection::prepareForDestruction):
1892         * editing/FrameSelection.h:
1893
1894 2018-06-01  Ryosuke Niwa  <rniwa@webkit.org>
1895
1896         ResourceLoader::cancel() shouldn't synchronously fire load event on document
1897         https://bugs.webkit.org/show_bug.cgi?id=185284
1898
1899         Revert the erroneous change to SSFontSelector::beginLoadTimerFired(), which broke CancelLoading.CancelFontSubresource.
1900         FrameLoader::loadDone calls checkCompleted, not checkLoadComplete so we still need to call checkLoadComplete here.
1901
1902         * css/CSSFontSelector.cpp:
1903         (WebCore::CSSFontSelector::beginLoadTimerFired): 
1904
1905 2018-06-01  Jeremy Jones  <jeremyj@apple.com>
1906
1907         Keyboard focus should exit fullscreen.
1908         https://bugs.webkit.org/show_bug.cgi?id=185617
1909         rdar://problem/34697938
1910
1911         Reviewed by Ryosuke Niwa.
1912
1913         No opensource test because feature is not enabled.
1914
1915         While in element fullscreen, initiating keyboard focus should exit fullscreen in iOS.
1916
1917         Improve fullscreen testability by exposing isAnimatingFullScreen.
1918
1919         * dom/Document.h:
1920         * testing/Internals.cpp:
1921         (WebCore::Internals::isAnimatingFullScreen const):
1922         * testing/Internals.h:
1923         * testing/Internals.idl:
1924
1925 2018-06-01  Jeremy Jones  <jeremyj@apple.com>
1926
1927         Don't continue playing in background when auto-picture-in-picture is disabled.
1928         https://bugs.webkit.org/show_bug.cgi?id=186089
1929         rdar://problem/40314314
1930
1931         Reviewed by Eric Carlson.
1932
1933         No new tests because we don't have a way to test auto-pip.
1934
1935         With the refactoring work done in VideoFullscreenInterfaceAVKit, HTMLMediaElement no longer has to anticipate 
1936         auto-pip when if it should pause on suspend. Instead VideoFullscreenInterfaceAVKit proactively updates 
1937         videoFullscreenMode, so checking for PIP is sufficient.
1938
1939         * html/HTMLMediaElement.cpp:
1940         (WebCore::HTMLMediaElement::shouldOverrideBackgroundPlaybackRestriction const):
1941
1942 2018-06-01  Chris Dumez  <cdumez@apple.com>
1943
1944         REGRESSION (r231456): Colloquy is broken
1945         https://bugs.webkit.org/show_bug.cgi?id=186197
1946         <rdar://problem/40722960>
1947
1948         Reviewed by Timothy Hatcher.
1949
1950         Restore pre-r231456 behavior for Colloquy app so that it works again.
1951
1952         * html/HTMLFrameElementBase.cpp:
1953         (WebCore::HTMLFrameElementBase::openURL):
1954         * page/Settings.yaml:
1955
1956 2018-06-01  Chris Dumez  <cdumez@apple.com>
1957
1958         Regression(r230567): Unable to log into twitter.com in private sessions
1959         https://bugs.webkit.org/show_bug.cgi?id=186205
1960         <rdar://problem/40670799>
1961
1962         Reviewed by Youenn Fablet.
1963
1964         We were using the same SWServer for all private sessions and the SWServer's sessionID would
1965         be legacyPrivateSessionID(). As a result, the service worker's sessionID would be legacyPrivateSessionID()
1966         as well and would not match the sessionID of its client pages. This sessionID mismatch was
1967         causing the breakage.
1968
1969         Instead of using the same SWServer of all private sessions, we now go back to using a SWServer
1970         per private session. However, we now make sure that the SWServer gets destroyed whenever its
1971         corresponding session gets destroyed.
1972
1973         * workers/service/server/SWServer.cpp:
1974         (WebCore::SWServer::~SWServer):
1975
1976 2018-06-01  Youenn Fablet  <youenn@apple.com>
1977
1978         Add an option to restrict communication to localhost sockets
1979         https://bugs.webkit.org/show_bug.cgi?id=186208
1980
1981         Reviewed by Eric Carlson.
1982
1983         Covered by existing tests.
1984         Add an option in LibWebRTCProvider to restrict to localhost sockets.
1985         Use that option when Internals is used.
1986
1987         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
1988         * testing/Internals.cpp:
1989         (WebCore::Internals::resetToConsistentState):
1990
1991 2018-06-01  Ryosuke Niwa  <rniwa@webkit.org>
1992
1993         ResourceLoader::cancel() shouldn't synchronously fire load event on document
1994         https://bugs.webkit.org/show_bug.cgi?id=185284
1995
1996         Reviewed by Antti Koivisto.
1997
1998         Because a resource loading can be canceled as a node is removed a document or CachedResource is destructed,
1999         it's not safe to synchronously fire load event on document upon cancelation. This patch makes the cancellation
2000         of a resource load schedule m_checkTimer in FrameLoader to fire a load event asynchronously instead.
2001
2002         Specifically, this patch makes FrameLoader::loadDone call FrameLoader::scheduleCheckCompleted when the load
2003         had failed or cancled instead of calling FrameLoader::checkCompleted which can synchronously fire load event.
2004         To differentiate the two cases, new enum LoadCompletionType has been added to FrameLoader::loadDone and related
2005         functions. To avoid calling the navigation delegate too early, the same abstraction for checkLoadComplete()
2006         has been added in the form of FrameLoader::subresourceLoadDone.
2007
2008         Unfortunately, delaying calls to checkCompleted() and checkLoadComplete() by a timer can result in client
2009         callbacks such as didFinishLoadForFrame and didFailLoadWithError to never get called when the frame gets
2010         detached from the parent after the last resource had stopped loading but before the timer fires. To preserve
2011         these deleagte callbacks, this patch expedites the timer in FrameLoader::frameDetached and Page::goToItem by
2012         by invoking newly added stopAllLoadersAndCheckCompleteness, which stops all loading and then immediately invokes
2013         checkCompleted() and checkLoadComplete() synchronously if m_checkTimer had been started.
2014
2015         Tests: http/tests/preload/dynamic_removing_preload.html
2016
2017         * css/CSSFontSelector.cpp:
2018         (WebCore::CSSFontSelector::beginLoadTimerFired): Removed superfluous call to checkLoadComplete since
2019         cachedResourceLoader's loadDone would call checkLoadComplete anyway.
2020         * html/HTMLFrameOwnerElement.cpp:
2021         (WebCore::HTMLFrameOwnerElement::disconnectContentFrame): Removed the misleading comment added in r140090.
2022         Firefox DOES indeed fire unload event in the content document of a removed frame. While this comment made
2023         it sound like this function isn't called when a frame is removed from the tree when in reality we simply
2024         remove a frame prior to removing the node via disconnectSubframesIfNeeded.
2025         * loader/DocumentLoader.cpp:
2026         (WebCore::DocumentLoader::removeSubresourceLoader):
2027         * loader/DocumentLoader.h:
2028         * loader/FrameLoader.cpp:
2029         (WebCore::FrameLoader::FrameLoader):
2030         (WebCore::FrameLoader::loadDone):
2031         (WebCore::FrameLoader::subresourceLoadDone):
2032         (WebCore::FrameLoader::checkCompleted): Added a release assert that this function is only called when it's safe
2033         to execute scripts.
2034         (WebCore::FrameLoader::checkTimerFired):
2035         (WebCore::FrameLoader::checkCompletenessNow):Extracted from checkTimerFired.
2036         (WebCore::FrameLoader::stopAllLoaders): Removed the code to stop m_checkTimer introduced in r53655.
2037         Stopping the timer here would prevent FrameLoader::frameDetached to detect the case when stopping the loader
2038         scheduled a load completion check. Also stopping this timer without clearing the corresponding booleans:
2039         m_checkingLoadCompleteForDetachment and m_checkingLoadCompleteForDetachment is problematic. The assertion
2040         r53655 addressed is now addressed by explicitly checking & clearing the timer in frameDetached.
2041         (WebCore::FrameLoader::stopAllLoadersAndCheckCompleteness): Added.
2042         (WebCore::FrameLoader::checkLoadCompleteForThisFrame): Avoid an early exit when the newly added boolean
2043         m_checkingLoadCompleteForDetachment is set since m_isStopping is no longer set in frameDetached in order
2044         to invoke didFailLoadWithError when detaching a frame.
2045         (WebCore::FrameLoader::frameDetached): Call checkCompletenessNow in the case the frame had already been
2046         completed loading. Also call stopAllLoadersAndCheckCompleteness in the case stopping loading would complete
2047         the loading before stopping active DOM objects.
2048         * loader/FrameLoader.h:
2049         (WebCore::FrameLoader::m_checkingLoadCompleteForDetachment): Added.
2050         * loader/FrameLoaderTypes.h:
2051         (WebCore::LoadCompletionType): Added.
2052         * loader/SubresourceLoader.cpp:
2053         (WebCore::SubresourceLoader::didFinishLoading):
2054         (WebCore::SubresourceLoader::didFail):
2055         (WebCore::SubresourceLoader::didCancel):
2056         (WebCore::SubresourceLoader::notifyDone):
2057         * loader/SubresourceLoader.h:
2058         * loader/cache/CachedResourceLoader.cpp:
2059         (WebCore::CachedResourceLoader::loadDone):
2060         * loader/cache/CachedResourceLoader.h:
2061         * page/Page.cpp:
2062         (WebCore::Page::goToItem): Call stopAllLoadersAndCheckCompleteness instead of stopAllLoaders since stopping
2063         loading here may complete loading.
2064
2065 2018-06-01  Sihui Liu  <sihui_liu@apple.com>
2066
2067         Stop using StorageTracker.db in LocalStorageDatabaseTracker
2068         https://bugs.webkit.org/show_bug.cgi?id=186104
2069
2070         Reviewed by Geoffrey Garen.
2071
2072         No behavior change.
2073
2074         * platform/sql/SQLiteFileSystem.h:
2075
2076 2018-06-01  Zalan Bujtas  <zalan@apple.com>
2077
2078         [LFC] Simplify the formatting class implementation by pushing down some of the logic to the Geometry class
2079         https://bugs.webkit.org/show_bug.cgi?id=186179
2080
2081         Reviewed by Antti Koivisto.
2082
2083         * layout/FormattingContext.cpp:
2084         (WebCore::Layout::FormattingContext::computeOutOfFlowPosition const):
2085         (WebCore::Layout::FormattingContext::computeOutOfFlowWidth const):
2086         (WebCore::Layout::FormattingContext::computeFloatingWidth const):
2087         (WebCore::Layout::FormattingContext::computeOutOfFlowHeight const):
2088         (WebCore::Layout::FormattingContext::computeFloatingHeight const):
2089         * layout/FormattingContext.h:
2090         * layout/FormattingContextGeometry.cpp:
2091         (WebCore::Layout::outOfFlowNonReplacedHeight):
2092         (WebCore::Layout::outOfFlowNonReplacedWidth):
2093         (WebCore::Layout::outOfFlowReplacedHeight):
2094         (WebCore::Layout::outOfFlowReplacedWidth):
2095         (WebCore::Layout::floatingNonReplacedHeight):
2096         (WebCore::Layout::floatingNonReplacedWidth):
2097         (WebCore::Layout::floatingReplacedHeight):
2098         (WebCore::Layout::floatingReplacedWidth):
2099         (WebCore::Layout::outOfFlowNonReplacedPosition):
2100         (WebCore::Layout::outOfFlowReplacedPosition):
2101         (WebCore::Layout::FormattingContext::Geometry::outOfFlowHeight):
2102         (WebCore::Layout::FormattingContext::Geometry::outOfFlowWidth):
2103         (WebCore::Layout::FormattingContext::Geometry::floatingHeight):
2104         (WebCore::Layout::FormattingContext::Geometry::floatingWidth):
2105         (WebCore::Layout::FormattingContext::Geometry::outOfFlowPosition):
2106         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeight):
2107         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidth):
2108         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHeight): Deleted.
2109         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedWidth): Deleted.
2110         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHeight): Deleted.
2111         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedWidth): Deleted.
2112         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedHeight): Deleted.
2113         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidth): Deleted.
2114         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeight): Deleted.
2115         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidth): Deleted.
2116         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedPosition): Deleted.
2117         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedPosition): Deleted.
2118         (WebCore::Layout::FormattingContext::Geometry::replacedHeight): Deleted.
2119         (WebCore::Layout::FormattingContext::Geometry::replacedWidth): Deleted.
2120         * layout/blockformatting/BlockFormattingContext.cpp:
2121         (WebCore::Layout::BlockFormattingContext::computeStaticPosition const):
2122         (WebCore::Layout::BlockFormattingContext::computeInFlowPositionedPosition const):
2123         (WebCore::Layout::BlockFormattingContext::computeInFlowHeight const):
2124         (WebCore::Layout::BlockFormattingContext::computeInFlowWidth const):
2125         * layout/blockformatting/BlockFormattingContext.h:
2126         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2127         (WebCore::Layout::inFlowNonReplacedHeight):
2128         (WebCore::Layout::inFlowNonReplacedWidth):
2129         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeight):
2130         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidth):
2131         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeight): Deleted.
2132         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidth): Deleted.
2133
2134 2018-06-01  Zalan Bujtas  <zalan@apple.com>
2135
2136         [LFC] Push FormattingContext::computeWidth/computeHeight logic from the base to the subclasses.
2137         https://bugs.webkit.org/show_bug.cgi?id=186172
2138
2139         Reviewed by Antti Koivisto.
2140
2141         FormattingContext::computeWidth/computeHeight virtual functions have very little benefit and in the long run
2142         it's better if we keep the number of virtual functions to the minimum necessary.
2143
2144         * layout/FormattingContext.cpp:
2145         (WebCore::Layout::FormattingContext::computeFloatingWidth const):
2146         (WebCore::Layout::FormattingContext::computeStaticPosition const): Deleted.
2147         (WebCore::Layout::FormattingContext::computeInFlowPositionedPosition const): Deleted.
2148         (WebCore::Layout::FormattingContext::computeWidth const): Deleted.
2149         (WebCore::Layout::FormattingContext::computeHeight const): Deleted.
2150         (WebCore::Layout::FormattingContext::computeMargin const): Deleted.
2151         * layout/FormattingContext.h:
2152         * layout/FormattingContextGeometry.cpp:
2153         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHeight):
2154         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedWidth):
2155         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeight):
2156         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidth):
2157         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeight):
2158         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidth):
2159         (WebCore::Layout::FormattingContext::Geometry::replacedHeight): Deleted.
2160         (WebCore::Layout::FormattingContext::Geometry::replacedWidth): Deleted.
2161         * layout/blockformatting/BlockFormattingContext.cpp:
2162         (WebCore::Layout::BlockFormattingContext::computeWidth const):
2163         (WebCore::Layout::BlockFormattingContext::computeHeight const):
2164         (WebCore::Layout::BlockFormattingContext::computeInFlowHeight const):
2165         (WebCore::Layout::BlockFormattingContext::computeInFlowWidth const):
2166         * layout/blockformatting/BlockFormattingContext.h:
2167         * layout/inlineformatting/InlineFormattingContext.cpp:
2168         (WebCore::Layout::InlineFormattingContext::computeStaticPosition const):
2169         (WebCore::Layout::InlineFormattingContext::computeInFlowPositionedPosition const):
2170         (WebCore::Layout::InlineFormattingContext::computeInFlowWidth const): Deleted.
2171         (WebCore::Layout::InlineFormattingContext::computeInFlowHeight const): Deleted.
2172         * layout/inlineformatting/InlineFormattingContext.h:
2173
2174 2018-06-01  Carlos Eduardo Ramalho  <cadubentzen@gmail.com>
2175
2176         [GTK] Difficult to read combo box text in dark theme
2177         https://bugs.webkit.org/show_bug.cgi?id=165072
2178
2179         Reviewed by Carlos Garcia Campos.
2180
2181         Set listbox foreground color to theme color to fix hard-to-read
2182         text color in combo box while using dark theme.
2183
2184         No new tests required. ManualTests/gtk/theme.html already covers it.
2185         See the "Option Lists" section.
2186
2187         * rendering/RenderTheme.cpp:
2188         (WebCore::RenderTheme::adjustStyle):
2189         Adjust style for ListboxPart as well.
2190         * rendering/RenderTheme.h: Add adjustListboxStyle()
2191         * rendering/RenderThemeGtk.cpp:
2192         (WebCore::RenderThemeGtk::adjustListboxStyle const):
2193         Set color to the theme foreground color.
2194         * rendering/RenderThemeGtk.h: adjustListboxStyle() overriden.
2195
2196 2018-06-01  Carlos Garcia Campos  <cgarcia@igalia.com>
2197
2198         [GTK] Switch to use a popup window with a tree view instead of a menu for option menu default implementation
2199         https://bugs.webkit.org/show_bug.cgi?id=186146
2200
2201         Reviewed by Michael Catanzaro.
2202
2203         Make it possible to use GUniquePtr with GtkTreePath.
2204
2205         * platform/gtk/GUniquePtrGtk.h:
2206
2207 2018-05-31  Per Arne Vollan  <pvollan@apple.com>
2208
2209         Add OpenGL display mask to WebPage creation parameters.
2210         https://bugs.webkit.org/show_bug.cgi?id=186163
2211         <rdar://problem/40634504>
2212
2213         Reviewed by Brent Fulgham.
2214
2215         To make sure the OpenGL display mask is always available, include it in the WebPage creation parameters.
2216         The OpenGL display mask is sent to the WebProcess when the platform display ID changes, but that is not
2217         early enough in all cases. If the OpenGL display mask is not set, only OpenGL software rendering is offered
2218         on some hardware configurations.
2219  
2220         No new tests, since it is not trivial to test whether OpenGL rendering is hardware accelerated.
2221
2222         * platform/PlatformScreen.h:
2223         * platform/mac/PlatformScreenMac.mm:
2224         (WebCore::displayID):
2225
2226 2018-05-31  Megan Gardner  <megan_gardner@apple.com>
2227
2228         Add setting to allow override screen size to be disabled.
2229         https://bugs.webkit.org/show_bug.cgi?id=186109
2230
2231         Reviewed by Andy Estes.
2232
2233         Not Testable, and for debug only.
2234
2235         Pipe settings and use them to ignore override screen size if setting is set. 
2236
2237         * page/DeprecatedGlobalSettings.cpp:
2238         * page/DeprecatedGlobalSettings.h:
2239         (WebCore::DeprecatedGlobalSettings::setDisableScreenSizeOverride):
2240         (WebCore::DeprecatedGlobalSettings::disableScreenSizeOverride):
2241         * page/Settings.yaml:
2242         * platform/ios/PlatformScreenIOS.mm:
2243
2244 2018-05-31  Brent Fulgham  <bfulgham@apple.com>
2245
2246         REGRESSION(r216119): DocumentLoader::detachFromFrame still encounters nullptr frame
2247         https://bugs.webkit.org/show_bug.cgi?id=186081
2248         <rdar://problem/34918109>
2249
2250         Reviewed by David Kilzer.
2251
2252         The nullptr check that was removed in r216119 was still needed because when the DocumentLoader
2253         is in 'm_waitingForNavigationPolicy' or in 'm_waitingForContentPolicy', a call to the policy checker
2254         to stopCheck we will clear the frame as part of the cleanup phase.
2255
2256         If m_frame is nullptr after cancelPolicyCheckIfNeeded, our work is already done so just return.
2257
2258         * loader/DocumentLoader.cpp:
2259         (WebCore::DocumentLoader::detachFromFrame):
2260
2261 2018-05-31  Dean Jackson  <dino@apple.com>
2262
2263         Don't paint the System Preview badge if the image isn't fully decoded
2264         https://bugs.webkit.org/show_bug.cgi?id=186158
2265         <rdar://problem/40454866>
2266
2267         Reviewed by Antoine Quint.
2268
2269         Only paint the system preview badge if the image itself said
2270         that it succeeded in drawing.
2271
2272         * rendering/RenderImage.cpp:
2273         (WebCore::RenderImage::paintIntoRect): Check the ImageDrawResult.
2274
2275 2018-05-31  David Kilzer  <ddkilzer@apple.com>
2276
2277         Implement checked cast for DDResultRef once DDResultGetCFTypeID() is available
2278         <https://webkit.org/b/184554>
2279         <rdar://problem/36241894>
2280
2281         Reviewed by Brent Fulgham.
2282
2283         * editing/cocoa/DataDetection.mm:
2284         (WebCore::detectItemAtPositionWithRange): Implement checked cast
2285         for DDResultRef.
2286
2287 2018-05-31  Alex Christensen  <achristensen@webkit.org>
2288
2289         Fix Windows build after r232246.
2290         https://bugs.webkit.org/show_bug.cgi?id=186024
2291
2292         * rendering/svg/SVGTextLayoutEngineBaseline.cpp:
2293         (WebCore::SVGTextLayoutEngineBaseline::calculateAlignmentBaselineShift const):
2294
2295 2018-05-31  Chris Dumez  <cdumez@apple.com>
2296
2297         Fix memory leak under NetworkStateNotifier::updateStateWithoutNotifying()
2298         https://bugs.webkit.org/show_bug.cgi?id=186149
2299         <rdar://problem/40674537>
2300
2301         Reviewed by Geoffrey Garen.
2302
2303         * platform/network/mac/NetworkStateNotifierMac.cpp:
2304         (WebCore::NetworkStateNotifier::updateStateWithoutNotifying):
2305
2306 2018-05-31  Zalan Bujtas  <zalan@apple.com>
2307
2308         [LFC] Layout code needs to know the type of the Element associated with a Layout::Box
2309         https://bugs.webkit.org/show_bug.cgi?id=186117
2310
2311         Reviewed by Antti Koivisto.
2312
2313         Since these attributes don't change during layout, we could just pass them in to Layout::Box instead
2314         of keep querying the Element.
2315
2316         * layout/layouttree/LayoutBlockContainer.cpp:
2317         (WebCore::Layout::BlockContainer::BlockContainer):
2318         * layout/layouttree/LayoutBlockContainer.h:
2319         * layout/layouttree/LayoutBox.cpp:
2320         (WebCore::Layout::Box::Box):
2321         (WebCore::Layout::Box::isPaddingApplicable const):
2322         (WebCore::Layout::Box::isDocumentBox const): Deleted.
2323         (WebCore::Layout::Box::isBodyBox const): Deleted.
2324         * layout/layouttree/LayoutBox.h:
2325         (WebCore::Layout::Box::isAnonymous const):
2326         (WebCore::Layout::Box::isDocumentBox const):
2327         (WebCore::Layout::Box::isBodyBox const):
2328         (WebCore::Layout::Box::ElementAttributes::ElementAttributes):
2329         (WebCore::Layout::Box::setPreviousSibling):
2330         (WebCore::Layout::Box::setIsAnonymous): Deleted.
2331         * layout/layouttree/LayoutContainer.cpp:
2332         (WebCore::Layout::Container::Container):
2333         * layout/layouttree/LayoutContainer.h:
2334         * layout/layouttree/LayoutInlineBox.cpp:
2335         (WebCore::Layout::InlineBox::InlineBox):
2336         * layout/layouttree/LayoutInlineBox.h:
2337         * layout/layouttree/LayoutInlineContainer.cpp:
2338         (WebCore::Layout::InlineContainer::InlineContainer):
2339         * layout/layouttree/LayoutInlineContainer.h:
2340         * layout/layouttree/LayoutTreeBuilder.cpp:
2341         (WebCore::Layout::TreeBuilder::createLayoutTree):
2342         (WebCore::Layout::TreeBuilder::createSubTree):
2343
2344 2018-05-31  Chris Dumez  <cdumez@apple.com>
2345
2346         Unreviewed iOS build fix after r232335.
2347
2348         * html/BaseChooserOnlyDateAndTimeInputType.h:
2349         * html/BaseDateAndTimeInputType.h:
2350
2351 2018-05-31  Chris Dumez  <cdumez@apple.com>
2352
2353         Unreviewed, apply review comments from Darin after r232310.
2354
2355         * platform/ReferrerPolicy.cpp:
2356         (WebCore::parseReferrerPolicy):
2357
2358 2018-05-31  Zalan Bujtas  <zalan@apple.com>
2359
2360         [LFC] Margin box is border box + margins.
2361         https://bugs.webkit.org/show_bug.cgi?id=186124
2362
2363         Reviewed by Antti Koivisto.
2364
2365         * layout/displaytree/DisplayBox.cpp:
2366         (WebCore::Display::Box::marginBox const):
2367
2368 2018-05-31  Zalan Bujtas  <zalan@apple.com>
2369
2370         [LFC] Add quirks mode setter/getting to LayoutContext
2371         https://bugs.webkit.org/show_bug.cgi?id=186122
2372
2373         Reviewed by Antti Koivisto.
2374
2375         * layout/LayoutContext.h:
2376         (WebCore::Layout::LayoutContext::setInQuirksMode):
2377         (WebCore::Layout::LayoutContext::inQuirksMode const):
2378         * page/FrameViewLayoutContext.cpp:
2379         (WebCore::layoutUsingFormattingContext):
2380
2381 2018-05-30  Carlos Eduardo Ramalho  <cadubentzen@gmail.com>
2382
2383         [GTK] Hardcoded text color in input fields
2384         https://bugs.webkit.org/show_bug.cgi?id=126907
2385
2386         Reviewed by Carlos Garcia Campos.
2387
2388         Set text color in input fields to foreground theme color.
2389         Also, set "window.background" as base GtkStyleContext to mimic
2390         GTK applications and fix some theme bugs.
2391
2392         No new tests required. ManualTests/gtk/theme.html already covers it.
2393
2394         * platform/gtk/RenderThemeGadget.cpp:
2395         (WebCore::baseStyleContext): Added.
2396         (WebCore::RenderThemeGadget::RenderThemeGadget):
2397         Use "window.background" GtkStyleContext instead of
2398         null parent for RenderThemeGadgets.
2399         * rendering/RenderThemeGtk.cpp:
2400         (WebCore::RenderThemeGtk::adjustButtonStyle const):
2401         Set color as foreground theme color.
2402         (WebCore::RenderThemeGtk::adjustTextFieldStyle const): Ditto.
2403         (WebCore::RenderThemeGtk::adjustTextAreaStyle const): Ditto.
2404         (WebCore::RenderThemeGtk::adjustSearchFieldStyle const): Ditto.
2405         * rendering/RenderThemeGtk.h: adjustTextAreaStyle() overriden.
2406
2407 2018-05-30  Yusuke Suzuki  <utatane.tea@gmail.com>
2408
2409         [JSC] Pass VM& parameter as much as possible
2410         https://bugs.webkit.org/show_bug.cgi?id=186085
2411
2412         Reviewed by Saam Barati.
2413
2414         No behavior change.
2415
2416         * bindings/js/JSCSSRuleListCustom.cpp:
2417         (WebCore::JSCSSRuleListOwner::isReachableFromOpaqueRoots):
2418         * bindings/js/JSCallbackData.cpp:
2419         (WebCore::JSCallbackData::invokeCallback):
2420         * bindings/js/JSCustomXPathNSResolver.cpp:
2421         (WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
2422         * bindings/js/JSDOMBuiltinConstructorBase.cpp:
2423         (WebCore::JSDOMBuiltinConstructorBase::callFunctionWithCurrentArguments):
2424         * bindings/js/JSDOMConvertScheduledAction.h:
2425         (WebCore::Converter<IDLScheduledAction>::convert):
2426         * bindings/js/JSDOMIterator.h:
2427         (WebCore::iteratorForEach):
2428         * bindings/js/JSDOMMapLike.cpp:
2429         (WebCore::forwardFunctionCallToBackingMap):
2430         (WebCore::forwardForEachCallToBackingMap):
2431         * bindings/js/JSDOMPromise.cpp:
2432         (WebCore::callFunction):
2433         * bindings/js/JSDOMPromiseDeferred.cpp:
2434         (WebCore::DeferredPromise::callFunction):
2435         (WebCore::createRejectedPromiseWithTypeError):
2436         * bindings/js/JSDeprecatedCSSOMValueCustom.cpp:
2437         (WebCore::JSDeprecatedCSSOMValueOwner::isReachableFromOpaqueRoots):
2438         * bindings/js/JSEventListener.cpp:
2439         (WebCore::JSEventListener::handleEvent):
2440         * bindings/js/JSNodeListCustom.cpp:
2441         (WebCore::JSNodeListOwner::isReachableFromOpaqueRoots):
2442         * bindings/js/JSPluginElementFunctions.cpp:
2443         (WebCore::pluginElementCustomPut):
2444         (WebCore::callPlugin):
2445         * bindings/js/JSWindowProxy.cpp:
2446         (WebCore::JSWindowProxy::setWindow):
2447         * bindings/js/ReadableStream.cpp:
2448         (WebCore::ReadableStreamInternal::callFunction):
2449         * bindings/js/ReadableStreamDefaultController.cpp:
2450         (WebCore::callFunction):
2451         * bindings/js/ScheduledAction.cpp:
2452         (WebCore::ScheduledAction::executeFunctionInContext):
2453         * bindings/js/SerializedScriptValue.cpp:
2454         (WebCore::CloneSerializer::getProperty):
2455         (WebCore::CloneSerializer::serialize):
2456         * bindings/js/StructuredClone.cpp:
2457         (WebCore::structuredCloneArrayBufferView):
2458         * bindings/js/WorkerScriptController.cpp:
2459         (WebCore::WorkerScriptController::initScript):
2460         * bridge/NP_jsobject.cpp:
2461         * bridge/objc/WebScriptObject.mm:
2462         (-[WebScriptObject callWebScriptMethod:withArguments:]):
2463         * testing/Internals.cpp:
2464         (WebCore::Internals::cloneArrayBuffer):
2465         * testing/js/WebCoreTestSupport.cpp:
2466         (WebCoreTestSupport::injectInternalsObject):
2467
2468 2018-05-28  Darin Adler  <darin@apple.com>
2469
2470         Straighten out HTMLInputElement attribute handling
2471         https://bugs.webkit.org/show_bug.cgi?id=186043
2472
2473         Reviewed by Daniel Bates.
2474
2475         * dom/RadioButtonGroups.cpp:
2476         (WebCore::RadioButtonGroup::requiredStateChanged): Renamed from requiredAttributeChanged,
2477         and changed to take a reference.
2478         (WebCore::RadioButtonGroups::requiredStateChanged): Ditto.
2479         * dom/RadioButtonGroups.h: Updated for changes above.
2480
2481         * html/BaseChooserOnlyDateAndTimeInputType.cpp:
2482         (WebCore::BaseChooserOnlyDateAndTimeInputType::createShadowSubtree): Call
2483         updateInnerTextValue by its new name.
2484         (WebCore::BaseChooserOnlyDateAndTimeInputType::updateInnerTextValue): Renamed
2485         from updateAppearance.
2486         (WebCore::BaseChooserOnlyDateAndTimeInputType::setValue): Call
2487         updateInnerTextValue by its new name.
2488         (WebCore::BaseChooserOnlyDateAndTimeInputType::attributeChanged): Override this
2489         instead of valueAttributeChanged.
2490         * html/BaseChooserOnlyDateAndTimeInputType.h: Tighten up inheritance a bit.
2491         Also use final a bit more and update for changes above.
2492
2493         * html/BaseDateAndTimeInputType.cpp:
2494         (WebCore::BaseDateAndTimeInputType::attributeChanged): Replaced
2495         minOrMaxAttributeChanged with this override, checking for the attribute names.
2496         * html/BaseDateAndTimeInputType.h: Updated for changes above.
2497
2498         * html/FileInputType.cpp:
2499         (WebCore::FileInputType::disabledStateChanged): Renamed from disabledAttributeChanged.
2500         (WebCore::FileInputType::attributeChanged): Replaced
2501         multipleAttributeChanged with this override, checking for the attribute names.
2502         * html/FileInputType.h: Updated for changes above.
2503
2504         * html/HTMLFormControlElement.cpp:
2505         (WebCore::HTMLFormControlElement::parseAttribute): Updated function names to say
2506         "state changed" rather than "attribute changed" if they are called only when the
2507         computed value is changed, not the raw attribute value.
2508         (WebCore::HTMLFormControlElement::readOnlyStateChanged): Updated name.
2509         (WebCore::HTMLFormControlElement::requiredStateChanged): Ditto.
2510         * html/HTMLFormControlElement.h: Updated for changes above.
2511
2512         * html/HTMLInputElement.cpp:
2513         (WebCore::HTMLInputElement::parseAttribute): Removed the code to call lots of specific
2514         attribute changed functions that have now been deleted. Also removed empty code for a
2515         couple of attributes.
2516         (WebCore::HTMLInputElement::disabledStateChanged): Added. Forward call to input type.
2517         (WebCore::HTMLInputElement::readOnlyStateChanged): Ditto.
2518         (WebCore::HTMLInputElement::requiredStateChanged): Renamed from requiredAttributeChanged.
2519         * html/HTMLInputElement.h: Updated for changes above.
2520
2521         * html/HTMLTextFormControlElement.cpp:
2522         (WebCore::HTMLTextFormControlElement::readOnlyStateChanged): Renamed from
2523         readOnlyAttributeChanged. Also fixed incorrect call to base class. This may have
2524         fixed a bug: With some work we could probably create a test case to demonstrate that.
2525         * html/HTMLTextFormControlElement.h: Updated for changes above.
2526
2527         * html/ImageInputType.cpp:
2528         (WebCore::ImageInputType::attributeChanged): Replaced
2529         altAttributeChanged and srcAttributeChanged with this override, checking for the
2530         attribute names.
2531         * html/ImageInputType.h: Updated for changes above.
2532
2533         * html/InputType.cpp:
2534         (WebCore::InputType::altAttributeChanged): Deleted.
2535         (WebCore::InputType::srcAttributeChanged): Deleted.
2536         (WebCore::InputType::maxResultsAttributeChanged): Deleted.
2537         (WebCore::InputType::minOrMaxAttributeChanged): Deleted.
2538         (WebCore::InputType::stepAttributeChanged): Deleted.
2539         (WebCore::InputType::valueAttributeChanged): Deleted.
2540         (WebCore::InputType::attributeChanged): Moved to header as an inline so derived
2541         classes can call through to the base class with the empty function inlined.
2542         (WebCore::InputType::multipleAttributeChanged): Deleted.
2543         (WebCore::InputType::disabledAttributeChanged): Moved to header as an inline.
2544         (WebCore::InputType::readonlyAttributeChanged): Ditto.
2545         (WebCore::InputType::requiredAttributeChanged): Ditto.
2546         * html/InputType.h: Updated for changes above.
2547
2548         * html/NumberInputType.cpp:
2549         (WebCore::NumberInputType::attributeChanged): Replaced
2550         minOrMaxAttributeChanged and stepAttributeChanged with this override, checking
2551         for the attribute names.
2552         * html/NumberInputType.h: Updated for changes above.
2553
2554         * html/RangeInputType.cpp:
2555         (WebCore::RangeInputType::disabledStateChanged): Renamed from
2556         disabledAttributeChanged.
2557         (WebCore::RangeInputType::attributeChanged): Replaced
2558         minOrMaxAttributeChanged with this override, checking for the attribute names.
2559         * html/RangeInputType.h: Updated for changes above.
2560
2561         * html/SearchInputType.cpp:
2562         (WebCore::SearchInputType::SearchInputType): Removed unneeded initialization of
2563         RefPtr data members to nullptr.
2564         (WebCore::updateResultButtonPseudoType): Removed unneeded if statement; the two
2565         cases above cover 0, and less than 0, so there is no need to check for greater
2566         than 0 for the third case.
2567         (WebCore::SearchInputType::attributeChanged): Replaced
2568         maxResultsAttributeChanged with this override, checking for the attribute name.
2569         * html/SearchInputType.h: Updated for changes above and marked more
2570         member functions final.
2571
2572         * html/TextFieldInputType.cpp:
2573         (WebCore::TextFieldInputType::attributeChanged): Added a call through to the
2574         base class to match the style of other overrides of this function.
2575         (WebCore::TextFieldInputType::disabledStateChanged): Renamed from disabledAttributeChanged.
2576         (WebCore::TextFieldInputType::readOnlyStateChanged): Renamed from readonlyAttributeChanged.
2577         * html/TextFieldInputType.h: Updated for changes above. Also made attributeChanged no
2578         longer be marked final since derived classes now override it.
2579
2580         * html/shadow/SliderThumbElement.cpp:
2581         (WebCore::SliderThumbElement::SliderThumbElement): Moved some data member initialization
2582         from this constructor to the class definition.
2583         (WebCore::SliderThumbElement::hostDisabledStateChanged): Renamed from disabledAttributeChanged.
2584         * html/shadow/SliderThumbElement.h: Updated for changes above and marked more
2585         member functions final.
2586
2587 2018-05-30  Nan Wang  <n_wang@apple.com>
2588
2589         AX: VoiceOver on macOS does not announce fieldset description from aria-describedby when focussing inputs
2590         https://bugs.webkit.org/show_bug.cgi?id=185246
2591         <rdar://problem/39939028>
2592
2593         Reviewed by Chris Fleizach.
2594
2595         Exposed the fieldset's description to its form control children.
2596
2597         Test: accessibility/mac/aria-describedby-fieldset.html
2598
2599         * accessibility/AccessibilityNodeObject.cpp:
2600         (WebCore::AccessibilityNodeObject::helpText const):
2601
2602 2018-05-30  Chris Fleizach  <cfleizach@apple.com>
2603
2604         AX: Expose link rel type to voiceover
2605         https://bugs.webkit.org/show_bug.cgi?id=186084
2606         <rdar://problem/40640871>
2607
2608         Reviewed by Sam Weinig.
2609
2610         Make the link rel attribute available to accessibility clients.
2611
2612         Test: accessibility/mac/linkrel.html
2613
2614         * accessibility/AccessibilityObject.cpp:
2615         (WebCore::AccessibilityObject::linkRelValue const):
2616         * accessibility/AccessibilityObject.h:
2617         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2618         (-[WebAccessibilityObjectWrapper accessibilityLinkRelationshipType]):
2619         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2620         (-[WebAccessibilityObjectWrapper accessibilityAttributeNames]):
2621         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
2622
2623 2018-05-30  Brady Eidson  <beidson@apple.com>
2624
2625         REGRESSION (r224684): User-agent seen by page does not change when modified by the develop menu options after reloading.
2626         <rdar://problem/34918109> and https://bugs.webkit.org/show_bug.cgi?id=186111
2627
2628         Reviewed by Andy Estes.
2629
2630         Test: http/tests/navigation/useragent-reload.php
2631
2632         * Modules/websockets/WebSocketHandshake.cpp:
2633         (WebCore::WebSocketHandshake::clientHandshakeRequest const): Use setUserAgent() for consistency.
2634
2635         * loader/DocumentLoader.cpp:
2636         (WebCore::DocumentLoader::startLoadingMainResource): Clear the user agent from the original DocumentLoader request
2637           before adding additional fields, as reloads should pick up user agent changes.
2638
2639 2018-05-30  Dean Jackson  <dino@apple.com>
2640
2641         WebContent crashes with system preview content
2642         https://bugs.webkit.org/show_bug.cgi?id=186118
2643
2644         Reviewed by Myles Maxfield.
2645
2646         We were receiving crash reports on iOS devices when getting
2647         platformContext() from a GraphicsContext. This usually
2648         occurred when the page was invisible. Debugging showed that
2649         it was trying to draw with a disabled context.
2650
2651         * rendering/RenderThemeIOS.mm:
2652         (WebCore::RenderThemeIOS::paintSystemPreviewBadge): Early
2653         return if the context has painting disabled.
2654
2655 2018-05-30  Daniel Bates  <dabates@apple.com>
2656
2657         Web Inspector: Annotate Same-Site cookies
2658         https://bugs.webkit.org/show_bug.cgi?id=184897
2659         <rdar://problem/35178209>
2660
2661         Reviewed by Brian Burg.
2662
2663         Store and retrieve the Same-Site cookie policy from CFNetwork.
2664
2665         * inspector/agents/InspectorPageAgent.cpp:
2666         (WebCore::cookieSameSitePolicyJSON): Added.
2667         (WebCore::buildObjectForCookie): Modified to include cookie Same-Site policy. 
2668         * platform/Cookie.h:
2669         (WebCore::Cookie::encode const): Encode Same-Site policy.
2670         (WebCore::Cookie::decode): Decode Same-Site policy.
2671         * platform/network/cocoa/CookieCocoa.mm:
2672         (WebCore::portStringFromVector):
2673         (WebCore::coreSameSitePolicy):
2674         (WebCore::nsSameSitePolicy):
2675         (WebCore::Cookie::operator NSHTTPCookie * _Nullable  const):
2676         (WebCore::Cookie::operator NSHTTPCookie * const): Deleted.
2677
2678 2018-05-30  Daniel Bates  <dabates@apple.com>
2679
2680         NavigationAction does not need to hold initiating DOM Event
2681         https://bugs.webkit.org/show_bug.cgi?id=185958
2682         <rdar://problem/40531539>
2683
2684         Reviewed by Simon Fraser.
2685
2686         Take a similar approach as was done in <https://bugs.webkit.org/show_bug.cgi?id=185712>
2687         and have NavigationAction hold only as many details of the initiating DOM Event as
2688         necessary to support WebKit functionality. Retaining a DOM Event effectively retains
2689         the document that associated with the event. And DocumentLoader always keeps around
2690         the NavigationAction of the last navigation for the "benefit of the various policy handlers".
2691         Therefore, having NavigationAction hold only the relevant details of the DOM Event
2692         instead of the DOM Event itself we avoid keeping the document we navigated from alive
2693         longer than necessary. 
2694
2695         * dom/MouseRelatedEvent.h:
2696         * dom/UIEventWithKeyState.h:
2697         * loader/NavigationAction.cpp:
2698         (WebCore::NavigationAction::UIEventWithKeyStateData::UIEventWithKeyStateData): Added.
2699         (WebCore::NavigationAction::MouseEventData::MouseEventData): Added.
2700         (WebCore::keyStateDataForFirstEventWithKeyState): Added.
2701         (WebCore::mouseEventDataForFirstMouseEvent): Added.
2702         * loader/NavigationAction.h:
2703         (WebCore::NavigationAction::keyStateEventData const): Added.
2704         (WebCore::NavigationAction::mouseEventData const): Added
2705         (WebCore::NavigationAction::event const): Deleted.
2706
2707 2018-05-30  Youenn Fablet  <youenn@apple.com>
2708
2709         Revert changes made to URLWithUserTypedString made in https://trac.webkit.org/changeset/232281
2710         https://bugs.webkit.org/show_bug.cgi?id=186108
2711         <rdar://problem/40663065>
2712
2713         Reviewed by Alex Christensen.
2714
2715         Covered by existing API tests.
2716
2717         * platform/mac/WebCoreNSURLExtras.mm:
2718         (WebCore::URLWithUserTypedString):
2719         Return early if WebCore::URL is not able to create a CFURL.
2720         Use CFURL otherwise to keep the existing behavior as much as possible.
2721
2722 2018-05-30  Youenn Fablet  <youenn@apple.com>
2723
2724         Rename FromOrigin runtime flag to CrossOriginResourcePolicy and enable it by default
2725         https://bugs.webkit.org/show_bug.cgi?id=186082
2726
2727         Reviewed by Chris Dumez.
2728
2729         No change of behavior.
2730
2731         * page/RuntimeEnabledFeatures.h:
2732         (WebCore::RuntimeEnabledFeatures::setCrossOriginResourcePolicyEnabled):
2733         (WebCore::RuntimeEnabledFeatures::crossOriginResourcePolicyEnabled const):
2734         (WebCore::RuntimeEnabledFeatures::setFromOriginResponseHeaderEnabled): Deleted.
2735         (WebCore::RuntimeEnabledFeatures::fromOriginResponseHeaderEnabled const): Deleted.
2736
2737 2018-05-30  Chris Dumez  <cdumez@apple.com>
2738
2739         Referrer-Policy response header is ignored
2740         https://bugs.webkit.org/show_bug.cgi?id=186037
2741         <rdar://problem/40600335>
2742
2743         Reviewed by Youenn Fablet.
2744
2745         Add support for Referrer-Policy HTTP response header:
2746         - https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-header
2747
2748         Tests: http/tests/security/referrer-policy-header-and-meta-tag-emptyString.html
2749                http/tests/security/referrer-policy-header-and-meta-tag.html
2750                http/tests/security/referrer-policy-header.html
2751
2752         * dom/Document.cpp:
2753         (WebCore::Document::setReferrerPolicy):
2754         (WebCore::Document::processReferrerPolicy):
2755         * dom/Document.h:
2756         (WebCore::Document::referrerPolicy const):
2757         * html/HTMLMetaElement.cpp:
2758         (WebCore::HTMLMetaElement::process):
2759         * loader/FrameLoader.cpp:
2760         (WebCore::FrameLoader::didBeginDocument):
2761         * loader/SubresourceLoader.cpp:
2762         (WebCore::SubresourceLoader::updateReferrerPolicy):
2763         * platform/ReferrerPolicy.cpp:
2764         (WebCore::parseReferrerPolicyToken):
2765         (WebCore::parseReferrerPolicy):
2766         * platform/ReferrerPolicy.h:
2767
2768 2018-05-30  Youenn Fablet  <youenn@apple.com>
2769
2770         Rename CrossOriginResourcePolicy same to same-origin
2771         https://bugs.webkit.org/show_bug.cgi?id=186080
2772
2773         Reviewed by Chris Dumez.
2774
2775         Covered by updated tests.
2776
2777         * platform/network/HTTPParsers.cpp:
2778         (WebCore::parseCrossOriginResourcePolicyHeader):
2779         * platform/network/HTTPParsers.h:
2780
2781 2018-05-30  Aditya Keerthi  <akeerthi@apple.com>
2782
2783         Fix the ENABLE(DATALIST_ELEMENT) build
2784         https://bugs.webkit.org/show_bug.cgi?id=186105
2785
2786         Reviewed by Wenson Hsieh.
2787
2788         * WebCore.xcodeproj/project.pbxproj:
2789         * html/ColorInputType.cpp:
2790         (WebCore::ColorInputType::suggestions const):
2791         * html/HTMLInputElement.h:
2792         * html/HTMLOptionElement.cpp:
2793         (WebCore::HTMLOptionElement::ownerDataListElement const):
2794         * rendering/RenderTheme.cpp:
2795         (WebCore::RenderTheme::paintSliderTicks):
2796
2797 2018-05-30  Alex Christensen  <achristensen@webkit.org>
2798
2799         Reduce String allocations
2800         https://bugs.webkit.org/show_bug.cgi?id=186059
2801
2802         Reviewed by Darin Adler.
2803
2804         Don't allocate Strings just to convert it to another form.
2805         Based mostly on Darin's feedback on bug 185986.
2806
2807         No change in behavior.
2808
2809         * Modules/websockets/WebSocketHandshake.cpp:
2810         (WebCore::hostName):
2811         (WebCore::WebSocketHandshake::host const):
2812         * css/parser/CSSSelectorParser.cpp:
2813         (WebCore::CSSSelectorParser::consumePseudo):
2814         (WebCore::CSSSelectorParser::consumeANPlusB):
2815         * loader/mac/LoaderNSURLExtras.mm:
2816         (suggestedFilenameWithMIMEType):
2817         * page/SecurityOriginData.h:
2818         (WebCore::SecurityOriginData::fromURL):
2819         * page/csp/ContentSecurityPolicySource.cpp:
2820         (WebCore::wildcardMatches):
2821         (WebCore::ContentSecurityPolicySource::hostMatches const):
2822         * platform/URL.cpp:
2823         (WebCore::URL::hostAndPort const):
2824         * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
2825         (WebCore::SocketStreamHandleImpl::createStreams):
2826
2827 2018-05-30  Jer Noble  <jer.noble@apple.com>
2828
2829         Media elements outside fullscreen should not be considered main content.
2830         https://bugs.webkit.org/show_bug.cgi?id=186063
2831         <rdar://problem/40630437>
2832
2833         Reviewed by Eric Carlson.
2834
2835         Test: platform/mac/media/video-best-element-for-playback-controls-purpose.html
2836
2837         Media elements outside the current fullscreen element are not visible, and thus should not be considered
2838         main content.
2839
2840         Drive-by fix: set the m_hasEverNotifiedAboutPlaying before dispatching the 'playing' event, so that
2841         tests can check bestMediaElementForShowingPlaybackControlsManager() in the 'playing' handler.
2842
2843         * html/HTMLMediaElement.cpp:
2844         (WebCore::HTMLMediaElement::notifyAboutPlaying):
2845         * html/HTMLMediaElement.h:
2846         * html/MediaElementSession.cpp:
2847         (WebCore::MediaElementSession::canShowControlsManager const):
2848         * testing/Internals.cpp:
2849         (WebCore::Internals::bestMediaElementForShowingPlaybackControlsManager):
2850         * testing/Internals.h:
2851         * testing/Internals.idl:
2852
2853 2018-05-30  Michael Catanzaro  <mcatanzaro@igalia.com>
2854
2855         Unreviewed, silence a -Wreturn-type warning
2856
2857         * css/SVGCSSComputedStyleDeclaration.cpp:
2858         (WebCore::glyphOrientationToCSSPrimitiveValue):
2859
2860 2018-05-30  Alexey Proskuryakov  <ap@apple.com>
2861
2862         Build fix attempt after https://trac.webkit.org/r232198
2863
2864         * platform/network/cf/ResourceHandleCFNet.cpp:
2865         (WebCore::ResourceHandle::createCFURLConnection): Added some toString() calls.
2866
2867 2018-05-30  Zalan Bujtas  <zalan@apple.com>
2868
2869         [LFC] Miscellaneous fixes to get closer to geometry correctness
2870         https://bugs.webkit.org/show_bug.cgi?id=186083
2871
2872         Reviewed by Antti Koivisto.
2873
2874         * layout/FormattingContextGeometry.cpp:
2875         (WebCore::Layout::FormattingContext::Geometry::computedBorder):
2876         * layout/LayoutContext.cpp:
2877         (WebCore::Layout::LayoutContext::initializeRoot):
2878         * layout/Verification.cpp:
2879         (WebCore::Layout::outputMismatchingBoxInformationIfNeeded):
2880         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2881         (WebCore::Layout::isStretchedToViewport):
2882         (WebCore::Layout::initialContainingBlock):
2883         (WebCore::Layout::computedInFlowNonReplacedComputedHeight):
2884         (WebCore::Layout::inFlowNonReplacedComputedWidth):
2885         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeight): lambda should capture the specification part. 
2886         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidth):
2887         * layout/displaytree/DisplayBox.cpp:
2888         (WebCore::Display::Box::marginBox const):
2889         (WebCore::Display::Box::paddingBox const):
2890         (WebCore::Display::Box::contentBox const):
2891         * layout/layouttree/LayoutBox.cpp:
2892         (WebCore::Layout::Box::isDocumentBox const):
2893         (WebCore::Layout::Box::isBodyBox const):
2894         * layout/layouttree/LayoutBox.h:
2895         * rendering/style/BorderValue.h: ignore border-width when type is hidden or none. 
2896         (WebCore::BorderValue::boxModelWidth const):
2897
2898 2018-05-30  Stephen McGruer  <smcgruer@chromium.org>
2899
2900         iOS: setting 'defaultValue' of input type=date from script should cause a UI update
2901         https://bugs.webkit.org/show_bug.cgi?id=185982
2902
2903         Reviewed by Darin Adler.
2904
2905         Test: fast/forms/date/date-appearance-defaultValue.html
2906
2907         * html/BaseChooserOnlyDateAndTimeInputType.cpp:
2908         (WebCore::BaseChooserOnlyDateAndTimeInputType::valueAttributeChanged):
2909         * html/BaseChooserOnlyDateAndTimeInputType.h:
2910         * html/HTMLInputElement.cpp:
2911         (WebCore::HTMLInputElement::parseAttribute):
2912         * html/InputType.cpp:
2913         (WebCore::InputType::valueAttributeChanged):
2914         * html/InputType.h:
2915
2916 2018-05-29  Nan Wang  <n_wang@apple.com>
2917
2918         Unreviewed, follow-up after r232285
2919         https://bugs.webkit.org/show_bug.cgi?id=180871
2920
2921         Removed redundant null check.
2922
2923         * accessibility/AccessibilityObject.cpp:
2924         (WebCore::AccessibilityObject::isExpanded const):
2925
2926 2018-05-29  Nan Wang  <n_wang@apple.com>
2927
2928         AX: macOS VoiceOver doesn't announce when details element is expanded when using role group
2929         https://bugs.webkit.org/show_bug.cgi?id=180866
2930         <rdar://problem/36074338>
2931
2932         Reviewed by Chris Fleizach.
2933
2934         We should use is<HTMLDetailsElement> to check for the details parent instead
2935         of using the role.
2936
2937         Added test cases to the existing test.
2938
2939         * accessibility/AccessibilityObject.cpp:
2940         (WebCore::AccessibilityObject::isExpanded const):
2941
2942 2018-05-29  Youenn Fablet  <youenn@apple.com>
2943
2944         Add a consistency check between URL and CFURL
2945         https://bugs.webkit.org/show_bug.cgi?id=186057
2946         <rdar://problem/40258457>
2947
2948         Reviewed by Geoff Garen.
2949
2950         It is important that WebCore::URL used in WebCore and CFURL that gets serialized in the network pipe remain consistent.
2951         Otherwise, we will end-up with odd bugs.
2952
2953         We add such a check when creating a CFURL from an URL.
2954         To make things more consistent, we also rely now more on WebCore::URL instead of directly creating a CFURL.
2955
2956         * platform/URL.h:
2957         * platform/cf/CFURLExtras.cpp:
2958         (WebCore::isCFURLSameOrigin):
2959         * platform/cf/CFURLExtras.h:
2960         * platform/cf/URLCF.cpp:
2961         (WebCore::URL::createCFURL const):
2962         * platform/mac/URLMac.mm:
2963         (WebCore::URL::createCFURL const):
2964         * platform/mac/WebCoreNSURLExtras.mm:
2965         (WebCore::URLWithUserTypedString):
2966
2967 2018-05-29  Timothy Hatcher  <timothy@apple.com>
2968
2969         Printing does not apply the right colors in all cases.
2970
2971         https://bugs.webkit.org/show_bug.cgi?id=186066
2972         rdar://problem/40274975
2973
2974         Reviewed by Tim Horton.
2975
2976         * inspector/agents/InspectorPageAgent.cpp:
2977         (WebCore::InspectorPageAgent::setEmulatedMedia): Call RenderTheme::platformColorsDidChange
2978         to invalidate the color cache.
2979         * page/FrameView.cpp:
2980         (WebCore::FrameView::adjustMediaTypeForPrinting): Ditto.
2981         * page/Page.cpp:
2982         (WebCore::Page::defaultAppearance const): Added. Use default when not screen.
2983         * page/Page.h:
2984         (WebCore::Page::defaultAppearance const): Deleted.
2985
2986 2018-05-29  Per Arne Vollan  <pvollan@apple.com>
2987
2988         Create typedef for HashMap<PlatformDisplayID, ScreenProperties>
2989         https://bugs.webkit.org/show_bug.cgi?id=186056
2990
2991         Reviewed by Brent Fulgham.
2992
2993         No new tests, no change in behavior.
2994
2995         * platform/PlatformScreen.h:
2996         * platform/mac/PlatformScreenMac.mm:
2997         (WebCore::screenProperties):
2998         (WebCore::getScreenProperties):
2999         (WebCore::setScreenProperties):
3000
3001 2018-05-29  Ryosuke Niwa  <rniwa@webkit.org>
3002
3003         iOS WK1: Occasional crash in sanitizedMarkupForFragmentInDocument
3004         https://bugs.webkit.org/show_bug.cgi?id=186011
3005
3006         Reviewed by David Kilzer.
3007
3008         The crash was caused by the HTML parser in sanitizedMarkupForFragmentInDocument yielding in the web thread
3009         when _WebThreadLock() sets webThreadShouldYield to true in the main thread.
3010
3011         No new tests. This is occasionally caught by existing tests.
3012
3013         * editing/markup.cpp:
3014         (WebCore::createPageForSanitizingWebContent): Fixed the bug by making the HTML parser never yield.
3015         Also release-assert that the body is never null here.
3016         (WebCore::sanitizedMarkupForFragmentInDocument): Removed superflous call to WTFMove since appendChild
3017         takes a reference, not a Ref.
3018         * inspector/InspectorOverlay.cpp:
3019         (WebCore::InspectorOverlay::overlayPage): Deployed the same fix.
3020         * loader/DocumentWriter.cpp:
3021         (WebCore::DocumentWriter::insertDataSynchronously): Added.
3022         * loader/DocumentWriter.h:
3023
3024 2018-05-29  Chris Dumez  <cdumez@apple.com>
3025
3026         Avoid unnecessary String allocation in isPublicSuffix(const String&)
3027         https://bugs.webkit.org/show_bug.cgi?id=186054
3028
3029         Reviewed by Sam Weinig.
3030
3031         Avoid unnecessary String allocation in isPublicSuffix(const String&) by calling directly
3032         the decodeHostName() overload taking in a NSString*. This overload returns a NSString*,
3033         which is what we need. We would previously call the overloading taking in a String, which
3034         would return a String, which we would have to convert back to a NSString*.
3035
3036         * platform/mac/PublicSuffixMac.mm:
3037         (WebCore::isPublicSuffix):
3038
3039 2018-05-29  Alex Christensen  <achristensen@webkit.org>
3040
3041         Do even fewer allocations in URL host operations
3042         https://bugs.webkit.org/show_bug.cgi?id=186003
3043
3044         Reviewed by Geoffrey Garen.
3045
3046         * loader/ResourceLoadStatistics.cpp:
3047         (WebCore::ResourceLoadStatistics::primaryDomain):
3048         * loader/ResourceLoadStatistics.h:
3049         * platform/URL.cpp:
3050         (WebCore::URL::hostIsIPAddress):
3051         * platform/URL.h:
3052         * platform/mac/URLMac.mm:
3053         (WebCore::URL::hostIsIPAddress):
3054         * platform/soup/URLSoup.cpp:
3055         (WebCore::URL::hostIsIPAddress):
3056
3057 2018-05-29  Tadeu Zagallo  <tzagallo@apple.com>
3058
3059         Don't assert on m_actionsStart when setting actions on DFA nodes
3060         https://bugs.webkit.org/show_bug.cgi?id=185979
3061         <rdar://problem/39669458>
3062
3063         Reviewed by Geoffrey Garen.
3064
3065         DFANode::setActions is called immediately after the node is created, and once again to set
3066         the actions of catch-all regular expressions (.*) on the root node. That works because
3067         m_actionsStart is initially 0, since the root was the first node to be created, but may fail
3068         after minimizing the DFA, when the root may no longer be the first node, and therefore
3069         m_actionsStart would not be 0, even if there are no actions attached to that node.
3070
3071         Test: http/tests/contentextensions/root-actions.html
3072
3073         * contentextensions/DFANode.h:
3074
3075 2018-05-29  Nan Wang  <n_wang@apple.com>
3076
3077         AX: setValue on contenteditable should preserve whitespace
3078         https://bugs.webkit.org/show_bug.cgi?id=185897
3079
3080         Reviewed by Ryosuke Niwa.
3081
3082         We should mimic typing when setting value to a contenteditable from accessibility
3083         instead of mutating the DOM by using setInnerText.
3084
3085         Updated tests to cover this change.
3086
3087         * accessibility/AccessibilityRenderObject.cpp:
3088         (WebCore::AccessibilityRenderObject::setValue):
3089
3090 2018-05-29  Zalan Bujtas  <zalan@apple.com>
3091
3092         [LFC] Miscellaneous fixes to ensure no assertion in LayoutContext::layout
3093         https://bugs.webkit.org/show_bug.cgi?id=186052
3094
3095         Reviewed by Antti Koivisto.
3096
3097         With this patch, LayoutContext::layout() does not assert on <html><body><div></div></body></html> anymore.
3098
3099         * layout/LayoutContext.cpp:
3100         (WebCore::Layout::LayoutContext::initializeRoot): New context root is always a layout root.
3101         * layout/LayoutContext.h:
3102         * layout/Verification.cpp:
3103         (WebCore::Layout::outputMismatchingBoxInformationIfNeeded):
3104         * layout/blockformatting/BlockFormattingContext.cpp:
3105         (WebCore::Layout::BlockFormattingContext::layout const): we need computed margin/border/padding for width computation  
3106         * layout/displaytree/DisplayBox.cpp: Add clone() method to be able to carry over the 'hasValid*' bits.
3107         (WebCore::Display::Box::Style::Style):
3108         (WebCore::Display::Box::borderBox const):
3109         (WebCore::Display::Box::contentBox const):
3110         * layout/displaytree/DisplayBox.h:
3111         (WebCore::Display::Box::Rect::operator LayoutRect const):
3112         (WebCore::Display::Box::setSize):
3113         (WebCore::Display::Box::setHasValidMargin):
3114         (WebCore::Display::Box::setHasValidBorder):
3115         (WebCore::Display::Box::setHasValidPadding):
3116         (WebCore::Display::Box::Rect::setHasValidPosition):
3117         (WebCore::Display::Box::Rect::setHasValidSize):
3118         (WebCore::Display::Box::Rect::setSize):
3119         (WebCore::Display::Box::Rect::clone const):
3120         (WebCore::Display::Box::setMargin):
3121         (WebCore::Display::Box::setBorder):
3122         (WebCore::Display::Box::setPadding):
3123         (WebCore::Display::Box::Rect::Rect): Deleted.
3124
3125 2018-05-29  Wenson Hsieh  <wenson_hsieh@apple.com>
3126
3127         [Extra zoom mode] "Significant area painted" rendering progress event is rarely fired
3128         https://bugs.webkit.org/show_bug.cgi?id=186042
3129         <rdar://problem/40604182>
3130
3131         Reviewed by Tim Horton.
3132
3133         Makes a minor tweak to the size of the relevant view rect in extra zoom mode, such that it's no wider than the
3134         visible content rect. Previously, the width of this rect has hard-coded to a value optimized for macOS (980),
3135         which makes it difficult for content laid out at device width in extra zoom mode to cover a significant portion
3136         of the relevant view rect.
3137
3138         Test: RenderingProgressTests.FirstPaintWithSignificantArea
3139
3140         * page/Page.cpp:
3141         (WebCore::relevantViewRect):
3142
3143 2018-05-29  Antoine Quint  <graouts@apple.com>
3144
3145         [Web Animations] Handle relative length units
3146         https://bugs.webkit.org/show_bug.cgi?id=186047
3147
3148         Reviewed by Dean Jackson.
3149
3150         In order to correctly handle relative units, such as "em", "vw" and "vh", we need to do two things.
3151
3152         First, because we need to apply the cascade to correctly compute relative lengths, we need to delay the computation of
3153         "blending keyframes" to when we have both keyframes data and a valid target. This also means that we need to reset blending
3154         keyframes when the target changes. As a result, old call sites of updateBlendingKeyframes() have been replaced by a call to
3155         m_blendingKeyframes.clear() and the method now gets called as part of apply() with the RenderStyle of the targeted element
3156         as a parameter.
3157
3158         Second, and as a result of the first change, we need to update the accelerated animation state based on animation
3159         progress rather than when calling specific methods, such as Animation.play() and Animation.pause(), since blending
3160         keyframes may not be available at those more specific call sites. We now have a new updateAcceleratedAnimationState()
3161         method that gets called as part of apply(). We also rename animationPlayStateDidChange() to animationSuspensionStateDidChange()
3162         since this method was specific to suspension and had a confusing name.
3163
3164         * animation/AnimationEffectReadOnly.h: Rename animationPlayStateDidChange() to animationSuspensionStateDidChange().
3165         * animation/KeyframeEffectReadOnly.cpp:
3166         (WebCore::KeyframeEffectReadOnly::getKeyframes): Fix a crash that revealed itself after other changes in this patch. We would later
3167         call into ComputedStyleExtractor::animationSuspensionStateDidChange() and this would yield an assertion because we'd call potentially
3168         call it with a custom CSS property.
3169         (WebCore::KeyframeEffectReadOnly::processKeyframes): Reset blending keyframes instead of calling updateBlendingKeyframes() since
3170         blending keyframes is now performed asynchronously upon style resolution.
3171         (WebCore::KeyframeEffectReadOnly::updateBlendingKeyframes): Take the target's RenderStyle as a parameter and use it to reset the
3172         associated StyleResolver's state, just like we do in StyleResolver::keyframeStylesForAnimation(), so that the CSS cascade is correctly
3173         accounted for when computing values using relative length units. Since blending keyframes can now be computed several times for a
3174         given set of keyframes, since the effect's target may change, we also need to create a copy of the MutableStyleProperties to pass
3175         to StyleRuleKeyframe::create().
3176         (WebCore::KeyframeEffectReadOnly::setTarget): Reset blending keyframes instead of calling updateBlendingKeyframes() since
3177         blending keyframes is now performed asynchronously upon style resolution.
3178         (WebCore::KeyframeEffectReadOnly::apply): Update blending keyframes and the accelerated animation state.
3179         (WebCore::KeyframeEffectReadOnly::getAnimatedStyle): Make sure we have blending keyframes with a call to updateBlendingKeyframes()
3180         in case the animation hasn't naturally progressed when this method is called.
3181         (WebCore::KeyframeEffectReadOnly::setAnimatedPropertiesInStyle): Make sure we have blending keyframes with a call to
3182         updateBlendingKeyframes() in case the animation hasn't naturally progressed when this method is called.
3183         (WebCore::KeyframeEffectReadOnly::updateAcceleratedAnimationState): Account for the animation's local time and play state to update
3184         the accelerated animation state.
3185         (WebCore::KeyframeEffectReadOnly::addPendingAcceleratedAction): Record the last accelerated action in a member variable which we can
3186         use to determine if we're running accelerated accounting for uncommited changes.
3187         (WebCore::KeyframeEffectReadOnly::animationDidSeek): Only record an AcceleratedAction::Seek action if we're already running accelerated.
3188         (WebCore::KeyframeEffectReadOnly::animationSuspensionStateDidChange): Only record an AcceleratedAction::Pause or AcceleratedAction::Play
3189         action if we're already running accelerated.
3190         (WebCore::KeyframeEffectReadOnly::applyPendingAcceleratedActions): Ensure we clone and clear the list of accelerated actions and check that
3191         we have any cloned actions before proceeding any further. Then we can stop accounting for m_startedAccelerated since the list of accelerated
3192         actions already account for animation state changes.
3193         (WebCore::KeyframeEffectReadOnly::animationPlayStateDidChange): Deleted.
3194         * animation/KeyframeEffectReadOnly.h:
3195         (WebCore::KeyframeEffectReadOnly::isRunningAccelerated const): Account for the m_lastRecordedAcceleratedAction to identify whether we're running.
3196         * animation/WebAnimation.cpp:
3197         (WebCore::WebAnimation::play): Stop calling animationPlayStateDidChange() directly since the accelerated animation state is now updated when
3198         the animation's effect is applied.
3199         (WebCore::WebAnimation::pause): Stop calling animationPlayStateDidChange() directly since the accelerated animation state is now updated when
3200         the animation's effect is applied.
3201         (WebCore::WebAnimation::resolve): Make sure we update the finished state prior to applying the animation's effect since the play state can
3202         change when updating the finished state and KeyframeEffectReadOnly::updateAcceleratedAnimationState(), which is called when calling into
3203         KeyframeEffectReadOnly::apply(), relies on it to correctly update the accelerated animation state.
3204         (WebCore::WebAnimation::setSuspended): Rename animationPlayStateDidChange() to animationSuspensionStateDidChange().
3205         * css/StyleResolver.cpp:
3206         (WebCore::StyleResolver::setNewStateWithElement): Add a new public method to reset a StyleResolver's state such that we can call it when creating
3207         blending keyframes for JS-originated animations just like we do when creating blending keyframes for CSS Animations in keyframeStylesForAnimation().
3208         (WebCore::StyleResolver::keyframeStylesForAnimation): Use the new setNewStateWithElement() method.
3209         * css/StyleResolver.h:
3210
3211 2018-05-29  Thibault Saunier  <tsaunier@igalia.com>
3212
3213         [GStreamer] Update "qtdemux: Clarify field name about stream-encryption-system" patch
3214         https://bugs.webkit.org/show_bug.cgi?id=186040
3215
3216         Reviewed by Xabier Rodriguez-Calvar.
3217
3218         s/avalaible-stream-encryption-systems/available-stream-encryption-systems/g
3219
3220         Tests: imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-*
3221
3222         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
3223         (WebCore::extractEventsAndSystemsFromMessage):
3224
3225 2018-05-28  Zalan Bujtas  <zalan@apple.com>
3226
3227         Unreviewed build fix.
3228
3229         * layout/displaytree/DisplayBox.h:
3230         (WebCore::Display::Box::Rect::operator LayoutRect const):
3231
3232 2018-05-28  Zalan Bujtas  <zalan@apple.com>
3233
3234         [LFC] Add Rect interface to Display::Box
3235         https://bugs.webkit.org/show_bug.cgi?id=186019
3236
3237         Reviewed by Antti Koivisto.
3238
3239         Having a dedicated Rect class and moving the geometry invalidation to it enables us to call
3240         displayBox.contentBox().left() even when the widht/height are not computed yet.
3241         Also having Rect with top/left/bottom/right interface is more aligned with the rest of the layout code than x/y/maxX/maxY.
3242
3243         * layout/FormattingContextGeometry.cpp:
3244         (WebCore::Layout::contentHeightForFormattingContextRoot):
3245         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
3246         (WebCore::Layout::BlockFormattingContext::Geometry::staticPosition):
3247         * layout/displaytree/DisplayBox.cpp:
3248         (WebCore::Display::Box::marginBox const):
3249         (WebCore::Display::Box::borderBox const):
3250         (WebCore::Display::Box::paddingBox const):
3251         (WebCore::Display::Box::contentBox const):
3252         * layout/displaytree/DisplayBox.h:
3253         (WebCore::Display::Box::Rect::invalidateTop):
3254         (WebCore::Display::Box::Rect::invalidateLeft):
3255         (WebCore::Display::Box::Rect::invalidateWidth):
3256         (WebCore::Display::Box::Rect::invalidateHeight):
3257         (WebCore::Display::Box::Rect::hasValidPosition const):
3258         (WebCore::Display::Box::Rect::hasValidSize const):
3259         (WebCore::Display::Box::Rect::hasValidGeometry const):
3260         (WebCore::Display::Box::rect const):
3261         (WebCore::Display::Box::top const):
3262         (WebCore::Display::Box::left const):
3263         (WebCore::Display::Box::bottom const):
3264         (WebCore::Display::Box::right const):
3265         (WebCore::Display::Box::topLeft const):
3266         (WebCore::Display::Box::bottomRight const):
3267         (WebCore::Display::Box::size const):
3268         (WebCore::Display::Box::width const):
3269         (WebCore::Display::Box::height const):
3270         (WebCore::Display::Box::setTopLeft):
3271         (WebCore::Display::Box::setTop):
3272         (WebCore::Display::Box::setLeft):
3273         (WebCore::Display::Box::setWidth):
3274         (WebCore::Display::Box::setHeight):
3275         (WebCore::Display::Box::Rect::invalidatePosition):
3276         (WebCore::Display::Box::Rect::setHasValidPosition):
3277         (WebCore::Display::Box::Rect::Rect):
3278         (WebCore::Display::Box::Rect::top const):
3279         (WebCore::Display::Box::Rect::left const):
3280         (WebCore::Display::Box::Rect::bottom const):
3281         (WebCore::Display::Box::Rect::right const):
3282         (WebCore::Display::Box::Rect::topLeft const):
3283         (WebCore::Display::Box::Rect::bottomRight const):
3284         (WebCore::Display::Box::Rect::size const):
3285         (WebCore::Display::Box::Rect::width const):
3286         (WebCore::Display::Box::Rect::height const):
3287         (WebCore::Display::Box::Rect::setTopLeft):
3288         (WebCore::Display::Box::Rect::setTop):
3289         (WebCore::Display::Box::Rect::setLeft):
3290         (WebCore::Display::Box::Rect::setWidth):
3291         (WebCore::Display::Box::Rect::setHeight):
3292         (WebCore::Display::Box::Rect::shiftLeftTo):
3293         (WebCore::Display::Box::Rect::shiftRightTo):
3294         (WebCore::Display::Box::Rect::shiftTopTo):
3295         (WebCore::Display::Box::Rect::shiftBottomTo):
3296         (WebCore::Display::Box::Rect::expand):
3297         (WebCore::Display::Box::invalidateTop): Deleted.
3298         (WebCore::Display::Box::invalidateLeft): Deleted.
3299         (WebCore::Display::Box::invalidateWidth): Deleted.
3300         (WebCore::Display::Box::invalidateHeight): Deleted.
3301         (WebCore::Display::Box::hasValidPosition const): Deleted.
3302         (WebCore::Display::Box::hasValidSize const): Deleted.
3303         (WebCore::Display::Box::hasValidGeometry const): Deleted.
3304         (WebCore::Display::Box::invalidatePosition): Deleted.
3305         (WebCore::Display::Box::setHasValidPosition): Deleted.
3306
3307 2018-05-28  Zalan Bujtas  <zalan@apple.com>
3308
3309         [LFC] Add formatting context testing codepath in FrameViewLayoutContext
3310         https://bugs.webkit.org/show_bug.cgi?id=186036
3311
3312         Reviewed by Antti Koivisto.
3313
3314         This is to verify the formatting context layout correctness.
3315
3316         * layout/LayoutContext.cpp:
3317         (WebCore::Layout::LayoutContext::LayoutContext):
3318         (WebCore::Layout::LayoutContext::initializeRoot):
3319         * layout/LayoutContext.h:
3320         (WebCore::Layout::LayoutContext::displayBoxForLayoutBox const):
3321         * page/FrameViewLayoutContext.cpp:
3322         (WebCore::layoutUsingFormattingContext):
3323         (WebCore::FrameViewLayoutContext::layout):
3324
3325 2018-05-28  Zalan Bujtas  <zalan@apple.com>
3326
3327         [LFC] Add layout tree verification.
3328         https://bugs.webkit.org/show_bug.cgi?id=186018
3329
3330         Reviewed by Antti Koivisto.
3331
3332         Compare layout and render tree geometry and output the mismtaching rectangles.
3333
3334         * Sources.txt:
3335         * WebCore.xcodeproj/project.pbxproj: Add missing headers and make then private.
3336         * layout/LayoutContext.h:
3337         * layout/Verification.cpp: Added.
3338         (WebCore::Layout::outputMismatchedBoxInformationIfNeeded):
3339         (WebCore::Layout::verifySubtree):
3340         (WebCore::Layout::LayoutContext::verifyAndOutputLayoutTree const):
3341
3342 2018-05-28  Sam Weinig  <sam@webkit.org>
3343
3344         Modernize SVGRenderStyleDefs.h
3345         https://bugs.webkit.org/show_bug.cgi?id=186024
3346
3347         Reviewed by Daniel Bates.
3348
3349         Modernized the set of enums in SVGRenderStyleDefs.h and WindRule.h by:
3350             - Converting them to enum classes
3351             - Renaming them to remove unnecessary prefix 'E's
3352             - Renaming values to take advantage of enum class scoping (e.g. StyleDifferenceEqual -> StyleDifference::Equal)
3353             - Renaming to match modern conventions (e.g BNONE -> None)
3354
3355         Modernizes the following enums:
3356             SVGPaintType
3357             BaselineShift (renamed from EBaselineShift)
3358             TextAnchor (renamed from ETextAnchor)
3359             ColorInterpolation (renamed from EColorInterpolation)
3360             ColorRendering (renamed from EColorRendering)
3361             ShapeRendering (renamed from EShapeRendering)
3362             GlyphOrientation (renamed from EGlyphOrientation)
3363             AlignmentBaseline (renamed from EAlignmentBaseline)
3364             DominantBaseline (renamed from EDominantBaseline)
3365             VectorEffect (renamed from EVectorEffect)
3366             BufferedRendering (renamed from EBufferedRendering)
3367             MaskType (renamed from EMaskType)
<