iBooks text can overlap, sometimes columns are shifted splitting words.
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-04-28  Zalan Bujtas  <zalan@apple.com>
2
3         iBooks text can overlap, sometimes columns are shifted splitting words.
4         https://bugs.webkit.org/show_bug.cgi?id=171472
5         <rdar://problem/31096037>
6
7         Reviewed by Antti Koivisto.
8
9         Instead of just checking if the glyph is taller than the line, we need to ensure that both the
10         ascent and the descent have enough space (this is for -webkit-line-box-contain: glyph).
11
12         Test: fast/text/simple-line-layout-glyph-overflows-line.html
13
14         * rendering/SimpleLineLayout.cpp:
15         (WebCore::SimpleLineLayout::canUseForText): compute the available space for the ascent/descent
16         and check them against the ceil-ed(see FontCascade::floatWidthForSimpleText) glyph min/max y.
17
18 2017-04-29  Nan Wang  <n_wang@apple.com>
19
20         AX: Improve performance of addChildren()/childrenChanged()
21         https://bugs.webkit.org/show_bug.cgi?id=171443
22
23         Reviewed by Chris Fleizach.
24
25         There's a lot of unnecessary work happening when childrenChanged() is being called.
26         Some of the improvements here:
27         1. When childrenChanged() is being called on some element, we are marking its parent
28            chain dirty. However, in the addChild() method we are then clearing each child of
29            that 'dirty' parent, eventually making the entire tree dirty. 
30            Added a m_subTreeDirty flag and using the needsToUpdateChildren() check to make sure
31            we are only clearing the right chain without updating the unchanged siblings.
32         2. In the addChild() method we are calling accessibilityIsIgnored() on each child and that 
33            might lead to going up the parent chain again to get necessary information. 
34            Since we are already traversing the tree from top to bottom to add children, added a 
35            struct to store the information and pass it to the child so to avoid unnecessary traversal.
36         3. Reduced the amount work of ARIA text controls perform when updating its parents in childrenChanged() 
37            so that we don't update a big portion of the tree while typing.
38
39         No new tests since this didn't change any functionality. 
40
41         * accessibility/AccessibilityNodeObject.cpp:
42         (WebCore::AccessibilityNodeObject::AccessibilityNodeObject):
43         (WebCore::AccessibilityNodeObject::childrenChanged):
44         (WebCore::AccessibilityNodeObject::insertChild):
45         (WebCore::AccessibilityNodeObject::addChildren):
46         (WebCore::AccessibilityNodeObject::isDescendantOfBarrenParent):
47         * accessibility/AccessibilityNodeObject.h:
48         * accessibility/AccessibilityObject.cpp:
49         (WebCore::AccessibilityObject::AccessibilityObject):
50         (WebCore::AccessibilityObject::defaultObjectInclusion):
51         (WebCore::AccessibilityObject::setIsIgnoredFromParentDataForChild):
52         * accessibility/AccessibilityObject.h:
53         (WebCore::AccessibilityIsIgnoredFromParentData::AccessibilityIsIgnoredFromParentData):
54         (WebCore::AccessibilityIsIgnoredFromParentData::isNull):
55         (WebCore::AccessibilityObject::setNeedsToUpdateSubTree):
56         (WebCore::AccessibilityObject::needsToUpdateChildren):
57         (WebCore::AccessibilityObject::setIsIgnoredFromParentData):
58         * accessibility/AccessibilityRenderObject.cpp:
59         (WebCore::AccessibilityRenderObject::updateChildrenIfNecessary):
60         (WebCore::AccessibilityRenderObject::addChildren):
61         * accessibility/AccessibilityRenderObject.h:
62         (WebCore::AccessibilityRenderObject::setRenderObject):
63         (WebCore::AccessibilityRenderObject::needsToUpdateChildren): Deleted.
64
65 2017-04-29  Yusuke Suzuki  <utatane.tea@gmail.com>
66
67         Move WebCore CPUTime to WTF and implement it in all the platforms
68         https://bugs.webkit.org/show_bug.cgi?id=171477
69
70         Reviewed by Chris Dumez.
71
72         Move CPUTime to WTF. And rename getCPUTime to CPUTime::get().
73
74         * CMakeLists.txt:
75         * PlatformMac.cmake:
76         * WebCore.xcodeproj/project.pbxproj:
77         * page/ChromeClient.h:
78         * page/PerformanceMonitor.cpp:
79         (WebCore::PerformanceMonitor::PerformanceMonitor):
80         (WebCore::PerformanceMonitor::measurePostLoadCPUUsage):
81         (WebCore::PerformanceMonitor::measurePostBackgroundingCPUUsage):
82         (WebCore::PerformanceMonitor::measureCPUUsageInActivityState):
83         * page/PerformanceMonitor.h:
84         * platform/CPUMonitor.cpp:
85         (WebCore::CPUMonitor::setCPULimit):
86         (WebCore::CPUMonitor::timerFired):
87         * platform/CPUMonitor.h:
88
89 2017-04-28  Per Arne Vollan  <pvollan@apple.com>
90
91         Crash under WebCore::AccessibilityRenderObject::handleAriaExpandedChanged().
92         https://bugs.webkit.org/show_bug.cgi?id=171427
93         rdar://problem/31863417
94
95         Reviewed by Brent Fulgham.
96
97         The AccessibilityRenderObject object might delete itself in handleAriaExpandedChanged() under the call
98         to the parentObject() method. This will cause a crash when accessing the object later in this method.
99         Protect the current object while executing arbitrary event code.
100
101         Test: accessibility/accessibility-crash-setattribute.html
102
103         * accessibility/AccessibilityRenderObject.cpp:
104         (WebCore::AccessibilityRenderObject::handleAriaExpandedChanged):
105
106 2017-04-28  Chris Dumez  <cdumez@apple.com>
107
108         Diagnostic logging of navigations is too verbose
109         https://bugs.webkit.org/show_bug.cgi?id=171455
110         <rdar://problem/31543815>
111
112         Reviewed by Andreas Kling.
113
114         Diagnostic logging of navigation is too verbose. We log things that are not actually user
115         navigations (e.g. speculative loads, bookmark icon fetches, ...). To address the issue,
116         we now only log *observable* loads. We do so by only logging if the page is visible or
117         if it becomes visible.
118
119         * loader/FrameLoader.cpp:
120         (WebCore::FrameLoader::loadWithDocumentLoader):
121         (WebCore::logNavigation): Deleted.
122         * page/Page.cpp:
123         (WebCore::Page::setIsVisibleInternal):
124         (WebCore::Page::logNavigation):
125         (WebCore::Page::mainFrameLoadStarted):
126         * page/Page.h:
127
128 2017-04-28  Joanmarie Diggs  <jdiggs@igalia.com>
129
130         AX: ARIA "region" role which lacks an accessible name should not be treated as a landmark
131         https://bugs.webkit.org/show_bug.cgi?id=171180
132
133         Reviewed by Chris Fleizach.
134
135         Remove mapping of LandmarkRegionRole for regions which lack an accessible name.
136         Doing so had a side effect of causing a number of DPub ARIA roles to stop being
137         mapped as ARIA landmarks. This is due to our internal role mappings, namely
138         treating the DPub ARIA landmark roles as if they were regions. Because DPub's
139         landmarks do not subclass region, and do not have the same name-from-author
140         requirement as region, create a new LandmarkDocRegionRole AccessibilityRole and
141         map DPub ARIA's generic landmarks to it.
142
143         No new tests because we already have sufficient coverage. Several existing
144         tests were given additional test cases to cover named and unnamed regions,
145         and test expectations updated accordingly.
146
147         * accessibility/AccessibilityNodeObject.cpp:
148         (WebCore::AccessibilityNodeObject::determineAriaRoleAttribute):
149         * accessibility/AccessibilityObject.cpp:
150         (WebCore::AccessibilityObject::accessibleNameDerivesFromContent):
151         (WebCore::AccessibilityObject::isLandmark):
152         (WebCore::initializeRoleMap):
153         (WebCore::AccessibilityObject::computedRoleString):
154         * accessibility/AccessibilityObject.h:
155         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
156         (atkRole):
157         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
158         (-[WebAccessibilityObjectWrapper _accessibilityIsLandmarkRole:]):
159         (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
160         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
161         (-[WebAccessibilityObjectWrapperBase ariaLandmarkRoleDescription]):
162         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
163         (createAccessibilityRoleMap):
164         (-[WebAccessibilityObjectWrapper subrole]):
165
166 2017-04-28  Simon Fraser  <simon.fraser@apple.com>
167
168         Enhance showLayerTree() to show fragments
169         https://bugs.webkit.org/show_bug.cgi?id=171469
170
171         Reviewed by Zalan Bujtas.
172
173         Have showLayerTree() dump fragments, like:
174
175              normal flow list(1)
176               layer 0x11c1879c0 at (0,0) size 700x1858 backgroundClip at (0,0) size 2120x779 clip at (0,0) size 2120x779
177                    fragment 0: bounds in layer at (0,0) size 700x1858 fragment bounds at (0,0) size 700x779
178                    fragment 1: bounds in layer at (710,-779) size 700x1858 fragment bounds at (710,0) size 700x779
179                    fragment 2: bounds in layer at (1420,-1558) size 700x1858 fragment bounds at (1420,0) size 700x300
180                 RenderMultiColumnFlowThread 0x11f1f3340 at (0,0) size 700x1858
181
182         We want these to show before the child renderers, so factor that code into writeLayerRenderers().
183         
184         Overloading of write() for layers doesn't help anyone, so call it writeLayer() for searchability.
185
186         * rendering/RenderLayer.cpp:
187         (WebCore::showLayerTree):
188         * rendering/RenderLayer.h:
189         * rendering/RenderTreeAsText.cpp:
190         (WebCore::writeLayer):
191         (WebCore::writeLayerRenderers):
192         (WebCore::writeLayers):
193         * rendering/RenderTreeAsText.h:
194
195 2017-04-28  Simon Fraser  <simon.fraser@apple.com>
196
197         Modernize RenderTreeAsText code
198         https://bugs.webkit.org/show_bug.cgi?id=171458
199
200         Reviewed by Zalan Bujtas.
201
202         Use modern loops. More references to render objects and layers.
203
204         * rendering/RenderTreeAsText.cpp:
205         (WebCore::write):
206         (WebCore::writeRenderNamedFlowThreads):
207         (WebCore::writeLayers):
208         (WebCore::writeSelection):
209         (WebCore::externalRepresentation):
210
211 2017-04-28  Wenson Hsieh  <wenson_hsieh@apple.com>
212
213         Fix and re-enable data interaction unit tests
214         https://bugs.webkit.org/show_bug.cgi?id=171446
215         <rdar://problem/31820646>
216
217         Reviewed by Tim Horton.
218
219         Three small tweaks to get all data interaction tests passing again (changes detailed below).
220         Fixes a failing unit test: DataInteractionTests.RespectsExternalSourceFidelityRankings.
221
222         * page/mac/DragControllerMac.mm:
223
224         When dropping in a plain text editable area, don't consider kUTTypeText to be a UTI supported by the destination.
225         This is because doing so would cause rich text UTIs, such as kUTTypeHTML, to match, so that the plain text area
226         would report HTML as a preferred UTI type to load when dropping rich content over it. What we want to check for
227         conformance here is really kUTTypePlainText.
228
229         (WebCore::DragController::updatePreferredTypeIdentifiersForDragHandlingMethod):
230         * platform/Pasteboard.h:
231         * platform/ios/PasteboardIOS.mm:
232
233         The default Pasteboard constructor no longer makes a sync call to the UI process to get the change count.
234         Instead, we introduce a new constructor that takes and sets the change count. This default constructor was used
235         from three places: Pasteboard::createForCopyAndPaste, Pasteboard::createPrivate and StaticPasteboard::create.
236
237         The first two call sites have been refactored to first fetch the change count from the UI process and then pass
238         it in to the constructor.
239
240         (WebCore::changeCountForPasteboard):
241         (WebCore::Pasteboard::Pasteboard):
242         (WebCore::Pasteboard::createForCopyAndPaste):
243         (WebCore::Pasteboard::createPrivate):
244         (WebCore::Pasteboard::readString):
245         (WebCore::Pasteboard::types):
246         * platform/mac/DragDataMac.mm:
247         (WebCore::typeIsAppropriateForSupportedTypes):
248         (WebCore::DragData::updatePreferredTypeIdentifiers):
249
250         Remove the two-pass heuristic. Instead, we should follow this policy: "select the highest fidelity UTI that
251         conforms to one of the destination's supported types".
252
253         * platform/mac/PasteboardMac.mm:
254         (WebCore::Pasteboard::Pasteboard):
255
256 2017-04-28  Dean Jackson  <dino@apple.com>
257
258         App crashing: Dispatch queue: com.apple.root.user-interactive-qos / vBoxConvolve / WebCore::FEGaussianBlur::platformApplySoftware()
259         https://bugs.webkit.org/show_bug.cgi?id=171461
260         <rdar://problem/30534722>
261
262         Reviewed by Eric Carlson.
263
264         We're getting reports of crashes in this function, caused by null or empty data being
265         passed to vImage. Guard against this, in a way that will ASSERT in debug builds if
266         anyone comes across it.
267
268         Test: css3/filters/blur-various-radii.html
269
270         * platform/graphics/filters/FEGaussianBlur.cpp:
271         (WebCore::accelerateBoxBlur): Return early if things don't look good.
272
273 2017-04-28  Chris Dumez  <cdumez@apple.com>
274
275         Stop using legacy ClientRect / ClientRectList in Internals
276         https://bugs.webkit.org/show_bug.cgi?id=171412
277
278         Reviewed by Simon Fraser.
279
280         Stop using legacy ClientRect / ClientRectList in Internals amd use the
281         newer DOMRect instead.
282
283         * dom/DOMRect.idl:
284         * page/Page.cpp:
285         (WebCore::Page::nonFastScrollableRects):
286         (WebCore::Page::touchEventRectsForEvent):
287         (WebCore::Page::passiveTouchEventListenerRects):
288         * page/Page.h:
289         * testing/Internals.cpp:
290         (WebCore::Internals::absoluteCaretBounds):
291         (WebCore::Internals::boundingBox):
292         (WebCore::Internals::inspectorHighlightRects):
293         (WebCore::Internals::layoutViewportRect):
294         (WebCore::Internals::visualViewportRect):
295         (WebCore::Internals::touchEventRectsForEvent):
296         (WebCore::Internals::passiveTouchEventListenerRects):
297         (WebCore::Internals::nonFastScrollableRects):
298         (WebCore::Internals::selectionBounds):
299         * testing/Internals.h:
300         * testing/Internals.idl:
301
302 2017-04-28  Youenn Fablet  <youenn@apple.com>
303
304         getUserMedia video streams should follow device orientation
305         https://bugs.webkit.org/show_bug.cgi?id=171284
306
307         Reviewed by Eric Carlson.
308
309         Only really affects AVVideoCaptureSource on iOS. Manually testing the following cases:
310         - Mac: no change of behavior
311         - iOS: page loaded in portrait, video is portrait. page loaded in landscape, video is landscape
312         - iOS: changing the device orientation makes the video samples to be moved to landscape/portrait.
313         - Same tests as above with peer connection.
314
315         Making Document having an OrientationNotifier that AVVideoCaptureSources get registered to.
316         Making AVVideoCaptureSource an OrientationNotifier::Observer so that it can changes width/height if needed.
317
318         Refactoring to specialize CaptureFactory in VideoCaptureFactory and AudioCaptureFactory.
319         Refactoring to return a CaptureSourceOrError instead of passing an out parameter plus returning a RefPtr.
320
321         * Modules/mediastream/UserMediaRequest.cpp:
322         (WebCore::UserMediaRequest::allow):
323         * WebCore.xcodeproj/project.pbxproj:
324         * dom/Document.cpp:
325         (WebCore::Document::orientationChanged):
326         * dom/Document.h:
327         * page/Frame.cpp:
328         (WebCore::Frame::orientationChanged):
329         * platform/OrientationNotifer.h: Copied from Source/WebKit2/UIProcess/Cocoa/UserMediaCaptureManagerProxy.h.
330         (WebCore::OrientationNotifier::Observer::setNotifier):
331         (WebCore::OrientationNotifier::Observer::~Observer):
332         (WebCore::OrientationNotifier::orientationChanged):
333         (WebCore::OrientationNotifier::addObserver):
334         (WebCore::OrientationNotifier::removeObserver):
335         * platform/mediastream/MediaStreamPrivate.cpp:
336         (WebCore::MediaStreamPrivate::monitorOrientation):
337         * platform/mediastream/MediaStreamPrivate.h:
338         * platform/mediastream/RealtimeMediaSource.h:
339         (WebCore::CaptureSourceOrError::CaptureSourceOrError):
340         (WebCore::CaptureSourceOrError::operator bool):
341         (WebCore::CaptureSourceOrError::source):
342         * platform/mediastream/RealtimeMediaSourceCenter.cpp:
343         (WebCore::RealtimeMediaSourceCenter::setAudioFactory):
344         (WebCore::RealtimeMediaSourceCenter::unsetAudioFactory):
345         (WebCore::RealtimeMediaSourceCenter::setVideoFactory):
346         (WebCore::RealtimeMediaSourceCenter::unsetVideoFactory):
347         * platform/mediastream/RealtimeMediaSourceCenter.h:
348         (WebCore::RealtimeMediaSourceCenter::defaultAudioFactory):
349         (WebCore::RealtimeMediaSourceCenter::defaultVideoFactory):
350         (WebCore::RealtimeMediaSourceCenter::audioFactory):
351         (WebCore::RealtimeMediaSourceCenter::videoFactory):
352         * platform/mediastream/mac/AVAudioCaptureSource.h:
353         * platform/mediastream/mac/AVAudioCaptureSource.mm:
354         (WebCore::AVAudioCaptureSource::create):
355         (WebCore::AVAudioCaptureSource::factory):
356         * platform/mediastream/mac/AVVideoCaptureSource.h:
357         * platform/mediastream/mac/AVVideoCaptureSource.mm:
358         (WebCore::AVVideoCaptureSource::create):
359         (WebCore::AVVideoCaptureSource::factory):
360         (WebCore::AVVideoCaptureSource::monitorOrientation):
361         (WebCore::AVVideoCaptureSource::orientationChanged):
362         (WebCore::AVVideoCaptureSource::processNewFrame):
363         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
364         (WebCore::CoreAudioCaptureSource::create):
365         (WebCore::CoreAudioCaptureSource::factory):
366         * platform/mediastream/mac/CoreAudioCaptureSource.h:
367         * platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
368         (WebCore::MockRealtimeAudioSource::create):
369         * platform/mediastream/mac/MockRealtimeVideoSourceMac.h:
370         * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
371         (WebCore::MockRealtimeVideoSource::create):
372         (WebCore::MockRealtimeVideoSourceMac::orientationChanged):
373         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
374         (WebCore::RealtimeMediaSourceCenterMac::createMediaStream):
375         (WebCore::RealtimeMediaSourceCenterMac::bestSourcesForTypeAndConstraints):
376         (WebCore::RealtimeMediaSourceCenterMac::defaultAudioFactory):
377         (WebCore::RealtimeMediaSourceCenterMac::defaultVideoFactory):
378         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.h:
379         * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp:
380         (WebCore::RealtimeMediaSourceCenterOwr::createMediaStream):
381         * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.h:
382         * platform/mock/MockRealtimeAudioSource.cpp:
383         (WebCore::MockRealtimeAudioSource::create):
384         (WebCore::MockRealtimeAudioSource::factory):
385         * platform/mock/MockRealtimeAudioSource.h:
386         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
387         (WebCore::MockRealtimeMediaSourceCenter::validateRequestConstraints):
388         (WebCore::MockRealtimeMediaSourceCenter::createMediaStream):
389         (WebCore::MockRealtimeMediaSourceCenter::defaultAudioFactory):
390         (WebCore::MockRealtimeMediaSourceCenter::defaultVideoFactory):
391         * platform/mock/MockRealtimeMediaSourceCenter.h:
392         * platform/mock/MockRealtimeVideoSource.cpp:
393         (WebCore::MockRealtimeVideoSource::create):
394         (WebCore::MockRealtimeVideoSource::factory):
395         * platform/mock/MockRealtimeVideoSource.h:
396
397 2017-04-28  Said Abou-Hallawa  <sabouhallawa@apple.com>
398
399         Unify how BitmapImage handles the availability of a decoded for large and animated images
400         https://bugs.webkit.org/show_bug.cgi?id=171410
401
402         Reviewed by Simon Fraser.
403
404         Rename some functions which are related to animation frame availability.
405         Make BitmapImage call ImageObserver::imageFrameAvailable() whenever a 
406         frame is available regardless it is for an animated or for a large image.
407
408         * html/HTMLMediaElement.cpp:
409         (WebCore::HTMLMediaElement::isVisibleInViewport):
410         * html/MediaElementSession.cpp:
411         (WebCore::MediaElementSession::autoplayPermitted):
412         (WebCore::isMainContentForPurposesOfAutoplay):
413         * loader/cache/CachedImage.cpp:
414         (WebCore::CachedImage::CachedImageObserver::imageFrameAvailable):
415         (WebCore::CachedImage::imageFrameAvailable):
416         (WebCore::CachedImage::usesImageContainerSize): Deleted.
417         (WebCore::CachedImage::imageHasRelativeWidth): Deleted.
418         (WebCore::CachedImage::imageHasRelativeHeight): Deleted.
419         (WebCore::CachedImage::CachedImageObserver::animationAdvanced): Deleted.
420         (WebCore::CachedImage::animationAdvanced): Deleted.
421         * loader/cache/CachedImage.h:
422         * loader/cache/CachedImageClient.h:
423         (WebCore::CachedImageClient::imageFrameAvailable):
424         (WebCore::CachedImageClient::newImageAnimationFrameAvailable): Deleted.
425         * platform/graphics/BitmapImage.cpp:
426         (WebCore::BitmapImage::internalAdvanceAnimation):
427         (WebCore::BitmapImage::imageFrameAvailableAtIndex):
428         (WebCore::BitmapImage::newFrameNativeImageAvailableAtIndex): Deleted.
429         * platform/graphics/BitmapImage.h:
430         * platform/graphics/Image.h:
431         (WebCore::Image::imageFrameAvailableAtIndex):
432         (WebCore::Image::newFrameNativeImageAvailableAtIndex): Deleted.
433         * platform/graphics/ImageFrameCache.cpp:
434         (WebCore::ImageFrameCache::cacheAsyncFrameNativeImageAtIndex):
435         * platform/graphics/ImageObserver.h:
436         * platform/graphics/ImageTypes.h:
437         * rendering/RenderElement.cpp:
438         (WebCore::RenderElement::RenderElement):
439         (WebCore::RenderElement::shouldRepaintInVisibleRect):
440         (WebCore::RenderElement::imageFrameAvailable):
441         (WebCore::RenderElement::repaintForPausedImageAnimationsIfNeeded):
442         (WebCore::shouldRepaintForImageAnimation): Deleted.
443         (WebCore::RenderElement::newImageAnimationFrameAvailable): Deleted.
444         * rendering/RenderElement.h:
445         * rendering/RenderView.cpp:
446         (WebCore::RenderView::updateVisibleViewportRect):
447         * svg/graphics/SVGImageClients.h:
448
449 2017-04-28  Jeremy Jones  <jeremyj@apple.com>
450
451         ARGUMENT BAD: time, time >= 0
452         https://bugs.webkit.org/show_bug.cgi?id=164336
453         rdar://problem/29314891
454
455         Reviewed by Eric Carlson.
456
457         Handle invalid duration and current time when calculating remaining time.
458
459         Test media/modern-media-controls/pip-support/pip-support-click.html now works without a workaround
460         in media/modern-media-controls/pip-support/pip-support-enabled.html
461
462         * platform/mac/WebVideoFullscreenHUDWindowController.mm:
463         (-[WebVideoFullscreenHUDWindowController remainingTimeText]):
464
465 2017-04-28  Daniel Bates  <dabates@apple.com>
466
467         Add WebCore::protocolIsJavaScript(StringView)
468         https://bugs.webkit.org/show_bug.cgi?id=171396
469
470         Reviewed by Alex Christensen.
471
472         Add an overload of WebCore::protocolIsJavaScript() that takes a StringView to
473         avoid the need for a caller to allocate a new String object when converting
474         from a StringView to a String. We are not using this functionality at the moment,
475         but we will in the patch for <https://bugs.webkit.org/show_bug.cgi?id=170925>.
476
477         No functionality has changed. So, no new tests.
478
479         * platform/URL.cpp: Remove an outdated comment about protocolIs(StringView, const char*).
480         This overload was removed in r212508.
481         (WebCore::protocolIsInternal): Added.
482         (WebCore::protocolIs): Implemented in terms of WebCore::protocolIsInternal().
483         (WebCore::URL::protocolIs): Ditto.
484         (WebCore::protocolIsJavaScript): Added; overload that takes a StringView.
485         (WebCore::mimeTypeFromDataURL): Modified to use WebCore::protocolIsInternal().
486         * platform/URL.h:
487
488 2017-04-28  Andy Estes  <aestes@apple.com>
489
490         [macOS] WebPlaybackControlsManager needs to know when the selected text or audio track changes
491         https://bugs.webkit.org/show_bug.cgi?id=171434
492         <rdar://problem/31887922>
493
494         Reviewed by Eric Carlson.
495
496         * dom/GenericEventQueue.cpp:
497         (WebCore::GenericEventQueue::hasPendingEventsOfType): Added to check if a pending event
498         exists of a certain type.
499         * dom/GenericEventQueue.h:
500         * html/HTMLMediaElement.cpp:
501         (WebCore::HTMLMediaElement::setSelectedTextTrack): Even if no track modes change, fire a
502         change event when the track to select is off or automatic so that
503         WebPlaybackSessionModelMediaElement detects the change.
504         * html/track/TrackListBase.cpp:
505         (TrackListBase::isChangeEventScheduled): Returns true if m_asyncEventQueue has a pending
506         change event.
507         * html/track/TrackListBase.h:
508         * platform/cocoa/WebPlaybackSessionModel.h:
509         (WebCore::WebPlaybackSessionModelClient::audioMediaSelectionIndexChanged):
510         (WebCore::WebPlaybackSessionModelClient::legibleMediaSelectionIndexChanged):
511         * platform/cocoa/WebPlaybackSessionModelMediaElement.h:
512         * platform/cocoa/WebPlaybackSessionModelMediaElement.mm:
513         (WebCore::WebPlaybackSessionModelMediaElement::setMediaElement): Registered/unregistered for
514         the change event on the audio and text tracks.
515         (WebCore::WebPlaybackSessionModelMediaElement::updateForEventName): Called
516         updateMediaSelectionIndices() when the change event fires.
517         (WebCore::WebPlaybackSessionModelMediaElement::updateMediaSelectionOptions): Renamed from
518         updateLegibleOptions().
519         (WebCore::WebPlaybackSessionModelMediaElement::updateMediaSelectionIndices): Called
520         audioMediaSelectionIndexChanged() and legibleMediaSelectionIndexChanged() on m_clients with
521         the updated indices.
522         (WebCore::WebPlaybackSessionModelMediaElement::legibleMediaSelectedIndex): Fixed a bug
523         where selectedIndex would never be set to offIndex if offIndex is 0 (which it usually is).
524         (WebCore::WebPlaybackSessionModelMediaElement::updateLegibleOptions): Renamed to
525         updateMediaSelectionOptions().
526         * platform/mac/WebPlaybackControlsManager.h:
527         * platform/mac/WebPlaybackControlsManager.mm:
528         (-[WebPlaybackControlsManager setAudioMediaSelectionIndex:]): Set
529         _currentAudioTouchBarMediaSelectionOption to the object at selectedIndex and manually
530         triggered a KVO notification. We can't call -setCurrentAudioTouchBarMediaSelectionOption:
531         here since that will send a message back to the Web process.
532         (-[WebPlaybackControlsManager setLegibleMediaSelectionIndex:]): Ditto for
533         _currentLegibleTouchBarMediaSelectionOption.
534         * platform/mac/WebPlaybackSessionInterfaceMac.h:
535         * platform/mac/WebPlaybackSessionInterfaceMac.mm:
536         (WebCore::WebPlaybackSessionInterfaceMac::audioMediaSelectionIndexChanged): Called
537         -[WebPlaybackControlsManager setAudioMediaSelectionIndex:].
538         (WebCore::WebPlaybackSessionInterfaceMac::legibleMediaSelectionIndexChanged): Called
539         -[WebPlaybackControlsManager setLegibleMediaSelectionIndex:].
540
541 2017-04-28  Chris Dumez  <cdumez@apple.com>
542
543         Range.getClientRects() / getBoundingClientRect() should return DOMRect types
544         https://bugs.webkit.org/show_bug.cgi?id=171393
545
546         Reviewed by Simon Fraser.
547
548         Range.getClientRects() / getBoundingClientRect() should return DOMRect types:
549         - https://drafts.csswg.org/cssom-view/#extensions-to-the-range-interface
550
551         Test: fast/dom/Range/getBoundingClientRect-getClientRects-return-type.html
552
553         * CMakeLists.txt:
554         * WebCore.xcodeproj/project.pbxproj:
555         * dom/DOMRect.cpp: Copied from Source/WebCore/dom/DOMRect.h.
556         (WebCore::createDOMRectVector):
557         * dom/DOMRect.h:
558         * dom/Element.cpp:
559         (WebCore::Element::getClientRects):
560         * dom/Range.cpp:
561         (WebCore::Range::getClientRects):
562         (WebCore::Range::getBoundingClientRect):
563         * dom/Range.h:
564         * dom/Range.idl:
565
566 2017-04-28  Chris Dumez  <cdumez@apple.com>
567
568         Tweak window.open features argument tokenizer to match HTML standard and Edge
569         https://bugs.webkit.org/show_bug.cgi?id=170548
570
571         Reviewed by Geoffrey Garen.
572
573         Update window.open() features argument tokenizer to match HTML standard:
574         - https://html.spec.whatwg.org/#concept-window-open-features-tokenize
575
576         Also update window.open() to return null instead of the window when
577         the 'noopener' feature is activated, as per:
578         - https://html.spec.whatwg.org/#dom-open (Step 10)
579
580         No new tests, rebaselined existing test.
581
582         * page/DOMWindow.cpp:
583         (WebCore::DOMWindow::createWindow):
584         Update window.open() to return null instead of the window when
585         the 'noopener' feature is activated, as per:
586         - https://html.spec.whatwg.org/#dom-open (Step 10)
587
588         * page/WindowFeatures.cpp:
589         (WebCore::isSeparator):
590         Treat all ASCII spaces as feature separators, as per:
591         - https://html.spec.whatwg.org/#feature-separator
592         This has the effect of adding U+000C (FormFeed) as a separator.
593
594         (WebCore::processFeaturesString):
595         Align tokenizing code with the specification:
596         - https://html.spec.whatwg.org/#concept-window-open-features-tokenize
597         In particular, the following changes were made:
598         - After the key, skip to first '=', but don't skip past a ',' or a non-separator.
599           The "or a non-separator" part is new in the spec (step 3.6.1) and is now implemented.
600         - After looking for the '=', only treat what follows as a value if the current character
601           is a separator. This is as per step 7 in the spec.
602         These changes now cause us to parse 'foo noopener=1' as ('foo', ''), ('noopener', '1').
603
604 2017-04-28  Eric Carlson  <eric.carlson@apple.com>
605
606         Implement ondevicechange
607         https://bugs.webkit.org/show_bug.cgi?id=169872
608
609         Unreviewed, remove some dead code accidentally committed in r215929.
610
611         * platform/mediastream/CaptureDeviceManager.cpp:
612
613 2017-04-28  Chris Dumez  <cdumez@apple.com>
614
615         Update DOMTokenList.replace() to match the latest DOM specification
616         https://bugs.webkit.org/show_bug.cgi?id=171388
617
618         Reviewed by Alex Christensen.
619
620         Update DOMTokenList.replace() to match the latest DOM specification after:
621         - https://github.com/whatwg/dom/issues/442
622         - https://github.com/whatwg/infra/pull/126
623
624         The latest spec text is at:
625         - https://dom.spec.whatwg.org/#dom-domtokenlist-replace
626         - https://infra.spec.whatwg.org/#set-replace
627
628         The behavior change in this patch causes (a, b, c).replace(a, c) to return
629         (c, b) instead of (b, c). This new behavior is aligned with Firefox as well.
630
631         No new tests, updated existing test.
632
633         * html/DOMTokenList.cpp:
634         (WebCore::DOMTokenList::replace):
635
636 2017-04-28  Brady Eidson  <beidson@apple.com>
637
638         Start of support for multiple WebsiteDataStore/SessionIDs per process
639         https://bugs.webkit.org/show_bug.cgi?id=171422
640
641         Reviewed by Geoffrey Garen.
642
643         Covered by API tests.
644
645         * platform/network/NetworkStorageSession.h:
646         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
647         (WebCore::NetworkStorageSession::ensureSession):
648         * platform/spi/cf/CFNetworkSPI.h:
649
650 2017-04-28  Chris Dumez  <cdumez@apple.com>
651
652         URLSearchParams should be reflective
653         https://bugs.webkit.org/show_bug.cgi?id=171345
654
655         Reviewed by Alex Christensen.
656
657         There was a bug in our implementation of [1] where we would replace
658         '+' with 0x20 *after* URL-decoding the string, instead of *before*.
659         This was causing us to replace URL-encoded '+' characters with 0x20.
660
661         [1] https://url.spec.whatwg.org/#concept-urlencoded-parser
662
663         No new tests, updated existing test.
664
665         * platform/URLParser.cpp:
666
667 2017-04-28  Youenn Fablet  <youenn@apple.com>
668
669         Adding a runtime flag specific to MediaDevices
670         https://bugs.webkit.org/show_bug.cgi?id=171433
671
672         Reviewed by Geoffrey Garen.
673
674         Covered by existing tests.
675
676         Adding a preference for MediaDevices.
677         Setting media devices runtime flag to false by default.
678         Setting peer connection and media stream flags to true by default.
679         Activating mediaDevices and getUserMedia Navigator properties based on media devices flag.
680
681         * Modules/mediastream/NavigatorMediaDevices.idl:
682         * Modules/mediastream/NavigatorUserMedia.idl:
683         * page/RuntimeEnabledFeatures.cpp:
684         (WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures):
685         * page/RuntimeEnabledFeatures.h:
686         (WebCore::RuntimeEnabledFeatures::mediaDevicesEnabled):
687         (WebCore::RuntimeEnabledFeatures::setMediaDevicesEnabled):
688
689 2017-04-28  Eric Carlson  <eric.carlson@apple.com>
690
691         Implement ondevicechange
692         https://bugs.webkit.org/show_bug.cgi?id=169872
693
694         Unreviewed, fix test crash.
695
696         * platform/mediastream/RealtimeMediaSourceCenter.cpp:
697         (WebCore::RealtimeMediaSourceCenter::addDevicesChangedObserver): "nextToken" must be static.
698
699 2017-04-28  Dean Jackson  <dino@apple.com>
700
701         [WebGPU] Label MTLCommandQueues with a prefix for internal telemetry
702         https://bugs.webkit.org/show_bug.cgi?id=171441
703         <rdar://problem/31826915>
704
705         Reviewed by Tim Horton.
706
707         Prefix any label that is set by the WebGPU API so that
708         our telemetry can identify the use. Don't expose that
709         prefix to the API though.
710
711         New API Test: GPUCommandQueue
712
713         * platform/graphics/cocoa/GPUCommandQueueMetal.mm:
714         (WebCore::GPUCommandQueue::GPUCommandQueue):
715         (WebCore::GPUCommandQueue::label):
716         (WebCore::GPUCommandQueue::setLabel):
717
718 2017-04-28  Joanmarie Diggs  <jdiggs@igalia.com>
719
720         [ATK] aria-modal="true" should be exposed via ATK_STATE_MODAL
721         https://bugs.webkit.org/show_bug.cgi?id=171188
722
723         Reviewed by Chris Fleizach.
724
725         Include ATK_STATE_MODAL in the AtkObject's state set if the accessible
726         element's node is the current ARIA modal node.
727
728         Test: accessibility/gtk/aria-modal-state-exposed.html
729
730         * accessibility/AccessibilityObject.cpp:
731         (WebCore::AccessibilityObject::isAriaModalNode):
732         * accessibility/AccessibilityObject.h:
733         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
734         (setAtkStateSetFromCoreObject):
735
736 2017-04-28  Eric Carlson  <eric.carlson@apple.com>
737
738         Implement ondevicechange
739         https://bugs.webkit.org/show_bug.cgi?id=169872
740         <rdar://problem/28945035>
741
742         Reviewed by Jer Noble.
743
744         Test: fast/mediastream/device-change-event.html
745
746         * Modules/mediastream/MediaDevices.cpp:
747         (WebCore::MediaDevices::MediaDevices): Register for devicechange callbacks.
748         (WebCore::MediaDevices::~MediaDevices): Unregister.
749         (WebCore::MediaDevices::scheduledEventTimerFired):
750         * Modules/mediastream/MediaDevices.h:
751         * Modules/mediastream/MediaDevices.idl:
752
753         * Modules/mediastream/MediaDevicesEnumerationRequest.cpp:
754         (WebCore::MediaDevicesEnumerationRequest::setDeviceInfo): Remove unnecessary instance variables.
755         * Modules/mediastream/MediaDevicesEnumerationRequest.h:
756
757         * Modules/mediastream/MediaDevicesRequest.cpp:
758         (WebCore::MediaDevicesRequest::start): Remove m_idHashSalt, it isn't used. RealtimeMediaSourceCenter
759         now has the method to hash ids and group IDs.
760         (WebCore::hashString): Deleted.
761         (WebCore::MediaDevicesRequest::hashID): Deleted.
762         * Modules/mediastream/MediaDevicesRequest.h:
763
764         * dom/Document.h:
765         (WebCore::Document::setDeviceIDHashSalt):
766         (WebCore::Document::deviceIDHashSalt):
767
768         * dom/EventNames.h: Add devicechange.
769
770         * dom/EventTargetFactory.in: Add MediaDevices.
771
772         * html/HTMLAttributeNames.in: Add ondevicechange.
773
774         * platform/mediastream/CaptureDeviceManager.cpp:
775         (WebCore::CaptureDeviceManager::captureDeviceFromPersistentID): Renamed from captureDeviceFromDeviceID
776         and changed to return a std::optional<CaptureDevice>.
777         (WebCore::CaptureDeviceManager::captureDeviceFromDeviceID): Deleted.
778
779         * platform/mediastream/RealtimeMediaSourceCenter.cpp:
780         (WebCore::addStringToSHA): New, add string bytes to SHA1. Moved from MediaDevicesRequest
781         so we can use for in testing.
782         (WebCore::RealtimeMediaSourceCenter::hashStringWithSalt): Generate hash for a string with a
783         salt. Moved from MediaDevicesRequest so we can use for in testing.
784         (WebCore::RealtimeMediaSourceCenter::captureDeviceWithUniqueID): Find a CaptureDevice given 
785         a unique ID and the process hash salt.
786         (WebCore::RealtimeMediaSourceCenter::setDeviceEnabled): Enable/disable a device. Used for
787         layout tests only.
788         (WebCore::RealtimeMediaSourceCenter::addDevicesChangedObserver): Add a devices changed listener.
789         (WebCore::RealtimeMediaSourceCenter::removeDevicesChangedObserver): Remove a listener.
790         (WebCore::RealtimeMediaSourceCenter::captureDevicesChanged): Notify listeners.
791         * platform/mediastream/RealtimeMediaSourceCenter.h:
792
793         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
794         (WebCore::AVCaptureDeviceManager::addDevicesChangedObserver): Update for change to captureDeviceFromDeviceID.
795
796         * platform/mock/MockRealtimeMediaSource.cpp:
797         (WebCore::MockRealtimeMediaSource::audioDevices): All devices are enabled by default.
798         (WebCore::MockRealtimeMediaSource::videoDevices): Ditto.
799
800         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
801         (WebCore::MockRealtimeMediaSourceCenter::createMediaStream): Drive-by cleanup: use the vector
802         of devices instead of making assumptions about the number.
803         (WebCore::MockRealtimeMediaSourceCenter::getMediaStreamDevices): Only include enabled devices.
804         (WebCore::MockRealtimeMediaSourceCenter::setDeviceEnabled): Enable or disable a device.
805         * platform/mock/MockRealtimeMediaSourceCenter.h:
806
807         * testing/Internals.cpp:
808         (WebCore::Internals::setMediaDeviceState): Enable or disable a mock capture device.
809         * testing/Internals.h:
810         * testing/Internals.idl:
811
812 2017-04-28  Alex Christensen  <achristensen@webkit.org>
813
814         Fix memory corruption issue after r215883.
815         https://bugs.webkit.org/show_bug.cgi?id=171365
816
817         Reviewed by Brady Eidson.
818
819         This fixes a crash when starting WebKit2.
820
821         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
822         (WebCore::NetworkStorageSession::NetworkStorageSession):
823         Initialize m_platformCookieStorage with the default constructor of RetainPtr,
824         then call NetworkStorageSession::cookieStorage which checks m_platformCookieStorage
825         for null.  It was checking uninitialized memory when we had m_platformCookieStorage
826         in the initializer list.
827
828 2017-04-28  Joanmarie Diggs  <jdiggs@igalia.com>
829
830         AX: Implement aria-value support for focusable separators
831         https://bugs.webkit.org/show_bug.cgi?id=171169
832
833         Reviewed by Chris Fleizach.
834
835         Add SplitterRole to the roles which support range value and are considered a range
836         control, as long as the SplitterRole element is focusable. Also replace ATK's role-
837         based check with a call to supportsRangeValue() when determining if the AtkValue
838         interface should be implemented.
839
840         Test: accessibility/separator-values.html
841
842         * accessibility/AccessibilityObject.cpp:
843         (WebCore::AccessibilityObject::isRangeControl):
844         (WebCore::AccessibilityObject::supportsRangeValue):
845         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
846         (getInterfaceMaskFromObject):
847
848 2017-04-28  Joanmarie Diggs  <jdiggs@igalia.com>
849
850         [ATK] GridCellRole should implement AtkTableCell (regression?)
851         https://bugs.webkit.org/show_bug.cgi?id=171179
852
853         Reviewed by Chris Fleizach.
854
855         Add GridCellRole to the group of roles which should implement AtkTableCell.
856
857         Test: accessibility/gtk/interface-table-cell.html
858
859         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
860         (getInterfaceMaskFromObject):
861
862 2017-04-28  Miguel Gomez  <magomez@igalia.com>
863
864         REGRESSION(r215211): [GTK] Several webgl related tests are failing
865         https://bugs.webkit.org/show_bug.cgi?id=170730
866
867         Reviewed by Said Abou-Hallawa.
868
869         There is a wrong situation in the image decoders where the complete data has been assigned
870         to them but the size of the image hasn't been decoded yet. This is causing rendering
871         issues in webgl when decoding the images used as textures. To fix this, we refactor how the
872         encoded data status is stored to avoid that situation: the status is handled completely
873         by ImageDecoder.h, and it's the one forcing the decode of the size when data gets assigned
874         to the decoders.
875
876         Covered by existent tests.
877
878         * platform/image-decoders/ImageDecoder.h:
879         (WebCore::ImageDecoder::isAllDataReceived):
880         (WebCore::ImageDecoder::setData):
881         (WebCore::ImageDecoder::encodedDataStatus):
882         (WebCore::ImageDecoder::isSizeAvailable):
883         (WebCore::ImageDecoder::setSize):
884         (WebCore::ImageDecoder::setFailed):
885         (WebCore::ImageDecoder::failed):
886         * platform/image-decoders/bmp/BMPImageDecoder.cpp:
887         (WebCore::BMPImageDecoder::frameBufferAtIndex):
888         (WebCore::BMPImageDecoder::decode):
889         (WebCore::BMPImageDecoder::encodedDataStatus): Deleted.
890         * platform/image-decoders/bmp/BMPImageDecoder.h:
891         * platform/image-decoders/gif/GIFImageDecoder.cpp:
892         (WebCore::GIFImageDecoder::frameCount):
893         (WebCore::GIFImageDecoder::frameBufferAtIndex):
894         (WebCore::GIFImageDecoder::decode):
895         (WebCore::GIFImageDecoder::encodedDataStatus): Deleted.
896         * platform/image-decoders/gif/GIFImageDecoder.h:
897         * platform/image-decoders/ico/ICOImageDecoder.cpp:
898         (WebCore::ICOImageDecoder::setData):
899         (WebCore::ICOImageDecoder::frameCount):
900         (WebCore::ICOImageDecoder::frameBufferAtIndex):
901         (WebCore::ICOImageDecoder::setDataForPNGDecoderAtIndex):
902         (WebCore::ICOImageDecoder::decode):
903         (WebCore::ICOImageDecoder::decodeAtIndex):
904         (WebCore::ICOImageDecoder::encodedDataStatus): Deleted.
905         * platform/image-decoders/ico/ICOImageDecoder.h:
906         * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
907         (WebCore::JPEGImageDecoder::frameBufferAtIndex):
908         (WebCore::JPEGImageDecoder::decode):
909         (WebCore::JPEGImageDecoder::encodedDataStatus): Deleted.
910         * platform/image-decoders/jpeg/JPEGImageDecoder.h:
911         * platform/image-decoders/png/PNGImageDecoder.cpp:
912         (WebCore::PNGImageDecoder::frameBufferAtIndex):
913         (WebCore::PNGImageDecoder::decode):
914         (WebCore::PNGImageDecoder::encodedDataStatus): Deleted.
915         * platform/image-decoders/png/PNGImageDecoder.h:
916         * platform/image-decoders/webp/WEBPImageDecoder.cpp:
917         (WebCore::WEBPImageDecoder::frameBufferAtIndex):
918         (WebCore::WEBPImageDecoder::decode):
919         (WebCore::WEBPImageDecoder::encodedDataStatus): Deleted.
920         * platform/image-decoders/webp/WEBPImageDecoder.h:
921
922 2017-04-27  Carlos Garcia Campos  <cgarcia@igalia.com>
923
924         Move UUID from WebCore/platform to WTF
925         https://bugs.webkit.org/show_bug.cgi?id=171372
926
927         Reviewed by Michael Catanzaro.
928
929         UUID only contains createCanonicalUUIDString() that is platform independent and doesn't depend on anything from
930         WebCore, only from WTF.
931
932         * CMakeLists.txt:
933         * Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp:
934         * Modules/mediacontrols/MediaControlsHost.cpp:
935         * Modules/mediastream/RTCPeerConnection.cpp:
936         * Modules/webaudio/MediaStreamAudioSource.cpp:
937         * Modules/webdatabase/DatabaseTracker.cpp:
938         * WebCore.order:
939         * WebCore.xcodeproj/project.pbxproj:
940         * editing/mac/EditorMac.mm:
941         * fileapi/BlobURL.cpp:
942         * loader/appcache/ApplicationCacheHost.cpp:
943         * loader/appcache/ApplicationCacheStorage.cpp:
944         * platform/URL.cpp:
945         * platform/glib/FileSystemGlib.cpp:
946         * platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp:
947         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
948         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
949         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
950         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
951         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
952         * platform/mediastream/CaptureDeviceManager.cpp:
953         * platform/mediastream/MediaStreamPrivate.h:
954         * platform/mediastream/MediaStreamTrackPrivate.cpp:
955         * platform/mediastream/RealtimeMediaSource.cpp:
956         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
957         * platform/mediastream/mac/AVMediaCaptureSource.mm:
958         * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp:
959         * platform/mock/MockRealtimeAudioSource.cpp:
960         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
961         * platform/mock/MockRealtimeVideoSource.cpp:
962         * testing/MockCDMFactory.cpp:
963
964 2017-04-27  Alex Christensen  <achristensen@webkit.org>
965
966         Make navigation policy checking more robust
967         https://bugs.webkit.org/show_bug.cgi?id=171409
968         <rdar://problem/31489248>
969
970         Reviewed by Geoffrey Garen.
971
972         No change in behavior.  Just added a protectedThis to a lambda and made the functions non-copyable.
973
974         * loader/DocumentLoader.cpp:
975         (WebCore::DocumentLoader::willSendRequest):
976         * loader/PolicyCallback.cpp:
977         (WebCore::PolicyCallback::set):
978         (WebCore::PolicyCallback::clear): Deleted.
979         * loader/PolicyCallback.h:
980         * loader/PolicyChecker.cpp:
981         (WebCore::PolicyChecker::cancelCheck):
982         (WebCore::PolicyChecker::stopCheck):
983         (WebCore::PolicyChecker::continueAfterNavigationPolicy):
984         (WebCore::PolicyChecker::continueAfterNewWindowPolicy):
985         (WebCore::PolicyChecker::continueAfterContentPolicy):
986
987 2017-04-27  Wenson Hsieh  <wenson_hsieh@apple.com>
988
989         Data interaction should not load pasteboard content before performing the data operation
990         https://bugs.webkit.org/show_bug.cgi?id=171414
991         <rdar://problem/31878197>
992
993         Reviewed by Tim Horton.
994
995         When interacting with a link, we should not try to fetch pasteboard contents for the URL UTI type before
996         performing the data operation. Teaches DragController to know whether it is allowed to load data from the
997         dragging pasteboard, and uses this information in DragController::dragOperation to determine whether to use
998         DragData::containsURLTypeIdentifier or DragData::containsURL.
999
1000         * page/DragController.cpp:
1001         (WebCore::DragController::DragController):
1002         (WebCore::DragController::performDragOperation):
1003         * page/DragController.h:
1004         (WebCore::DragController::canLoadDataFromDraggingPasteboard):
1005         * page/mac/DragControllerMac.mm:
1006         (WebCore::DragController::dragOperation):
1007         * platform/DragData.h:
1008         * platform/ios/WebItemProviderPasteboard.mm:
1009         (-[WebItemProviderPasteboard _preLoadedDataConformingToType:forItemProviderAtIndex:]):
1010         * platform/mac/DragDataMac.mm:
1011         (WebCore::DragData::containsURLTypeIdentifier):
1012
1013 2017-04-27  Joseph Pecoraro  <pecoraro@apple.com>
1014
1015         Support for promise rejection events (unhandledrejection)
1016         https://bugs.webkit.org/show_bug.cgi?id=150358
1017         <rdar://problem/28441651>
1018
1019         Reviewed by Saam Barati.
1020
1021         Patch by Joseph Pecoraro and Yusuke Suzuki.
1022
1023         Implement support for the `onunhandledrejection` and `rejectionhandled` events.
1024         They dispatch a new PromiseRejectionEvent using the ES6 HostPromiseRejectionTracker hook:
1025         https://tc39.github.io/ecma262/#sec-host-promise-rejection-tracker
1026         https://html.spec.whatwg.org/multipage/webappapis.html#unhandled-promise-rejections
1027
1028         This is currently implemented only for Documents and not yet Web Workers.
1029
1030         Tests: js/dom/unhandled-promise-rejection-basic.html
1031                js/dom/unhandled-promise-rejection-bindings-type-error.html
1032                js/dom/unhandled-promise-rejection-console-no-report.html
1033                js/dom/unhandled-promise-rejection-console-report.html
1034                js/dom/unhandled-promise-rejection-handle-during-event.html
1035                js/dom/unhandled-promise-rejection-handle-in-handler.html
1036                js/dom/unhandled-promise-rejection-handle.html
1037                js/dom/unhandled-promise-rejection-order.html
1038
1039         * CMakeLists.txt:
1040         * DerivedSources.cpp:
1041         * DerivedSources.make:
1042         * WebCore.xcodeproj/project.pbxproj:
1043         * dom/DOMAllInOne.cpp:
1044         New files.
1045
1046         * bindings/scripts/CodeGenerator.pm:
1047         (IsPromiseType):
1048         * bindings/scripts/CodeGeneratorJS.pm:
1049         (AddToIncludesForIDLType):
1050         (GetBaseIDLType):
1051         Binding support for Promise<T> attributes.
1052
1053         * bindings/js/JSDOMConvert.h:
1054         * bindings/js/JSDOMConvertPromise.h: Copied from Source/JavaScriptCore/runtime/JSPromise.h.
1055         (WebCore::Converter<IDLPromise<T>>::convert):
1056         (WebCore::JSConverter<IDLPromise<T>>::convert):
1057         Promise<T> binding conversion is currently unimplemented, which only means
1058         web developers creating their own PromiseRejectionEvent will not get
1059         autowrapping of values assigned to `promise` in event initialization.
1060         Engine generated events will have expected behavior.
1061
1062         * bindings/js/JSDOMWindowBase.cpp:
1063         (WebCore::JSDOMWindowBase::promiseRejectionTracker):
1064         * bindings/js/JSDOMWindowBase.h:
1065         * bindings/js/JSWorkerGlobalScopeBase.cpp:
1066         Implement HostPromiseRejectionTracker hook for Document but not Worker.
1067         Passes through to the ScriptExecutionContext's tracker.
1068
1069         * bindings/js/JSMainThreadExecState.cpp:
1070         (WebCore::JSMainThreadExecState::didLeaveScriptContext):
1071         * bindings/js/JSMainThreadExecState.h:
1072         (WebCore::JSMainThreadExecState::~JSMainThreadExecState):
1073         When completing script execution and performing microtasks notify
1074         about rejected promises. Technically this should go inside of
1075         performing a microtask checkpoint, except lacking EventLoop
1076         concepts we use ScriptExecutionState.
1077
1078         * dom/EventNames.h:
1079         * dom/EventNames.in:
1080         * dom/PromiseRejectionEvent.cpp: Added.
1081         (WebCore::PromiseRejectionEvent::PromiseRejectionEvent):
1082         (WebCore::PromiseRejectionEvent::~PromiseRejectionEvent):
1083         * dom/PromiseRejectionEvent.h: Added.
1084         * dom/PromiseRejectionEvent.idl: Added.
1085         New PromiseRejectionEvent event interface.
1086
1087         * dom/GlobalEventHandlers.idl:
1088         New onunhandledrejection and onrejectionhandled.
1089
1090         * dom/RejectedPromiseTracker.cpp: Added.
1091         (WebCore::RejectedPromise::RejectedPromise):
1092         (WebCore::RejectedPromise::globalObject):
1093         (WebCore::RejectedPromise::promise):
1094         (WebCore::UnhandledPromise::UnhandledPromise):
1095         (WebCore::UnhandledPromise::callStack):
1096         (WebCore::RejectedPromiseTracker::RejectedPromiseTracker):
1097         (WebCore::RejectedPromiseTracker::~RejectedPromiseTracker):
1098         (WebCore::createScriptCallStackFromReason):
1099         (WebCore::RejectedPromiseTracker::promiseRejected):
1100         (WebCore::RejectedPromiseTracker::promiseHandled):
1101         (WebCore::RejectedPromiseTracker::processQueueSoon):
1102         (WebCore::RejectedPromiseTracker::reportUnhandledRejections):
1103         (WebCore::RejectedPromiseTracker::reportRejectionHandled):
1104         * dom/RejectedPromiseTracker.h: Added.
1105         Track and report rejected promises. The promises are tracked weakly
1106         allowing them to be collected before they are reported. When reporting
1107         we dispatch PromiseRejectionEvent events, and if the default is not
1108         prevented we log a message to the console.
1109
1110         * dom/ScriptExecutionContext.cpp:
1111         (WebCore::ScriptExecutionContext::reportUnhandledPromiseRejection):
1112         (WebCore::ScriptExecutionContext::ensureRejectedPromiseTrackerSlow):
1113         * dom/ScriptExecutionContext.h:
1114         (WebCore::ScriptExecutionContext::ensureRejectedPromiseTracker):
1115         Each ScriptExecutionContext can own a rejected promise tracker.
1116
1117         * html/HTMLMediaElement.cpp:
1118         (WebCore::HTMLMediaElement::pauseInternal):
1119         https://html.spec.whatwg.org/multipage/embedded-content.html#internal-pause-steps
1120         Internal pause steps say to timeupdate, pause, and rejecting pending play promises
1121         should all happen in a queued task. Here the first two actions are already scheduled
1122         on tasks, but rejecting play promises was not being done in a task, so this makes
1123         that change.
1124
1125         * Modules/streams/ReadableStream.js:
1126         (pipeThrough):
1127         * Modules/streams/ReadableStreamInternals.js:
1128         (readableStreamReaderGenericInitialize):
1129         (readableStreamError):
1130         (readableStreamReaderGenericRelease):
1131         Satisfy parts of the Streams specification which state to set the
1132         [[PromiseIsHandled]] internal state of promises created internally
1133         by the Streams APIs. This prevents some internal promises from
1134         appearing as unhandled promise rejections.
1135
1136 2017-04-27  Chris Dumez  <cdumez@apple.com>
1137
1138         Align colspan/rowspan limits with the latest HTML specification
1139         https://bugs.webkit.org/show_bug.cgi?id=171322
1140
1141         Reviewed by Darin Adler.
1142
1143         Align colspan/rowspan limits with the latest HTML specification after:
1144         - https://github.com/whatwg/html/pull/1993
1145
1146         The following changes were made:
1147         - Our rowspan limit was raised from 8190 to 65534
1148         - A colspan limit of 1000 was introduced. Blink has UseCounter data showing that
1149           colspans over 1000 are extremely rare and Gecko has data showing that when we
1150           get a colspan greater than 1000, it is usually a bug. Therefore, this change
1151           should be fine.
1152         - The limits are now properly reflected via the IDL attributes instead of lying
1153           to the Web about the colspan / rowspan we are using internally.
1154
1155         Test: imported/w3c/web-platform-tests/html/semantics/tabular-data/processing-model-1/span-limits.html
1156
1157         * html/HTMLTableCellElement.cpp:
1158         (WebCore::HTMLTableCellElement::colSpan):
1159         (WebCore::HTMLTableCellElement::rowSpan):
1160         (WebCore::HTMLTableCellElement::rowSpanForBindings):
1161         (WebCore::HTMLTableCellElement::setColSpan):
1162         * html/HTMLTableCellElement.h:
1163         * html/HTMLTableCellElement.idl:
1164         * html/parser/HTMLParserIdioms.cpp:
1165         (WebCore::parseHTMLIntegerInternal):
1166         (WebCore::parseHTMLInteger):
1167         (WebCore::parseHTMLNonNegativeInteger):
1168         (WebCore::parseValidHTMLNonNegativeIntegerInternal):
1169         (WebCore::parseHTTPRefreshInternal):
1170         * html/parser/HTMLParserIdioms.h:
1171         (WebCore::parseHTMLInteger):
1172         (WebCore::parseHTMLNonNegativeInteger):
1173
1174         (WebCore::clampHTMLNonNegativeIntegerToRange):
1175         Add utility function to implement:
1176         - https://html.spec.whatwg.org/#clamped-to-the-range
1177
1178 2017-04-27  Wenson Hsieh  <wenson_hsieh@apple.com>
1179
1180         WKUIDelegatePrivate needs a hook to vend data used to initialize item providers for data interaction
1181         https://bugs.webkit.org/show_bug.cgi?id=171386
1182         <rdar://problem/31557237>
1183
1184         Reviewed by Beth Dakin.
1185
1186         Teach WebItemProviderPasteboard to remember what WebItemProviderRegistrationInfoList it was initialized with
1187         when beginning a drag. This information is cleared out the next time the list of item providers is set to
1188         something different, which happens when the data interaction session concludes.
1189
1190         * platform/ios/WebItemProviderPasteboard.h:
1191         * platform/ios/WebItemProviderPasteboard.mm:
1192         (-[WebItemProviderPasteboard init]):
1193         (-[WebItemProviderPasteboard setItemProviders:]):
1194         (-[WebItemProviderPasteboard setItemsUsingRegistrationInfoLists:]):
1195         (-[WebItemProviderPasteboard registrationInfoAtIndex:]):
1196         (-[WebItemProviderPasteboard itemProviderAtIndex:]):
1197
1198 2017-04-27  Brady Eidson  <beidson@apple.com>
1199
1200         Refactor SessionID to support multiple non-ephemeral (persistent) sessions.
1201         https://bugs.webkit.org/show_bug.cgi?id=171367
1202
1203         Reviewed by Andy Estes.
1204
1205         This is also a nice general cleanup of SessionID, including privatizing the "arbitrary number" constructor
1206         and moving encode/decode into the class.
1207
1208         No new tests (Refactor, no behavior change yet).
1209
1210         * CMakeLists.txt:
1211         * WebCore.xcodeproj/project.pbxproj:
1212         
1213         * page/SessionID.cpp: Added.
1214         (WebCore::SessionID::generatePersistentSessionID):
1215         (WebCore::SessionID::generateEphemeralSessionID):
1216         (WebCore::SessionID::enableGenerationProtection):
1217         
1218         * page/SessionID.h:
1219         (WebCore::SessionID::SessionID):
1220         (WebCore::SessionID::emptySessionID):
1221         (WebCore::SessionID::hashTableDeletedValue):
1222         (WebCore::SessionID::defaultSessionID):
1223         (WebCore::SessionID::legacyPrivateSessionID):
1224         (WebCore::SessionID::isValid):
1225         (WebCore::SessionID::isEphemeral):
1226         (WebCore::SessionID::encode):
1227         (WebCore::SessionID::decode):
1228         (WTF::HashTraits<WebCore::SessionID>::constructDeletedValue):
1229         (WTF::HashTraits<WebCore::SessionID>::isDeletedValue):
1230
1231 2017-04-27  Said Abou-Hallawa  <sabouhallawa@apple.com>
1232
1233         Attempt to fix a PLT regression on Mac
1234         <rdar://problem/31826998>
1235
1236         Unreviewed.
1237
1238         Disable passing the TypeIdentifierHint to CGImageSourceCreateIncremental()
1239         on Mac for now.
1240
1241         * platform/graphics/cg/ImageDecoderCG.cpp:
1242         (WebCore::ImageDecoder::ImageDecoder):
1243
1244 2017-04-27  Daniel Bates  <dabates@apple.com>
1245
1246         Rename callerDOMWindow()/CallerDocument to incumbentDOMWindow()/IncumbentDocument
1247         https://bugs.webkit.org/show_bug.cgi?id=171145
1248
1249         Reviewed by Saam Barati.
1250
1251         Standardize on the terminology "incumbent" to refer to "most-recently-entered author
1252         function or script on the stack, or the author function or script that originally
1253         scheduled the currently-running callback" (1).
1254
1255         [1] <https://html.spec.whatwg.org/multipage/webappapis.html#realms-settings-objects-global-objects> (27 April 2017)
1256
1257         * bindings/js/JSDOMWindowBase.cpp:
1258         (WebCore::incumbentDOMWindow):
1259         (WebCore::callerDOMWindow): Deleted.
1260         * bindings/js/JSDOMWindowBase.h:
1261         * bindings/scripts/CodeGeneratorJS.pm:
1262         (GenerateCallWith):
1263         * bindings/scripts/test/JS/JSTestObj.cpp:
1264         (WebCore::jsTestObjPrototypeFunctionWithCallerDocumentArgumentCaller):
1265         (WebCore::jsTestObjPrototypeFunctionWithCallerWindowArgumentCaller):
1266         * bindings/scripts/test/TestObj.idl:
1267         * page/DOMWindow.idl:
1268
1269 2017-04-27  Youenn Fablet  <youenn@apple.com>
1270
1271         LayoutTest webrtc/datachannel/datachannel-event.html is a flaky crash
1272         https://bugs.webkit.org/show_bug.cgi?id=171092
1273         <rdar://problem/31748066>
1274
1275         Reviewed by Eric Carlson.
1276
1277         Covered by manual testing on iterating on the crashing tests.
1278         With the patch, they appear to no longer crash.
1279
1280         The current RTCPeerConnection/RTCController was expecting that peer connections would be stopped before the controller.
1281         This assumption is sometimes wrong.
1282         Adding clean-up on both sides so that if controller goes away, it notifies its peer connections that they are unregistered.
1283
1284         * Modules/mediastream/RTCController.cpp:
1285         (WebCore::RTCController::~RTCController):
1286         * Modules/mediastream/RTCController.h:
1287         * Modules/mediastream/RTCPeerConnection.cpp:
1288         (WebCore::RTCPeerConnection::create):
1289         (WebCore::RTCPeerConnection::~RTCPeerConnection):
1290         (WebCore::RTCPeerConnection::doStop):
1291         (WebCore::RTCPeerConnection::registerToController):
1292         (WebCore::RTCPeerConnection::unregisterFromController):
1293         (WebCore::RTCPeerConnection::rtcController): Deleted.
1294         * Modules/mediastream/RTCPeerConnection.h:
1295
1296 2017-04-27  Said Abou-Hallawa  <sabouhallawa@apple.com>
1297
1298         REGRESSION(r213764): Async decoding of animated images is disabled for ImageDocument
1299         https://bugs.webkit.org/show_bug.cgi?id=170333
1300
1301         Reviewed by Simon Fraser.
1302
1303         The way the image drawing settings are transfered from the Settings to
1304         BitmapImage is problematic. The drawing settings are retrieved from the
1305         CachedImageObserver which store them in the constructor only if the
1306         CachedImage as a loader. In the case of ImageDocument, there isn't loader
1307         set in CachedImage so the settings of ImageDocument are not set. Also
1308         the CachedImage can be used after loading by another document which may
1309         have a different drawing settings.
1310
1311         The fix is to make BitmapImage reads the drawing settings every time it 
1312         is drawn as a foreground or background image in a RenderElement.
1313
1314         * html/canvas/CanvasRenderingContext2D.cpp:
1315         (WebCore::CanvasRenderingContext2D::drawImage):
1316         * loader/cache/CachedImage.cpp:
1317         (WebCore::CachedImage::CachedImageObserver::CachedImageObserver):
1318         * loader/cache/CachedImage.h:
1319         * platform/graphics/BitmapImage.cpp:
1320         (WebCore::BitmapImage::setDrawingSettings):
1321         (WebCore::BitmapImage::draw):
1322         (WebCore::BitmapImage::shouldUseAsyncDecodingForLargeImages): I was
1323         trying to disable the async image decoding temporarily but this way will
1324         even prevent testing it until it is enabled. Disable it through WK1 and
1325         WK2 preferences.
1326         (WebCore::BitmapImage::shouldUseAsyncDecodingForAnimatedImages):
1327         (WebCore::BitmapImage::advanceAnimation):
1328         * platform/graphics/BitmapImage.h:
1329         * platform/graphics/ImageObserver.h:
1330         * rendering/RenderBoxModelObject.cpp:
1331         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
1332         * rendering/RenderImage.cpp:
1333         (WebCore::RenderImage::paintIntoRect):
1334
1335 2017-04-27  Wenson Hsieh  <wenson_hsieh@apple.com>
1336
1337         Performing data interaction with plain text into a contenteditable does not insert any content
1338         https://bugs.webkit.org/show_bug.cgi?id=171381
1339
1340         Reviewed by Tim Horton.
1341
1342         Attempt to read plain-text-conformant UTI types as kUTTypePlainText before reading them as kUTTypeText.
1343         This allows WebItemProviderPasteboard to properly materialize an NSString in -valuesForPasteboardType:
1344         inItemSet: using a pre-loaded NSData blob.
1345
1346         This scenario is covered by DataInteractionTests.ExternalSourceUTF8PlainTextOnly, but DataInteractionTests
1347         are temporarily disabled due to incompatibilities with the current internal SDK.
1348
1349         * platform/ios/PasteboardIOS.mm:
1350         (WebCore::readPasteboardWebContentDataForType):
1351
1352 2017-04-27  Chris Dumez  <cdumez@apple.com>
1353
1354         Element.getBoundingClientRect() / getClientRects() should return a DOMRect types
1355         https://bugs.webkit.org/show_bug.cgi?id=171226
1356
1357         Reviewed by Simon Fraser.
1358
1359         Element.getBoundingClientRect() / getClientRects() should return a DOMRect types
1360         as per:
1361         - https://drafts.csswg.org/cssom-view/#extension-to-the-element-interface
1362
1363         DOMRect is compatible with ClientRect, which we used to return so the risk should
1364         be low.
1365
1366         Tests: fast/css/DOMRect-attributes-prototype.html
1367                fast/css/DOMRect-serialization.html
1368                fast/dom/Element/getClientRects-return-type.html
1369
1370         * dom/ClientRectList.cpp:
1371         (WebCore::ClientRectList::ClientRectList):
1372         * dom/ClientRectList.h:
1373         (WebCore::ClientRectList::create):
1374         * dom/DOMRect.h:
1375         (WebCore::DOMRect::create):
1376         * dom/DOMRectReadOnly.h:
1377         * dom/Element.cpp:
1378         (WebCore::toDOMRectVector):
1379         (WebCore::Element::getClientRects):
1380         (WebCore::Element::getBoundingClientRect):
1381         * dom/Element.h:
1382         * dom/Element.idl:
1383         * html/track/VTTRegion.cpp:
1384         (WebCore::VTTRegion::displayLastTextTrackCueBox):
1385
1386 2017-04-27  Joanmarie Diggs  <jdiggs@igalia.com>
1387
1388         AX: Expose elements with the ARIA "feed" role
1389         https://bugs.webkit.org/show_bug.cgi?id=171184
1390
1391         Reviewed by Chris Fleizach.
1392
1393         Map elements with the "feed" role to the internal ApplicationGroupRole
1394         AccessibilityRole. This prevents them from being unexpectedly pruned from
1395         the accessibility tree, and causes them to be exposed with ATK_ROLE_PANEL
1396         in WebKitGtk and AXGroup in Safari.
1397
1398         No new tests needed. Instead, add the "feed" role to roles-exposed.html,
1399         xml-roles-exposed.html, and roles-computedRoleString.html.
1400
1401         * accessibility/AccessibilityObject.cpp:
1402         (WebCore::initializeRoleMap):
1403
1404 2017-04-27  Brady Eidson  <beidson@apple.com>
1405
1406         Update NetworkStorageSession to support multiple persistent sessions and explicitly set cookie storages.
1407         https://bugs.webkit.org/show_bug.cgi?id=171365
1408
1409         Reviewed by Andy Estes.
1410
1411         No new tests (No testable behavior change yet).
1412
1413         * platform/network/NetworkStorageSession.cpp:
1414         (WebCore::NetworkStorageSession::destroySession):
1415         * platform/network/NetworkStorageSession.h:
1416         
1417         * platform/network/NetworkStorageSessionStub.cpp:
1418         (WebCore::NetworkStorageSession::ensurePrivateBrowsingSession):
1419         (WebCore::NetworkStorageSession::ensureSession):
1420         
1421         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
1422         (WebCore::createCFStorageSessionForIdentifier):
1423         (WebCore::NetworkStorageSession::NetworkStorageSession):
1424         (WebCore::NetworkStorageSession::switchToNewTestingSession):
1425         (WebCore::NetworkStorageSession::defaultStorageSession):
1426         (WebCore::NetworkStorageSession::ensurePrivateBrowsingSession):
1427         (WebCore::NetworkStorageSession::ensureSession):
1428         (WebCore::NetworkStorageSession::cookieStorage):
1429         
1430         * platform/network/soup/NetworkStorageSessionSoup.cpp:
1431         (WebCore::NetworkStorageSession::ensureSession):
1432         
1433         * platform/spi/cf/CFNetworkSPI.h:
1434
1435 2017-04-27  Zalan Bujtas  <zalan@apple.com>
1436
1437         Use text-shadow to visualize simple line layout coverage.
1438         https://bugs.webkit.org/show_bug.cgi?id=171379
1439
1440         Reviewed by Antti Koivisto.
1441
1442         It's more subtle (for everyday use).
1443
1444         * rendering/SimpleLineLayoutFunctions.cpp:
1445         (WebCore::SimpleLineLayout::paintFlow):
1446         (WebCore::SimpleLineLayout::paintDebugBorders): Deleted.
1447
1448 2017-04-27  Joanmarie Diggs  <jdiggs@igalia.com>
1449
1450         [ATK] ARIA alertdialogs should be exposed with ROLE_DIALOG
1451         https://bugs.webkit.org/show_bug.cgi?id=171187
1452
1453         Reviewed by Chris Fleizach.
1454
1455         Map ApplicationAlertDialogRole to ATK_ROLE_DIALOG. While ATK_ROLE_ALERT is
1456         appropriate as far as ATK is concerned, the Core Accessibility API Mappings
1457         map ARIA's alertdialog role to ATK_ROLE_DIALOG. We should be consistent
1458         with the spec. The fact that this is an alert dialog can still be obtained
1459         via the AtkObject attributes.
1460
1461         No new tests needed. Update the expectations for roles-exposed.html,
1462         xml-roles-exposed.html, and aria-mappings.html to reflect the change.
1463
1464         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
1465         (atkRole):
1466
1467 2017-04-27  Antti Koivisto  <antti@apple.com>
1468
1469         Repeated layouts in Mail due to viewport units being used with auto-sizing
1470         https://bugs.webkit.org/show_bug.cgi?id=171371
1471         <rdar://problem/28780084>
1472
1473         Reviewed by Zalan Bujtas.
1474
1475         Test: css3/viewport-percentage-lengths/vh-auto-size.html
1476
1477         Auto-sizing code would adjust the size of the view in the beginning of layout(). This would
1478         end up invalidating style for elements that use vh units and we would perform main layout
1479         with unclean style. This would result in endless layout loops and hit assert on debug.
1480
1481         * page/FrameView.cpp:
1482         (WebCore::FrameView::availableContentSizeChanged):
1483
1484             Ensure we heve clean style after resize if we are in pre-layout.
1485
1486 2017-04-27  Alex Christensen  <achristensen@webkit.org>
1487
1488         Modernize Frame.h
1489         https://bugs.webkit.org/show_bug.cgi?id=171357
1490
1491         Reviewed by Andy Estes.
1492
1493         Frame.h has several std::unique_ptrs that are created in the constructor, never null,
1494         and destroyed in the destructor.  This is what WTF::UniqueRef is for, and using UniqueRef
1495         allows us to not check for null values because a UniqueRef can never be null.
1496         An interesting case was the EventHandler, which we explicitly set to nullptr in the destructor
1497         of MainFrame, a subclass of Frame.  We added this in r199181 to fix a crash tested by
1498         fast/events/wheel-event-destroys-frame.html and this improved lifetime also does not crash
1499         or assert in that test.
1500
1501         Using UniqueRef also requires const correctness, which this patch adds when necessary.
1502
1503         * accessibility/AccessibilityObject.cpp:
1504         (WebCore::AccessibilityObject::dispatchTouchEvent):
1505         * editing/DeleteSelectionCommand.cpp:
1506         (WebCore::DeleteSelectionCommand::calculateTypingStyleAfterDelete):
1507         * editing/Editor.cpp:
1508         (WebCore::Editor::isSelectTrailingWhitespaceEnabled):
1509         (WebCore::Editor::computeAndSetTypingStyle):
1510         * editing/Editor.h:
1511         * editing/FrameSelection.cpp:
1512         (WebCore::FrameSelection::contains):
1513         (WebCore::FrameSelection::copyTypingStyle):
1514         * editing/FrameSelection.h:
1515         (WebCore::FrameSelection::setTypingStyle):
1516         * loader/EmptyClients.cpp:
1517         * loader/FrameLoader.cpp:
1518         (WebCore::FrameLoader::clear):
1519         * page/EditorClient.h:
1520         * page/EventHandler.cpp:
1521         (WebCore::EventHandler::hitTestResultAtPoint):
1522         * page/EventHandler.h:
1523         * page/Frame.cpp:
1524         (WebCore::Frame::Frame):
1525         (WebCore::Frame::setView):
1526         (WebCore::Frame::injectUserScripts):
1527         * page/Frame.h:
1528         (WebCore::Frame::editor):
1529         (WebCore::Frame::eventHandler):
1530         (WebCore::Frame::selection):
1531         (WebCore::Frame::animation):
1532         (WebCore::Frame::script):
1533         (WebCore::Frame::eventHandlerPtr): Deleted.
1534         * page/MainFrame.cpp:
1535         (WebCore::MainFrame::~MainFrame):
1536         * replay/UserInputBridge.cpp:
1537         (WebCore::UserInputBridge::handleContextMenuEvent):
1538         * replay/UserInputBridge.h:
1539
1540 2017-04-27  Andy Estes  <aestes@apple.com>
1541
1542         Fix the macOS build.
1543
1544         * platform/mac/WebPlaybackControlsManager.h:
1545
1546 2017-04-27  Zalan Bujtas  <zalan@apple.com>
1547
1548         Text gets cut off when bailing out of simple line layout with widows.
1549         https://bugs.webkit.org/show_bug.cgi?id=171370
1550         <rdar://problem/31563414>
1551
1552         Reviewed by Antti Koivisto.
1553
1554         Normal line layout requires an extra layout to handle widows. See RenderBlockFlow::relayoutToAvoidWidows. 
1555
1556         Test: fast/multicol/simple-line-layout-widows-when-switching-over-to-normal-line-layout.html
1557
1558         * rendering/RenderBlockFlow.cpp:
1559         (WebCore::RenderBlockFlow::ensureLineBoxes):
1560
1561 2017-04-27  Dean Jackson  <dino@apple.com>
1562
1563         Use the correct modern-media-controls
1564         https://bugs.webkit.org/show_bug.cgi?id=171358
1565
1566         Reviewed by Antoine Quint.
1567
1568         * WebCore.xcodeproj/project.pbxproj:
1569
1570 2017-04-26  Dan Bernstein  <mitz@apple.com>
1571
1572         Reverted r215774.
1573
1574         That change wasn’t doing what it was intended to do and was inappropriate for WebCore.
1575
1576         * WebCore.xcodeproj/project.pbxproj:
1577
1578 2017-04-26  Said Abou-Hallawa  <sabouhallawa@apple.com>
1579
1580         Attempt to fix a PLT regression.
1581         <rdar://problem/31826998>
1582
1583         Unreviewed.
1584
1585         Disable passing the TypeIdentifierHint to CGImageSourceCreateIncremental()
1586         on iOS for now.
1587
1588         * platform/graphics/cg/ImageDecoderCG.cpp:
1589         (WebCore::ImageDecoder::ImageDecoder):
1590
1591 2017-04-26  Joanmarie Diggs  <jdiggs@igalia.com>
1592
1593         [ATK] ARIA buttons which have a popup should be ATK_ROLE_PUSH_BUTTON; not ATK_ROLE_COMBO_BOX
1594         https://bugs.webkit.org/show_bug.cgi?id=171182
1595
1596         Reviewed by Chris Fleizach.
1597
1598         Test: accessibility/gtk/button-with-aria-haspopup-is-not-a-combobox.html
1599
1600         WebCore Accessibility assigns PopUpButtonRole to collapsed select elements,
1601         which the ATK code correctly maps to ATK_ROLE_COMBO_BOX. It turns out that
1602         WebCore Accessibility also maps the ARIA button role to PopUpButtonRole if
1603         it also has aria-haspopup. Add a check to atkRole() so that the latter case
1604         is mapped to ATK_ROLE_PUSH_BUTTON.
1605
1606         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
1607         (atkRole):
1608
1609 2017-04-26  Tim Horton  <timothy_horton@apple.com>
1610
1611         Should not drag x-apple-data-detectors links
1612         https://bugs.webkit.org/show_bug.cgi?id=171352
1613         <rdar://problem/31309081>
1614
1615         Reviewed by Beth Dakin.
1616
1617         Test: fast/events/do-not-drag-and-drop-data-detectors-link.html
1618
1619         These links are only meaningful in the context of the original document,
1620         so they should not be draggable.
1621
1622         * editing/cocoa/DataDetection.h:
1623         * editing/cocoa/DataDetection.mm:
1624         (WebCore::DataDetection::dataDetectorURLProtocol):
1625         (WebCore::DataDetection::isDataDetectorURL):
1626         * page/DragController.cpp:
1627         (WebCore::isDraggableLink):
1628         Disallow dragging of <a href="x-apple-data-detectors://..."> links.
1629
1630 2017-04-26  Tim Horton  <timothy_horton@apple.com>
1631
1632         Revert accidentally smushed commit.
1633
1634         * editing/cocoa/DataDetection.h:
1635         * editing/cocoa/DataDetection.mm:
1636         (WebCore::DataDetection::dataDetectorURLProtocol): Deleted.
1637         (WebCore::DataDetection::isDataDetectorURL): Deleted.
1638         * page/DragController.cpp:
1639         (WebCore::isDraggableLink):
1640         * platform/mac/DragImageMac.mm:
1641         (WebCore::createDragImageForLink):
1642
1643 2017-04-26  Alex Christensen  <achristensen@webkit.org>
1644
1645         REGRESSION (r215686): ASSERTION FAILED: data seen with webarchive/loading tests
1646         https://bugs.webkit.org/show_bug.cgi?id=171340
1647
1648         Reviewed by Brady Eidson.
1649
1650         This fixes a flaky assertion in webarchive/loading/missing-data.html
1651
1652         * platform/cf/SharedBufferCF.cpp:
1653         (WebCore::SharedBuffer::append):
1654         If there's no CFDataRef, there's no need to append data.
1655         This happens sometimes.
1656
1657 2017-04-26  Ryan Haddad  <ryanhaddad@apple.com>
1658
1659         Unreviewed, rolling out r215814.
1660
1661         The LayoutTest for this change is failing on ios-simulator and
1662         is flaky on macOS.
1663
1664         Reverted changeset:
1665
1666         "Response.blob() does not set the content-type based on the
1667         header value."
1668         https://bugs.webkit.org/show_bug.cgi?id=170849
1669         http://trac.webkit.org/changeset/215814
1670
1671 2017-04-26  Wenson Hsieh  <wenson_hsieh@apple.com>
1672
1673         WebItemProviderPasteboard should not synchronously load provided data
1674         https://bugs.webkit.org/show_bug.cgi?id=171341
1675         <rdar://problem/31614010>
1676
1677         Reviewed by Tim Horton.
1678
1679         Refactors WebItemProviderPasteboard to not require asynchronously loading item provider data. To accomplish this,
1680         we ensure that before performing data interaction, the UTI type that the data operation target should consume is
1681         propagated to the UI process prior to the web process receiving the signal from the UI process to begin the
1682         data operation itself. This information is sent via WebPlatformStrategies::updatePreferredTypeIdentifiers, a new
1683         pasteboard helper function.
1684
1685         * page/DragController.cpp:
1686         (WebCore::DragController::DragController):
1687         (WebCore::dragIsHandledByDocument):
1688         (WebCore::DragController::performDragOperation):
1689         (WebCore::DragController::dragEnteredOrUpdated):
1690         (WebCore::DragController::updatePreferredTypeIdentifiersForDragHandlingMethod):
1691         (WebCore::DragController::tryDocumentDrag):
1692
1693         Give DragHandlingMethod a richer representation of what type of action will be performed. DragController::
1694         updatePreferredTypeIdentifiersForDragHandlingMethod uses this to determine what kinds of UTIs are acceptable for
1695         the current drop session.
1696
1697         * page/DragController.h:
1698         (WebCore::DragController::documentIsHandlingNonDefaultDrag):
1699         * page/mac/DragControllerMac.mm:
1700         (WebCore::DragController::updatePreferredTypeIdentifiersForDragHandlingMethod):
1701
1702         Updates the data interaction pasteboard's list of preferred type identifiers it should load upon data operation.
1703
1704         * platform/DragData.h:
1705         * platform/PasteboardStrategy.h:
1706         * platform/PlatformPasteboard.h:
1707         * platform/ios/AbstractPasteboard.h:
1708         * platform/ios/PlatformPasteboardIOS.mm:
1709         (WebCore::PlatformPasteboard::updatePreferredTypeIdentifiers):
1710         * platform/ios/WebItemProviderPasteboard.mm:
1711
1712         Introduce _preferredTypeIdentifiers, which -doAfterLoadingProvidedContentIntoFileURLs: uses as a hint when
1713         determining which UTI to load for an item provider. In the absence of preferred type identifiers, the default
1714         behavior is to use the highest fidelity type adhering to "public.content".
1715
1716         (-[WebItemProviderPasteboard init]):
1717         (-[WebItemProviderPasteboard updatePreferredTypeIdentifiers:]):
1718         (-[WebItemProviderPasteboard setItemProviders:]):
1719         (-[WebItemProviderPasteboard dataForPasteboardType:inItemSet:]):
1720         (-[WebItemProviderPasteboard valuesForPasteboardType:inItemSet:]):
1721
1722         Remove calls to -createObjectOfClass: and -copyDataRepresentation:. Instead, rely solely on the loaded file URL
1723         to read and initialize data and objects from the pasteboard.
1724
1725         (-[WebItemProviderPasteboard doAfterLoadingProvidedContentIntoFileURLs:]):
1726         (-[WebItemProviderPasteboard _tryToCreateObjectOfClass:usingProvider:]): Deleted.
1727         * platform/mac/DragDataMac.mm:
1728         (WebCore::DragData::updatePreferredTypeIdentifiers):
1729
1730 2017-04-26  Joanmarie Diggs  <jdiggs@igalia.com>
1731
1732         [ATK] Elements with a defined, non-false value for aria-current should expose ATK_STATE_ACTIVE
1733         https://bugs.webkit.org/show_bug.cgi?id=171163
1734
1735         Reviewed by Chris Fleizach.
1736
1737         Add ATK_STATE_ACTIVE to the state set of elements which have a valid, non-false
1738         value for aria-current, expose the value of via the "current" AtkObject attribute,
1739         and emit state-change notifications when the value of aria-current changes from
1740         non-false to false, or vice versa.
1741
1742         Tests: accessibility/gtk/aria-current-changed-notification.html
1743                accessibility/gtk/aria-current.html
1744
1745         * accessibility/AXObjectCache.cpp:
1746         (WebCore::AXObjectCache::handleAttributeChanged):
1747         * accessibility/AXObjectCache.h:
1748         * accessibility/AccessibilityObject.cpp:
1749         (WebCore::AccessibilityObject::supportsARIACurrent):
1750         (WebCore::AccessibilityObject::ariaCurrentValue):
1751         * accessibility/AccessibilityObject.h:
1752         * accessibility/atk/AXObjectCacheAtk.cpp:
1753         (WebCore::AXObjectCache::postPlatformNotification):
1754         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
1755         (webkitAccessibleGetAttributes):
1756         (setAtkStateSetFromCoreObject):
1757         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1758         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]): Moved code returning
1759         string value for aria-current into AccessibilityObject:ariaCurrentValue().
1760
1761 2017-04-26  Wenson Hsieh  <wenson_hsieh@apple.com>
1762
1763         WebItemProviderPasteboard should fetch preloaded assets from disk when possible
1764         https://bugs.webkit.org/show_bug.cgi?id=171320
1765         <rdar://problem/31614010>
1766
1767         Reviewed by Tim Horton.
1768
1769         Adds a mechanism to WebItemProviderPasteboard to remember the temporary file URLs of assets it has loaded using
1770         doAfterLoadingProvidedContentIntoFileURLs:. When retrieving data from the pasteboard, we then see if we can
1771         first fetch serialized data straight from disk instead of having to go through the item provider in both
1772         -dataForPasteboardType:inItemSet: and -valuesForPasteboardType:inItemSet:.
1773
1774         See below annotations for more detail.
1775
1776         * platform/ios/AbstractPasteboard.h:
1777         * platform/ios/PlatformPasteboardIOS.mm:
1778         (WebCore::PlatformPasteboard::filenamesForDataInteraction):
1779         * platform/ios/WebItemProviderPasteboard.h:
1780         * platform/ios/WebItemProviderPasteboard.mm:
1781
1782         Introduces _typeToFileURLMaps, an array of dictionaries. A dictionary at the ith index of this array represents
1783         a mapping of UTIs to loaded temo file URLs for the ith UIItemProvider in the _itemProviders array. Before data
1784         interaction is performed, all entries in this array will be empty.
1785
1786         (-[WebItemProviderPasteboard init]):
1787         (-[WebItemProviderPasteboard setItemProviders:]):
1788         (-[WebItemProviderPasteboard _preLoadedDataConformingToType:forItemProviderAtIndex:]):
1789         (-[WebItemProviderPasteboard dataForPasteboardType:inItemSet:]):
1790         (-[WebItemProviderPasteboard valuesForPasteboardType:inItemSet:]):
1791
1792         Consult any loaded assets on disk before hitting UIItemProviders via the new
1793         -_preLoadedDataConformingToType:forItemProviderAtIndex: helper method.
1794
1795         (-[WebItemProviderPasteboard _tryToCreateObjectOfClass:usingProvider:]):
1796         (-[WebItemProviderPasteboard fileURLsForDataInteraction]):
1797
1798         Traverse _typeToFileURLMaps to collect all file URLs.
1799
1800         (-[WebItemProviderPasteboard doAfterLoadingProvidedContentIntoFileURLs:]):
1801
1802         Refactored to populate and set _typeToFileURLMaps when loading completes, rather than an array of file URLs.
1803
1804         (-[WebItemProviderPasteboard _tryToCreateAndAppendObjectOfClass:toArray:usingProvider:]): Deleted.
1805         (-[WebItemProviderPasteboard filenamesForDataInteraction]): Deleted.
1806
1807         Correct an erroneously named method (replaces filenames with fileURLs).
1808
1809 2017-04-26  Youenn Fablet  <youenn@apple.com>
1810
1811         LayoutTest webrtc/datachannel/basic.html is a flaky crash
1812         https://bugs.webkit.org/show_bug.cgi?id=170154
1813         <rdar://problem/31288423>
1814
1815         Reviewed by Geoffrey Garen.
1816
1817         Before the patch, we are setting the channel handler client to null and then unregistering from observer to
1818         libwebrtc data channel. Since this happens in two different threads, there might be a timing issue.
1819
1820         Removing this risk by first unregistering (done synchronously on the other thread), before setting client to null.
1821         Made some clean-up related refactoring.
1822
1823         * Modules/mediastream/RTCDataChannel.cpp:
1824         (WebCore::RTCDataChannel::create):
1825         (WebCore::RTCDataChannel::close):
1826         * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.cpp:
1827         (WebCore::LibWebRTCDataChannelHandler::setClient):
1828         (WebCore::LibWebRTCDataChannelHandler::close):
1829         * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h:
1830         * platform/mediastream/RTCDataChannelHandler.h:
1831         * platform/mock/RTCDataChannelHandlerMock.cpp:
1832         (WebCore::RTCDataChannelHandlerMock::setClient):
1833         * platform/mock/RTCDataChannelHandlerMock.h:
1834
1835 2017-04-26  Alex Christensen  <achristensen@webkit.org>
1836
1837         Make user script injection more robust
1838         https://bugs.webkit.org/show_bug.cgi?id=171339
1839         <rdar://problem/30643691>
1840
1841         Reviewed by Geoffrey Garen.
1842
1843         * loader/EmptyClients.cpp:
1844         * page/Frame.cpp:
1845         (WebCore::Frame::injectUserScripts):
1846         * page/UserContentController.cpp:
1847         (WebCore::UserContentController::forEachUserScript):
1848         (WebCore::UserContentController::forEachUserStyleSheet):
1849         (WebCore::UserContentController::forEachUserMessageHandler):
1850         * page/UserContentController.h:
1851         * page/UserContentProvider.h:
1852
1853 2017-04-26  Zalan Bujtas  <zalan@apple.com>
1854
1855         RTL: recent searches popover is displayed in incorrect location
1856         https://bugs.webkit.org/show_bug.cgi?id=171338
1857         <rdar://problem/31377807>
1858
1859         Reviewed by Dean Jackson.
1860
1861         Compute the absolute coordinates for the popup the same way we do for the select dropdown.
1862
1863         * rendering/RenderSearchField.cpp:
1864         (WebCore::RenderSearchField::showPopup):
1865
1866 2017-04-26  Said Abou-Hallawa  <sabouhallawa@apple.com>
1867
1868         Restrict WebKit image formats to a known whitelist
1869         https://bugs.webkit.org/show_bug.cgi?id=170700
1870
1871         Reviewed by Tim Horton.
1872
1873         If the image format is not supported, the load should be canceled and the
1874         image is marked a broken image.
1875
1876         Test: fast/images/image-formats-support.html
1877
1878         * loader/cache/CachedImage.cpp:
1879         (WebCore::CachedImage::addIncrementalDataBuffer):
1880         (WebCore::CachedImage::setImageDataBuffer):
1881         (WebCore::CachedImage::finishLoading):
1882         * loader/cache/CachedImage.h:
1883
1884 2017-04-26  Joanmarie Diggs  <jdiggs@igalia.com>
1885
1886         [ATK] Implement support for new ARIA 1.1 values of aria-haspopup
1887         https://bugs.webkit.org/show_bug.cgi?id=171164
1888
1889         Reviewed by Chris Fleizach.
1890
1891         In ARIA 1.1, aria-haspopup's value type changed from true/false to a token.
1892         Values: true, false (default, unless it's a combobox), dialog, grid, listbox
1893         (default for combobox), menu, and tree. Any value of aria-haspopup that is
1894         not included in the list of allowed values, including an empty string, must
1895         be treated as if the value false had been provided.
1896
1897         Add AccessibilityObject::ariaPopupValue() to validate the value, handle implicit
1898         values, and give platform assistive technologies a means to access that value.
1899
1900         If there is a valid, non-false value of aria-haspopup, include ATK_STATE_HAS_POPUP
1901         in the AtkStateSet. Lastly, expose the value (rather than true/false) via the "haspop"
1902         AtkObject attribute.
1903
1904         Test: accessibility/gtk/aria-haspopup.html
1905
1906         * accessibility/AccessibilityObject.h:
1907         (WebCore::AccessibilityObject::ariaPopupValue):
1908         (WebCore::AccessibilityObject::supportsARIAHasPopup):
1909         * accessibility/AccessibilityRenderObject.cpp:
1910         (WebCore::AccessibilityRenderObject::ariaHasPopup):
1911         * accessibility/AccessibilityRenderObject.h:
1912         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
1913         (webkitAccessibleGetAttributes):
1914         (setAtkStateSetFromCoreObject):
1915
1916 2017-04-26  Alex Christensen  <achristensen@webkit.org>
1917
1918         Fix CMake build.
1919
1920         * PlatformMac.cmake:
1921
1922 2017-04-26  Antti Koivisto  <antti@apple.com>
1923
1924         Enable expired-only reload policy on Mac and iOS
1925         https://bugs.webkit.org/show_bug.cgi?id=171264
1926         <rdar://problem/31807637>
1927
1928         Reviewed by Andreas Kling.
1929
1930         Limit the behavior to http and data URLs (where we explicitly know about expiration).
1931
1932         * html/HTMLLinkElement.cpp:
1933         (WebCore::HTMLLinkElement::setCSSStyleSheet):
1934         * loader/FrameLoader.cpp:
1935         (WebCore::FrameLoader::subresourceCachePolicy):
1936
1937             Pass the URL so we can test for protocol.
1938
1939         * loader/FrameLoader.h:
1940         * loader/NavigationAction.cpp:
1941         (WebCore::navigationType):
1942
1943             Test for reload navigation type correctly.
1944
1945         * loader/cache/CachedResource.cpp:
1946         (WebCore::CachedResource::load):
1947         * loader/cache/CachedResourceLoader.cpp:
1948         (WebCore::CachedResourceLoader::determineRevalidationPolicy):
1949         (WebCore::CachedResourceLoader::cachePolicy):
1950         * loader/cache/CachedResourceLoader.h:
1951
1952 2017-04-26  WebKit Contributor  <webkitcontrib@gmail.com>
1953
1954         Response.blob() does not set the content-type based on the header value.
1955         https://bugs.webkit.org/show_bug.cgi?id=170849
1956
1957         Reviewed by Alex Christensen.
1958
1959         The Fetch API specification requires setting the blob contentType
1960         using the Content-Type header value, if present.  Previously the
1961         FetchResponse class only called updateContentType() when first
1962         created even though all the headers were not available.  Call
1963         updateContentType() again after the headers are populated.
1964
1965         This change allows WebKit to pass the "Consume response's body: from
1966         fetch to blob" case in the WPT response-consume.html test.
1967
1968         Test: http://w3c-test.org/fetch/api/response/response-consume.html
1969
1970         * Modules/fetch/FetchResponse.cpp:
1971         (WebCore::FetchResponse::BodyLoader::didReceiveResponse): Modified to
1972         call FetchBodyOwner::updateContentType() after filling m_headers.
1973
1974 2017-04-26  Andy Estes  <aestes@apple.com>
1975
1976         Try to fix the macOS Sierra build.
1977
1978         * platform/mac/WebVideoFullscreenInterfaceMac.mm:
1979
1980 2017-04-26  Andy Estes  <aestes@apple.com>
1981
1982         [macOS] Add picture-in-picture support to WebPlaybackControlsManager
1983         https://bugs.webkit.org/show_bug.cgi?id=171328
1984         <rdar://problem/29875010>
1985
1986         Reviewed by Jer Noble.
1987
1988         * platform/cocoa/WebPlaybackSessionModel.h:
1989         * platform/cocoa/WebPlaybackSessionModelMediaElement.h:
1990         * platform/cocoa/WebPlaybackSessionModelMediaElement.mm:
1991         (WebCore::WebPlaybackSessionModelMediaElement::togglePictureInPicture): If the media element
1992         is currently in PiP fullscreen mode, exit fullscreen. Otherwise, enter PiP fullscreen mode.
1993         * platform/mac/WebPlaybackControlsManager.h:
1994         * platform/mac/WebPlaybackControlsManager.mm:
1995         (-[WebPlaybackControlsManager canTogglePictureInPicture]): Added. Returns YES if
1996         -allowsPictureInPicturePlayback returns YES.
1997         (-[WebPlaybackControlsManager togglePictureInPicture]): Added. Calls
1998         WebPlaybackSessionModel::togglePictureInPicture().
1999         * platform/mac/WebVideoFullscreenInterfaceMac.mm:
2000         (WebCore::WebVideoFullscreenInterfaceMac::enterFullscreen): Added a call to
2001         -[WebPlaybackControlsManager setPictureInPictureActive:YES].
2002         (WebCore::WebVideoFullscreenInterfaceMac::exitFullscreen): Added a call to
2003         -[WebPlaybackControlsManager setPictureInPictureActive:NO].
2004         (WebCore::WebVideoFullscreenInterfaceMac::exitFullscreenWithoutAnimationToMode): Ditto.
2005         * platform/spi/cocoa/AVKitSPI.h: Declared new SPI on AVTouchBarPlaybackControlsControlling.
2006
2007 2017-04-25  Dean Jackson  <dino@apple.com>
2008
2009         [Color] Make gradients work with ExtendedColors
2010         https://bugs.webkit.org/show_bug.cgi?id=171315
2011         <rdar://problems/31830177>
2012
2013         Reviewed by Antoine Quint.
2014
2015         Allow gradients to hold Color objects, and thus
2016         handle ExtendedColor. Implement the backend for
2017         CoreGraphics.
2018
2019         Test: css3/color/gradients.html
2020
2021         * platform/graphics/Gradient.cpp:
2022         (WebCore::Gradient::addColorStop): Just copy the Color now.
2023         (WebCore::compareStops): Handle rename of stop to offset.
2024         (WebCore::Gradient::hasAlpha): Use Color's helper.
2025         * platform/graphics/Gradient.h:
2026         (WebCore::Gradient::ColorStop::ColorStop): Rename stop
2027         to offset, and store a Color rather than four floating
2028         point values.
2029         * platform/graphics/cairo/GradientCairo.cpp:
2030         (WebCore::Gradient::platformGradient):
2031         * platform/graphics/cg/GradientCG.cpp:
2032         (WebCore::Gradient::platformGradient): Use the CG method
2033         that can handle CGColorRefs with ColorSpace values, and
2034         pass the Extended sRGB space which should be no change for
2035         all existing gradients but also handle ColorSpaces like
2036         Display P3.
2037         * platform/graphics/win/GradientDirect2D.cpp:
2038         (WebCore::Gradient::generateGradient):
2039         * svg/SVGGradientElement.cpp:
2040         (WebCore::SVGGradientElement::buildStops):
2041
2042 2017-04-25  Alex Christensen  <achristensen@webkit.org>
2043
2044         Encoded filename should be decoded for WKContentExtension.identifier
2045         https://bugs.webkit.org/show_bug.cgi?id=171316
2046
2047         Reviewed by Andy Estes.
2048
2049         * platform/FileSystem.h:
2050
2051 2017-04-26  Frederic Wang  <fwang@igalia.com>
2052
2053         Fix typo in RenderFrameBase
2054         https://bugs.webkit.org/show_bug.cgi?id=171324
2055
2056         Reviewed by Zalan Bujtas.
2057
2058         No new tests, behavior unchanged.
2059
2060         * rendering/RenderFrameBase.cpp:
2061         (WebCore::RenderFrameBase::layoutWithFlattening):
2062         (WebCore::RenderFrameBase::performLayoutWithFlattening):
2063         (WebCore::RenderFrameBase::peformLayoutWithFlattening): Deleted.
2064         * rendering/RenderFrameBase.h:
2065
2066 2017-04-26  Zalan Bujtas  <zalan@apple.com>
2067
2068         Forced page break on :after triggers infinite loop in column balancing
2069         https://bugs.webkit.org/show_bug.cgi?id=171309
2070         rdar://problem/26285884
2071
2072         Reviewed by David Hyatt.
2073
2074         Stop trying to balance the columns when the forced page breaks >= the number of
2075         columns even when this number is 1. Content will always overflow to the next page.
2076         see https://chromium.googlesource.com/chromium/src/+/fbbebf38cefb2712c912581eccb046ef363ec84e%5E%21/#F2 
2077
2078         Test: fast/multicol/infinite-loop-when-forced-break.html
2079
2080         * rendering/RenderMultiColumnSet.cpp:
2081         (WebCore::RenderMultiColumnSet::calculateBalancedHeight):
2082
2083 2017-04-26  Said Abou-Hallawa  <sabouhallawa@apple.com>
2084
2085         Attempt to fix a JetStream regression.
2086         <rdar://problem/31742414>
2087
2088         Unreviewed.
2089
2090         Disable async decoding for large images till the flickering bug wk170640
2091         is fixed.
2092
2093         * platform/graphics/BitmapImage.cpp:
2094         (WebCore::BitmapImage::shouldUseAsyncDecodingForLargeImages):
2095
2096 2017-04-26  Ryan Haddad  <ryanhaddad@apple.com>
2097
2098         Unreviewed, rolling out r215767.
2099
2100         The LayoutTest for this change is a flaky failure.
2101
2102         Reverted changeset:
2103
2104         "Restrict WebKit image formats to a known whitelist"
2105         https://bugs.webkit.org/show_bug.cgi?id=170700
2106         http://trac.webkit.org/changeset/215767
2107
2108 2017-04-26  Dave Hyatt  <hyatt@apple.com>
2109
2110         Improve wavy underline rendering
2111         https://bugs.webkit.org/show_bug.cgi?id=171281
2112
2113         Reviewed by Sam Weinig.
2114
2115         Change wavy underline rendering to use font size instead of stroke
2116         thickness as a way to tune it. Cut the extra offset from 2 to 1.
2117         Change the parameters to make the line flatter and to make the proportion
2118         of the wave that renders underneath a glyph the same.
2119
2120         * rendering/TextDecorationPainter.cpp:
2121         (WebCore::strokeWavyTextDecoration):
2122         (WebCore::TextDecorationPainter::paintTextDecoration):
2123         * style/InlineTextBoxStyle.cpp:
2124         (WebCore::getWavyStrokeParameters):
2125         (WebCore::visualOverflowForDecorations):
2126         * style/InlineTextBoxStyle.h:
2127         (WebCore::wavyOffsetFromDecoration):
2128
2129 2017-04-24  Sergio Villar Senin  <svillar@igalia.com>
2130
2131         [css-grid] Remove most of the usage of SizingOperation
2132         https://bugs.webkit.org/show_bug.cgi?id=171225
2133
2134         Reviewed by Darin Adler.
2135
2136         SizingOperation was added as a way to modify the behaviour of the track sizing algorithm
2137         with the specifics for intrinsic size computations. The problem is that although intrinsic
2138         size computation does imply indefinite sizes, the opposite is not always true. For example,
2139         a grid container with height:auto would compute the row sizes with an indefinite size but is
2140         not part of the intrinsic size (preferred widths) computation.
2141
2142         That's why it was wrongly used in some parts of the current code, in most of the cases is
2143         more than enough to check whether the available space is indefinite or not. In order to do
2144         that we have to keep both available sizes (height & width) around all the time to properly
2145         support orthogonal flows.
2146
2147         This change does not imply any change in behaviour.
2148
2149         * rendering/GridTrackSizingAlgorithm.cpp:
2150         (WebCore::GridTrackSizingAlgorithm::setAvailableSpace):
2151         (WebCore::GridTrackSizingAlgorithm::computeTrackBasedSize):
2152         (WebCore::GridTrackSizingAlgorithm::initialBaseSize):
2153         (WebCore::GridTrackSizingAlgorithm::initialGrowthLimit):
2154         (WebCore::GridTrackSizingAlgorithm::sizeTrackToFitNonSpanningItem):
2155         (WebCore::GridTrackSizingAlgorithm::increaseSizesToAccommodateSpanningItems):
2156         (WebCore::GridTrackSizingAlgorithm::assumedRowsSizeForOrthogonalChild):
2157         (WebCore::GridTrackSizingAlgorithm::gridAreaBreadthForChild):
2158         (WebCore::GridTrackSizingAlgorithm::gridTrackSize):
2159         (WebCore::IndefiniteSizeStrategy::findUsedFlexFraction):
2160         (WebCore::IndefiniteSizeStrategy::recomputeUsedFlexFractionIfNeeded):
2161         (WebCore::GridTrackSizingAlgorithm::initializeTrackSizes):
2162         (WebCore::GridTrackSizingAlgorithm::setup):
2163         (WebCore::GridTrackSizingAlgorithm::reset):
2164         * rendering/GridTrackSizingAlgorithm.h:
2165         (WebCore::GridTrackSizingAlgorithmStrategy::availableSpace):
2166         * rendering/RenderGrid.cpp:
2167         (WebCore::RenderGrid::availableSpaceForGutters):
2168         (WebCore::RenderGrid::computeTrackBasedLogicalHeight):
2169         (WebCore::RenderGrid::computeTrackSizesForDefiniteSize):
2170         (WebCore::RenderGrid::layoutBlock):
2171         (WebCore::RenderGrid::gridGap):
2172         (WebCore::RenderGrid::guttersSize):
2173         (WebCore::RenderGrid::computeIntrinsicLogicalWidths):
2174         (WebCore::RenderGrid::computeTrackSizesForIndefiniteSize):
2175         (WebCore::RenderGrid::computeAutoRepeatTracksCount):
2176         (WebCore::RenderGrid::placeItemsOnGrid):
2177         (WebCore::RenderGrid::trackSizesForComputedStyle):
2178         (WebCore::RenderGrid::applyStretchAlignmentToTracksIfNeeded):
2179         (WebCore::RenderGrid::offsetAndBreadthForPositionedChild):
2180         (WebCore::RenderGrid::populateGridPositionsForDirection):
2181         (WebCore::RenderGrid::columnAxisOffsetForChild):
2182         (WebCore::RenderGrid::rowAxisOffsetForChild):
2183         (WebCore::RenderGrid::gridGapForDirection): Deleted.
2184         * rendering/RenderGrid.h:
2185
2186 2017-04-26  Frederic Wang  <fwang@igalia.com>
2187
2188         Remove Document::*FrameElementsShouldIgnoreScrolling
2189         https://bugs.webkit.org/show_bug.cgi?id=171271
2190
2191         Reviewed by Chris Dumez.
2192
2193         setFrameElementsShouldIgnoreScrolling and frameElementsShouldIgnoreScrolling were
2194         introduced bug 23072 in order to work around a bug in the Dictionary application.
2195         However, this was removed in bug 132095 and hence the functions are no longer necessary.
2196
2197         No new tests.
2198
2199         * dom/Document.h:
2200         (WebCore::Document::setFrameElementsShouldIgnoreScrolling): Deleted.
2201         (WebCore::Document::frameElementsShouldIgnoreScrolling): Deleted.
2202         * html/HTMLFrameElementBase.cpp:
2203         (WebCore::HTMLFrameElementBase::parseAttribute):
2204
2205 2017-04-26  Zan Dobersek  <zdobersek@igalia.com>
2206
2207         [GCrypt] CryptoKeyRSA: implement create(), keySizeInBits(), buildAlgorithm(), exportData()
2208         https://bugs.webkit.org/show_bug.cgi?id=171213
2209
2210         Reviewed by Michael Catanzaro.
2211
2212         CryptoKeyRSA::create() validates the specified key type along with the
2213         provided data. If everything is OK, it then proceeds to build the key
2214         of the appropriate type through an s-expression that is constructed with
2215         the necessary data. We don't currently support creating private keys
2216         with any additional prime information (apart from p and q).
2217
2218         CryptoKeyRSA::keySizeInBits() calls the helper getRSAModulusLength()
2219         function that find the modulus MPI in the key s-expression and returns
2220         the modulus data length in bits.
2221
2222         CryptoKeyRSA::buildAlgorithm() returns KeyAlgorithm that's constructed
2223         from the appropriate name, this key's modulus length, and this key's
2224         public exponent data. It also specifies the hash if there is such a
2225         restriction for this key.
2226
2227         CryptoKeyRSA::exportData() returns a properly-constructed
2228         CryptoKeyDataRSAComponents object. The public modulus and exponent are
2229         used in case the key is public. If the key is private, the secret
2230         exponent and the p and q prime numbers are retrieved in MPI format.
2231         They're then used to calculate the dp, dq and qi parameters that are
2232         exported in the JWK format. Note that libgcrypt internally switches
2233         the p and q prime numbers such that p < q, but the Web Crypto
2234         specification and the dependant RFCs expect that q < p. We address
2235         this by simply switching the roles of the two primes and follow the
2236         usual q < p assumption when exporting the primes and computing the
2237         dependant exponents and coefficients.
2238
2239         No new tests -- existing ones cover this but don't work yet due to missing
2240         RSA-related CryptoAlgorithm implementations.
2241
2242         * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
2243         (WebCore::getRSAModulusLength):
2244         (WebCore::getParameterMPIData):
2245         (WebCore::getRSAKeyParameter):
2246         (WebCore::CryptoKeyRSA::create):
2247         (WebCore::CryptoKeyRSA::keySizeInBits):
2248         (WebCore::CryptoKeyRSA::buildAlgorithm):
2249         (WebCore::CryptoKeyRSA::exportData):
2250
2251 2017-04-25  Jiewen Tan  <jiewen_tan@apple.com>
2252
2253         [WebCrypto] Enhance ways to convert an ECDSA signature binary into DER format
2254         https://bugs.webkit.org/show_bug.cgi?id=171287
2255         <rdar://problem/31735332>
2256
2257         Reviewed by Brent Fulgham.
2258
2259         Covered by existing tests.
2260
2261         * crypto/mac/CryptoAlgorithmECDSAMac.cpp:
2262         (WebCore::verifyECDSA):
2263
2264 2017-04-25  Brent Fulgham  <bfulgham@apple.com>
2265
2266         Relax the event firing ASSERT for Attr changes
2267         https://bugs.webkit.org/show_bug.cgi?id=171236
2268         <rdar://problem/30516349>
2269
2270         Reviewed by Dean Jackson.
2271
2272         The assertions added in Bug 167318 were overly strict, and trigger for valid behavior.
2273         Relax the assertion preventing event dispatch for the case of Attr elements at the
2274         end of childrenChanged.
2275
2276         Test: fast/dom/HTMLLinkElement/event-while-removing-attribute.html
2277
2278         * dom/Attr.cpp:
2279         (WebCore::Attr::childrenChanged):
2280
2281 2017-04-25  John Wilander  <wilander@apple.com>
2282
2283         Resource Load Statistics: Introduce shorter time-to-live for cookie partition whitelisting
2284         https://bugs.webkit.org/show_bug.cgi?id=171295
2285         <rdar://problem/31823818>
2286
2287         Reviewed by Brent Fulgham.
2288
2289         Test: http/tests/loading/resourceLoadStatistics/partitioned-and-unpartitioned-cookie-with-partitioning-timeout.html
2290
2291         * loader/ResourceLoadObserver.cpp:
2292         (WebCore::reduceTimeResolutionToOneDay): Deleted.
2293         (WebCore::reduceTimeResolution):
2294             Changed name to no longer lock this to a specific resolution.
2295         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
2296             Now calls WebCore::reduceTimeResolution().
2297         (WebCore::ResourceLoadObserver::setTimeToLiveCookiePartitionFree):
2298             Added for testing purposes.
2299         (WebCore::ResourceLoadObserver::fireShouldPartitionCookiesHandler):
2300             Added for testing purposes.
2301         * loader/ResourceLoadObserver.h:
2302         * loader/ResourceLoadStatisticsStore.cpp:
2303         (WebCore::shouldPartitionCookies):
2304             Static inline convenience function.
2305         (WebCore::ResourceLoadStatisticsStore::fireShouldPartitionCookiesHandler):
2306             Now decides whether a domain should get partitioned cookies
2307             based on timeToLiveCookiePartitionFree.
2308             Removed clearFirst parameter since it's not needed here
2309             and it introduced complexity in keeping the store and the
2310             network process cache in sync.
2311         (WebCore::ResourceLoadStatisticsStore::setTimeToLiveCookiePartitionFree):
2312             Added for testing purposes.
2313         * loader/ResourceLoadStatisticsStore.h:
2314
2315 2017-04-25  Saam Barati  <sbarati@apple.com>
2316
2317         JSArray::isArrayPrototypeIteratorProtocolFastAndNonObservable is wrong because it does not do the necessary checks on the base object
2318         https://bugs.webkit.org/show_bug.cgi?id=171150
2319         <rdar://problem/31771880>
2320
2321         Reviewed by Sam Weinig.
2322
2323         This patch moves the sequence converters to use the now fixed
2324         JSArray::isArrayPrototypeIteratorProtocolFastAndNonObservable test
2325         inside JSC.
2326         
2327         This patch also fixes a few bugs:
2328         1. Converting to a sequence of numbers must prove that the JSArray
2329         is filled only with Int32/Double. If there is a chance the array
2330         contains objects, the conversion to a numeric IDLType can be observable
2331         (via valueOf()), and can change the iterator protocol.
2332         2. There are other conversions that can have side effects a-la valueOf().
2333         This patch introduces a new static constant in the various Converter
2334         classes that tell the sequence converter if the conversion operation
2335         can have JS side effects. If it does have side effects, we fall back to
2336         the generic conversion that uses the iterator protocol. If not, we can
2337         do a faster version that iterates over each element of the array,
2338         reading it directly, and converting it.
2339
2340         Tests: js/sequence-iterator-protocol-2.html
2341                js/sequence-iterator-protocol.html
2342
2343         * bindings/js/JSDOMConvertAny.h: Does not have side effects.
2344         * bindings/js/JSDOMConvertBase.h: We pessimistically assume inside DefaultConverter that converions have side effects.
2345         * bindings/js/JSDOMConvertBoolean.h: Does not have side effects.
2346         * bindings/js/JSDOMConvertCallbacks.h: Does not have side effects.
2347         * bindings/js/JSDOMConvertObject.h: Does not have side effects.
2348         * bindings/js/JSDOMConvertSequences.h:
2349         (WebCore::Detail::NumericSequenceConverter::convert):
2350         (WebCore::Detail::SequenceConverter::convert):
2351
2352 2017-04-25  Michael Saboff  <msaboff@apple.com>
2353
2354         Call bmalloc scavenger first when handling a memory pressure event
2355         https://bugs.webkit.org/show_bug.cgi?id=171289
2356
2357         Reviewed by Geoffrey Garen.
2358
2359         Let bmalloc free any pages to the OS that it can before doing anything else.
2360
2361         * page/MemoryRelease.cpp:
2362         (WebCore::releaseMemory):
2363
2364 2017-04-25  Dean Jackson  <dino@apple.com>
2365
2366         Skip WebKitAdditions for Safari Technology Preview media controls
2367         https://bugs.webkit.org/show_bug.cgi?id=171302
2368         <rdar://problem/31823256>
2369
2370         Reviewed by Simon Fraser.
2371
2372         Safari Technology Preview should use the same controls
2373         as OpenSource.
2374
2375         * WebCore.xcodeproj/project.pbxproj:
2376
2377 2017-04-25  Ryan Haddad  <ryanhaddad@apple.com>
2378
2379         Unreviewed, rolling out r215730.
2380
2381         The LayoutTest for this change is a flaky timeout on mac-wk1
2382         debug.
2383
2384         Reverted changeset:
2385
2386         "Enable expired-only reload policy on Mac and iOS"
2387         https://bugs.webkit.org/show_bug.cgi?id=171264
2388         http://trac.webkit.org/changeset/215730
2389
2390 2017-04-24  Matt Rajca  <mrajca@apple.com>
2391
2392         Indicate presence of audio when handling autoplay events.
2393         https://bugs.webkit.org/show_bug.cgi?id=171227
2394
2395         Reviewed by Alex Christensen.
2396
2397         Added API tests.
2398
2399         * html/HTMLMediaElement.cpp:
2400         (WebCore::HTMLMediaElement::handleAutoplayEvent):
2401         (WebCore::HTMLMediaElement::playInternal):
2402         (WebCore::HTMLMediaElement::mediaPlayerTimeChanged):
2403         (WebCore::HTMLMediaElement::stopWithoutDestroyingMediaPlayer):
2404         (WebCore::HTMLMediaElement::userDidInterfereWithAutoplay):
2405         (WebCore::HTMLMediaElement::setPlaybackWithoutUserGesture):
2406         * html/HTMLMediaElement.h:
2407         * page/AutoplayEvent.h:
2408         * page/ChromeClient.h:
2409
2410 2017-04-25  Aakash Jain  <aakash_jain@apple.com>
2411
2412         WebCore.framework should restrict allowable_clients
2413         https://bugs.webkit.org/show_bug.cgi?id=171260
2414
2415         Reviewed by Alexey Proskuryakov.
2416
2417         * Configurations/WebCore.xcconfig: Adding allowable_client to all platform, in order to restrict WebCore
2418         from being directly linked on any platform.
2419         Moved WebKitLegacy and WebCoreTestSupport to OTHER_LDFLAGS_BASE.
2420         Removed WebKit2 as allowable_client from mac.
2421         Added iTunesU, Casablanca and Remote to OTHER_LDFLAGS_BASE_ios for iTunes related projects.
2422         Added WebKit, TVBooks, DumpRenderTree, WebKitTestRunner and TestWebKitAPI to OTHER_LDFLAGS_BASE_ios.
2423
2424 2017-04-25  Said Abou-Hallawa  <sabouhallawa@apple.com>
2425
2426         Restrict WebKit image formats to a known whitelist
2427         https://bugs.webkit.org/show_bug.cgi?id=170700
2428
2429         Reviewed by Tim Horton.
2430
2431         If the image format is not supported, the load should be canceled and the
2432         image is marked a broken image.
2433
2434         Test: fast/images/image-formats-support.html
2435
2436         * loader/cache/CachedImage.cpp:
2437         (WebCore::CachedImage::addIncrementalDataBuffer):
2438         (WebCore::CachedImage::setImageDataBuffer):
2439         (WebCore::CachedImage::finishLoading):
2440         * loader/cache/CachedImage.h:
2441
2442 2017-04-25  Youenn Fablet  <youenn@apple.com>
2443
2444         CoreAudioCaptureSource::suspend is asserting too often
2445         https://bugs.webkit.org/show_bug.cgi?id=171285
2446
2447         Reviewed by Eric Carlson.
2448
2449         No change of behavior.
2450
2451         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
2452         (WebCore::CoreAudioCaptureSource::suspend): Moving the assertion to where it might be useful.
2453
2454 2017-04-25  Daniel Bates  <dabates@apple.com>
2455
2456         Use an OptionSet for compositing reasons bitmask
2457         https://bugs.webkit.org/show_bug.cgi?id=171153
2458
2459         Reviewed by Simon Fraser.
2460
2461         We should make use of OptionSet to represent the bitmask of the reasons a layer
2462         was composited instead of using an integer and bitwise operations.
2463
2464         * inspector/InspectorLayerTreeAgent.cpp:
2465         (WebCore::InspectorLayerTreeAgent::reasonsForCompositingLayer):
2466         * rendering/RenderLayerCompositor.cpp:
2467         (WebCore::RenderLayerCompositor::reasonsForCompositing):
2468         (WebCore::RenderLayerCompositor::logReasonsForCompositing): Also fix code style issues;
2469         an else-if statement should be written as an if-statement when the prior if-statement
2470         concludes with a return statement.
2471         * rendering/RenderLayerCompositor.h:
2472
2473 2017-04-25  Myles C. Maxfield  <mmaxfield@apple.com>
2474
2475         Supplementary Multilingual Plane Complex Scripts Rendered Incorrectly
2476         https://bugs.webkit.org/show_bug.cgi?id=171272
2477         <rdar://problem/30966764>
2478
2479         Reviewed by Zalan Bujtas.
2480
2481         These scripts need to take the complex text codepath.
2482
2483         Test: fast/text/kaithi.html
2484
2485         * platform/graphics/FontCascade.cpp:
2486         (WebCore::FontCascade::characterRangeCodePath):
2487
2488 2017-04-25  Carlos Alberto Lopez Perez  <clopez@igalia.com>
2489
2490         [GTK] Revert r215745 (especulative build fix) after r215752.
2491         https://bugs.webkit.org/show_bug.cgi?id=170842
2492
2493         Unreviewed.
2494
2495         * platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
2496         (WebCore::normalizeCharacters):
2497
2498 2017-04-25  Daniel Bates  <dabates@apple.com>
2499
2500         [Cocoa][Win] Enable of X-Content-Type-Options: nosniff header
2501         https://bugs.webkit.org/show_bug.cgi?id=136452
2502         <rdar://problem/23412620>
2503
2504         Reviewed by Brent Fulgham.
2505
2506         Enable support for X-Content-Type-Options: nosniff on Mac, iOS and Windows.
2507
2508         Additionally, honor X-Content-Type-Options: nosniff header for stylesheets as per
2509         <https://fetch.spec.whatwg.org/#should-response-to-request-be-blocked-due-to-nosniff%3F> (30 March 2017).
2510
2511         Test: http/tests/security/contentTypeOptions/nosniff-dynamic-script-blocked.html
2512
2513         * Configurations/FeatureDefines.xcconfig:
2514         * css/StyleSheetContents.cpp:
2515         (WebCore::StyleSheetContents::parseAuthorStyleSheet): Log an error if the stylesheet
2516         has the nosniff header and does not have a valid MIME type. Also update code for
2517         renaming of MIMETypeCheck to MIMETypeCheckHint.
2518         (WebCore::StyleSheetContents::notifyLoadedSheet): If the stylesheet is blocked by
2519         nosniff then consider it analogous to a load error so that we dispatch a DOM error
2520         event at the <style>/<link> element.
2521         * dom/LoadableClassicScript.cpp:
2522         (WebCore::LoadableClassicScript::notifyFinished): Modified the wording of the error
2523         message when a script is disallowed by nosniff so as to more closely match the
2524         wording used when a stylesheet is disallowed by nonsniff.
2525         * loader/cache/CachedCSSStyleSheet.cpp:
2526         (WebCore::CachedCSSStyleSheet::sheetText): Update for renaming of MIMETypeCheck
2527         to MIMETypeCheckHint.
2528         (WebCore::CachedCSSStyleSheet::responseMIMEType): Added.
2529         (WebCore::CachedCSSStyleSheet::mimeTypeAllowedByNosniff): Added.
2530         (WebCore::CachedCSSStyleSheet::canUseSheet): Modified to check if the X-Content-Type-Options: nosniff
2531         header is in the HTTP response for the stylesheet. If it is then we can only use the stylesheet
2532         if its content-type is "text/css". Otherwise, apply the existing criterion for determining whether
2533         to to use the stylesheet.
2534         * loader/cache/CachedCSSStyleSheet.h: Rename MIMETypeCheck to MIMETypeCheckHint to better
2535         describe its purpose as a hint as to whether to enforce MIME type checking for the stylesheet.
2536         Processing of the HTTP header X-Content-Type-Options takes precedence over this hint.
2537         * loader/cache/CachedScript.h: Make mimeType() private.
2538
2539 2017-04-25  Daniel Bates  <dabates@apple.com>
2540
2541         [Cocoa][Win] Enable of X-Content-Type-Options: nosniff header
2542         https://bugs.webkit.org/show_bug.cgi?id=136452
2543         <rdar://problem/23412620>
2544
2545         Reviewed by Brent Fulgham.
2546
2547         Part 1
2548
2549         Enable X-Content-Type-Options: nosniff on Mac, iOS and Windows platforms.
2550
2551         * Configurations/FeatureDefines.xcconfig:
2552
2553 2017-04-25  Myles C. Maxfield  <mmaxfield@apple.com>
2554
2555         [GTK] Build fix after r215737
2556         https://bugs.webkit.org/show_bug.cgi?id=170842
2557
2558         Unreviewed.
2559
2560         No new tests because there is no behavior change.
2561
2562         * platform/graphics/FontCascade.h:
2563         (WebCore::FontCascade::treatAsZeroWidthSpace):
2564         (WebCore::FontCascade::treatAsZeroWidthSpaceInComplexScript):
2565
2566 2017-04-25  Wenson Hsieh  <wenson_hsieh@apple.com>
2567
2568         Remove an unnecessary -respondsToSelector: check after r215724
2569
2570         Rubber-stamped by Tim Horton.
2571
2572         Addresses review feedback from <https://bugs.webkit.org/show_bug.cgi?id=171156>. -[NSURL _title]
2573         will always for builds that need to access it.
2574
2575         * platform/ios/PlatformPasteboardIOS.mm:
2576         (WebCore::PlatformPasteboard::readURL):
2577
2578 2017-04-25  Antti Koivisto  <antti@apple.com>
2579
2580         REGRESSION (r215469): [ios-simulator-wk2] LayoutTest compositing/animation/animation-backing.html is a flaky failure
2581         https://bugs.webkit.org/show_bug.cgi?id=171060
2582         <rdar://problem/31771174>
2583
2584         Reviewed by Simon Fraser.
2585
2586         Accelerated transform animations move underlying layers without invalidating GraphicsLayers.
2587         To update tile coverage we need to commit such subtrees even if there are not other changes.
2588
2589         * platform/graphics/ca/GraphicsLayerCA.cpp:
2590         (WebCore::GraphicsLayerCA::GraphicsLayerCA):
2591         (WebCore::GraphicsLayerCA::needsCommit):
2592
2593             Commit subtrees with accelerated transform animations.
2594             Factor into a function.
2595
2596         (WebCore::GraphicsLayerCA::recursiveCommitChanges):
2597
2598             Track if descendants had any accelerated transform animations after commit.
2599
2600         * platform/graphics/ca/GraphicsLayerCA.h:
2601         (WebCore::GraphicsLayerCA::hasDescendantsWithRunningTransformAnimations):
2602         (WebCore::GraphicsLayerCA::setHasDescendantsWithRunningTransformAnimations):
2603
2604 2017-04-25  Eric Carlson  <eric.carlson@apple.com>
2605
2606         [MediaStream macOS] Unable to apply frameRate constraint
2607         https://bugs.webkit.org/show_bug.cgi?id=171279
2608
2609         Reviewed by Youenn Fablet.
2610
2611         No new tests, this doesn't affect the mock capture devices.
2612
2613         * platform/mediastream/mac/AVVideoCaptureSource.mm:
2614         (WebCore::AVVideoCaptureSource::supportsSizeAndFrameRate): Cast frame rate
2615         ranges to int before comparing.
2616
2617 2017-04-25  Carlos Alberto Lopez Perez  <clopez@igalia.com>
2618
2619         [GTK] Build fix after r215737
2620         https://bugs.webkit.org/show_bug.cgi?id=170842
2621
2622         Unreviewed.
2623
2624         * platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
2625         (WebCore::normalizeCharacters):
2626
2627 2017-04-25  John Wilander  <wilander@apple.com>
2628
2629         Resource Load Statistics: Clear network process cache when clearing store
2630         https://bugs.webkit.org/show_bug.cgi?id=171256
2631         <rdar://problem/31802347>
2632
2633         Reviewed by Brent Fulgham.
2634
2635         Test that covers this code:
2636         http/tests/loading/resourceLoadStatistics/clear-in-memory-and-persistent-store.html
2637
2638         * loader/ResourceLoadObserver.cpp:
2639         (WebCore::ResourceLoadObserver::clearInMemoryStore):
2640             Better name.
2641         (WebCore::ResourceLoadObserver::logUserInteraction):
2642             Now passes on the boolean parameter clearFirst to
2643             ResourceLoadStatisticsStore::fireShouldPartitionCookiesHandler().
2644         (WebCore::ResourceLoadObserver::fireShouldPartitionCookiesHandler):
2645             Now takes and passes on the boolean parameter clearFirst to
2646             ResourceLoadStatisticsStore::fireShouldPartitionCookiesHandler().
2647         (WebCore::ResourceLoadObserver::statisticsStore): Deleted.
2648             This getter violated abstraction. The way it was used
2649             is now solved through dedicated functions.
2650         * loader/ResourceLoadObserver.h:
2651         * loader/ResourceLoadStatisticsStore.cpp:
2652         (WebCore::ResourceLoadStatisticsStore::readDataFromDecoder):
2653             Now passes on the boolean parameter clearFirst to
2654             ResourceLoadStatisticsStore::fireShouldPartitionCookiesHandler().
2655         (WebCore::ResourceLoadStatisticsStore::clearInMemory):
2656             Better name.
2657             Now triggers clearing of the associated network process cache.
2658         (WebCore::ResourceLoadStatisticsStore::clearInMemoryAndPersistent):
2659             Now calls clearInMemory().
2660         (WebCore::ResourceLoadStatisticsStore::setShouldPartitionCookiesCallback):
2661             Now expects a handler with the boolean parameter clearFirst.
2662         (WebCore::ResourceLoadStatisticsStore::fireShouldPartitionCookiesHandler):
2663             Now takes and passes on the boolean parameter clearFirst to
2664             m_shouldPartitionCookiesForDomainsHandler().
2665         * loader/ResourceLoadStatisticsStore.h:
2666         (WebCore::ResourceLoadStatisticsStore::clear): Deleted.
2667         * platform/network/NetworkStorageSession.h:
2668             NetworkStorageSession::setShouldPartitionCookiesForHosts() now
2669             takes the boolean parameter clearFirst.
2670         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
2671         (WebCore::NetworkStorageSession::setShouldPartitionCookiesForHosts):
2672             Now clears m_topPrivatelyControlledDomainsForCookiePartitioning
2673             if the boolean parameter clearFirst is true.
2674
2675 2017-04-25  Myles C. Maxfield  <mmaxfield@apple.com>
2676
2677         Add performance test for FontCache::systemFallbackForCharacters()
2678         https://bugs.webkit.org/show_bug.cgi?id=170842
2679
2680         Reviewed by Tim Horton.
2681
2682         No new tests because there is no behavior change.
2683
2684         * platform/graphics/FontCascade.h:
2685         (WebCore::FontCascade::treatAsZeroWidthSpace):
2686         (WebCore::FontCascade::treatAsZeroWidthSpaceInComplexScript): Deleted.
2687         * platform/graphics/WidthCache.h:
2688         (WebCore::WidthCache::add):
2689         (WebCore::WidthCache::addSlowCase):
2690
2691 2017-04-25  Chris Dumez  <cdumez@apple.com>
2692
2693         Content-Disposition header filename is ignored when 'download' attribute is specified in HTML
2694         https://bugs.webkit.org/show_bug.cgi?id=171239
2695         <rdar://problem/31789855>
2696
2697         Reviewed by Alex Christensen.
2698
2699         Add isAttachmentWithFilename() utility method to ResourceResponse to implement:
2700         - https://html.spec.whatwg.org/#as-a-download (Step 2)
2701
2702         Test: http/tests/download/anchor-download-attribute-content-disposition.html
2703
2704         * platform/network/ResourceResponseBase.cpp:
2705         (WebCore::ResourceResponseBase::isAttachmentWithFilename):
2706         * platform/network/ResourceResponseBase.h:
2707
2708 2017-04-25  Antti Koivisto  <antti@apple.com>
2709
2710         Enable expired-only reload policy on Mac and iOS
2711         https://bugs.webkit.org/show_bug.cgi?id=171264
2712         <rdar://problem/31807637>
2713
2714         Reviewed by Andreas Kling.
2715
2716         * loader/NavigationAction.cpp:
2717         (WebCore::navigationType):
2718
2719         Test for reload navigation type correctly.
2720
2721 2017-04-25  Miguel Gomez  <magomez@igalia.com>
2722
2723         Image decoders must have private constructors to avoid refcount misuse: ASSERTION FAILED: m_deletionHasBegun when destroying ImageDecoder
2724         https://bugs.webkit.org/show_bug.cgi?id=171211
2725
2726         Reviewed by Carlos Garcia Campos.
2727
2728         Add a create method to each of the decoders and set their constructors as private. Change
2729         ICOImageDecoder to store its internal PNG decoders as RefPtr and use the new create method, and
2730         change ImageDecoder to use the create methods as well.
2731
2732         Covered by existent tests.
2733
2734         * platform/image-decoders/ImageDecoder.cpp:
2735         (WebCore::ImageDecoder::create):
2736         * platform/image-decoders/bmp/BMPImageDecoder.h:
2737         * platform/image-decoders/gif/GIFImageDecoder.h:
2738         * platform/image-decoders/ico/ICOImageDecoder.cpp:
2739         (WebCore::ICOImageDecoder::decodeAtIndex):
2740         * platform/image-decoders/ico/ICOImageDecoder.h:
2741         * platform/image-decoders/jpeg/JPEGImageDecoder.h:
2742         * platform/image-decoders/png/PNGImageDecoder.h:
2743         * platform/image-decoders/webp/WEBPImageDecoder.h:
2744
2745 2017-04-25  Myles C. Maxfield  <mmaxfield@apple.com>
2746
2747         Build fix
2748
2749         Unreviewed.
2750
2751         No new tests because there is no behavior change.
2752
2753         * crypto/mac/SerializedCryptoKeyWrapMac.mm:
2754         (WebCore::wrapSerializedCryptoKey):
2755         (WebCore::unwrapSerializedCryptoKey):
2756
2757 2017-04-25  Wenson Hsieh  <wenson_hsieh@apple.com>
2758
2759         Support reading NSURL titles from the pasteboard when performing data interaction
2760         https://bugs.webkit.org/show_bug.cgi?id=171156
2761         <rdar://problem/31356937>
2762
2763         Reviewed by Tim Horton.
2764
2765         Support reading link titles from the pasteboard when performing data interaction. To do this, we refactor
2766         Pasteboard::readURL to take in an additional String& title which is ultimately plumbed to the PlatformPasteboard
2767         where it is set to the value of -[NSURL _title].
2768
2769         Test: DataInteractionTests.ExternalSourceTitledNSURL.
2770
2771         * editing/FrameSelection.h:
2772         * editing/ios/EditorIOS.mm:
2773         (WebCore::Editor::WebContentReader::readURL):
2774         * page/DragController.cpp:
2775         (WebCore::DragController::performDragOperation):
2776         (WebCore::DragController::concludeEditDrag):
2777
2778         Move calls to clearDragCaret() out of concludeEditDrag and into the call site, in performDragOperation after
2779         attempting to concludeEditDrag. This is done so that if the WebEditorClient queries whether the drag caret is
2780         in richly editable content for the purposes of generating a document fragment to insert, the answer will not
2781         always be false as a drop is occurring.
2782
2783         * platform/PasteboardStrategy.h:
2784         * platform/PlatformPasteboard.h:
2785         * platform/ios/PasteboardIOS.mm:
2786         (WebCore::Pasteboard::respectsUTIFidelities):
2787         (WebCore::Pasteboard::readString):
2788         * platform/ios/PlatformPasteboardIOS.mm:
2789         (WebCore::PlatformPasteboard::readURL):
2790
2791 2017-04-24  Andy VanWagoner  <thetalecrafter@gmail.com>
2792
2793         Clean up ICU headers
2794         https://bugs.webkit.org/show_bug.cgi?id=170997
2795
2796         Reviewed by JF Bastien.
2797
2798         Update all icu headers to 55.1
2799
2800         * icu/LICENSE: Update copyright
2801         * icu/README: Explain ICU headers for OS X better
2802         * icu/unicode/localpointer.h:
2803         (LocalPointer::LocalPointer):
2804         (LocalPointer::adoptInsteadAndCheckErrorCode):
2805         * icu/unicode/platform.h:
2806         * icu/unicode/putil.h:
2807         * icu/unicode/std_string.h:
2808         * icu/unicode/ubrk.h:
2809         * icu/unicode/uchar.h:
2810         * icu/unicode/ucnv.h:
2811         * icu/unicode/ucol.h:
2812         * icu/unicode/ucoleitr.h:
2813         * icu/unicode/uconfig.h:
2814         * icu/unicode/ucurr.h:
2815         * icu/unicode/uidna.h:
2816         * icu/unicode/uloc.h:
2817         * icu/unicode/umachine.h:
2818         * icu/unicode/unistr.h:
2819         (UnicodeString::getArrayStart):
2820         (UnicodeString::UnicodeString):
2821         (UnicodeString::hasShortLength):
2822         (UnicodeString::getShortLength):
2823         (UnicodeString::length):
2824         (UnicodeString::getCapacity):
2825         (UnicodeString::isBogus):
2826         (UnicodeString::isWritable):
2827         (UnicodeString::isBufferWritable):
2828         (UnicodeString::getBuffer):
2829         (UnicodeString::isEmpty):
2830         (UnicodeString::setZeroLength):
2831         (UnicodeString::setShortLength):
2832         (UnicodeString::setLength):
2833         (UnicodeString::setToEmpty):
2834         (UnicodeString::remove):
2835         * icu/unicode/urename.h:
2836         * icu/unicode/uscript.h:
2837         * icu/unicode/usearch.h:
2838         * icu/unicode/uset.h:
2839         * icu/unicode/ustring.h:
2840         * icu/unicode/utf8.h:
2841         * icu/unicode/utypes.h:
2842         * icu/unicode/uvernum.h:
2843
2844 2017-04-24  Jiewen Tan  <jiewen_tan@apple.com>
2845
2846         LayoutTests crypto/subtle/ecdsa-generate-key-sign-verify-p384.html and crypto/subtle/ecdsa-generate-key-sign-verify-p256.html are flaky failures
2847         https://bugs.webkit.org/show_bug.cgi?id=171059
2848         <rdar://problem/31734958>
2849
2850         Reviewed by Brent Fulgham.
2851
2852         Covered by existing tests.
2853
2854         * crypto/mac/CryptoAlgorithmECDSAMac.cpp:
2855         (WebCore::signECDSA):
2856         Enhance ways to convert the DER signatures produced from CommonCrypto to r||s.
2857
2858 2017-04-24  Manuel Rego Casasnovas  <rego@igalia.com>
2859
2860         [selectors4] :focus-within should use the flat tree
2861         https://bugs.webkit.org/show_bug.cgi?id=170899
2862
2863         Reviewed by Antti Koivisto.
2864
2865         This has been discussed in the following CSS WG issue:
2866         https://github.com/w3c/csswg-drafts/issues/1135
2867
2868         And the spec has been updated (https://drafts.csswg.org/selectors-4/#the-focus-within-pseudo):
2869         "An element also matches :focus-within if one of its descendants in the flat tree
2870          (including non-element nodes, such as text nodes) matches the conditions for matching :focus."
2871
2872         Test: imported/w3c/web-platform-tests/css/selectors4/focus-within-shadow-006.html
2873
2874         * dom/Element.cpp:
2875         (WebCore::Element::setFocus): Use "flat tree" ("composed tree" in WebKit)
2876         to set focus-within flag.
2877
2878 2017-04-24  Wenson Hsieh  <wenson_hsieh@apple.com>
2879
2880         Respect fidelity order when reading web content from item providers
2881         https://bugs.webkit.org/show_bug.cgi?id=171155
2882         <rdar://problem/31356937>
2883
2884         Reviewed by Tim Horton.
2885
2886         Currently, when reading web content from pasteboards, we assume the old UIPasteboard/NSPasteboard model wherein
2887         the destination must determine which of the items is considered to have the highest fidelity for the purposes of
2888         inserting into an editable area. This destination-side fidelity ranking is determined solely by the NSArray
2889         returned from Pasteboard::supportedPasteboardTypes, which lists compatible types in order from highest fidelity
2890         to lowest fidelity. Pasteboard::read effectively iterates over this list of types in order, attempting to read
2891         highest fidelity types and bailing when it first successfully reads data.
2892
2893         However, when our pasteboard is backed by UIItemProviders, we should instead read pasteboard types in order of
2894         fidelity as specified by the source rather than the destination. To accomplish this, we introduce an alternate
2895         codepath, Pasteboard::readRespectingUTIFidelities, which we take if Pasteboard::respectsUTIFidelities is true
2896         (currently, this only applies for the purposes of data interaction). This version follows a different flow:
2897         for each item in the pasteboard, we ask for just the UTIs for that item, in order of fidelity. For each item,
2898         we then call readPasteboardWebContentDataForType to try and read data for that type, continuing until either
2899         all UTIs have been attempted, or reading was successful.
2900
2901         This patch makes two additional adjustments. First, we introduce Pasteboard::getTypesByFidelityForItemAtIndex,
2902         which is used by Pasteboard::readRespectingUTIFidelities when querying the list of supported UTIs for each
2903         pasteboard item, sorted by highest to lowest fidelity.
2904
2905         Secondly, we refactor logic to write to the item provider pasteboard in PlatformPasteboardIOS. Since we are
2906         now respecting fidelity rankings on the destination, the source must also register UTI types in the right
2907         fidelity order. While this was mostly achieved using our existing method of writing a list of object
2908         representations to the pasteboard and then all of the contents of a NSString => NSData dictionary containing
2909         private UTI data, this approach has two flaws:
2910         1.  We are unable to register high-priority custom types, followed by representing objects, followed by more
2911             lower-priority custom types, since we assume that all custom types follow all representing objects.
2912         2.  Since we're just iterating over a dictionary of NSString => NSData when registering custom UTI
2913             representations to the item provider, there cannot inherently be any fidelity ordering for custom types.
2914
2915         To address both of these issues, we introduce two new objects that encapsulate how we register data to the item
2916         provider pasteboard. WebItemProviderRegistrationInfo represents some data that can be registered to an item
2917         provider (either an object conforming to UIItemProviderWriting, or an NSString and NSData).
2918         WebItemProviderRegistrationInfoList represents a list of WebItemProviderRegistrationInfos in order of highest to
2919         lowest fidelity. In PlatformPasteboardIOS, we transform PasteboardWebContent, PasteboardImage, and PasteboardURL
2920         into a WebItemProviderRegistrationInfoList, which we then pass along to the WebItemProviderPasteboard. In
2921         WebItemProviderPasteboard, we traverse the list of WebItemProviderRegistrationInfos in the list and register
2922         each WebItemProviderRegistrationInfo's representing object or data to the item provider.
2923
2924         Test: DataInteractionTests.RespectsExternalSourceFidelityRankings.
2925
2926         * WebCore.xcodeproj/project.pbxproj:
2927         * platform/Pasteboard.h:
2928         * platform/PasteboardStrategy.h:
2929         * platform/PlatformPasteboard.h:
2930         * platform/ios/AbstractPasteboard.h:
2931         * platform/ios/AbstractPasteboard.mm: Removed.
2932
2933         Moves WebItemProviderData, formerly implemented in AbstractPasteboard.mm, into WebItemProviderPasteboard.mm.
2934         We can delete AbstractPasteboard.mm as a result.
2935
2936         * platform/ios/PasteboardIOS.mm:
2937         (WebCore::readPasteboardWebContentDataForType):
2938
2939         Pull out common logic for reading data given a UTI type from the pasteboard into the PasteboardWebContentReader.
2940         This is invoked from both the existing Pasteboard::read codepath, as well as the readRespectingUTIFidelities
2941         codepath.
2942
2943         (WebCore::Pasteboard::read):
2944
2945         Refactored to call the new readPasteboardWebContentDataForType helper. Behavior should not have changed, unless
2946         the pasteboard supports UTI fidelities.
2947
2948         (WebCore::Pasteboard::respectsUTIFidelities):
2949         (WebCore::Pasteboard::readRespectingUTIFidelities):
2950
2951         An alternative to Pasteboard::read that considers source-side fidelity rankings of UTIs.
2952
2953         * platform/ios/PlatformPasteboardIOS.mm:
2954         (WebCore::PlatformPasteboard::getTypesByFidelityForItemAtIndex):
2955         (WebCore::PlatformPasteboard::writeObjectRepresentations):
2956
2957         Refactored to build a WebItemProviderRegistrationInfoList and pass it to the WebItemProviderPasteboard to
2958         register items and data.
2959
2960         (WebCore::PlatformPasteboard::write):
2961         * platform/ios/WebItemProviderPasteboard.h:
2962         * platform/ios/WebItemProviderPasteboard.mm:
2963         (-[WebItemProviderRegistrationInfo initWithRepresentingObject:typeIdentifier:data:]):
2964         (-[WebItemProviderRegistrationInfo representingObject]):
2965         (-[WebItemProviderRegistrationInfo typeIdentifier]):
2966         (-[WebItemProviderRegistrationInfo data]):
2967
2968         Represents a single calls to register data onto the item provider pasteboard. See
2969         WebItemProviderPasteboard.h header comments for more info.
2970
2971         (-[WebItemProviderRegistrationInfoList init]):
2972         (-[WebItemProviderRegistrationInfoList addData:forType:]):
2973         (-[WebItemProviderRegistrationInfoList addRepresentingObject:]):
2974         (-[WebItemProviderRegistrationInfoList numberOfItems]):
2975         (-[WebItemProviderRegistrationInfoList itemAtIndex:]):
2976         (-[WebItemProviderRegistrationInfoList enumerateItems:]):
2977
2978         Represents a series of calls to register representations onto the item provider pasteboard. See
2979         WebItemProviderPasteboard.h header comments for more info.
2980
2981         (-[WebItemProviderPasteboard pasteboardTypesByFidelityForItemAtIndex:]):
2982         (-[WebItemProviderPasteboard setItemsUsingRegistrationInfoLists:]):
2983         (-[WebItemProviderPasteboard setItemsFromObjectRepresentations:]): Deleted.
2984
2985 2017-04-24  Chris Dumez  <cdumez@apple.com>
2986
2987         Regression(r204605): support for "cp874" charset alias was inadvertently dropped which may cause issues on certain Thai sites
2988         https://bugs.webkit.org/show_bug.cgi?id=171128
2989         <rdar://problem/31526844>
2990
2991         Reviewed by Alexey Proskuryakov.
2992
2993         When using Thai as default language on MacOS, defaultTextEncodingNameForSystemLanguage()
2994         was returning "cp874" encoding with was dropped in r204605 for not being part of the
2995         encoding specification (https://encoding.spec.whatwg.org/#names-and-labels).
2996
2997         To address the issue, we map "cp874" encoding to the "dos-874" encoding which is
2998         properly recognized. Without this, this could lead to issue on WebSites that do not
2999         specify a charset.
3000
3001         * platform/text/TextEncodingRegistry.cpp:
3002         (WebCore::defaultTextEncodingNameForSystemLanguage):
3003
3004 2017-04-24  Said Abou-Hallawa  <sabouhallawa@apple.com>
3005
3006         [CG] Provide a type identifier hint to the CGImageSource so getting the type identifier is more accurate
3007         https://bugs.webkit.org/show_bug.cgi?id=171042
3008
3009         Reviewed by Tim Horton.
3010
3011         The image URL can be used to get the type identifier hint. Without providing
3012         this hint, the image type identifier is not accurate for image formats.
3013
3014         Also add a function to the ImageDecoder class to get the typeIdentifier. Add
3015         all the pluming from the ImageDecoder till the Image class.
3016
3017         * WebCore.xcodeproj/project.pbxproj:
3018         * platform/graphics/BitmapImage.cpp:
3019         (WebCore::BitmapImage::destroyDecodedData):
3020         (WebCore::BitmapImage::frameImageAtIndexCacheIfNeeded):
3021         (WebCore::BitmapImage::draw):
3022         (WebCore::BitmapImage::internalStartAnimation):
3023         (WebCore::BitmapImage::advanceAnimation):
3024         (WebCore::BitmapImage::internalAdvanceAnimation):
3025         (WebCore::BitmapImage::newFrameNativeImageAvailableAtIndex):
3026         * platform/graphics/BitmapImage.h:
3027         * platform/graphics/Image.cpp:
3028         (WebCore::Image::sourceURL):
3029         * platform/graphics/Image.h: Change the sourceURL() to return a URL so CG can create CFURLRef from it.
3030         (WebCore::Image::uti):
3031         * platform/graphics/ImageFrameCache.cpp:
3032         (WebCore::ImageFrameCache::cacheAsyncFrameNativeImageAtIndex):
3033         (WebCore::ImageFrameCache::startAsyncDecodingQueue):
3034         (WebCore::ImageFrameCache::requestFrameAsyncDecodingAtIndex):
3035         (WebCore::ImageFrameCache::stopAsyncDecodingQueue):
3036         (WebCore::ImageFrameCache::clearMetadata):
3037         (WebCore::ImageFrameCache::sourceURL):
3038         (WebCore::ImageFrameCache::encodedDataStatus):
3039         (WebCore::ImageFrameCache::uti):
3040         (WebCore::ImageFrameCache::filenameExtension):
3041         * platform/graphics/ImageFrameCache.h:
3042         * platform/graphics/ImageSource.cpp:
3043         (WebCore::ImageSource::ensureDecoderAvailable):
3044         * platform/graphics/ImageSource.h:
3045         (WebCore::ImageSource::uti):
3046         * platform/graphics/cg/ImageDecoderCG.cpp:
3047         (WebCore::ImageDecoder::ImageDecoder): Pass the type identifier hint to CGImageSourceCreateIncremental().
3048         (WebCore::ImageDecoder::uti):
3049         (WebCore::ImageDecoder::filenameExtension):
3050         (WebCore::ImageDecoder::frameHasAlphaAtIndex):
3051         (WebCore::ImageDecoder::createFrameImageAtIndex):
3052         * platform/graphics/cg/ImageDecoderCG.h:
3053         (WebCore::ImageDecoder::create):
3054         * platform/graphics/win/ImageDecoderDirect2D.cpp:
3055         (WebCore::ImageDecoder::encodedDataStatus):
3056         * platform/graphics/win/ImageDecoderDirect2D.h:
3057         (WebCore::ImageDecoder::create): Add an argument of type URL.
3058         * platform/image-decoders/ImageDecoder.cpp:
3059         (WebCore::ImageDecoder::create): Add an argument of type URL.
3060         * platform/image-decoders/ImageDecoder.h:
3061         (WebCore::ImageDecoder::encodedDataStatus): Make it const.
3062         * platform/image-decoders/bmp/BMPImageDecoder.cpp:
3063         (WebCore::BMPImageDecoder::encodedDataStatus):
3064         * platform/image-decoders/bmp/BMPImageDecoder.h:
3065         * platform/image-decoders/gif/GIFImageDecoder.cpp:
3066         (WebCore::GIFImageDecoder::encodedDataStatus):
3067         * platform/image-decoders/gif/GIFImageDecoder.h:
3068         * platform/image-decoders/ico/ICOImageDecoder.cpp:
3069         (WebCore::ICOImageDecoder::encodedDataStatus):
3070         * platform/image-decoders/ico/ICOImageDecoder.h:
3071         * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
3072         (WebCore::JPEGImageDecoder::encodedDataStatus):
3073         * platform/image-decoders/jpeg/JPEGImageDecoder.h:
3074         * platform/image-decoders/png/PNGImageDecoder.cpp:
3075         (WebCore::PNGImageDecoder::encodedDataStatus):
3076         * platform/image-decoders/png/PNGImageDecoder.h:
3077         * platform/image-decoders/webp/WEBPImageDecoder.cpp:
3078         (WebCore::WEBPImageDecoder::encodedDataStatus):
3079         * platform/image-decoders/webp/WEBPImageDecoder.h:
3080         * platform/spi/cg/ImageIOSPI.h: Added.
3081
3082 2017-04-24  Ryan Haddad  <ryanhaddad@apple.com>
3083
3084         Unreviewed build fix.
3085
3086         * crypto/mac/CryptoAlgorithmAES_GCMMac.cpp:
3087         (WebCore::encryptAES_GCM):
3088         (WebCore::decyptAES_GCM):
3089
3090 2017-04-24  Said Abou-Hallawa  <sabouhallawa@apple.com>
3091
3092         Whitelist supported image MIME types
3093         https://bugs.webkit.org/show_bug.cgi?id=171077
3094
3095         Reviewed by Tim Horton.
3096
3097         Restrict the CG port image formats to a known whitelist. Build this list from image
3098         UTI's instead of MIME types, since the image UTI's is a superset of the MIME types.
3099         Use this list to build the list of supported image MIME types.
3100
3101         * PlatformAppleWin.cmake:
3102         * WebCore.xcodeproj/project.pbxproj:
3103         * platform/MIMETypeRegistry.cpp:
3104         (WebCore::initializeSupportedImageMIMETypes):
3105         * platform/graphics/cg/UTIRegistry.cpp: Added.
3106         (WebCore::allowedImageUTIs):
3107         (WebCore::isAllowedImageUTI):
3108         * platform/graphics/cg/UTIRegistry.h: Added.
3109
3110 2017-04-24  Nan Wang  <n_wang@apple.com>
3111
3112         AX: Crash at WebCore::AXObjectCache::characterOffsetForIndex(int, WebCore::AccessibilityObject const*) + 703
3113         https://bugs.webkit.org/show_bug.cgi?id=171247
3114
3115         Reviewed by Chris Fleizach.
3116
3117         Crashed because we were passing a nil node into rootAXEditableElement(). Fixed it by
3118         adding a null check.
3119
3120         Test: accessibility/mac/input-string-for-range-crash.html
3121
3122         * accessibility/AXObjectCache.cpp:
3123         (WebCore::AXObjectCache::characterOffsetForIndex):
3124
3125 2017-04-24  Youenn Fablet  <youenn@apple.com>
3126
3127         Set defaults video getUserMedia constraints
3128         https://bugs.webkit.org/show_bug.cgi?id=171127
3129
3130         Reviewed by Eric Carlson.
3131
3132         Test: fast/mediastream/getUserMedia-default.html
3133
3134         Adding default optional constraints for video size and frame rate if none is defined.
3135         Default is 640x480 30fps.
3136
3137         Doing some refactoring in MeddiaConstraintsImpl and MeddiaConstraintsData to use more move constructors.
3138
3139         * Modules/mediastream/MediaConstraintsImpl.cpp:
3140         (WebCore::defaultVideoConstraints):
3141         (WebCore::MediaConstraintsData::setDefaultVideoConstraints):
3142         (WebCore::MediaConstraintsImpl::create): Deleted.
3143         * Modules/mediastream/MediaConstraintsImpl.h:
3144         * Modules/mediastream/MediaDevices.cpp:
3145         (WebCore::MediaDevices::getUserMedia):
3146         * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
3147         (WebCore::MockRealtimeVideoSourceMac::updateSampleBuffer): Fixing crash when setting frameRate.
3148
3149 2017-04-24  Chris Dumez  <cdumez@apple.com>
3150
3151         createElementNS() should now throw only InvalidCharacterError, not NamespaceError
3152         https://bugs.webkit.org/show_bug.cgi?id=171052
3153
3154         Reviewed by Sam Weinig.
3155
3156         Validating a qualified name should only throw InvalidCharacterError, not NamespaceError,
3157         after:
3158         - https://github.com/whatwg/dom/issues/319
3159         - https://github.com/w3c/web-platform-tests/issues/5161
3160         - https://github.com/whatwg/dom/issues/423
3161
3162         Latest spec:
3163         - https://dom.spec.whatwg.org/#validate
3164
3165         No new tests, updated web-platform-tests.
3166
3167         * dom/Document.cpp:
3168         (WebCore::Document::parseQualifiedName):
3169
3170 2017-04-24  Chris Dumez  <cdumez@apple.com>
3171
3172         REGRESSION (214503): Webkit crash under RenderElement::repaintForPausedImageAnimationsIfNeeded() when scrolling giphy pages
3173         https://bugs.webkit.org/show_bug.cgi?id=171243
3174         <rdar://problem/31715572>
3175
3176         Reviewed by Antti Koivisto.
3177
3178         After r214503, we would frequently crash when scrolling giphy pages because we were failing to call
3179         RenderView::removeRendererWithPausedImageAnimations(renderer, cachedImage) in some cases. This would
3180         cause a RenderElement to still be associated to a CachedImage in RenderView but not in practice.
3181         If the CachedImage then gets destroyed and the user scrolls, we end up calling
3182         RenderElement::repaintForPausedImageAnimationsIfNeeded() with a bad CachedImage.
3183
3184         StyleCachedImage was properly calling RenderView::removeRendererWithPausedImageAnimations() before
3185         unregistering the renderer as a client to the CachedImage. However, RenderImageResource was failing
3186         to do the same. To make this less error-prone, I added a didRemoveCachedImageClient(CachedImage&)
3187         function to the CachedImageClient interface. It is overriden in RenderElement only to call
3188         RenderView::removeRendererWithPausedImageAnimations().
3189
3190         Test: fast/images/animated-gif-scrolling-crash.html
3191
3192         * loader/cache/CachedImage.cpp:
3193         (WebCore::CachedImage::didRemoveClient):
3194         * loader/cache/CachedImageClient.h:
3195         (WebCore::CachedImageClient::didRemoveCachedImageClient):
3196         * rendering/RenderElement.cpp:
3197         (WebCore::RenderElement::didRemoveCachedImageClient):
3198         * rendering/RenderElement.h:
3199         * rendering/style/StyleCachedImage.cpp:
3200         (WebCore::StyleCachedImage::removeClient):
3201
3202 2017-04-24  Andy Estes  <aestes@apple.com>
3203
3204         [macOS] Fix two minor issues with MediaSelectionOption::Type
3205         https://bugs.webkit.org/show_bug.cgi?id=171235
3206
3207         Reviewed by Sam Weinig.
3208
3209         * platform/MediaSelectionOption.h: Gave type a default value, and added explicit
3210         constructors to make gcc and msvc happy.
3211         * platform/mac/WebPlaybackControlsManager.mm:
3212         (toAVTouchBarMediaSelectionOptionType): Added an ASSERT_NOT_REACHED if none of the switch
3213         cases match.
3214
3215 2017-04-24  Andy Estes  <aestes@apple.com>
3216
3217         [macOS] Enable media selection button on AVTouchBarScrubber
3218         https://bugs.webkit.org/show_bug.cgi?id=171149
3219         <rdar://problem/29875010>
3220
3221         Reviewed by Beth Dakin.
3222
3223         * platform/spi/cocoa/AVKitSPI.h:
3224
3225 2017-04-24  Alex Christensen  <achristensen@webkit.org>
3226
3227         Reduce copies and allocations in SharedBuffer::append
3228         https://bugs.webkit.org/show_bug.cgi?id=170956
3229
3230         Reviewed by Andreas Kling.
3231
3232         SharedBuffer was a mess of different data structures added over the years.
3233         SharedBuffer::append would allocate large Vector<char>s and call memcpy, and that
3234         is inefficient and causes crashes when large allocations fail, and the allocations
3235         and copies aren't even necessary.  There were also const correctness problems in
3236         ResourceLoader::addDataOrBuffer, and iterating a SharedBuffer was strange because
3237         sometimes we don't want to add unnecessary copies.
3238
3239         These problems are solved by making SharedBuffer a Vector of read-only data segments,
3240         which can be contained in various ways but we don't care because all we want to do is
3241         read them.  Appending SharedBuffers is now const correct because we just add to a
3242         Vector<Ref<DataSegment>> and neither SharedBuffer can write to the data.  Sometimes,
3243         though, we want all the data to be in continuous memory, and if there are multiple
3244         segments then the data needs to be copied once to a new segment.  We should audit the
3245         call sites of SharedBuffer::data and see if this is really necessary.
3246
3247         No change in functional behavior.  Fewer copies of the data are made when buffering
3248         data in the NetworkProcess.  No extra memory is allocated for bytes we think we might
3249         need to append in the future.  Data is now only copied into one buffer lazily as needed,
3250         which could slightly change when small delays from memcpy happen, but it's an overall
3251         improvement.  We could have a performance hit if we were to call append() then data()
3252         then append() then data() etc. but that doesn't happen in WebKit because we call append
3253         repeatedly when buffering the data then call data() once when reading the data.
3254
3255         * editing/cocoa/EditorCocoa.mm:
3256         (WebCore::archivedDataForAttributedString):
3257         (WebCore::Editor::selectionInWebArchiveFormat):
3258         (WebCore::Editor::dataInRTFDFormat):
3259         (WebCore::Editor::dataInRTFFormat):
3260         * editing/ios/EditorIOS.mm:
3261         (WebCore::Editor::WebContentReader::readURL):
3262         * editing/mac/EditorMac.mm:
3263         (WebCore::Editor::imageInWebArchiveFormat):
3264         * loader/TextTrackLoader.cpp:
3265         (WebCore::TextTrackLoader::processNewCueData):
3266         * loader/archive/cf/LegacyWebArchive.cpp:
3267         (WebCore::LegacyWebArchive::createResource):
3268         * loader/cache/CachedResource.cpp:
3269         (WebCore::CachedResource::tryReplaceEncodedData):
3270         * loader/cocoa/DiskCacheMonitorCocoa.mm:
3271         (WebCore::DiskCacheMonitor::tryGetFileBackedSharedBufferFromCFURLCachedResponse):
3272         * platform/SharedBuffer.cpp:
3273         (WebCore::SharedBuffer::SharedBuffer):
3274         (WebCore::SharedBuffer::create):
3275         (WebCore::SharedBuffer::combineToOneSegment):
3276         (WebCore::SharedBuffer::data):
3277         (WebCore::SharedBuffer::createArrayBuffer):
3278         (WebCore::SharedBuffer::append):
3279         (WebCore::SharedBuffer::clear):
3280         (WebCore::SharedBuffer::copy):
3281         (WebCore::SharedBuffer::DataSegment::data):
3282         (WebCore::SharedBuffer::DataSegment::size):
3283         (WebCore::segmentIndex): Deleted.
3284         (WebCore::offsetInSegment): Deleted.
3285         (WebCore::allocateSegment): Deleted.
3286         (WebCore::freeSegment): Deleted.
3287         (WebCore::SharedBuffer::~SharedBuffer): Deleted.
3288         (WebCore::SharedBuffer::size): Deleted.
3289         (WebCore::SharedBuffer::duplicateDataBufferIfNecessary): Deleted.
3290         (WebCore::SharedBuffer::appendToDataBuffer): Deleted.
3291         (WebCore::SharedBuffer::clearDataBuffer): Deleted.
3292         (WebCore::SharedBuffer::copyBufferAndClear): Deleted.
3293         (WebCore::SharedBuffer::buffer): Deleted.
3294         (WebCore::SharedBuffer::getSomeData): Deleted.
3295         (WebCore::SharedBuffer::maybeTransferMappedFileData): Deleted.
3296         (WebCore::SharedBuffer::clearPlatformData): Deleted.
3297         (WebCore::SharedBuffer::maybeTransferPlatformData): Deleted.
3298         (WebCore::SharedBuffer::hasPlatformData): Deleted.
3299         (WebCore::SharedBuffer::platformData): Deleted.
3300         (WebCore::SharedBuffer::maybeAppendPlatformData): Deleted.
3301         * platform/SharedBuffer.h:
3302         (WebCore::SharedBuffer::create): Deleted.
3303         (WebCore::SharedBuffer::isEmpty): Deleted.
3304         * platform/SharedBufferChunkReader.cpp:
3305         (WebCore::SharedBufferChunkReader::nextChunk):
3306         (WebCore::SharedBufferChunkReader::peek):
3307         * platform/SharedBufferChunkReader.h:
3308         * platform/URLParser.cpp:
3309         (WebCore::URLParser::URLParser):
3310         * platform/cf/KeyedEncoderCF.cpp:
3311         (WebCore::KeyedEncoderCF::finishEncoding):
3312         * platform/cf/SharedBufferCF.cpp:
3313         (WebCore::SharedBuffer::SharedBuffer):
3314         (WebCore::SharedBuffer::createCFData):
3315         (WebCore::SharedBuffer::create):
3316         (WebCore::SharedBuffer::hintMemoryNotNeededSoon):
3317         (WebCore::SharedBuffer::append):
3318         (WebCore::SharedBuffer::wrapCFData): Deleted.
3319         (WebCore::SharedBuffer::hasPlatformData): Deleted.
3320         (WebCore::SharedBuffer::platformData): Deleted.
3321         (WebCore::SharedBuffer::platformDataSize): Deleted.
3322         (WebCore::SharedBuffer::maybeTransferPlatformData): Deleted.
3323         (WebCore::SharedBuffer::clearPlatformData): Deleted.
3324         (WebCore::SharedBuffer::tryReplaceContentsWithPlatformBuffer): Deleted.
3325         (WebCore::SharedBuffer::maybeAppendPlatformData): Deleted.
3326         (WebCore::SharedBuffer::copyBufferAndClear): Deleted.
3327         (WebCore::SharedBuffer::copySomeDataFromDataArray): Deleted.
3328         (WebCore::SharedBuffer::singleDataArrayBuffer): Deleted.
3329         (WebCore::SharedBuffer::maybeAppendDataArray): Deleted.
3330         * platform/cocoa/NetworkExtensionContentFilter.mm:
3331         (WebCore::NetworkExtensionContentFilter::replacementData):
3332         * platform/cocoa/ParentalControlsContentFilter.mm:
3333         (WebCore::ParentalControlsContentFilter::replacementData):
3334         * platform/cocoa/SharedBufferCocoa.mm:
3335         (-[WebCoreSharedBufferData initWithSharedBufferDataSegment:]):
3336         (-[WebCoreSharedBufferData length]):
3337         (-[WebCoreSharedBufferData bytes]):
3338         (WebCore::SharedBuffer::create):
3339         (WebCore::SharedBuffer::createCFData):
3340         (WebCore::SharedBuffer::createFromReadingFile):
3341         (WebCore::SharedBuffer::createNSDataArray):
3342         (-[WebCoreSharedBufferData initWithSharedBufferDataBuffer:]): Deleted.
3343         (WebCore::SharedBuffer::wrapNSData): Deleted.
3344         (WebCore::SharedBuffer::existingCFData): Deleted.
3345         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
3346         (WebCore::WebCoreAVFResourceLoader::fulfillRequestWithResource):
3347         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
3348         (WebCore::FontPlatformData::openTypeTable):
3349         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
3350         (ResourceHandleStreamingClient::didReceiveBuffer):
3351         * platform/graphics/mac/ImageMac.mm:
3352         (WebCore::Image::loadPlatformResource):
3353         * platform/image-decoders/ImageDecoder.cpp:
3354         (WebCore::ImageDecoder::create):
3355         * platform/image-decoders/png/PNGImageDecoder.cpp:
3356         (WebCore::PNGImageReader::decode):
3357         * platform/ios/PlatformPasteboardIOS.mm:
3358         (WebCore::PlatformPasteboard::readBuffer):
3359         * platform/mac/PasteboardMac.mm:
3360         (WebCore::writeFileWrapperAsRTFDAttachment):
3361         (WebCore::Pasteboard::write):
3362         * platform/mac/PlatformPasteboardMac.mm:
3363         (WebCore::PlatformPasteboard::bufferForType):
3364         * platform/network/BlobResourceHandle.cpp:
3365         (WebCore::BlobResourceHandle::notifyReceiveData):
3366         * platform/network/MIMEHeader.cpp:
3367         * platform/network/MIMEHeader.h:
3368         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
3369         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveData):
3370         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
3371         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveData):
3372         * platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
3373         (-[WebCoreResourceHandleAsDelegate connection:didReceiveData:lengthReceived:]):
3374         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
3375         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveData:lengthReceived:]):
3376         * platform/soup/SharedBufferSoup.cpp:
3377         (WebCore::SharedBuffer::SharedBuffer):
3378         (WebCore::SharedBuffer::createSoupBuffer):
3379         (WebCore::SharedBuffer::clearPlatformData): Deleted.
3380         (WebCore::SharedBuffer::maybeTransferPlatformData): Deleted.
3381         (WebCore::SharedBuffer::hasPlatformData): Deleted.
3382         (WebCore::SharedBuffer::platformData): Deleted.
3383         (WebCore::SharedBuffer::platformDataSize): Deleted.
3384         (WebCore::SharedBuffer::maybeAppendPlatformData): Deleted.
3385         (WebCore::SharedBuffer::tryReplaceContentsWithPlatformBuffer): Deleted.
3386
3387 2017-04-24  Dan Bernstein  <mitz@apple.com>
3388
3389         [Cocoa] Some ivars are needlessly @protected
3390         https://bugs.webkit.org/show_bug.cgi?id=171208
3391
3392         Reviewed by Anders Carlsson.
3393
3394         Made ivars @private where possible.
3395
3396         * platform/mac/WebCoreFullScreenPlaceholderView.h:
3397         * platform/mac/WebCoreFullScreenWarningView.h:
3398         * platform/mac/WebPlaybackControlsManager.h:
3399         * platform/network/cocoa/WebCoreNSURLSession.h:
3400
3401 2017-04-24  Carlos Garcia Campos  <cgarcia@igalia.com>
3402
3403         [GTK] Switch to use ENABLE_REMOTE_INSPECTOR instead of ENABLE_INSPECTOR_SERVER for the remote inspector
3404         https://bugs.webkit.org/show_bug.cgi?id=166680
3405
3406         Reviewed by Michael Catanzaro.
3407
3408         Add PageDebuggable.cpp to the compilation.
3409
3410         * CMakeLists.txt:
3411
3412 2017-04-23  Commit Queue  <commit-queue@webkit.org>
3413
3414         Unreviewed, rolling out r215657 and r215676.
3415         https://bugs.webkit.org/show_bug.cgi?id=171201
3416
3417         Broke the build (Requested by ap on #webkit).
3418
3419         Reverted changesets:
3420
3421         "[macOS] Enable media selection button on AVTouchBarScrubber"
3422         https://bugs.webkit.org/show_bug.cgi?id=171149
3423         http://trac.webkit.org/changeset/215657
3424
3425         "Build fix after r215657."
3426         http://trac.webkit.org/changeset/215676
3427
3428 2017-04-23  Andy Estes  <aestes@apple.com>
3429
3430         [macOS] AVTouchBarMediaSelectionOptions should be created with the correct type
3431         https://bugs.webkit.org/show_bug.cgi?id=171192
3432         <rdar://problem/29875010>
3433