Update NetworkStorageSession to support multiple persistent sessions and explicitly...
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-04-27  Brady Eidson  <beidson@apple.com>
2
3         Update NetworkStorageSession to support multiple persistent sessions and explicitly set cookie storages.
4         https://bugs.webkit.org/show_bug.cgi?id=171365
5
6         Reviewed by Andy Estes.
7
8         No new tests (No testable behavior change yet).
9
10         * platform/network/NetworkStorageSession.cpp:
11         (WebCore::NetworkStorageSession::destroySession):
12         * platform/network/NetworkStorageSession.h:
13         
14         * platform/network/NetworkStorageSessionStub.cpp:
15         (WebCore::NetworkStorageSession::ensurePrivateBrowsingSession):
16         (WebCore::NetworkStorageSession::ensureSession):
17         
18         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
19         (WebCore::createCFStorageSessionForIdentifier):
20         (WebCore::NetworkStorageSession::NetworkStorageSession):
21         (WebCore::NetworkStorageSession::switchToNewTestingSession):
22         (WebCore::NetworkStorageSession::defaultStorageSession):
23         (WebCore::NetworkStorageSession::ensurePrivateBrowsingSession):
24         (WebCore::NetworkStorageSession::ensureSession):
25         (WebCore::NetworkStorageSession::cookieStorage):
26         
27         * platform/network/soup/NetworkStorageSessionSoup.cpp:
28         (WebCore::NetworkStorageSession::ensureSession):
29         
30         * platform/spi/cf/CFNetworkSPI.h:
31
32 2017-04-27  Zalan Bujtas  <zalan@apple.com>
33
34         Use text-shadow to visualize simple line layout coverage.
35         https://bugs.webkit.org/show_bug.cgi?id=171379
36
37         Reviewed by Antti Koivisto.
38
39         It's more subtle (for everyday use).
40
41         * rendering/SimpleLineLayoutFunctions.cpp:
42         (WebCore::SimpleLineLayout::paintFlow):
43         (WebCore::SimpleLineLayout::paintDebugBorders): Deleted.
44
45 2017-04-27  Joanmarie Diggs  <jdiggs@igalia.com>
46
47         [ATK] ARIA alertdialogs should be exposed with ROLE_DIALOG
48         https://bugs.webkit.org/show_bug.cgi?id=171187
49
50         Reviewed by Chris Fleizach.
51
52         Map ApplicationAlertDialogRole to ATK_ROLE_DIALOG. While ATK_ROLE_ALERT is
53         appropriate as far as ATK is concerned, the Core Accessibility API Mappings
54         map ARIA's alertdialog role to ATK_ROLE_DIALOG. We should be consistent
55         with the spec. The fact that this is an alert dialog can still be obtained
56         via the AtkObject attributes.
57
58         No new tests needed. Update the expectations for roles-exposed.html,
59         xml-roles-exposed.html, and aria-mappings.html to reflect the change.
60
61         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
62         (atkRole):
63
64 2017-04-27  Antti Koivisto  <antti@apple.com>
65
66         Repeated layouts in Mail due to viewport units being used with auto-sizing
67         https://bugs.webkit.org/show_bug.cgi?id=171371
68         <rdar://problem/28780084>
69
70         Reviewed by Zalan Bujtas.
71
72         Test: css3/viewport-percentage-lengths/vh-auto-size.html
73
74         Auto-sizing code would adjust the size of the view in the beginning of layout(). This would
75         end up invalidating style for elements that use vh units and we would perform main layout
76         with unclean style. This would result in endless layout loops and hit assert on debug.
77
78         * page/FrameView.cpp:
79         (WebCore::FrameView::availableContentSizeChanged):
80
81             Ensure we heve clean style after resize if we are in pre-layout.
82
83 2017-04-27  Alex Christensen  <achristensen@webkit.org>
84
85         Modernize Frame.h
86         https://bugs.webkit.org/show_bug.cgi?id=171357
87
88         Reviewed by Andy Estes.
89
90         Frame.h has several std::unique_ptrs that are created in the constructor, never null,
91         and destroyed in the destructor.  This is what WTF::UniqueRef is for, and using UniqueRef
92         allows us to not check for null values because a UniqueRef can never be null.
93         An interesting case was the EventHandler, which we explicitly set to nullptr in the destructor
94         of MainFrame, a subclass of Frame.  We added this in r199181 to fix a crash tested by
95         fast/events/wheel-event-destroys-frame.html and this improved lifetime also does not crash
96         or assert in that test.
97
98         Using UniqueRef also requires const correctness, which this patch adds when necessary.
99
100         * accessibility/AccessibilityObject.cpp:
101         (WebCore::AccessibilityObject::dispatchTouchEvent):
102         * editing/DeleteSelectionCommand.cpp:
103         (WebCore::DeleteSelectionCommand::calculateTypingStyleAfterDelete):
104         * editing/Editor.cpp:
105         (WebCore::Editor::isSelectTrailingWhitespaceEnabled):
106         (WebCore::Editor::computeAndSetTypingStyle):
107         * editing/Editor.h:
108         * editing/FrameSelection.cpp:
109         (WebCore::FrameSelection::contains):
110         (WebCore::FrameSelection::copyTypingStyle):
111         * editing/FrameSelection.h:
112         (WebCore::FrameSelection::setTypingStyle):
113         * loader/EmptyClients.cpp:
114         * loader/FrameLoader.cpp:
115         (WebCore::FrameLoader::clear):
116         * page/EditorClient.h:
117         * page/EventHandler.cpp:
118         (WebCore::EventHandler::hitTestResultAtPoint):
119         * page/EventHandler.h:
120         * page/Frame.cpp:
121         (WebCore::Frame::Frame):
122         (WebCore::Frame::setView):
123         (WebCore::Frame::injectUserScripts):
124         * page/Frame.h:
125         (WebCore::Frame::editor):
126         (WebCore::Frame::eventHandler):
127         (WebCore::Frame::selection):
128         (WebCore::Frame::animation):
129         (WebCore::Frame::script):
130         (WebCore::Frame::eventHandlerPtr): Deleted.
131         * page/MainFrame.cpp:
132         (WebCore::MainFrame::~MainFrame):
133         * replay/UserInputBridge.cpp:
134         (WebCore::UserInputBridge::handleContextMenuEvent):
135         * replay/UserInputBridge.h:
136
137 2017-04-27  Andy Estes  <aestes@apple.com>
138
139         Fix the macOS build.
140
141         * platform/mac/WebPlaybackControlsManager.h:
142
143 2017-04-27  Zalan Bujtas  <zalan@apple.com>
144
145         Text gets cut off when bailing out of simple line layout with widows.
146         https://bugs.webkit.org/show_bug.cgi?id=171370
147         <rdar://problem/31563414>
148
149         Reviewed by Antti Koivisto.
150
151         Normal line layout requires an extra layout to handle widows. See RenderBlockFlow::relayoutToAvoidWidows. 
152
153         Test: fast/multicol/simple-line-layout-widows-when-switching-over-to-normal-line-layout.html
154
155         * rendering/RenderBlockFlow.cpp:
156         (WebCore::RenderBlockFlow::ensureLineBoxes):
157
158 2017-04-27  Dean Jackson  <dino@apple.com>
159
160         Use the correct modern-media-controls
161         https://bugs.webkit.org/show_bug.cgi?id=171358
162
163         Reviewed by Antoine Quint.
164
165         * WebCore.xcodeproj/project.pbxproj:
166
167 2017-04-26  Dan Bernstein  <mitz@apple.com>
168
169         Reverted r215774.
170
171         That change wasn’t doing what it was intended to do and was inappropriate for WebCore.
172
173         * WebCore.xcodeproj/project.pbxproj:
174
175 2017-04-26  Said Abou-Hallawa  <sabouhallawa@apple.com>
176
177         Attempt to fix a PLT regression.
178         <rdar://problem/31826998>
179
180         Unreviewed.
181
182         Disable passing the TypeIdentifierHint to CGImageSourceCreateIncremental()
183         on iOS for now.
184
185         * platform/graphics/cg/ImageDecoderCG.cpp:
186         (WebCore::ImageDecoder::ImageDecoder):
187
188 2017-04-26  Joanmarie Diggs  <jdiggs@igalia.com>
189
190         [ATK] ARIA buttons which have a popup should be ATK_ROLE_PUSH_BUTTON; not ATK_ROLE_COMBO_BOX
191         https://bugs.webkit.org/show_bug.cgi?id=171182
192
193         Reviewed by Chris Fleizach.
194
195         Test: accessibility/gtk/button-with-aria-haspopup-is-not-a-combobox.html
196
197         WebCore Accessibility assigns PopUpButtonRole to collapsed select elements,
198         which the ATK code correctly maps to ATK_ROLE_COMBO_BOX. It turns out that
199         WebCore Accessibility also maps the ARIA button role to PopUpButtonRole if
200         it also has aria-haspopup. Add a check to atkRole() so that the latter case
201         is mapped to ATK_ROLE_PUSH_BUTTON.
202
203         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
204         (atkRole):
205
206 2017-04-26  Tim Horton  <timothy_horton@apple.com>
207
208         Should not drag x-apple-data-detectors links
209         https://bugs.webkit.org/show_bug.cgi?id=171352
210         <rdar://problem/31309081>
211
212         Reviewed by Beth Dakin.
213
214         Test: fast/events/do-not-drag-and-drop-data-detectors-link.html
215
216         These links are only meaningful in the context of the original document,
217         so they should not be draggable.
218
219         * editing/cocoa/DataDetection.h:
220         * editing/cocoa/DataDetection.mm:
221         (WebCore::DataDetection::dataDetectorURLProtocol):
222         (WebCore::DataDetection::isDataDetectorURL):
223         * page/DragController.cpp:
224         (WebCore::isDraggableLink):
225         Disallow dragging of <a href="x-apple-data-detectors://..."> links.
226
227 2017-04-26  Tim Horton  <timothy_horton@apple.com>
228
229         Revert accidentally smushed commit.
230
231         * editing/cocoa/DataDetection.h:
232         * editing/cocoa/DataDetection.mm:
233         (WebCore::DataDetection::dataDetectorURLProtocol): Deleted.
234         (WebCore::DataDetection::isDataDetectorURL): Deleted.
235         * page/DragController.cpp:
236         (WebCore::isDraggableLink):
237         * platform/mac/DragImageMac.mm:
238         (WebCore::createDragImageForLink):
239
240 2017-04-26  Alex Christensen  <achristensen@webkit.org>
241
242         REGRESSION (r215686): ASSERTION FAILED: data seen with webarchive/loading tests
243         https://bugs.webkit.org/show_bug.cgi?id=171340
244
245         Reviewed by Brady Eidson.
246
247         This fixes a flaky assertion in webarchive/loading/missing-data.html
248
249         * platform/cf/SharedBufferCF.cpp:
250         (WebCore::SharedBuffer::append):
251         If there's no CFDataRef, there's no need to append data.
252         This happens sometimes.
253
254 2017-04-26  Ryan Haddad  <ryanhaddad@apple.com>
255
256         Unreviewed, rolling out r215814.
257
258         The LayoutTest for this change is failing on ios-simulator and
259         is flaky on macOS.
260
261         Reverted changeset:
262
263         "Response.blob() does not set the content-type based on the
264         header value."
265         https://bugs.webkit.org/show_bug.cgi?id=170849
266         http://trac.webkit.org/changeset/215814
267
268 2017-04-26  Wenson Hsieh  <wenson_hsieh@apple.com>
269
270         WebItemProviderPasteboard should not synchronously load provided data
271         https://bugs.webkit.org/show_bug.cgi?id=171341
272         <rdar://problem/31614010>
273
274         Reviewed by Tim Horton.
275
276         Refactors WebItemProviderPasteboard to not require asynchronously loading item provider data. To accomplish this,
277         we ensure that before performing data interaction, the UTI type that the data operation target should consume is
278         propagated to the UI process prior to the web process receiving the signal from the UI process to begin the
279         data operation itself. This information is sent via WebPlatformStrategies::updatePreferredTypeIdentifiers, a new
280         pasteboard helper function.
281
282         * page/DragController.cpp:
283         (WebCore::DragController::DragController):
284         (WebCore::dragIsHandledByDocument):
285         (WebCore::DragController::performDragOperation):
286         (WebCore::DragController::dragEnteredOrUpdated):
287         (WebCore::DragController::updatePreferredTypeIdentifiersForDragHandlingMethod):
288         (WebCore::DragController::tryDocumentDrag):
289
290         Give DragHandlingMethod a richer representation of what type of action will be performed. DragController::
291         updatePreferredTypeIdentifiersForDragHandlingMethod uses this to determine what kinds of UTIs are acceptable for
292         the current drop session.
293
294         * page/DragController.h:
295         (WebCore::DragController::documentIsHandlingNonDefaultDrag):
296         * page/mac/DragControllerMac.mm:
297         (WebCore::DragController::updatePreferredTypeIdentifiersForDragHandlingMethod):
298
299         Updates the data interaction pasteboard's list of preferred type identifiers it should load upon data operation.
300
301         * platform/DragData.h:
302         * platform/PasteboardStrategy.h:
303         * platform/PlatformPasteboard.h:
304         * platform/ios/AbstractPasteboard.h:
305         * platform/ios/PlatformPasteboardIOS.mm:
306         (WebCore::PlatformPasteboard::updatePreferredTypeIdentifiers):
307         * platform/ios/WebItemProviderPasteboard.mm:
308
309         Introduce _preferredTypeIdentifiers, which -doAfterLoadingProvidedContentIntoFileURLs: uses as a hint when
310         determining which UTI to load for an item provider. In the absence of preferred type identifiers, the default
311         behavior is to use the highest fidelity type adhering to "public.content".
312
313         (-[WebItemProviderPasteboard init]):
314         (-[WebItemProviderPasteboard updatePreferredTypeIdentifiers:]):
315         (-[WebItemProviderPasteboard setItemProviders:]):
316         (-[WebItemProviderPasteboard dataForPasteboardType:inItemSet:]):
317         (-[WebItemProviderPasteboard valuesForPasteboardType:inItemSet:]):
318
319         Remove calls to -createObjectOfClass: and -copyDataRepresentation:. Instead, rely solely on the loaded file URL
320         to read and initialize data and objects from the pasteboard.
321
322         (-[WebItemProviderPasteboard doAfterLoadingProvidedContentIntoFileURLs:]):
323         (-[WebItemProviderPasteboard _tryToCreateObjectOfClass:usingProvider:]): Deleted.
324         * platform/mac/DragDataMac.mm:
325         (WebCore::DragData::updatePreferredTypeIdentifiers):
326
327 2017-04-26  Joanmarie Diggs  <jdiggs@igalia.com>
328
329         [ATK] Elements with a defined, non-false value for aria-current should expose ATK_STATE_ACTIVE
330         https://bugs.webkit.org/show_bug.cgi?id=171163
331
332         Reviewed by Chris Fleizach.
333
334         Add ATK_STATE_ACTIVE to the state set of elements which have a valid, non-false
335         value for aria-current, expose the value of via the "current" AtkObject attribute,
336         and emit state-change notifications when the value of aria-current changes from
337         non-false to false, or vice versa.
338
339         Tests: accessibility/gtk/aria-current-changed-notification.html
340                accessibility/gtk/aria-current.html
341
342         * accessibility/AXObjectCache.cpp:
343         (WebCore::AXObjectCache::handleAttributeChanged):
344         * accessibility/AXObjectCache.h:
345         * accessibility/AccessibilityObject.cpp:
346         (WebCore::AccessibilityObject::supportsARIACurrent):
347         (WebCore::AccessibilityObject::ariaCurrentValue):
348         * accessibility/AccessibilityObject.h:
349         * accessibility/atk/AXObjectCacheAtk.cpp:
350         (WebCore::AXObjectCache::postPlatformNotification):
351         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
352         (webkitAccessibleGetAttributes):
353         (setAtkStateSetFromCoreObject):
354         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
355         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]): Moved code returning
356         string value for aria-current into AccessibilityObject:ariaCurrentValue().
357
358 2017-04-26  Wenson Hsieh  <wenson_hsieh@apple.com>
359
360         WebItemProviderPasteboard should fetch preloaded assets from disk when possible
361         https://bugs.webkit.org/show_bug.cgi?id=171320
362         <rdar://problem/31614010>
363
364         Reviewed by Tim Horton.
365
366         Adds a mechanism to WebItemProviderPasteboard to remember the temporary file URLs of assets it has loaded using
367         doAfterLoadingProvidedContentIntoFileURLs:. When retrieving data from the pasteboard, we then see if we can
368         first fetch serialized data straight from disk instead of having to go through the item provider in both
369         -dataForPasteboardType:inItemSet: and -valuesForPasteboardType:inItemSet:.
370
371         See below annotations for more detail.
372
373         * platform/ios/AbstractPasteboard.h:
374         * platform/ios/PlatformPasteboardIOS.mm:
375         (WebCore::PlatformPasteboard::filenamesForDataInteraction):
376         * platform/ios/WebItemProviderPasteboard.h:
377         * platform/ios/WebItemProviderPasteboard.mm:
378
379         Introduces _typeToFileURLMaps, an array of dictionaries. A dictionary at the ith index of this array represents
380         a mapping of UTIs to loaded temo file URLs for the ith UIItemProvider in the _itemProviders array. Before data
381         interaction is performed, all entries in this array will be empty.
382
383         (-[WebItemProviderPasteboard init]):
384         (-[WebItemProviderPasteboard setItemProviders:]):
385         (-[WebItemProviderPasteboard _preLoadedDataConformingToType:forItemProviderAtIndex:]):
386         (-[WebItemProviderPasteboard dataForPasteboardType:inItemSet:]):
387         (-[WebItemProviderPasteboard valuesForPasteboardType:inItemSet:]):
388
389         Consult any loaded assets on disk before hitting UIItemProviders via the new
390         -_preLoadedDataConformingToType:forItemProviderAtIndex: helper method.
391
392         (-[WebItemProviderPasteboard _tryToCreateObjectOfClass:usingProvider:]):
393         (-[WebItemProviderPasteboard fileURLsForDataInteraction]):
394
395         Traverse _typeToFileURLMaps to collect all file URLs.
396
397         (-[WebItemProviderPasteboard doAfterLoadingProvidedContentIntoFileURLs:]):
398
399         Refactored to populate and set _typeToFileURLMaps when loading completes, rather than an array of file URLs.
400
401         (-[WebItemProviderPasteboard _tryToCreateAndAppendObjectOfClass:toArray:usingProvider:]): Deleted.
402         (-[WebItemProviderPasteboard filenamesForDataInteraction]): Deleted.
403
404         Correct an erroneously named method (replaces filenames with fileURLs).
405
406 2017-04-26  Youenn Fablet  <youenn@apple.com>
407
408         LayoutTest webrtc/datachannel/basic.html is a flaky crash
409         https://bugs.webkit.org/show_bug.cgi?id=170154
410         <rdar://problem/31288423>
411
412         Reviewed by Geoffrey Garen.
413
414         Before the patch, we are setting the channel handler client to null and then unregistering from observer to
415         libwebrtc data channel. Since this happens in two different threads, there might be a timing issue.
416
417         Removing this risk by first unregistering (done synchronously on the other thread), before setting client to null.
418         Made some clean-up related refactoring.
419
420         * Modules/mediastream/RTCDataChannel.cpp:
421         (WebCore::RTCDataChannel::create):
422         (WebCore::RTCDataChannel::close):
423         * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.cpp:
424         (WebCore::LibWebRTCDataChannelHandler::setClient):
425         (WebCore::LibWebRTCDataChannelHandler::close):
426         * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h:
427         * platform/mediastream/RTCDataChannelHandler.h:
428         * platform/mock/RTCDataChannelHandlerMock.cpp:
429         (WebCore::RTCDataChannelHandlerMock::setClient):
430         * platform/mock/RTCDataChannelHandlerMock.h:
431
432 2017-04-26  Alex Christensen  <achristensen@webkit.org>
433
434         Make user script injection more robust
435         https://bugs.webkit.org/show_bug.cgi?id=171339
436         <rdar://problem/30643691>
437
438         Reviewed by Geoffrey Garen.
439
440         * loader/EmptyClients.cpp:
441         * page/Frame.cpp:
442         (WebCore::Frame::injectUserScripts):
443         * page/UserContentController.cpp:
444         (WebCore::UserContentController::forEachUserScript):
445         (WebCore::UserContentController::forEachUserStyleSheet):
446         (WebCore::UserContentController::forEachUserMessageHandler):
447         * page/UserContentController.h:
448         * page/UserContentProvider.h:
449
450 2017-04-26  Zalan Bujtas  <zalan@apple.com>
451
452         RTL: recent searches popover is displayed in incorrect location
453         https://bugs.webkit.org/show_bug.cgi?id=171338
454         <rdar://problem/31377807>
455
456         Reviewed by Dean Jackson.
457
458         Compute the absolute coordinates for the popup the same way we do for the select dropdown.
459
460         * rendering/RenderSearchField.cpp:
461         (WebCore::RenderSearchField::showPopup):
462
463 2017-04-26  Said Abou-Hallawa  <sabouhallawa@apple.com>
464
465         Restrict WebKit image formats to a known whitelist
466         https://bugs.webkit.org/show_bug.cgi?id=170700
467
468         Reviewed by Tim Horton.
469
470         If the image format is not supported, the load should be canceled and the
471         image is marked a broken image.
472
473         Test: fast/images/image-formats-support.html
474
475         * loader/cache/CachedImage.cpp:
476         (WebCore::CachedImage::addIncrementalDataBuffer):
477         (WebCore::CachedImage::setImageDataBuffer):
478         (WebCore::CachedImage::finishLoading):
479         * loader/cache/CachedImage.h:
480
481 2017-04-26  Joanmarie Diggs  <jdiggs@igalia.com>
482
483         [ATK] Implement support for new ARIA 1.1 values of aria-haspopup
484         https://bugs.webkit.org/show_bug.cgi?id=171164
485
486         Reviewed by Chris Fleizach.
487
488         In ARIA 1.1, aria-haspopup's value type changed from true/false to a token.
489         Values: true, false (default, unless it's a combobox), dialog, grid, listbox
490         (default for combobox), menu, and tree. Any value of aria-haspopup that is
491         not included in the list of allowed values, including an empty string, must
492         be treated as if the value false had been provided.
493
494         Add AccessibilityObject::ariaPopupValue() to validate the value, handle implicit
495         values, and give platform assistive technologies a means to access that value.
496
497         If there is a valid, non-false value of aria-haspopup, include ATK_STATE_HAS_POPUP
498         in the AtkStateSet. Lastly, expose the value (rather than true/false) via the "haspop"
499         AtkObject attribute.
500
501         Test: accessibility/gtk/aria-haspopup.html
502
503         * accessibility/AccessibilityObject.h:
504         (WebCore::AccessibilityObject::ariaPopupValue):
505         (WebCore::AccessibilityObject::supportsARIAHasPopup):
506         * accessibility/AccessibilityRenderObject.cpp:
507         (WebCore::AccessibilityRenderObject::ariaHasPopup):
508         * accessibility/AccessibilityRenderObject.h:
509         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
510         (webkitAccessibleGetAttributes):
511         (setAtkStateSetFromCoreObject):
512
513 2017-04-26  Alex Christensen  <achristensen@webkit.org>
514
515         Fix CMake build.
516
517         * PlatformMac.cmake:
518
519 2017-04-26  Antti Koivisto  <antti@apple.com>
520
521         Enable expired-only reload policy on Mac and iOS
522         https://bugs.webkit.org/show_bug.cgi?id=171264
523         <rdar://problem/31807637>
524
525         Reviewed by Andreas Kling.
526
527         Limit the behavior to http and data URLs (where we explicitly know about expiration).
528
529         * html/HTMLLinkElement.cpp:
530         (WebCore::HTMLLinkElement::setCSSStyleSheet):
531         * loader/FrameLoader.cpp:
532         (WebCore::FrameLoader::subresourceCachePolicy):
533
534             Pass the URL so we can test for protocol.
535
536         * loader/FrameLoader.h:
537         * loader/NavigationAction.cpp:
538         (WebCore::navigationType):
539
540             Test for reload navigation type correctly.
541
542         * loader/cache/CachedResource.cpp:
543         (WebCore::CachedResource::load):
544         * loader/cache/CachedResourceLoader.cpp:
545         (WebCore::CachedResourceLoader::determineRevalidationPolicy):
546         (WebCore::CachedResourceLoader::cachePolicy):
547         * loader/cache/CachedResourceLoader.h:
548
549 2017-04-26  WebKit Contributor  <webkitcontrib@gmail.com>
550
551         Response.blob() does not set the content-type based on the header value.
552         https://bugs.webkit.org/show_bug.cgi?id=170849
553
554         Reviewed by Alex Christensen.
555
556         The Fetch API specification requires setting the blob contentType
557         using the Content-Type header value, if present.  Previously the
558         FetchResponse class only called updateContentType() when first
559         created even though all the headers were not available.  Call
560         updateContentType() again after the headers are populated.
561
562         This change allows WebKit to pass the "Consume response's body: from
563         fetch to blob" case in the WPT response-consume.html test.
564
565         Test: http://w3c-test.org/fetch/api/response/response-consume.html
566
567         * Modules/fetch/FetchResponse.cpp:
568         (WebCore::FetchResponse::BodyLoader::didReceiveResponse): Modified to
569         call FetchBodyOwner::updateContentType() after filling m_headers.
570
571 2017-04-26  Andy Estes  <aestes@apple.com>
572
573         Try to fix the macOS Sierra build.
574
575         * platform/mac/WebVideoFullscreenInterfaceMac.mm:
576
577 2017-04-26  Andy Estes  <aestes@apple.com>
578
579         [macOS] Add picture-in-picture support to WebPlaybackControlsManager
580         https://bugs.webkit.org/show_bug.cgi?id=171328
581         <rdar://problem/29875010>
582
583         Reviewed by Jer Noble.
584
585         * platform/cocoa/WebPlaybackSessionModel.h:
586         * platform/cocoa/WebPlaybackSessionModelMediaElement.h:
587         * platform/cocoa/WebPlaybackSessionModelMediaElement.mm:
588         (WebCore::WebPlaybackSessionModelMediaElement::togglePictureInPicture): If the media element
589         is currently in PiP fullscreen mode, exit fullscreen. Otherwise, enter PiP fullscreen mode.
590         * platform/mac/WebPlaybackControlsManager.h:
591         * platform/mac/WebPlaybackControlsManager.mm:
592         (-[WebPlaybackControlsManager canTogglePictureInPicture]): Added. Returns YES if
593         -allowsPictureInPicturePlayback returns YES.
594         (-[WebPlaybackControlsManager togglePictureInPicture]): Added. Calls
595         WebPlaybackSessionModel::togglePictureInPicture().
596         * platform/mac/WebVideoFullscreenInterfaceMac.mm:
597         (WebCore::WebVideoFullscreenInterfaceMac::enterFullscreen): Added a call to
598         -[WebPlaybackControlsManager setPictureInPictureActive:YES].
599         (WebCore::WebVideoFullscreenInterfaceMac::exitFullscreen): Added a call to
600         -[WebPlaybackControlsManager setPictureInPictureActive:NO].
601         (WebCore::WebVideoFullscreenInterfaceMac::exitFullscreenWithoutAnimationToMode): Ditto.
602         * platform/spi/cocoa/AVKitSPI.h: Declared new SPI on AVTouchBarPlaybackControlsControlling.
603
604 2017-04-25  Dean Jackson  <dino@apple.com>
605
606         [Color] Make gradients work with ExtendedColors
607         https://bugs.webkit.org/show_bug.cgi?id=171315
608         <rdar://problems/31830177>
609
610         Reviewed by Antoine Quint.
611
612         Allow gradients to hold Color objects, and thus
613         handle ExtendedColor. Implement the backend for
614         CoreGraphics.
615
616         Test: css3/color/gradients.html
617
618         * platform/graphics/Gradient.cpp:
619         (WebCore::Gradient::addColorStop): Just copy the Color now.
620         (WebCore::compareStops): Handle rename of stop to offset.
621         (WebCore::Gradient::hasAlpha): Use Color's helper.
622         * platform/graphics/Gradient.h:
623         (WebCore::Gradient::ColorStop::ColorStop): Rename stop
624         to offset, and store a Color rather than four floating
625         point values.
626         * platform/graphics/cairo/GradientCairo.cpp:
627         (WebCore::Gradient::platformGradient):
628         * platform/graphics/cg/GradientCG.cpp:
629         (WebCore::Gradient::platformGradient): Use the CG method
630         that can handle CGColorRefs with ColorSpace values, and
631         pass the Extended sRGB space which should be no change for
632         all existing gradients but also handle ColorSpaces like
633         Display P3.
634         * platform/graphics/win/GradientDirect2D.cpp:
635         (WebCore::Gradient::generateGradient):
636         * svg/SVGGradientElement.cpp:
637         (WebCore::SVGGradientElement::buildStops):
638
639 2017-04-25  Alex Christensen  <achristensen@webkit.org>
640
641         Encoded filename should be decoded for WKContentExtension.identifier
642         https://bugs.webkit.org/show_bug.cgi?id=171316
643
644         Reviewed by Andy Estes.
645
646         * platform/FileSystem.h:
647
648 2017-04-26  Frederic Wang  <fwang@igalia.com>
649
650         Fix typo in RenderFrameBase
651         https://bugs.webkit.org/show_bug.cgi?id=171324
652
653         Reviewed by Zalan Bujtas.
654
655         No new tests, behavior unchanged.
656
657         * rendering/RenderFrameBase.cpp:
658         (WebCore::RenderFrameBase::layoutWithFlattening):
659         (WebCore::RenderFrameBase::performLayoutWithFlattening):
660         (WebCore::RenderFrameBase::peformLayoutWithFlattening): Deleted.
661         * rendering/RenderFrameBase.h:
662
663 2017-04-26  Zalan Bujtas  <zalan@apple.com>
664
665         Forced page break on :after triggers infinite loop in column balancing
666         https://bugs.webkit.org/show_bug.cgi?id=171309
667         rdar://problem/26285884
668
669         Reviewed by David Hyatt.
670
671         Stop trying to balance the columns when the forced page breaks >= the number of
672         columns even when this number is 1. Content will always overflow to the next page.
673         see https://chromium.googlesource.com/chromium/src/+/fbbebf38cefb2712c912581eccb046ef363ec84e%5E%21/#F2 
674
675         Test: fast/multicol/infinite-loop-when-forced-break.html
676
677         * rendering/RenderMultiColumnSet.cpp:
678         (WebCore::RenderMultiColumnSet::calculateBalancedHeight):
679
680 2017-04-26  Said Abou-Hallawa  <sabouhallawa@apple.com>
681
682         Attempt to fix a JetStream regression.
683         <rdar://problem/31742414>
684
685         Unreviewed.
686
687         Disable async decoding for large images till the flickering bug wk170640
688         is fixed.
689
690         * platform/graphics/BitmapImage.cpp:
691         (WebCore::BitmapImage::shouldUseAsyncDecodingForLargeImages):
692
693 2017-04-26  Ryan Haddad  <ryanhaddad@apple.com>
694
695         Unreviewed, rolling out r215767.
696
697         The LayoutTest for this change is a flaky failure.
698
699         Reverted changeset:
700
701         "Restrict WebKit image formats to a known whitelist"
702         https://bugs.webkit.org/show_bug.cgi?id=170700
703         http://trac.webkit.org/changeset/215767
704
705 2017-04-26  Dave Hyatt  <hyatt@apple.com>
706
707         Improve wavy underline rendering
708         https://bugs.webkit.org/show_bug.cgi?id=171281
709
710         Reviewed by Sam Weinig.
711
712         Change wavy underline rendering to use font size instead of stroke
713         thickness as a way to tune it. Cut the extra offset from 2 to 1.
714         Change the parameters to make the line flatter and to make the proportion
715         of the wave that renders underneath a glyph the same.
716
717         * rendering/TextDecorationPainter.cpp:
718         (WebCore::strokeWavyTextDecoration):
719         (WebCore::TextDecorationPainter::paintTextDecoration):
720         * style/InlineTextBoxStyle.cpp:
721         (WebCore::getWavyStrokeParameters):
722         (WebCore::visualOverflowForDecorations):
723         * style/InlineTextBoxStyle.h:
724         (WebCore::wavyOffsetFromDecoration):
725
726 2017-04-24  Sergio Villar Senin  <svillar@igalia.com>
727
728         [css-grid] Remove most of the usage of SizingOperation
729         https://bugs.webkit.org/show_bug.cgi?id=171225
730
731         Reviewed by Darin Adler.
732
733         SizingOperation was added as a way to modify the behaviour of the track sizing algorithm
734         with the specifics for intrinsic size computations. The problem is that although intrinsic
735         size computation does imply indefinite sizes, the opposite is not always true. For example,
736         a grid container with height:auto would compute the row sizes with an indefinite size but is
737         not part of the intrinsic size (preferred widths) computation.
738
739         That's why it was wrongly used in some parts of the current code, in most of the cases is
740         more than enough to check whether the available space is indefinite or not. In order to do
741         that we have to keep both available sizes (height & width) around all the time to properly
742         support orthogonal flows.
743
744         This change does not imply any change in behaviour.
745
746         * rendering/GridTrackSizingAlgorithm.cpp:
747         (WebCore::GridTrackSizingAlgorithm::setAvailableSpace):
748         (WebCore::GridTrackSizingAlgorithm::computeTrackBasedSize):
749         (WebCore::GridTrackSizingAlgorithm::initialBaseSize):
750         (WebCore::GridTrackSizingAlgorithm::initialGrowthLimit):
751         (WebCore::GridTrackSizingAlgorithm::sizeTrackToFitNonSpanningItem):
752         (WebCore::GridTrackSizingAlgorithm::increaseSizesToAccommodateSpanningItems):
753         (WebCore::GridTrackSizingAlgorithm::assumedRowsSizeForOrthogonalChild):
754         (WebCore::GridTrackSizingAlgorithm::gridAreaBreadthForChild):
755         (WebCore::GridTrackSizingAlgorithm::gridTrackSize):
756         (WebCore::IndefiniteSizeStrategy::findUsedFlexFraction):
757         (WebCore::IndefiniteSizeStrategy::recomputeUsedFlexFractionIfNeeded):
758         (WebCore::GridTrackSizingAlgorithm::initializeTrackSizes):
759         (WebCore::GridTrackSizingAlgorithm::setup):
760         (WebCore::GridTrackSizingAlgorithm::reset):
761         * rendering/GridTrackSizingAlgorithm.h:
762         (WebCore::GridTrackSizingAlgorithmStrategy::availableSpace):
763         * rendering/RenderGrid.cpp:
764         (WebCore::RenderGrid::availableSpaceForGutters):
765         (WebCore::RenderGrid::computeTrackBasedLogicalHeight):
766         (WebCore::RenderGrid::computeTrackSizesForDefiniteSize):
767         (WebCore::RenderGrid::layoutBlock):
768         (WebCore::RenderGrid::gridGap):
769         (WebCore::RenderGrid::guttersSize):
770         (WebCore::RenderGrid::computeIntrinsicLogicalWidths):
771         (WebCore::RenderGrid::computeTrackSizesForIndefiniteSize):
772         (WebCore::RenderGrid::computeAutoRepeatTracksCount):
773         (WebCore::RenderGrid::placeItemsOnGrid):
774         (WebCore::RenderGrid::trackSizesForComputedStyle):
775         (WebCore::RenderGrid::applyStretchAlignmentToTracksIfNeeded):
776         (WebCore::RenderGrid::offsetAndBreadthForPositionedChild):
777         (WebCore::RenderGrid::populateGridPositionsForDirection):
778         (WebCore::RenderGrid::columnAxisOffsetForChild):
779         (WebCore::RenderGrid::rowAxisOffsetForChild):
780         (WebCore::RenderGrid::gridGapForDirection): Deleted.
781         * rendering/RenderGrid.h:
782
783 2017-04-26  Frederic Wang  <fwang@igalia.com>
784
785         Remove Document::*FrameElementsShouldIgnoreScrolling
786         https://bugs.webkit.org/show_bug.cgi?id=171271
787
788         Reviewed by Chris Dumez.
789
790         setFrameElementsShouldIgnoreScrolling and frameElementsShouldIgnoreScrolling were
791         introduced bug 23072 in order to work around a bug in the Dictionary application.
792         However, this was removed in bug 132095 and hence the functions are no longer necessary.
793
794         No new tests.
795
796         * dom/Document.h:
797         (WebCore::Document::setFrameElementsShouldIgnoreScrolling): Deleted.
798         (WebCore::Document::frameElementsShouldIgnoreScrolling): Deleted.
799         * html/HTMLFrameElementBase.cpp:
800         (WebCore::HTMLFrameElementBase::parseAttribute):
801
802 2017-04-26  Zan Dobersek  <zdobersek@igalia.com>
803
804         [GCrypt] CryptoKeyRSA: implement create(), keySizeInBits(), buildAlgorithm(), exportData()
805         https://bugs.webkit.org/show_bug.cgi?id=171213
806
807         Reviewed by Michael Catanzaro.
808
809         CryptoKeyRSA::create() validates the specified key type along with the
810         provided data. If everything is OK, it then proceeds to build the key
811         of the appropriate type through an s-expression that is constructed with
812         the necessary data. We don't currently support creating private keys
813         with any additional prime information (apart from p and q).
814
815         CryptoKeyRSA::keySizeInBits() calls the helper getRSAModulusLength()
816         function that find the modulus MPI in the key s-expression and returns
817         the modulus data length in bits.
818
819         CryptoKeyRSA::buildAlgorithm() returns KeyAlgorithm that's constructed
820         from the appropriate name, this key's modulus length, and this key's
821         public exponent data. It also specifies the hash if there is such a
822         restriction for this key.
823
824         CryptoKeyRSA::exportData() returns a properly-constructed
825         CryptoKeyDataRSAComponents object. The public modulus and exponent are
826         used in case the key is public. If the key is private, the secret
827         exponent and the p and q prime numbers are retrieved in MPI format.
828         They're then used to calculate the dp, dq and qi parameters that are
829         exported in the JWK format. Note that libgcrypt internally switches
830         the p and q prime numbers such that p < q, but the Web Crypto
831         specification and the dependant RFCs expect that q < p. We address
832         this by simply switching the roles of the two primes and follow the
833         usual q < p assumption when exporting the primes and computing the
834         dependant exponents and coefficients.
835
836         No new tests -- existing ones cover this but don't work yet due to missing
837         RSA-related CryptoAlgorithm implementations.
838
839         * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
840         (WebCore::getRSAModulusLength):
841         (WebCore::getParameterMPIData):
842         (WebCore::getRSAKeyParameter):
843         (WebCore::CryptoKeyRSA::create):
844         (WebCore::CryptoKeyRSA::keySizeInBits):
845         (WebCore::CryptoKeyRSA::buildAlgorithm):
846         (WebCore::CryptoKeyRSA::exportData):
847
848 2017-04-25  Jiewen Tan  <jiewen_tan@apple.com>
849
850         [WebCrypto] Enhance ways to convert an ECDSA signature binary into DER format
851         https://bugs.webkit.org/show_bug.cgi?id=171287
852         <rdar://problem/31735332>
853
854         Reviewed by Brent Fulgham.
855
856         Covered by existing tests.
857
858         * crypto/mac/CryptoAlgorithmECDSAMac.cpp:
859         (WebCore::verifyECDSA):
860
861 2017-04-25  Brent Fulgham  <bfulgham@apple.com>
862
863         Relax the event firing ASSERT for Attr changes
864         https://bugs.webkit.org/show_bug.cgi?id=171236
865         <rdar://problem/30516349>
866
867         Reviewed by Dean Jackson.
868
869         The assertions added in Bug 167318 were overly strict, and trigger for valid behavior.
870         Relax the assertion preventing event dispatch for the case of Attr elements at the
871         end of childrenChanged.
872
873         Test: fast/dom/HTMLLinkElement/event-while-removing-attribute.html
874
875         * dom/Attr.cpp:
876         (WebCore::Attr::childrenChanged):
877
878 2017-04-25  John Wilander  <wilander@apple.com>
879
880         Resource Load Statistics: Introduce shorter time-to-live for cookie partition whitelisting
881         https://bugs.webkit.org/show_bug.cgi?id=171295
882         <rdar://problem/31823818>
883
884         Reviewed by Brent Fulgham.
885
886         Test: http/tests/loading/resourceLoadStatistics/partitioned-and-unpartitioned-cookie-with-partitioning-timeout.html
887
888         * loader/ResourceLoadObserver.cpp:
889         (WebCore::reduceTimeResolutionToOneDay): Deleted.
890         (WebCore::reduceTimeResolution):
891             Changed name to no longer lock this to a specific resolution.
892         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
893             Now calls WebCore::reduceTimeResolution().
894         (WebCore::ResourceLoadObserver::setTimeToLiveCookiePartitionFree):
895             Added for testing purposes.
896         (WebCore::ResourceLoadObserver::fireShouldPartitionCookiesHandler):
897             Added for testing purposes.
898         * loader/ResourceLoadObserver.h:
899         * loader/ResourceLoadStatisticsStore.cpp:
900         (WebCore::shouldPartitionCookies):
901             Static inline convenience function.
902         (WebCore::ResourceLoadStatisticsStore::fireShouldPartitionCookiesHandler):
903             Now decides whether a domain should get partitioned cookies
904             based on timeToLiveCookiePartitionFree.
905             Removed clearFirst parameter since it's not needed here
906             and it introduced complexity in keeping the store and the
907             network process cache in sync.
908         (WebCore::ResourceLoadStatisticsStore::setTimeToLiveCookiePartitionFree):
909             Added for testing purposes.
910         * loader/ResourceLoadStatisticsStore.h:
911
912 2017-04-25  Saam Barati  <sbarati@apple.com>
913
914         JSArray::isArrayPrototypeIteratorProtocolFastAndNonObservable is wrong because it does not do the necessary checks on the base object
915         https://bugs.webkit.org/show_bug.cgi?id=171150
916         <rdar://problem/31771880>
917
918         Reviewed by Sam Weinig.
919
920         This patch moves the sequence converters to use the now fixed
921         JSArray::isArrayPrototypeIteratorProtocolFastAndNonObservable test
922         inside JSC.
923         
924         This patch also fixes a few bugs:
925         1. Converting to a sequence of numbers must prove that the JSArray
926         is filled only with Int32/Double. If there is a chance the array
927         contains objects, the conversion to a numeric IDLType can be observable
928         (via valueOf()), and can change the iterator protocol.
929         2. There are other conversions that can have side effects a-la valueOf().
930         This patch introduces a new static constant in the various Converter
931         classes that tell the sequence converter if the conversion operation
932         can have JS side effects. If it does have side effects, we fall back to
933         the generic conversion that uses the iterator protocol. If not, we can
934         do a faster version that iterates over each element of the array,
935         reading it directly, and converting it.
936
937         Tests: js/sequence-iterator-protocol-2.html
938                js/sequence-iterator-protocol.html
939
940         * bindings/js/JSDOMConvertAny.h: Does not have side effects.
941         * bindings/js/JSDOMConvertBase.h: We pessimistically assume inside DefaultConverter that converions have side effects.
942         * bindings/js/JSDOMConvertBoolean.h: Does not have side effects.
943         * bindings/js/JSDOMConvertCallbacks.h: Does not have side effects.
944         * bindings/js/JSDOMConvertObject.h: Does not have side effects.
945         * bindings/js/JSDOMConvertSequences.h:
946         (WebCore::Detail::NumericSequenceConverter::convert):
947         (WebCore::Detail::SequenceConverter::convert):
948
949 2017-04-25  Michael Saboff  <msaboff@apple.com>
950
951         Call bmalloc scavenger first when handling a memory pressure event
952         https://bugs.webkit.org/show_bug.cgi?id=171289
953
954         Reviewed by Geoffrey Garen.
955
956         Let bmalloc free any pages to the OS that it can before doing anything else.
957
958         * page/MemoryRelease.cpp:
959         (WebCore::releaseMemory):
960
961 2017-04-25  Dean Jackson  <dino@apple.com>
962
963         Skip WebKitAdditions for Safari Technology Preview media controls
964         https://bugs.webkit.org/show_bug.cgi?id=171302
965         <rdar://problem/31823256>
966
967         Reviewed by Simon Fraser.
968
969         Safari Technology Preview should use the same controls
970         as OpenSource.
971
972         * WebCore.xcodeproj/project.pbxproj:
973
974 2017-04-25  Ryan Haddad  <ryanhaddad@apple.com>
975
976         Unreviewed, rolling out r215730.
977
978         The LayoutTest for this change is a flaky timeout on mac-wk1
979         debug.
980
981         Reverted changeset:
982
983         "Enable expired-only reload policy on Mac and iOS"
984         https://bugs.webkit.org/show_bug.cgi?id=171264
985         http://trac.webkit.org/changeset/215730
986
987 2017-04-24  Matt Rajca  <mrajca@apple.com>
988
989         Indicate presence of audio when handling autoplay events.
990         https://bugs.webkit.org/show_bug.cgi?id=171227
991
992         Reviewed by Alex Christensen.
993
994         Added API tests.
995
996         * html/HTMLMediaElement.cpp:
997         (WebCore::HTMLMediaElement::handleAutoplayEvent):
998         (WebCore::HTMLMediaElement::playInternal):
999         (WebCore::HTMLMediaElement::mediaPlayerTimeChanged):
1000         (WebCore::HTMLMediaElement::stopWithoutDestroyingMediaPlayer):
1001         (WebCore::HTMLMediaElement::userDidInterfereWithAutoplay):
1002         (WebCore::HTMLMediaElement::setPlaybackWithoutUserGesture):
1003         * html/HTMLMediaElement.h:
1004         * page/AutoplayEvent.h:
1005         * page/ChromeClient.h:
1006
1007 2017-04-25  Aakash Jain  <aakash_jain@apple.com>
1008
1009         WebCore.framework should restrict allowable_clients
1010         https://bugs.webkit.org/show_bug.cgi?id=171260
1011
1012         Reviewed by Alexey Proskuryakov.
1013
1014         * Configurations/WebCore.xcconfig: Adding allowable_client to all platform, in order to restrict WebCore
1015         from being directly linked on any platform.
1016         Moved WebKitLegacy and WebCoreTestSupport to OTHER_LDFLAGS_BASE.
1017         Removed WebKit2 as allowable_client from mac.
1018         Added iTunesU, Casablanca and Remote to OTHER_LDFLAGS_BASE_ios for iTunes related projects.
1019         Added WebKit, TVBooks, DumpRenderTree, WebKitTestRunner and TestWebKitAPI to OTHER_LDFLAGS_BASE_ios.
1020
1021 2017-04-25  Said Abou-Hallawa  <sabouhallawa@apple.com>
1022
1023         Restrict WebKit image formats to a known whitelist
1024         https://bugs.webkit.org/show_bug.cgi?id=170700
1025
1026         Reviewed by Tim Horton.
1027
1028         If the image format is not supported, the load should be canceled and the
1029         image is marked a broken image.
1030
1031         Test: fast/images/image-formats-support.html
1032
1033         * loader/cache/CachedImage.cpp:
1034         (WebCore::CachedImage::addIncrementalDataBuffer):
1035         (WebCore::CachedImage::setImageDataBuffer):
1036         (WebCore::CachedImage::finishLoading):
1037         * loader/cache/CachedImage.h:
1038
1039 2017-04-25  Youenn Fablet  <youenn@apple.com>
1040
1041         CoreAudioCaptureSource::suspend is asserting too often
1042         https://bugs.webkit.org/show_bug.cgi?id=171285
1043
1044         Reviewed by Eric Carlson.
1045
1046         No change of behavior.
1047
1048         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
1049         (WebCore::CoreAudioCaptureSource::suspend): Moving the assertion to where it might be useful.
1050
1051 2017-04-25  Daniel Bates  <dabates@apple.com>
1052
1053         Use an OptionSet for compositing reasons bitmask
1054         https://bugs.webkit.org/show_bug.cgi?id=171153
1055
1056         Reviewed by Simon Fraser.
1057
1058         We should make use of OptionSet to represent the bitmask of the reasons a layer
1059         was composited instead of using an integer and bitwise operations.
1060
1061         * inspector/InspectorLayerTreeAgent.cpp:
1062         (WebCore::InspectorLayerTreeAgent::reasonsForCompositingLayer):
1063         * rendering/RenderLayerCompositor.cpp:
1064         (WebCore::RenderLayerCompositor::reasonsForCompositing):
1065         (WebCore::RenderLayerCompositor::logReasonsForCompositing): Also fix code style issues;
1066         an else-if statement should be written as an if-statement when the prior if-statement
1067         concludes with a return statement.
1068         * rendering/RenderLayerCompositor.h:
1069
1070 2017-04-25  Myles C. Maxfield  <mmaxfield@apple.com>
1071
1072         Supplementary Multilingual Plane Complex Scripts Rendered Incorrectly
1073         https://bugs.webkit.org/show_bug.cgi?id=171272
1074         <rdar://problem/30966764>
1075
1076         Reviewed by Zalan Bujtas.
1077
1078         These scripts need to take the complex text codepath.
1079
1080         Test: fast/text/kaithi.html
1081
1082         * platform/graphics/FontCascade.cpp:
1083         (WebCore::FontCascade::characterRangeCodePath):
1084
1085 2017-04-25  Carlos Alberto Lopez Perez  <clopez@igalia.com>
1086
1087         [GTK] Revert r215745 (especulative build fix) after r215752.
1088         https://bugs.webkit.org/show_bug.cgi?id=170842
1089
1090         Unreviewed.
1091
1092         * platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
1093         (WebCore::normalizeCharacters):
1094
1095 2017-04-25  Daniel Bates  <dabates@apple.com>
1096
1097         [Cocoa][Win] Enable of X-Content-Type-Options: nosniff header
1098         https://bugs.webkit.org/show_bug.cgi?id=136452
1099         <rdar://problem/23412620>
1100
1101         Reviewed by Brent Fulgham.
1102
1103         Enable support for X-Content-Type-Options: nosniff on Mac, iOS and Windows.
1104
1105         Additionally, honor X-Content-Type-Options: nosniff header for stylesheets as per
1106         <https://fetch.spec.whatwg.org/#should-response-to-request-be-blocked-due-to-nosniff%3F> (30 March 2017).
1107
1108         Test: http/tests/security/contentTypeOptions/nosniff-dynamic-script-blocked.html
1109
1110         * Configurations/FeatureDefines.xcconfig:
1111         * css/StyleSheetContents.cpp:
1112         (WebCore::StyleSheetContents::parseAuthorStyleSheet): Log an error if the stylesheet
1113         has the nosniff header and does not have a valid MIME type. Also update code for
1114         renaming of MIMETypeCheck to MIMETypeCheckHint.
1115         (WebCore::StyleSheetContents::notifyLoadedSheet): If the stylesheet is blocked by
1116         nosniff then consider it analogous to a load error so that we dispatch a DOM error
1117         event at the <style>/<link> element.
1118         * dom/LoadableClassicScript.cpp:
1119         (WebCore::LoadableClassicScript::notifyFinished): Modified the wording of the error
1120         message when a script is disallowed by nosniff so as to more closely match the
1121         wording used when a stylesheet is disallowed by nonsniff.
1122         * loader/cache/CachedCSSStyleSheet.cpp:
1123         (WebCore::CachedCSSStyleSheet::sheetText): Update for renaming of MIMETypeCheck
1124         to MIMETypeCheckHint.
1125         (WebCore::CachedCSSStyleSheet::responseMIMEType): Added.
1126         (WebCore::CachedCSSStyleSheet::mimeTypeAllowedByNosniff): Added.
1127         (WebCore::CachedCSSStyleSheet::canUseSheet): Modified to check if the X-Content-Type-Options: nosniff
1128         header is in the HTTP response for the stylesheet. If it is then we can only use the stylesheet
1129         if its content-type is "text/css". Otherwise, apply the existing criterion for determining whether
1130         to to use the stylesheet.
1131         * loader/cache/CachedCSSStyleSheet.h: Rename MIMETypeCheck to MIMETypeCheckHint to better
1132         describe its purpose as a hint as to whether to enforce MIME type checking for the stylesheet.
1133         Processing of the HTTP header X-Content-Type-Options takes precedence over this hint.
1134         * loader/cache/CachedScript.h: Make mimeType() private.
1135
1136 2017-04-25  Daniel Bates  <dabates@apple.com>
1137
1138         [Cocoa][Win] Enable of X-Content-Type-Options: nosniff header
1139         https://bugs.webkit.org/show_bug.cgi?id=136452
1140         <rdar://problem/23412620>
1141
1142         Reviewed by Brent Fulgham.
1143
1144         Part 1
1145
1146         Enable X-Content-Type-Options: nosniff on Mac, iOS and Windows platforms.
1147
1148         * Configurations/FeatureDefines.xcconfig:
1149
1150 2017-04-25  Myles C. Maxfield  <mmaxfield@apple.com>
1151
1152         [GTK] Build fix after r215737
1153         https://bugs.webkit.org/show_bug.cgi?id=170842
1154
1155         Unreviewed.
1156
1157         No new tests because there is no behavior change.
1158
1159         * platform/graphics/FontCascade.h:
1160         (WebCore::FontCascade::treatAsZeroWidthSpace):
1161         (WebCore::FontCascade::treatAsZeroWidthSpaceInComplexScript):
1162
1163 2017-04-25  Wenson Hsieh  <wenson_hsieh@apple.com>
1164
1165         Remove an unnecessary -respondsToSelector: check after r215724
1166
1167         Rubber-stamped by Tim Horton.
1168
1169         Addresses review feedback from <https://bugs.webkit.org/show_bug.cgi?id=171156>. -[NSURL _title]
1170         will always for builds that need to access it.
1171
1172         * platform/ios/PlatformPasteboardIOS.mm:
1173         (WebCore::PlatformPasteboard::readURL):
1174
1175 2017-04-25  Antti Koivisto  <antti@apple.com>
1176
1177         REGRESSION (r215469): [ios-simulator-wk2] LayoutTest compositing/animation/animation-backing.html is a flaky failure
1178         https://bugs.webkit.org/show_bug.cgi?id=171060
1179         <rdar://problem/31771174>
1180
1181         Reviewed by Simon Fraser.
1182
1183         Accelerated transform animations move underlying layers without invalidating GraphicsLayers.
1184         To update tile coverage we need to commit such subtrees even if there are not other changes.
1185
1186         * platform/graphics/ca/GraphicsLayerCA.cpp:
1187         (WebCore::GraphicsLayerCA::GraphicsLayerCA):
1188         (WebCore::GraphicsLayerCA::needsCommit):
1189
1190             Commit subtrees with accelerated transform animations.
1191             Factor into a function.
1192
1193         (WebCore::GraphicsLayerCA::recursiveCommitChanges):
1194
1195             Track if descendants had any accelerated transform animations after commit.
1196
1197         * platform/graphics/ca/GraphicsLayerCA.h:
1198         (WebCore::GraphicsLayerCA::hasDescendantsWithRunningTransformAnimations):
1199         (WebCore::GraphicsLayerCA::setHasDescendantsWithRunningTransformAnimations):
1200
1201 2017-04-25  Eric Carlson  <eric.carlson@apple.com>
1202
1203         [MediaStream macOS] Unable to apply frameRate constraint
1204         https://bugs.webkit.org/show_bug.cgi?id=171279
1205
1206         Reviewed by Youenn Fablet.
1207
1208         No new tests, this doesn't affect the mock capture devices.
1209
1210         * platform/mediastream/mac/AVVideoCaptureSource.mm:
1211         (WebCore::AVVideoCaptureSource::supportsSizeAndFrameRate): Cast frame rate
1212         ranges to int before comparing.
1213
1214 2017-04-25  Carlos Alberto Lopez Perez  <clopez@igalia.com>
1215
1216         [GTK] Build fix after r215737
1217         https://bugs.webkit.org/show_bug.cgi?id=170842
1218
1219         Unreviewed.
1220
1221         * platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
1222         (WebCore::normalizeCharacters):
1223
1224 2017-04-25  John Wilander  <wilander@apple.com>
1225
1226         Resource Load Statistics: Clear network process cache when clearing store
1227         https://bugs.webkit.org/show_bug.cgi?id=171256
1228         <rdar://problem/31802347>
1229
1230         Reviewed by Brent Fulgham.
1231
1232         Test that covers this code:
1233         http/tests/loading/resourceLoadStatistics/clear-in-memory-and-persistent-store.html
1234
1235         * loader/ResourceLoadObserver.cpp:
1236         (WebCore::ResourceLoadObserver::clearInMemoryStore):
1237             Better name.
1238         (WebCore::ResourceLoadObserver::logUserInteraction):
1239             Now passes on the boolean parameter clearFirst to
1240             ResourceLoadStatisticsStore::fireShouldPartitionCookiesHandler().
1241         (WebCore::ResourceLoadObserver::fireShouldPartitionCookiesHandler):
1242             Now takes and passes on the boolean parameter clearFirst to
1243             ResourceLoadStatisticsStore::fireShouldPartitionCookiesHandler().
1244         (WebCore::ResourceLoadObserver::statisticsStore): Deleted.
1245             This getter violated abstraction. The way it was used
1246             is now solved through dedicated functions.
1247         * loader/ResourceLoadObserver.h:
1248         * loader/ResourceLoadStatisticsStore.cpp:
1249         (WebCore::ResourceLoadStatisticsStore::readDataFromDecoder):
1250             Now passes on the boolean parameter clearFirst to
1251             ResourceLoadStatisticsStore::fireShouldPartitionCookiesHandler().
1252         (WebCore::ResourceLoadStatisticsStore::clearInMemory):
1253             Better name.
1254             Now triggers clearing of the associated network process cache.
1255         (WebCore::ResourceLoadStatisticsStore::clearInMemoryAndPersistent):
1256             Now calls clearInMemory().
1257         (WebCore::ResourceLoadStatisticsStore::setShouldPartitionCookiesCallback):
1258             Now expects a handler with the boolean parameter clearFirst.
1259         (WebCore::ResourceLoadStatisticsStore::fireShouldPartitionCookiesHandler):
1260             Now takes and passes on the boolean parameter clearFirst to
1261             m_shouldPartitionCookiesForDomainsHandler().
1262         * loader/ResourceLoadStatisticsStore.h:
1263         (WebCore::ResourceLoadStatisticsStore::clear): Deleted.
1264         * platform/network/NetworkStorageSession.h:
1265             NetworkStorageSession::setShouldPartitionCookiesForHosts() now
1266             takes the boolean parameter clearFirst.
1267         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
1268         (WebCore::NetworkStorageSession::setShouldPartitionCookiesForHosts):
1269             Now clears m_topPrivatelyControlledDomainsForCookiePartitioning
1270             if the boolean parameter clearFirst is true.
1271
1272 2017-04-25  Myles C. Maxfield  <mmaxfield@apple.com>
1273
1274         Add performance test for FontCache::systemFallbackForCharacters()
1275         https://bugs.webkit.org/show_bug.cgi?id=170842
1276
1277         Reviewed by Tim Horton.
1278
1279         No new tests because there is no behavior change.
1280
1281         * platform/graphics/FontCascade.h:
1282         (WebCore::FontCascade::treatAsZeroWidthSpace):
1283         (WebCore::FontCascade::treatAsZeroWidthSpaceInComplexScript): Deleted.
1284         * platform/graphics/WidthCache.h:
1285         (WebCore::WidthCache::add):
1286         (WebCore::WidthCache::addSlowCase):
1287
1288 2017-04-25  Chris Dumez  <cdumez@apple.com>
1289
1290         Content-Disposition header filename is ignored when 'download' attribute is specified in HTML
1291         https://bugs.webkit.org/show_bug.cgi?id=171239
1292         <rdar://problem/31789855>
1293
1294         Reviewed by Alex Christensen.
1295
1296         Add isAttachmentWithFilename() utility method to ResourceResponse to implement:
1297         - https://html.spec.whatwg.org/#as-a-download (Step 2)
1298
1299         Test: http/tests/download/anchor-download-attribute-content-disposition.html
1300
1301         * platform/network/ResourceResponseBase.cpp:
1302         (WebCore::ResourceResponseBase::isAttachmentWithFilename):
1303         * platform/network/ResourceResponseBase.h:
1304
1305 2017-04-25  Antti Koivisto  <antti@apple.com>
1306
1307         Enable expired-only reload policy on Mac and iOS
1308         https://bugs.webkit.org/show_bug.cgi?id=171264
1309         <rdar://problem/31807637>
1310
1311         Reviewed by Andreas Kling.
1312
1313         * loader/NavigationAction.cpp:
1314         (WebCore::navigationType):
1315
1316         Test for reload navigation type correctly.
1317
1318 2017-04-25  Miguel Gomez  <magomez@igalia.com>
1319
1320         Image decoders must have private constructors to avoid refcount misuse: ASSERTION FAILED: m_deletionHasBegun when destroying ImageDecoder
1321         https://bugs.webkit.org/show_bug.cgi?id=171211
1322
1323         Reviewed by Carlos Garcia Campos.
1324
1325         Add a create method to each of the decoders and set their constructors as private. Change
1326         ICOImageDecoder to store its internal PNG decoders as RefPtr and use the new create method, and
1327         change ImageDecoder to use the create methods as well.
1328
1329         Covered by existent tests.
1330
1331         * platform/image-decoders/ImageDecoder.cpp:
1332         (WebCore::ImageDecoder::create):
1333         * platform/image-decoders/bmp/BMPImageDecoder.h:
1334         * platform/image-decoders/gif/GIFImageDecoder.h:
1335         * platform/image-decoders/ico/ICOImageDecoder.cpp:
1336         (WebCore::ICOImageDecoder::decodeAtIndex):
1337         * platform/image-decoders/ico/ICOImageDecoder.h:
1338         * platform/image-decoders/jpeg/JPEGImageDecoder.h:
1339         * platform/image-decoders/png/PNGImageDecoder.h:
1340         * platform/image-decoders/webp/WEBPImageDecoder.h:
1341
1342 2017-04-25  Myles C. Maxfield  <mmaxfield@apple.com>
1343
1344         Build fix
1345
1346         Unreviewed.
1347
1348         No new tests because there is no behavior change.
1349
1350         * crypto/mac/SerializedCryptoKeyWrapMac.mm:
1351         (WebCore::wrapSerializedCryptoKey):
1352         (WebCore::unwrapSerializedCryptoKey):
1353
1354 2017-04-25  Wenson Hsieh  <wenson_hsieh@apple.com>
1355
1356         Support reading NSURL titles from the pasteboard when performing data interaction
1357         https://bugs.webkit.org/show_bug.cgi?id=171156
1358         <rdar://problem/31356937>
1359
1360         Reviewed by Tim Horton.
1361
1362         Support reading link titles from the pasteboard when performing data interaction. To do this, we refactor
1363         Pasteboard::readURL to take in an additional String& title which is ultimately plumbed to the PlatformPasteboard
1364         where it is set to the value of -[NSURL _title].
1365
1366         Test: DataInteractionTests.ExternalSourceTitledNSURL.
1367
1368         * editing/FrameSelection.h:
1369         * editing/ios/EditorIOS.mm:
1370         (WebCore::Editor::WebContentReader::readURL):
1371         * page/DragController.cpp:
1372         (WebCore::DragController::performDragOperation):
1373         (WebCore::DragController::concludeEditDrag):
1374
1375         Move calls to clearDragCaret() out of concludeEditDrag and into the call site, in performDragOperation after
1376         attempting to concludeEditDrag. This is done so that if the WebEditorClient queries whether the drag caret is
1377         in richly editable content for the purposes of generating a document fragment to insert, the answer will not
1378         always be false as a drop is occurring.
1379
1380         * platform/PasteboardStrategy.h:
1381         * platform/PlatformPasteboard.h:
1382         * platform/ios/PasteboardIOS.mm:
1383         (WebCore::Pasteboard::respectsUTIFidelities):
1384         (WebCore::Pasteboard::readString):
1385         * platform/ios/PlatformPasteboardIOS.mm:
1386         (WebCore::PlatformPasteboard::readURL):
1387
1388 2017-04-24  Andy VanWagoner  <thetalecrafter@gmail.com>
1389
1390         Clean up ICU headers
1391         https://bugs.webkit.org/show_bug.cgi?id=170997
1392
1393         Reviewed by JF Bastien.
1394
1395         Update all icu headers to 55.1
1396
1397         * icu/LICENSE: Update copyright
1398         * icu/README: Explain ICU headers for OS X better
1399         * icu/unicode/localpointer.h:
1400         (LocalPointer::LocalPointer):
1401         (LocalPointer::adoptInsteadAndCheckErrorCode):
1402         * icu/unicode/platform.h:
1403         * icu/unicode/putil.h:
1404         * icu/unicode/std_string.h:
1405         * icu/unicode/ubrk.h:
1406         * icu/unicode/uchar.h:
1407         * icu/unicode/ucnv.h:
1408         * icu/unicode/ucol.h:
1409         * icu/unicode/ucoleitr.h:
1410         * icu/unicode/uconfig.h:
1411         * icu/unicode/ucurr.h:
1412         * icu/unicode/uidna.h:
1413         * icu/unicode/uloc.h:
1414         * icu/unicode/umachine.h:
1415         * icu/unicode/unistr.h:
1416         (UnicodeString::getArrayStart):
1417         (UnicodeString::UnicodeString):
1418         (UnicodeString::hasShortLength):
1419         (UnicodeString::getShortLength):
1420         (UnicodeString::length):
1421         (UnicodeString::getCapacity):
1422         (UnicodeString::isBogus):
1423         (UnicodeString::isWritable):
1424         (UnicodeString::isBufferWritable):
1425         (UnicodeString::getBuffer):
1426         (UnicodeString::isEmpty):
1427         (UnicodeString::setZeroLength):
1428         (UnicodeString::setShortLength):
1429         (UnicodeString::setLength):
1430         (UnicodeString::setToEmpty):
1431         (UnicodeString::remove):
1432         * icu/unicode/urename.h:
1433         * icu/unicode/uscript.h:
1434         * icu/unicode/usearch.h:
1435         * icu/unicode/uset.h:
1436         * icu/unicode/ustring.h:
1437         * icu/unicode/utf8.h:
1438         * icu/unicode/utypes.h:
1439         * icu/unicode/uvernum.h:
1440
1441 2017-04-24  Jiewen Tan  <jiewen_tan@apple.com>
1442
1443         LayoutTests crypto/subtle/ecdsa-generate-key-sign-verify-p384.html and crypto/subtle/ecdsa-generate-key-sign-verify-p256.html are flaky failures
1444         https://bugs.webkit.org/show_bug.cgi?id=171059
1445         <rdar://problem/31734958>
1446
1447         Reviewed by Brent Fulgham.
1448
1449         Covered by existing tests.
1450
1451         * crypto/mac/CryptoAlgorithmECDSAMac.cpp:
1452         (WebCore::signECDSA):
1453         Enhance ways to convert the DER signatures produced from CommonCrypto to r||s.
1454
1455 2017-04-24  Manuel Rego Casasnovas  <rego@igalia.com>
1456
1457         [selectors4] :focus-within should use the flat tree
1458         https://bugs.webkit.org/show_bug.cgi?id=170899
1459
1460         Reviewed by Antti Koivisto.
1461
1462         This has been discussed in the following CSS WG issue:
1463         https://github.com/w3c/csswg-drafts/issues/1135
1464
1465         And the spec has been updated (https://drafts.csswg.org/selectors-4/#the-focus-within-pseudo):
1466         "An element also matches :focus-within if one of its descendants in the flat tree
1467          (including non-element nodes, such as text nodes) matches the conditions for matching :focus."
1468
1469         Test: imported/w3c/web-platform-tests/css/selectors4/focus-within-shadow-006.html
1470
1471         * dom/Element.cpp:
1472         (WebCore::Element::setFocus): Use "flat tree" ("composed tree" in WebKit)
1473         to set focus-within flag.
1474
1475 2017-04-24  Wenson Hsieh  <wenson_hsieh@apple.com>
1476
1477         Respect fidelity order when reading web content from item providers
1478         https://bugs.webkit.org/show_bug.cgi?id=171155
1479         <rdar://problem/31356937>
1480
1481         Reviewed by Tim Horton.
1482
1483         Currently, when reading web content from pasteboards, we assume the old UIPasteboard/NSPasteboard model wherein
1484         the destination must determine which of the items is considered to have the highest fidelity for the purposes of
1485         inserting into an editable area. This destination-side fidelity ranking is determined solely by the NSArray
1486         returned from Pasteboard::supportedPasteboardTypes, which lists compatible types in order from highest fidelity
1487         to lowest fidelity. Pasteboard::read effectively iterates over this list of types in order, attempting to read
1488         highest fidelity types and bailing when it first successfully reads data.
1489
1490         However, when our pasteboard is backed by UIItemProviders, we should instead read pasteboard types in order of
1491         fidelity as specified by the source rather than the destination. To accomplish this, we introduce an alternate
1492         codepath, Pasteboard::readRespectingUTIFidelities, which we take if Pasteboard::respectsUTIFidelities is true
1493         (currently, this only applies for the purposes of data interaction). This version follows a different flow:
1494         for each item in the pasteboard, we ask for just the UTIs for that item, in order of fidelity. For each item,
1495         we then call readPasteboardWebContentDataForType to try and read data for that type, continuing until either
1496         all UTIs have been attempted, or reading was successful.
1497
1498         This patch makes two additional adjustments. First, we introduce Pasteboard::getTypesByFidelityForItemAtIndex,
1499         which is used by Pasteboard::readRespectingUTIFidelities when querying the list of supported UTIs for each
1500         pasteboard item, sorted by highest to lowest fidelity.
1501
1502         Secondly, we refactor logic to write to the item provider pasteboard in PlatformPasteboardIOS. Since we are
1503         now respecting fidelity rankings on the destination, the source must also register UTI types in the right
1504         fidelity order. While this was mostly achieved using our existing method of writing a list of object
1505         representations to the pasteboard and then all of the contents of a NSString => NSData dictionary containing
1506         private UTI data, this approach has two flaws:
1507         1.  We are unable to register high-priority custom types, followed by representing objects, followed by more
1508             lower-priority custom types, since we assume that all custom types follow all representing objects.
1509         2.  Since we're just iterating over a dictionary of NSString => NSData when registering custom UTI
1510             representations to the item provider, there cannot inherently be any fidelity ordering for custom types.
1511
1512         To address both of these issues, we introduce two new objects that encapsulate how we register data to the item
1513         provider pasteboard. WebItemProviderRegistrationInfo represents some data that can be registered to an item
1514         provider (either an object conforming to UIItemProviderWriting, or an NSString and NSData).
1515         WebItemProviderRegistrationInfoList represents a list of WebItemProviderRegistrationInfos in order of highest to
1516         lowest fidelity. In PlatformPasteboardIOS, we transform PasteboardWebContent, PasteboardImage, and PasteboardURL
1517         into a WebItemProviderRegistrationInfoList, which we then pass along to the WebItemProviderPasteboard. In
1518         WebItemProviderPasteboard, we traverse the list of WebItemProviderRegistrationInfos in the list and register
1519         each WebItemProviderRegistrationInfo's representing object or data to the item provider.
1520
1521         Test: DataInteractionTests.RespectsExternalSourceFidelityRankings.
1522
1523         * WebCore.xcodeproj/project.pbxproj:
1524         * platform/Pasteboard.h:
1525         * platform/PasteboardStrategy.h:
1526         * platform/PlatformPasteboard.h:
1527         * platform/ios/AbstractPasteboard.h:
1528         * platform/ios/AbstractPasteboard.mm: Removed.
1529
1530         Moves WebItemProviderData, formerly implemented in AbstractPasteboard.mm, into WebItemProviderPasteboard.mm.
1531         We can delete AbstractPasteboard.mm as a result.
1532
1533         * platform/ios/PasteboardIOS.mm:
1534         (WebCore::readPasteboardWebContentDataForType):
1535
1536         Pull out common logic for reading data given a UTI type from the pasteboard into the PasteboardWebContentReader.
1537         This is invoked from both the existing Pasteboard::read codepath, as well as the readRespectingUTIFidelities
1538         codepath.
1539
1540         (WebCore::Pasteboard::read):
1541
1542         Refactored to call the new readPasteboardWebContentDataForType helper. Behavior should not have changed, unless
1543         the pasteboard supports UTI fidelities.
1544
1545         (WebCore::Pasteboard::respectsUTIFidelities):
1546         (WebCore::Pasteboard::readRespectingUTIFidelities):
1547
1548         An alternative to Pasteboard::read that considers source-side fidelity rankings of UTIs.
1549
1550         * platform/ios/PlatformPasteboardIOS.mm:
1551         (WebCore::PlatformPasteboard::getTypesByFidelityForItemAtIndex):
1552         (WebCore::PlatformPasteboard::writeObjectRepresentations):
1553
1554         Refactored to build a WebItemProviderRegistrationInfoList and pass it to the WebItemProviderPasteboard to
1555         register items and data.
1556
1557         (WebCore::PlatformPasteboard::write):
1558         * platform/ios/WebItemProviderPasteboard.h:
1559         * platform/ios/WebItemProviderPasteboard.mm:
1560         (-[WebItemProviderRegistrationInfo initWithRepresentingObject:typeIdentifier:data:]):
1561         (-[WebItemProviderRegistrationInfo representingObject]):
1562         (-[WebItemProviderRegistrationInfo typeIdentifier]):
1563         (-[WebItemProviderRegistrationInfo data]):
1564
1565         Represents a single calls to register data onto the item provider pasteboard. See
1566         WebItemProviderPasteboard.h header comments for more info.
1567
1568         (-[WebItemProviderRegistrationInfoList init]):
1569         (-[WebItemProviderRegistrationInfoList addData:forType:]):
1570         (-[WebItemProviderRegistrationInfoList addRepresentingObject:]):
1571         (-[WebItemProviderRegistrationInfoList numberOfItems]):
1572         (-[WebItemProviderRegistrationInfoList itemAtIndex:]):
1573         (-[WebItemProviderRegistrationInfoList enumerateItems:]):
1574
1575         Represents a series of calls to register representations onto the item provider pasteboard. See
1576         WebItemProviderPasteboard.h header comments for more info.
1577
1578         (-[WebItemProviderPasteboard pasteboardTypesByFidelityForItemAtIndex:]):
1579         (-[WebItemProviderPasteboard setItemsUsingRegistrationInfoLists:]):
1580         (-[WebItemProviderPasteboard setItemsFromObjectRepresentations:]): Deleted.
1581
1582 2017-04-24  Chris Dumez  <cdumez@apple.com>
1583
1584         Regression(r204605): support for "cp874" charset alias was inadvertently dropped which may cause issues on certain Thai sites
1585         https://bugs.webkit.org/show_bug.cgi?id=171128
1586         <rdar://problem/31526844>
1587
1588         Reviewed by Alexey Proskuryakov.
1589
1590         When using Thai as default language on MacOS, defaultTextEncodingNameForSystemLanguage()
1591         was returning "cp874" encoding with was dropped in r204605 for not being part of the
1592         encoding specification (https://encoding.spec.whatwg.org/#names-and-labels).
1593
1594         To address the issue, we map "cp874" encoding to the "dos-874" encoding which is
1595         properly recognized. Without this, this could lead to issue on WebSites that do not
1596         specify a charset.
1597
1598         * platform/text/TextEncodingRegistry.cpp:
1599         (WebCore::defaultTextEncodingNameForSystemLanguage):
1600
1601 2017-04-24  Said Abou-Hallawa  <sabouhallawa@apple.com>
1602
1603         [CG] Provide a type identifier hint to the CGImageSource so getting the type identifier is more accurate
1604         https://bugs.webkit.org/show_bug.cgi?id=171042
1605
1606         Reviewed by Tim Horton.
1607
1608         The image URL can be used to get the type identifier hint. Without providing
1609         this hint, the image type identifier is not accurate for image formats.
1610
1611         Also add a function to the ImageDecoder class to get the typeIdentifier. Add
1612         all the pluming from the ImageDecoder till the Image class.
1613
1614         * WebCore.xcodeproj/project.pbxproj:
1615         * platform/graphics/BitmapImage.cpp:
1616         (WebCore::BitmapImage::destroyDecodedData):
1617         (WebCore::BitmapImage::frameImageAtIndexCacheIfNeeded):
1618         (WebCore::BitmapImage::draw):
1619         (WebCore::BitmapImage::internalStartAnimation):
1620         (WebCore::BitmapImage::advanceAnimation):
1621         (WebCore::BitmapImage::internalAdvanceAnimation):
1622         (WebCore::BitmapImage::newFrameNativeImageAvailableAtIndex):
1623         * platform/graphics/BitmapImage.h:
1624         * platform/graphics/Image.cpp:
1625         (WebCore::Image::sourceURL):
1626         * platform/graphics/Image.h: Change the sourceURL() to return a URL so CG can create CFURLRef from it.
1627         (WebCore::Image::uti):
1628         * platform/graphics/ImageFrameCache.cpp:
1629         (WebCore::ImageFrameCache::cacheAsyncFrameNativeImageAtIndex):
1630         (WebCore::ImageFrameCache::startAsyncDecodingQueue):
1631         (WebCore::ImageFrameCache::requestFrameAsyncDecodingAtIndex):
1632         (WebCore::ImageFrameCache::stopAsyncDecodingQueue):
1633         (WebCore::ImageFrameCache::clearMetadata):
1634         (WebCore::ImageFrameCache::sourceURL):
1635         (WebCore::ImageFrameCache::encodedDataStatus):
1636         (WebCore::ImageFrameCache::uti):
1637         (WebCore::ImageFrameCache::filenameExtension):
1638         * platform/graphics/ImageFrameCache.h:
1639         * platform/graphics/ImageSource.cpp:
1640         (WebCore::ImageSource::ensureDecoderAvailable):
1641         * platform/graphics/ImageSource.h:
1642         (WebCore::ImageSource::uti):
1643         * platform/graphics/cg/ImageDecoderCG.cpp:
1644         (WebCore::ImageDecoder::ImageDecoder): Pass the type identifier hint to CGImageSourceCreateIncremental().
1645         (WebCore::ImageDecoder::uti):
1646         (WebCore::ImageDecoder::filenameExtension):
1647         (WebCore::ImageDecoder::frameHasAlphaAtIndex):
1648         (WebCore::ImageDecoder::createFrameImageAtIndex):
1649         * platform/graphics/cg/ImageDecoderCG.h:
1650         (WebCore::ImageDecoder::create):
1651         * platform/graphics/win/ImageDecoderDirect2D.cpp:
1652         (WebCore::ImageDecoder::encodedDataStatus):
1653         * platform/graphics/win/ImageDecoderDirect2D.h:
1654         (WebCore::ImageDecoder::create): Add an argument of type URL.
1655         * platform/image-decoders/ImageDecoder.cpp:
1656         (WebCore::ImageDecoder::create): Add an argument of type URL.
1657         * platform/image-decoders/ImageDecoder.h:
1658         (WebCore::ImageDecoder::encodedDataStatus): Make it const.
1659         * platform/image-decoders/bmp/BMPImageDecoder.cpp:
1660         (WebCore::BMPImageDecoder::encodedDataStatus):
1661         * platform/image-decoders/bmp/BMPImageDecoder.h:
1662         * platform/image-decoders/gif/GIFImageDecoder.cpp:
1663         (WebCore::GIFImageDecoder::encodedDataStatus):
1664         * platform/image-decoders/gif/GIFImageDecoder.h:
1665         * platform/image-decoders/ico/ICOImageDecoder.cpp:
1666         (WebCore::ICOImageDecoder::encodedDataStatus):
1667         * platform/image-decoders/ico/ICOImageDecoder.h:
1668         * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
1669         (WebCore::JPEGImageDecoder::encodedDataStatus):
1670         * platform/image-decoders/jpeg/JPEGImageDecoder.h:
1671         * platform/image-decoders/png/PNGImageDecoder.cpp:
1672         (WebCore::PNGImageDecoder::encodedDataStatus):
1673         * platform/image-decoders/png/PNGImageDecoder.h:
1674         * platform/image-decoders/webp/WEBPImageDecoder.cpp:
1675         (WebCore::WEBPImageDecoder::encodedDataStatus):
1676         * platform/image-decoders/webp/WEBPImageDecoder.h:
1677         * platform/spi/cg/ImageIOSPI.h: Added.
1678
1679 2017-04-24  Ryan Haddad  <ryanhaddad@apple.com>
1680
1681         Unreviewed build fix.
1682
1683         * crypto/mac/CryptoAlgorithmAES_GCMMac.cpp:
1684         (WebCore::encryptAES_GCM):
1685         (WebCore::decyptAES_GCM):
1686
1687 2017-04-24  Said Abou-Hallawa  <sabouhallawa@apple.com>
1688
1689         Whitelist supported image MIME types
1690         https://bugs.webkit.org/show_bug.cgi?id=171077
1691
1692         Reviewed by Tim Horton.
1693
1694         Restrict the CG port image formats to a known whitelist. Build this list from image
1695         UTI's instead of MIME types, since the image UTI's is a superset of the MIME types.
1696         Use this list to build the list of supported image MIME types.
1697
1698         * PlatformAppleWin.cmake:
1699         * WebCore.xcodeproj/project.pbxproj:
1700         * platform/MIMETypeRegistry.cpp:
1701         (WebCore::initializeSupportedImageMIMETypes):
1702         * platform/graphics/cg/UTIRegistry.cpp: Added.
1703         (WebCore::allowedImageUTIs):
1704         (WebCore::isAllowedImageUTI):
1705         * platform/graphics/cg/UTIRegistry.h: Added.
1706
1707 2017-04-24  Nan Wang  <n_wang@apple.com>
1708
1709         AX: Crash at WebCore::AXObjectCache::characterOffsetForIndex(int, WebCore::AccessibilityObject const*) + 703
1710         https://bugs.webkit.org/show_bug.cgi?id=171247
1711
1712         Reviewed by Chris Fleizach.
1713
1714         Crashed because we were passing a nil node into rootAXEditableElement(). Fixed it by
1715         adding a null check.
1716
1717         Test: accessibility/mac/input-string-for-range-crash.html
1718
1719         * accessibility/AXObjectCache.cpp:
1720         (WebCore::AXObjectCache::characterOffsetForIndex):
1721
1722 2017-04-24  Youenn Fablet  <youenn@apple.com>
1723
1724         Set defaults video getUserMedia constraints
1725         https://bugs.webkit.org/show_bug.cgi?id=171127
1726
1727         Reviewed by Eric Carlson.
1728
1729         Test: fast/mediastream/getUserMedia-default.html
1730
1731         Adding default optional constraints for video size and frame rate if none is defined.
1732         Default is 640x480 30fps.
1733
1734         Doing some refactoring in MeddiaConstraintsImpl and MeddiaConstraintsData to use more move constructors.
1735
1736         * Modules/mediastream/MediaConstraintsImpl.cpp:
1737         (WebCore::defaultVideoConstraints):
1738         (WebCore::MediaConstraintsData::setDefaultVideoConstraints):
1739         (WebCore::MediaConstraintsImpl::create): Deleted.
1740         * Modules/mediastream/MediaConstraintsImpl.h:
1741         * Modules/mediastream/MediaDevices.cpp:
1742         (WebCore::MediaDevices::getUserMedia):
1743         * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
1744         (WebCore::MockRealtimeVideoSourceMac::updateSampleBuffer): Fixing crash when setting frameRate.
1745
1746 2017-04-24  Chris Dumez  <cdumez@apple.com>
1747
1748         createElementNS() should now throw only InvalidCharacterError, not NamespaceError
1749         https://bugs.webkit.org/show_bug.cgi?id=171052
1750
1751         Reviewed by Sam Weinig.
1752
1753         Validating a qualified name should only throw InvalidCharacterError, not NamespaceError,
1754         after:
1755         - https://github.com/whatwg/dom/issues/319
1756         - https://github.com/w3c/web-platform-tests/issues/5161
1757         - https://github.com/whatwg/dom/issues/423
1758
1759         Latest spec:
1760         - https://dom.spec.whatwg.org/#validate
1761
1762         No new tests, updated web-platform-tests.
1763
1764         * dom/Document.cpp:
1765         (WebCore::Document::parseQualifiedName):
1766
1767 2017-04-24  Chris Dumez  <cdumez@apple.com>
1768
1769         REGRESSION (214503): Webkit crash under RenderElement::repaintForPausedImageAnimationsIfNeeded() when scrolling giphy pages
1770         https://bugs.webkit.org/show_bug.cgi?id=171243
1771         <rdar://problem/31715572>
1772
1773         Reviewed by Antti Koivisto.
1774
1775         After r214503, we would frequently crash when scrolling giphy pages because we were failing to call
1776         RenderView::removeRendererWithPausedImageAnimations(renderer, cachedImage) in some cases. This would
1777         cause a RenderElement to still be associated to a CachedImage in RenderView but not in practice.
1778         If the CachedImage then gets destroyed and the user scrolls, we end up calling
1779         RenderElement::repaintForPausedImageAnimationsIfNeeded() with a bad CachedImage.
1780
1781         StyleCachedImage was properly calling RenderView::removeRendererWithPausedImageAnimations() before
1782         unregistering the renderer as a client to the CachedImage. However, RenderImageResource was failing
1783         to do the same. To make this less error-prone, I added a didRemoveCachedImageClient(CachedImage&)
1784         function to the CachedImageClient interface. It is overriden in RenderElement only to call
1785         RenderView::removeRendererWithPausedImageAnimations().
1786
1787         Test: fast/images/animated-gif-scrolling-crash.html
1788
1789         * loader/cache/CachedImage.cpp:
1790         (WebCore::CachedImage::didRemoveClient):
1791         * loader/cache/CachedImageClient.h:
1792         (WebCore::CachedImageClient::didRemoveCachedImageClient):
1793         * rendering/RenderElement.cpp:
1794         (WebCore::RenderElement::didRemoveCachedImageClient):
1795         * rendering/RenderElement.h:
1796         * rendering/style/StyleCachedImage.cpp:
1797         (WebCore::StyleCachedImage::removeClient):
1798
1799 2017-04-24  Andy Estes  <aestes@apple.com>
1800
1801         [macOS] Fix two minor issues with MediaSelectionOption::Type
1802         https://bugs.webkit.org/show_bug.cgi?id=171235
1803
1804         Reviewed by Sam Weinig.
1805
1806         * platform/MediaSelectionOption.h: Gave type a default value, and added explicit
1807         constructors to make gcc and msvc happy.
1808         * platform/mac/WebPlaybackControlsManager.mm:
1809         (toAVTouchBarMediaSelectionOptionType): Added an ASSERT_NOT_REACHED if none of the switch
1810         cases match.
1811
1812 2017-04-24  Andy Estes  <aestes@apple.com>
1813
1814         [macOS] Enable media selection button on AVTouchBarScrubber
1815         https://bugs.webkit.org/show_bug.cgi?id=171149
1816         <rdar://problem/29875010>
1817
1818         Reviewed by Beth Dakin.
1819
1820         * platform/spi/cocoa/AVKitSPI.h:
1821
1822 2017-04-24  Alex Christensen  <achristensen@webkit.org>
1823
1824         Reduce copies and allocations in SharedBuffer::append
1825         https://bugs.webkit.org/show_bug.cgi?id=170956
1826
1827         Reviewed by Andreas Kling.
1828
1829         SharedBuffer was a mess of different data structures added over the years.
1830         SharedBuffer::append would allocate large Vector<char>s and call memcpy, and that
1831         is inefficient and causes crashes when large allocations fail, and the allocations
1832         and copies aren't even necessary.  There were also const correctness problems in
1833         ResourceLoader::addDataOrBuffer, and iterating a SharedBuffer was strange because
1834         sometimes we don't want to add unnecessary copies.
1835
1836         These problems are solved by making SharedBuffer a Vector of read-only data segments,
1837         which can be contained in various ways but we don't care because all we want to do is
1838         read them.  Appending SharedBuffers is now const correct because we just add to a
1839         Vector<Ref<DataSegment>> and neither SharedBuffer can write to the data.  Sometimes,
1840         though, we want all the data to be in continuous memory, and if there are multiple
1841         segments then the data needs to be copied once to a new segment.  We should audit the
1842         call sites of SharedBuffer::data and see if this is really necessary.
1843
1844         No change in functional behavior.  Fewer copies of the data are made when buffering
1845         data in the NetworkProcess.  No extra memory is allocated for bytes we think we might
1846         need to append in the future.  Data is now only copied into one buffer lazily as needed,
1847         which could slightly change when small delays from memcpy happen, but it's an overall
1848         improvement.  We could have a performance hit if we were to call append() then data()
1849         then append() then data() etc. but that doesn't happen in WebKit because we call append
1850         repeatedly when buffering the data then call data() once when reading the data.
1851
1852         * editing/cocoa/EditorCocoa.mm:
1853         (WebCore::archivedDataForAttributedString):
1854         (WebCore::Editor::selectionInWebArchiveFormat):
1855         (WebCore::Editor::dataInRTFDFormat):
1856         (WebCore::Editor::dataInRTFFormat):
1857         * editing/ios/EditorIOS.mm:
1858         (WebCore::Editor::WebContentReader::readURL):
1859         * editing/mac/EditorMac.mm:
1860         (WebCore::Editor::imageInWebArchiveFormat):
1861         * loader/TextTrackLoader.cpp:
1862         (WebCore::TextTrackLoader::processNewCueData):
1863         * loader/archive/cf/LegacyWebArchive.cpp:
1864         (WebCore::LegacyWebArchive::createResource):
1865         * loader/cache/CachedResource.cpp:
1866         (WebCore::CachedResource::tryReplaceEncodedData):
1867         * loader/cocoa/DiskCacheMonitorCocoa.mm:
1868         (WebCore::DiskCacheMonitor::tryGetFileBackedSharedBufferFromCFURLCachedResponse):
1869         * platform/SharedBuffer.cpp:
1870         (WebCore::SharedBuffer::SharedBuffer):
1871         (WebCore::SharedBuffer::create):
1872         (WebCore::SharedBuffer::combineToOneSegment):
1873         (WebCore::SharedBuffer::data):
1874         (WebCore::SharedBuffer::createArrayBuffer):
1875         (WebCore::SharedBuffer::append):
1876         (WebCore::SharedBuffer::clear):
1877         (WebCore::SharedBuffer::copy):
1878         (WebCore::SharedBuffer::DataSegment::data):
1879         (WebCore::SharedBuffer::DataSegment::size):
1880         (WebCore::segmentIndex): Deleted.
1881         (WebCore::offsetInSegment): Deleted.
1882         (WebCore::allocateSegment): Deleted.
1883         (WebCore::freeSegment): Deleted.
1884         (WebCore::SharedBuffer::~SharedBuffer): Deleted.
1885         (WebCore::SharedBuffer::size): Deleted.
1886         (WebCore::SharedBuffer::duplicateDataBufferIfNecessary): Deleted.
1887         (WebCore::SharedBuffer::appendToDataBuffer): Deleted.
1888         (WebCore::SharedBuffer::clearDataBuffer): Deleted.
1889         (WebCore::SharedBuffer::copyBufferAndClear): Deleted.
1890         (WebCore::SharedBuffer::buffer): Deleted.
1891         (WebCore::SharedBuffer::getSomeData): Deleted.
1892         (WebCore::SharedBuffer::maybeTransferMappedFileData): Deleted.
1893         (WebCore::SharedBuffer::clearPlatformData): Deleted.
1894         (WebCore::SharedBuffer::maybeTransferPlatformData): Deleted.
1895         (WebCore::SharedBuffer::hasPlatformData): Deleted.
1896         (WebCore::SharedBuffer::platformData): Deleted.
1897         (WebCore::SharedBuffer::maybeAppendPlatformData): Deleted.
1898         * platform/SharedBuffer.h:
1899         (WebCore::SharedBuffer::create): Deleted.
1900         (WebCore::SharedBuffer::isEmpty): Deleted.
1901         * platform/SharedBufferChunkReader.cpp:
1902         (WebCore::SharedBufferChunkReader::nextChunk):
1903         (WebCore::SharedBufferChunkReader::peek):
1904         * platform/SharedBufferChunkReader.h:
1905         * platform/URLParser.cpp:
1906         (WebCore::URLParser::URLParser):
1907         * platform/cf/KeyedEncoderCF.cpp:
1908         (WebCore::KeyedEncoderCF::finishEncoding):
1909         * platform/cf/SharedBufferCF.cpp:
1910         (WebCore::SharedBuffer::SharedBuffer):
1911         (WebCore::SharedBuffer::createCFData):
1912         (WebCore::SharedBuffer::create):
1913         (WebCore::SharedBuffer::hintMemoryNotNeededSoon):
1914         (WebCore::SharedBuffer::append):
1915         (WebCore::SharedBuffer::wrapCFData): Deleted.
1916         (WebCore::SharedBuffer::hasPlatformData): Deleted.
1917         (WebCore::SharedBuffer::platformData): Deleted.
1918         (WebCore::SharedBuffer::platformDataSize): Deleted.
1919         (WebCore::SharedBuffer::maybeTransferPlatformData): Deleted.
1920         (WebCore::SharedBuffer::clearPlatformData): Deleted.
1921         (WebCore::SharedBuffer::tryReplaceContentsWithPlatformBuffer): Deleted.
1922         (WebCore::SharedBuffer::maybeAppendPlatformData): Deleted.
1923         (WebCore::SharedBuffer::copyBufferAndClear): Deleted.
1924         (WebCore::SharedBuffer::copySomeDataFromDataArray): Deleted.
1925         (WebCore::SharedBuffer::singleDataArrayBuffer): Deleted.
1926         (WebCore::SharedBuffer::maybeAppendDataArray): Deleted.
1927         * platform/cocoa/NetworkExtensionContentFilter.mm:
1928         (WebCore::NetworkExtensionContentFilter::replacementData):
1929         * platform/cocoa/ParentalControlsContentFilter.mm:
1930         (WebCore::ParentalControlsContentFilter::replacementData):
1931         * platform/cocoa/SharedBufferCocoa.mm:
1932         (-[WebCoreSharedBufferData initWithSharedBufferDataSegment:]):
1933         (-[WebCoreSharedBufferData length]):
1934         (-[WebCoreSharedBufferData bytes]):
1935         (WebCore::SharedBuffer::create):
1936         (WebCore::SharedBuffer::createCFData):
1937         (WebCore::SharedBuffer::createFromReadingFile):
1938         (WebCore::SharedBuffer::createNSDataArray):
1939         (-[WebCoreSharedBufferData initWithSharedBufferDataBuffer:]): Deleted.
1940         (WebCore::SharedBuffer::wrapNSData): Deleted.
1941         (WebCore::SharedBuffer::existingCFData): Deleted.
1942         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
1943         (WebCore::WebCoreAVFResourceLoader::fulfillRequestWithResource):
1944         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
1945         (WebCore::FontPlatformData::openTypeTable):
1946         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
1947         (ResourceHandleStreamingClient::didReceiveBuffer):
1948         * platform/graphics/mac/ImageMac.mm:
1949         (WebCore::Image::loadPlatformResource):
1950         * platform/image-decoders/ImageDecoder.cpp:
1951         (WebCore::ImageDecoder::create):
1952         * platform/image-decoders/png/PNGImageDecoder.cpp:
1953         (WebCore::PNGImageReader::decode):
1954         * platform/ios/PlatformPasteboardIOS.mm:
1955         (WebCore::PlatformPasteboard::readBuffer):
1956         * platform/mac/PasteboardMac.mm:
1957         (WebCore::writeFileWrapperAsRTFDAttachment):
1958         (WebCore::Pasteboard::write):
1959         * platform/mac/PlatformPasteboardMac.mm:
1960         (WebCore::PlatformPasteboard::bufferForType):
1961         * platform/network/BlobResourceHandle.cpp:
1962         (WebCore::BlobResourceHandle::notifyReceiveData):
1963         * platform/network/MIMEHeader.cpp:
1964         * platform/network/MIMEHeader.h:
1965         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
1966         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveData):
1967         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
1968         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveData):
1969         * platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
1970         (-[WebCoreResourceHandleAsDelegate connection:didReceiveData:lengthReceived:]):
1971         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
1972         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveData:lengthReceived:]):
1973         * platform/soup/SharedBufferSoup.cpp:
1974         (WebCore::SharedBuffer::SharedBuffer):
1975         (WebCore::SharedBuffer::createSoupBuffer):
1976         (WebCore::SharedBuffer::clearPlatformData): Deleted.
1977         (WebCore::SharedBuffer::maybeTransferPlatformData): Deleted.
1978         (WebCore::SharedBuffer::hasPlatformData): Deleted.
1979         (WebCore::SharedBuffer::platformData): Deleted.
1980         (WebCore::SharedBuffer::platformDataSize): Deleted.
1981         (WebCore::SharedBuffer::maybeAppendPlatformData): Deleted.
1982         (WebCore::SharedBuffer::tryReplaceContentsWithPlatformBuffer): Deleted.
1983
1984 2017-04-24  Dan Bernstein  <mitz@apple.com>
1985
1986         [Cocoa] Some ivars are needlessly @protected
1987         https://bugs.webkit.org/show_bug.cgi?id=171208
1988
1989         Reviewed by Anders Carlsson.
1990
1991         Made ivars @private where possible.
1992
1993         * platform/mac/WebCoreFullScreenPlaceholderView.h:
1994         * platform/mac/WebCoreFullScreenWarningView.h:
1995         * platform/mac/WebPlaybackControlsManager.h:
1996         * platform/network/cocoa/WebCoreNSURLSession.h:
1997
1998 2017-04-24  Carlos Garcia Campos  <cgarcia@igalia.com>
1999
2000         [GTK] Switch to use ENABLE_REMOTE_INSPECTOR instead of ENABLE_INSPECTOR_SERVER for the remote inspector
2001         https://bugs.webkit.org/show_bug.cgi?id=166680
2002
2003         Reviewed by Michael Catanzaro.
2004
2005         Add PageDebuggable.cpp to the compilation.
2006
2007         * CMakeLists.txt:
2008
2009 2017-04-23  Commit Queue  <commit-queue@webkit.org>
2010
2011         Unreviewed, rolling out r215657 and r215676.
2012         https://bugs.webkit.org/show_bug.cgi?id=171201
2013
2014         Broke the build (Requested by ap on #webkit).
2015
2016         Reverted changesets:
2017
2018         "[macOS] Enable media selection button on AVTouchBarScrubber"
2019         https://bugs.webkit.org/show_bug.cgi?id=171149
2020         http://trac.webkit.org/changeset/215657
2021
2022         "Build fix after r215657."
2023         http://trac.webkit.org/changeset/215676
2024
2025 2017-04-23  Andy Estes  <aestes@apple.com>
2026
2027         [macOS] AVTouchBarMediaSelectionOptions should be created with the correct type
2028         https://bugs.webkit.org/show_bug.cgi?id=171192
2029         <rdar://problem/29875010>
2030
2031         Reviewed by Wenson Hsieh.
2032
2033         AVTouchBarMediaSelectionOption was always being created with type
2034         AVTouchBarMediaSelectionOptionTypeRegular, but we know if a TextTrack is really the legible
2035         off or legible auto track. This change plumbs that information into
2036         WebPlaybackControlsManager so that AVTouchBarMediaSelectionOptions can be created with the
2037         right AVTouchBarMediaSelectionOptionType. 
2038
2039         * WebCore.xcodeproj/project.pbxproj:
2040         * page/CaptionUserPreferences.cpp:
2041         (WebCore::CaptionUserPreferences::mediaSelectionOptionForTrack):
2042         * page/CaptionUserPreferences.h:
2043         * platform/MediaSelectionOption.h: Added.
2044         * platform/cocoa/WebPlaybackSessionModel.h:
2045         (WebCore::WebPlaybackSessionModelClient::audioMediaSelectionOptionsChanged):
2046         (WebCore::WebPlaybackSessionModelClient::legibleMediaSelectionOptionsChanged):
2047         * platform/cocoa/WebPlaybackSessionModelMediaElement.h:
2048         * platform/cocoa/WebPlaybackSessionModelMediaElement.mm:
2049         (WebCore::WebPlaybackSessionModelMediaElement::audioMediaSelectionOptions):
2050         (WebCore::WebPlaybackSessionModelMediaElement::legibleMediaSelectionOptions):
2051         * platform/ios/WebPlaybackSessionInterfaceAVKit.h:
2052         * platform/ios/WebPlaybackSessionInterfaceAVKit.mm:
2053         (WebCore::mediaSelectionOptions):
2054         (WebCore::WebPlaybackSessionInterfaceAVKit::audioMediaSelectionOptionsChanged):
2055         (WebCore::WebPlaybackSessionInterfaceAVKit::legibleMediaSelectionOptionsChanged):
2056         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
2057         (WebVideoFullscreenControllerContext::audioMediaSelectionOptionsChanged):
2058         (WebVideoFullscreenControllerContext::legibleMediaSelectionOptionsChanged):
2059         (WebVideoFullscreenControllerContext::audioMediaSelectionOptions):
2060         (WebVideoFullscreenControllerContext::legibleMediaSelectionOptions):
2061         * platform/mac/WebPlaybackControlsManager.h:
2062         * platform/mac/WebPlaybackControlsManager.mm:
2063         (toAVTouchBarMediaSelectionOptionType):
2064         (mediaSelectionOptions):
2065         (-[WebPlaybackControlsManager setAudioMediaSelectionOptions:withSelectedIndex:]):
2066         (-[WebPlaybackControlsManager setLegibleMediaSelectionOptions:withSelectedIndex:]):
2067         (-[WebPlaybackControlsManager webPlaybackSessionInterfaceMac]):
2068         (-[WebPlaybackControlsManager setWebPlaybackSessionInterfaceMac:]):
2069         * platform/mac/WebPlaybackSessionInterfaceMac.h:
2070         * platform/mac/WebPlaybackSessionInterfaceMac.mm:
2071         (WebCore::WebPlaybackSessionInterfaceMac::audioMediaSelectionOptionsChanged):
2072         (WebCore::WebPlaybackSessionInterfaceMac::legibleMediaSelectionOptionsChanged):
2073
2074 2017-04-22  Wenson Hsieh  <wenson_hsieh@apple.com>
2075
2076         File inputs only accept UTI types that can be inserted into contenteditable areas when dropping
2077         https://bugs.webkit.org/show_bug.cgi?id=171177
2078         <rdar://problem/31765379>
2079
2080         Reviewed by Andy Estes.
2081
2082         Currently, DragController::canProcessDrag bails immediately with `false` if the drag data does not contain
2083         compatible content. However, if we are dragging over a file input, we want the presence of files in the drag
2084         data to take priority. To fix this, we teach DragData::containsCompatibleContent to take the purpose of the drag
2085         into account (by default, this is Editing, but when dragging over a file input, this becomes FileUpload). We
2086         then consider DragData to have compatible content for the purpose of file uploading if it contains any files.
2087
2088         Test: DataInteractionTests.ExternalSourceJSONToFileInput.
2089
2090         * page/DragController.cpp:
2091         (WebCore::DragController::canProcessDrag):
2092         * platform/DragData.h:
2093         * platform/gtk/DragDataGtk.cpp:
2094         (WebCore::DragData::containsCompatibleContent):
2095         * platform/mac/DragDataMac.mm:
2096         (WebCore::DragData::containsCompatibleContent):
2097         * platform/win/DragDataWin.cpp:
2098         (WebCore::DragData::containsCompatibleContent):
2099
2100 2017-04-22  Eric Carlson  <eric.carlson@apple.com>
2101
2102         [MediaStream] Fix regression caused by r215626
2103         https://bugs.webkit.org/show_bug.cgi?id=171168
2104         <rdar://problem/31774787>
2105
2106         Reviewed by Antoine Quint.
2107
2108         No new tests, fixes fast/mediastream/MediaStream-page-muted.html
2109
2110         * Modules/mediastream/MediaStream.cpp:
2111         (WebCore::MediaStream::mediaState): Test muted before m_isProducingData because if both are 
2112         true we want to report that the stream is muted.
2113
2114 2017-04-21  Zalan Bujtas  <zalan@apple.com>
2115
2116         Do not measure large chunk of text repeatedly during mid-word breaking.
2117         https://bugs.webkit.org/show_bug.cgi?id=171065
2118         <rdar://problem/31630245>
2119
2120         Reviewed by Antti Koivisto.
2121
2122         This patch reduces redundant text measuring for mid-word breaking by
2123         1. Adjusting the range for the binary search when the text fragment is longer than the available width
2124         2. Preserving the width value for the left side of the split fragment (computed during the binary search) so
2125         that when the fragment is being split we don't need to re-measure it
2126         3. Checking if the right side fits the next line and only adjust the width (by re-measuring the text) for
2127         kerning/ligature if it does (if it does not fit, we'll end up re-measuring some part of it
2128         during the next split)
2129
2130         Performance test has already been added.
2131
2132         * rendering/SimpleLineLayout.cpp:
2133         (WebCore::SimpleLineLayout::hyphenPositionForFragment):
2134         (WebCore::SimpleLineLayout::split): binary search with adjusting the range and preserving the width for the left side.
2135         (WebCore::SimpleLineLayout::splitFragmentToFitLine):
2136         (WebCore::SimpleLineLayout::FragmentForwardIterator::FragmentForwardIterator): Deleted.
2137         (WebCore::SimpleLineLayout::FragmentForwardIterator::operator++): Deleted.
2138         (WebCore::SimpleLineLayout::FragmentForwardIterator::operator!=): Deleted.
2139         (WebCore::SimpleLineLayout::FragmentForwardIterator::operator==): Deleted.
2140         (WebCore::SimpleLineLayout::FragmentForwardIterator::operator*): Deleted.
2141         (WebCore::SimpleLineLayout::begin): Deleted.
2142         (WebCore::SimpleLineLayout::end): Deleted.
2143         * rendering/SimpleLineLayoutTextFragmentIterator.h:
2144         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::split):
2145         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::splitWithHyphen):
2146
2147 2017-04-21  Wenson Hsieh  <wenson_hsieh@apple.com>
2148
2149         Support writing link titles to the pasteboard when beginning data interaction on a link
2150         https://bugs.webkit.org/show_bug.cgi?id=171154
2151         <rdar://problem/31356937>
2152
2153         Reviewed by Andy Estes.
2154
2155         Currently, when writing NSURLs to the pasteboard, we only write a String to the pasteboard corresponding to
2156         kUTTypeURL. This means richer data associated with the link (in this case, the title) are not captured when
2157         writing to the pasteboard. To address this, we introduce a new codepath for writing links to the pasteboard that
2158         mirrors the way PasteboardImage and PasteboardWebContent are written to the pasteboard.
2159
2160         Test: Augmented DataInteractionTests.LinkToInput.
2161
2162         * platform/PasteboardStrategy.h:
2163         * platform/PlatformPasteboard.h:
2164
2165         Add plumbing support for writing PasteboardURLs.
2166
2167         * platform/ios/PasteboardIOS.mm:
2168         (WebCore::Pasteboard::write):
2169         * platform/ios/PlatformPasteboardIOS.mm:
2170         (WebCore::PlatformPasteboard::writeObjectRepresentations):
2171
2172         Teach PlatformPasteboard to also set the _title attribute of the NSURL when creating an NSURL representation
2173         for registering with the shared WebItemProviderPasteboard.
2174
2175         (WebCore::PlatformPasteboard::write):
2176         * platform/ios/WebItemProviderPasteboard.mm:
2177
2178         Remove deprecation guards and replace deprecated method calls with the latest undeprecated versions.
2179
2180         (-[WebItemProviderPasteboard setItemsFromObjectRepresentations:]):
2181
2182 2017-04-21  Michael Catanzaro  <mcatanzaro@igalia.com>
2183
2184         Unreviewed, rolling out r215608.
2185
2186         Hundreds of test failures on GTK bot
2187
2188         Reverted changeset:
2189
2190         "Reduce copies and allocations in SharedBuffer::append"
2191         https://bugs.webkit.org/show_bug.cgi?id=170956
2192         http://trac.webkit.org/changeset/215608
2193
2194 2017-04-21  Zalan Bujtas  <zalan@apple.com>
2195
2196         REGRESSION(r205374): <li> content inside <ul> should mid-word wrap when word-break: break-word is present.
2197         https://bugs.webkit.org/show_bug.cgi?id=171108
2198         <rdar://problem/30271747>
2199
2200         Reviewed by Dan Bernstein.
2201
2202         This patch ensures that we search for mid-word breaks when a zero sized element has been committed on the line
2203         unless it's an image or some other replaced element with special properties (e.g. list-style: inside).  
2204
2205         Tests: fast/replaced/ul-li-word-break-break-word.html
2206                fast/replaced/zero-width-image-force-linebreak.html
2207
2208         * rendering/line/BreakingContext.h:
2209         (WebCore::BreakingContext::handleReplaced):
2210         (WebCore::BreakingContext::handleText): This matches pre-r205374 behaviour, but it's explicit about whether a 
2211         replaced width has already been committed on the current line.
2212         * rendering/line/LineWidth.cpp:
2213         (WebCore::LineWidth::commit):
2214         * rendering/line/LineWidth.h:
2215         (WebCore::LineWidth::hasCommittedReplaced):
2216         (WebCore::LineWidth::addUncommittedReplacedWidth): These 2 last functions were removed with r205374 (and now I am adding them back). 
2217
2218 2017-04-21  Jer Noble  <jer.noble@apple.com>
2219
2220         [MediaCapture] Improvements to CoreAudioCaptureSource
2221         https://bugs.webkit.org/show_bug.cgi?id=171146
2222
2223         Reviewed by Eric Carlson.
2224
2225         Various interlocking improvements to CoreAudioCaptureSource:
2226
2227         - Allow the volume, sampleRate, and echoCancellation settings to be applied to the source.
2228         - Update the values returned via settings() when these values change.
2229         - Obey the sampleRate and echoCancellation settings when creating the VPIO unit.
2230         - Because AudioUnitRender() mutates the passed in AudioBufferList, reset it immediately before calling.
2231
2232         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
2233         (WebCore::CoreAudioCaptureSource::create):
2234         (WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource):
2235         (WebCore::CoreAudioCaptureSource::preferredSampleRate):
2236         (WebCore::CoreAudioCaptureSource::preferredIOBufferSize):
2237         (WebCore::CoreAudioCaptureSource::configureMicrophoneProc):
2238         (WebCore::CoreAudioCaptureSource::configureSpeakerProc):
2239         (WebCore::CoreAudioCaptureSource::processMicrophoneSamples):
2240         (WebCore::CoreAudioCaptureSource::setupAudioUnits):
2241         (WebCore::CoreAudioCaptureSource::stopProducingData):
2242         (WebCore::CoreAudioCaptureSource::settings):
2243         (WebCore::CoreAudioCaptureSource::settingsDidChange):
2244         (WebCore::CoreAudioCaptureSource::preferredIOBufferDuration): Deleted.
2245         * platform/mediastream/mac/CoreAudioCaptureSource.h:
2246
2247 2017-04-21  Youenn Fablet  <youenn@apple.com>
2248
2249         com.apple.WebCore: non-virtual thunk to WebCore::LibWebRTCDataChannelHandler::OnBufferedAmountChange + 39
2250         https://bugs.webkit.org/show_bug.cgi?id=171087
2251         <rdar://problem/31739051>
2252
2253         Reviewed by Eric Carlson.
2254
2255         Covered by existing tests.
2256         No test added as this behavior is really libwebrtc specific and cannot be triggered easily.
2257
2258         * Modules/mediastream/RTCDataChannel.cpp:
2259         (WebCore::RTCDataChannel::close): Stopping observing libwebrtc data channel before closing it.
2260         This ensures we will stop getting notified as soon as there is no more interest.
2261         * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.cpp:
2262         (WebCore::LibWebRTCDataChannelHandler::OnStateChange): libwebrtc can still notify us even though we said we were
2263         not interested. Ensuring we do not call the client if we are no longer interested.
2264         (WebCore::LibWebRTCDataChannelHandler::OnMessage): Ditto.
2265         (WebCore::LibWebRTCDataChannelHandler::OnBufferedAmountChange): Ditto.
2266
2267 2017-04-21  Andy Estes  <aestes@apple.com>
2268
2269         [macOS] Enable media selection button on AVTouchBarScrubber
2270         https://bugs.webkit.org/show_bug.cgi?id=171149
2271         <rdar://problem/29875010>
2272
2273         Reviewed by Beth Dakin.
2274
2275         * platform/spi/cocoa/AVKitSPI.h:
2276
2277 2017-04-21  Andy Estes  <aestes@apple.com>
2278
2279         [macOS] Name WebPlaybackControlsManager delegate methods correctly depending on OS version
2280         https://bugs.webkit.org/show_bug.cgi?id=171147
2281         <rdar://problem/29875010>
2282
2283         Reviewed by Beth Dakin.
2284
2285         On macOS 10.12, WebPlaybackControlsManager conforms to
2286         AVFunctionBarPlaybackControlsControlling, but on 10.13 it conforms to
2287         AVTouchBarPlaybackControlsControlling. These protocols are near-identical, except for
2288         instances of "FunctionBar" in method names are renamed to "TouchBar". This patch updates to
2289         the new method names, and generally renames things with "FunctionBar" to "TouchBar".
2290
2291         * platform/mac/WebPlaybackControlsManager.h:
2292         * platform/mac/WebPlaybackControlsManager.mm:
2293         (-[WebPlaybackControlsManager generateTouchBarThumbnailsForTimes:tolerance:size:thumbnailHandler:]):
2294         (-[WebPlaybackControlsManager generateTouchBarAudioAmplitudeSamples:completionHandler:]):
2295         (-[WebPlaybackControlsManager canBeginTouchBarScrubbing]):
2296         (-[WebPlaybackControlsManager beginTouchBarScrubbing]):
2297         (-[WebPlaybackControlsManager endTouchBarScrubbing]):
2298         (-[WebPlaybackControlsManager generateFunctionBarThumbnailsForTimes:size:completionHandler:]):
2299         (-[WebPlaybackControlsManager generateFunctionBarAudioAmplitudeSamples:completionHandler:]):
2300         (-[WebPlaybackControlsManager canBeginFunctionBarScrubbing]):
2301         (-[WebPlaybackControlsManager beginFunctionBarScrubbing]):
2302         (-[WebPlaybackControlsManager endFunctionBarScrubbing]):
2303         (-[WebPlaybackControlsManager audioTouchBarMediaSelectionOptions]):
2304         (-[WebPlaybackControlsManager setAudioTouchBarMediaSelectionOptions:]):
2305         (-[WebPlaybackControlsManager currentAudioTouchBarMediaSelectionOption]):
2306         (-[WebPlaybackControlsManager setCurrentAudioTouchBarMediaSelectionOption:]):
2307         (-[WebPlaybackControlsManager legibleTouchBarMediaSelectionOptions]):
2308         (-[WebPlaybackControlsManager setLegibleTouchBarMediaSelectionOptions:]):
2309         (-[WebPlaybackControlsManager currentLegibleTouchBarMediaSelectionOption]):
2310         (-[WebPlaybackControlsManager setCurrentLegibleTouchBarMediaSelectionOption:]):
2311         (-[WebPlaybackControlsManager setAudioMediaSelectionOptions:withSelectedIndex:]):
2312         (-[WebPlaybackControlsManager setLegibleMediaSelectionOptions:withSelectedIndex:]):
2313         (-[WebPlaybackControlsManager audioFunctionBarMediaSelectionOptions]): Deleted.
2314         (-[WebPlaybackControlsManager setAudioFunctionBarMediaSelectionOptions:]): Deleted.
2315         (-[WebPlaybackControlsManager currentAudioFunctionBarMediaSelectionOption]): Deleted.
2316         (-[WebPlaybackControlsManager setCurrentAudioFunctionBarMediaSelectionOption:]): Deleted.
2317         (-[WebPlaybackControlsManager legibleFunctionBarMediaSelectionOptions]): Deleted.
2318         (-[WebPlaybackControlsManager setLegibleFunctionBarMediaSelectionOptions:]): Deleted.
2319         (-[WebPlaybackControlsManager currentLegibleFunctionBarMediaSelectionOption]): Deleted.
2320         (-[WebPlaybackControlsManager setCurrentLegibleFunctionBarMediaSelectionOption:]): Deleted.
2321
2322 2017-04-21  Jer Noble  <jer.noble@apple.com>
2323
2324         Make CoreAudioCaptureDevice stackable.
2325         https://bugs.webkit.org/show_bug.cgi?id=171097
2326
2327         Reviewed by Eric Carlson.
2328
2329         There's no real reason to keep CoreAudioCaptureDevice from being created on the stack. 
2330         Make it un-RefCounted, and have it's static factory method return an std::optional rather
2331         than a RefPtr.
2332
2333         Drive-by fix: clean up the factory method of CoreAudioCaptureSource a bit.
2334
2335         * platform/mediastream/mac/CoreAudioCaptureDevice.cpp:
2336         (WebCore::CoreAudioCaptureDevice::create):
2337         (WebCore::CoreAudioCaptureDevice::deviceID): Deleted.
2338         * platform/mediastream/mac/CoreAudioCaptureDevice.h:
2339         (WebCore::CoreAudioCaptureDevice::deviceID):
2340         * platform/mediastream/mac/CoreAudioCaptureDeviceManager.cpp:
2341         (WebCore::CoreAudioCaptureDeviceManager::coreAudioCaptureDevices):
2342         (WebCore::CoreAudioCaptureDeviceManager::coreAudioDeviceWithUID):
2343         (WebCore::CoreAudioCaptureDeviceManager::refreshAudioCaptureDevices):
2344         * platform/mediastream/mac/CoreAudioCaptureDeviceManager.h:
2345         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
2346         (WebCore::CoreAudioCaptureSource::create):
2347         (WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource):
2348         * platform/mediastream/mac/CoreAudioCaptureSource.h:
2349
2350 2017-04-21  Eric Carlson  <eric.carlson@apple.com>
2351
2352         [MediaStream iOS] Release capture session when not producing data
2353         https://bugs.webkit.org/show_bug.cgi?id=171148
2354         <rdar://problem/29265868>
2355
2356         Reviewed by Jer Noble.
2357
2358         On iOS, only one AVCaptureSession can be active at a time, so release a session whenever
2359         it is told to stop producing data. The session will recreated if the capture source if/when
2360         told to produce data again.
2361
2362         * platform/mediastream/mac/AVMediaCaptureSource.mm:
2363         (WebCore::AVMediaCaptureSource::stopProducingData): Clear m_session to release the session.
2364         It will be re-allocated if startProducingData is called later.
2365
2366 2017-04-21  Aaron Chu  <aaron_chu@apple.com>
2367
2368         AX: FKA: Buttons need a visible focus indicator
2369         https://bugs.webkit.org/show_bug.cgi?id=171040
2370         <rdar://problem/30922548>
2371
2372         Reviewed by Antoine Quint.
2373
2374         Added a background color for the focus state of the icon buttons in modern media controls.
2375
2376         Test: media/modern-media-controls/icon-button/icon-button-focus-state.html
2377
2378         * Modules/modern-media-controls/controls/icon-button.css:
2379         (button.icon:focus):
2380
2381 2017-03-22  Matt Rajca  <mrajca@apple.com>
2382
2383         Consider muting audio hardware a form of autoplay interference.
2384         https://bugs.webkit.org/show_bug.cgi?id=169971
2385
2386         Reviewed by Eric Carlson.
2387
2388         If the user mutes audio hardware and a media element is auto-playing, consider that
2389         as a form of auto-play interference that we tell clients about.
2390
2391         * html/HTMLMediaElement.cpp:
2392         (WebCore::HTMLMediaElement::HTMLMediaElement):
2393         (WebCore::HTMLMediaElement::~HTMLMediaElement):
2394         (WebCore::HTMLMediaElement::hardwareMutedStateDidChange):
2395         * html/HTMLMediaElement.h:
2396         * platform/audio/AudioSession.h:
2397         (WebCore::AudioSession::MutedStateObserver::~MutedStateObserver):
2398         * platform/audio/mac/AudioSessionMac.cpp:
2399         (WebCore::AudioSession::isMuted):
2400         (WebCore::muteProcess):
2401         (WebCore::AudioSession::handleMutedStateChange):
2402         (WebCore::AudioSession::addMutedStateObserver):
2403         (WebCore::AudioSession::removeMutedStateObserver):
2404
2405 2017-04-21  Chris Dumez  <cdumez@apple.com>
2406
2407         Regression(r206240): XMLSerializer.serializeToString() does not properly escape '<' / '>' in attribute values
2408         https://bugs.webkit.org/show_bug.cgi?id=171132
2409         <rdar://problem/31426752>
2410
2411         Reviewed by Ryosuke Niwa.
2412
2413         Use XMLSerialization [1] in MarkupAccumulator::appendAttribute() when inXMLFragmentSerialization()
2414         returns true, even if the node's associated document is an HTML document. When XMLSerializer.serializeToString()
2415         is called on a Node, we want XML serialization, even if the node comes from an HTML document.
2416
2417         [1] https://w3c.github.io/DOM-Parsing/#dfn-xml-serialization
2418
2419         Test: fast/dom/XMLSerializer-serializeToString-entities.html
2420
2421         * editing/MarkupAccumulator.cpp:
2422         (WebCore::MarkupAccumulator::appendAttributeValue):
2423         (WebCore::MarkupAccumulator::appendAttribute):
2424         * editing/MarkupAccumulator.h:
2425
2426 2017-04-20  Sam Weinig  <sam@webkit.org>
2427
2428         Split cryptographic digest computation and parsing out of CSP code so it can be reused
2429         https://bugs.webkit.org/show_bug.cgi?id=171076
2430
2431         Reviewed by Chris Dumez.
2432
2433         Factor out cryptographic digest parsing from Content Security Policy code
2434         so that it can be reused for the Subresource Integrity implementation.
2435
2436         * CMakeLists.txt:
2437         * WebCore.xcodeproj/project.pbxproj:
2438         Add new files.
2439
2440         * html/parser/ParsingUtilities.h:
2441         (WebCore::skipExactlyIgnoringASCIICase):
2442         Add parsing helper to match / skip over a constant string, using IgnoringASCIICase semantics.
2443
2444         * loader/ResourceCryptographicDigest.cpp: Added.
2445         (WebCore::parseHashAlgorithmAdvancingPosition):
2446         (WebCore::parseCryptographicDigestImpl):
2447         (WebCore::parseCryptographicDigest):
2448         Move parsing of cryptographic-digest strings from ContentSecurityPolicySourceList.cpp
2449         and optimize it a little by avoiding String allocations and generalizing it so that it
2450         can parse either UChars or LChars.
2451
2452         * loader/ResourceCryptographicDigest.h: Added.
2453         (WebCore::ResourceCryptographicDigest::operator==):
2454         (WebCore::ResourceCryptographicDigest::operator!=):
2455         (WTF::DefaultHash<WebCore::ResourceCryptographicDigest>::Hash::hash):
2456         (WTF::DefaultHash<WebCore::ResourceCryptographicDigest>::Hash::equal):
2457         (WTF::HashTraits<WebCore::ResourceCryptographicDigest>::emptyValue):
2458         (WTF::HashTraits<WebCore::ResourceCryptographicDigest>::constructDeletedValue):
2459         (WTF::HashTraits<WebCore::ResourceCryptographicDigest>::isDeletedValue):
2460         Add a struct (rather than using a std::pair) to represent the digest + algorithm. And add
2461         HashTraits so it can be used as HashMap.
2462         
2463         * page/csp/ContentSecurityPolicy.cpp:
2464         (WebCore::ContentSecurityPolicy::findHashOfContentInPolicies):
2465         (WebCore::toCryptoDigestAlgorithm): Deleted.
2466         Move algorithm conversion to ResourceCryptographicDigest.cpp. Make use of new 
2467         cryptographicDigestForBytes function to do hashing.
2468
2469         * page/csp/ContentSecurityPolicy.h:
2470         * page/csp/ContentSecurityPolicyHash.h:
2471         (WTF::DefaultHash<WebCore::ContentSecurityPolicyDigest>::Hash::hash): Deleted.
2472         (WTF::DefaultHash<WebCore::ContentSecurityPolicyDigest>::Hash::equal): Deleted.
2473         Remove HashTraits for the digest, this is now handled by ResourceCryptographicDigest. 
2474         To keep things relatively straight-forward, redefine ContentSecurityPolicyHashAlgorithm
2475         and ContentSecurityPolicyHash in terms of ResourceCryptographicDigest, so that less code
2476         has to be changed all at once. In a later pass, if wanted, we can remove these using 
2477         declarations.
2478
2479         * page/csp/ContentSecurityPolicySourceList.cpp:
2480         (WebCore::isNonceCharacter):
2481         Use renamed isBase64OrBase64URLCharacter predicate.
2482
2483         (WebCore::ContentSecurityPolicySourceList::parseHashSource):
2484         Rework using ResourceCryptographicDigest parsing. Quotation and maximum digest
2485         length have been kept here, as they are not applicable to other uses of 
2486         the digest, specifically Subresource Integrity.
2487
2488 2017-04-21  Jer Noble  <jer.noble@apple.com>
2489
2490         Unreviewed fix after r215624; null-deref crash.
2491
2492         Make sure to call reset() inside each constructor.
2493
2494         * platform/audio/WebAudioBufferList.cpp:
2495         (WebCore::WebAudioBufferList::WebAudioBufferList):
2496
2497 2017-04-21  Anders Carlsson  <andersca@apple.com>
2498
2499         Stop using deprecated APIs, part 5
2500         https://bugs.webkit.org/show_bug.cgi?id=171134
2501         rdar://problem/31589635
2502
2503         Reviewed by Tim Horton.
2504
2505         * Modules/applepay/ApplePaySession.cpp:
2506         (WebCore::convertAndValidate):
2507         Stop using the toPaymentAuthorizationStatus. Convert the passed in status results to the remaining
2508         PaymentAuthorizationStatus values, and add errors if needed.
2509
2510         (WebCore::toPaymentAuthorizationStatus):
2511         This function is no longer used.
2512
2513         * Modules/applepay/PaymentAuthorizationStatus.h:
2514         Remove deprecated status values. We can achieve the same results with errors now.
2515
2516         * Modules/applepay/PaymentRequest.cpp:
2517         (WebCore::isFinalStateResult):
2518         Remove deprecated status values.
2519
2520         * Modules/applepay/PaymentRequest.h:
2521         Remove deprecated status values.
2522
2523 2017-04-21  Per Arne Vollan  <pvollan@apple.com>
2524
2525         Validate vImage arguments
2526         https://bugs.webkit.org/show_bug.cgi?id=171109
2527         rdar://problem/30236606
2528
2529         Reviewed by Brent Fulgham.
2530
2531         When writing data to a canvas context, clip the source rectangle to the data rectangle
2532         to make sure we will not attempt to read data outside of the buffer.
2533
2534         Test: fast/canvas/canvas-crash.html
2535
2536         * html/canvas/CanvasRenderingContext2D.cpp:
2537         (WebCore::CanvasRenderingContext2D::putImageData):
2538
2539 2017-04-21  David Kilzer  <ddkilzer@apple.com>
2540
2541         Switch from -std=gnu++11 to -std=gnu++14 for consistency in DerivedSources.make
2542         <https://webkit.org/b/171122>
2543
2544         Reviewed by Brent Fulgham.
2545
2546         * DerivedSources.make: Switch to -std=gnu++14 for preprocessing
2547         headers to check for build settings.
2548
2549 2017-04-21  Jer Noble  <jer.noble@apple.com>
2550
2551         [MediaCapture][iOS] AVAudioSession must be active and the correct category before IO AudioUnits start producing data.
2552         https://bugs.webkit.org/show_bug.cgi?id=171095
2553
2554         Reviewed by Youenn Fablet.
2555
2556         If an input audio unit is asked to start before the AVAudioSession is in a recording category and active,
2557         CoreAudio will return an error stating that no input device is available.
2558
2559         The PlatformMediaSessionManager will automatically set the category of and activate the AVAudioSession when one
2560         of its associated MediaStreams has a capturing RealtimeMediaSource and is currently producing data.  To solve
2561         the chicken-or-egg problem of activating the AVAudioSession before the source produces data, move the state bit
2562         of "producing data" directly into MediaStreams, and notify the PlatformMediaSessionManager that capturing is
2563         occurring after flipping that bit, but before asking the constituent tracks to begin producing data.
2564
2565         In places (i.e. UserMediaRequest) where we previously told a stream's tracks to begin producing data, instead
2566         allow the stream to handle that by telling it to produce data directly.
2567
2568         * Modules/mediastream/MediaStream.cpp:
2569         (WebCore::MediaStream::startProducingData):
2570         (WebCore::MediaStream::stopProducingData):
2571         (WebCore::MediaStream::mediaState):
2572         (WebCore::MediaStream::mediaType):
2573         (WebCore::MediaStream::characteristics):
2574         (WebCore::MediaStream::canProduceAudio):
2575         * Modules/mediastream/MediaStream.h:
2576         * Modules/mediastream/UserMediaRequest.cpp:
2577         (WebCore::UserMediaRequest::allow):
2578         * platform/mediastream/mac/CoreAudioCaptureSource.h:
2579
2580 2017-04-21  Jer Noble  <jer.noble@apple.com>
2581
2582         Add a method to retrieve the current I/O buffer size from AudioSession
2583         https://bugs.webkit.org/show_bug.cgi?id=171126
2584
2585         Reviewed by Eric Carlson.
2586
2587         There is an existing method to get and set the preferred I/O buffer size; add a matching method to return
2588         the acutal I/O buffer size.
2589
2590         * platform/audio/AudioSession.cpp:
2591         (WebCore::AudioSession::bufferSize):
2592         * platform/audio/AudioSession.h:
2593         * platform/audio/ios/AudioSessionIOS.mm:
2594         (WebCore::AudioSession::bufferSize):
2595         * platform/audio/mac/AudioSessionMac.cpp:
2596         (WebCore::AudioSession::bufferSize):
2597
2598 2017-04-21  Jer Noble  <jer.noble@apple.com>
2599
2600         Make AudioSampleBufferList::reset() less expensive.
2601         https://bugs.webkit.org/show_bug.cgi?id=171124
2602
2603         Reviewed by Eric Carlson.
2604
2605         Previously, AudioSampleBufferList would reallocate its constituent WebAudioBufferList every time reset() was
2606         called. Instead, add a reset() method to WebAudioBufferList which re-initializes its AudioBufferList (which is a
2607         simple memcpy of a 24-byte struct), reusing the existing memory buffers.
2608
2609         While making these changes, we'll also take the opportunity to clean up the AudioSampleBufferList class by
2610         making some of its members into UniqueRefs instead of unique_ptrs, thus removing the possibility of null-
2611         dereferences.
2612
2613         * platform/audio/WebAudioBufferList.cpp:
2614         (WebCore::WebAudioBufferList::WebAudioBufferList):
2615         (WebCore::WebAudioBufferList::reset):
2616         * platform/audio/WebAudioBufferList.h:
2617         * platform/audio/mac/AudioSampleBufferList.cpp:
2618         (WebCore::AudioSampleBufferList::AudioSampleBufferList):
2619         (WebCore::AudioSampleBufferList::applyGain):
2620         (WebCore::AudioSampleBufferList::mixFrom):
2621         (WebCore::AudioSampleBufferList::reset):
2622         (WebCore::AudioSampleBufferList::zero):
2623         (WebCore::AudioSampleBufferList::~AudioSampleBufferList): Deleted.
2624         * platform/audio/mac/AudioSampleBufferList.h:
2625         (WebCore::AudioSampleBufferList::bufferList):
2626
2627 2017-04-21  Jer Noble  <jer.noble@apple.com>
2628
2629         Fix some spurious ASSERTs when working with capturing media elements
2630         https://bugs.webkit.org/show_bug.cgi?id=171096
2631
2632         Reviewed by Youenn Fablet.
2633
2634         Two related ASSERTS:
2635
2636         1) When we added a new PlatformMediaSession MediaType (MediaStreamCapturingAudio), we did not update all the
2637         places that validated the enum. This would lead to spurious ASSERTs when an element capturing audio would
2638         fail various checks to enusre it's type's validity.
2639
2640         2) Audio elements will ASSERT when they change page visibility, as they do not have a renderer which implements
2641         visibleInViewportStateChanged(). So opt out of visibility-state checking for non-video media elements.
2642
2643         * html/MediaElementSession.cpp:
2644         (WebCore::MediaElementSession::wantsToObserveViewportVisibilityForAutoplay):
2645         * platform/audio/PlatformMediaSessionManager.cpp:
2646         (WebCore::PlatformMediaSessionManager::resetRestrictions):
2647         (WebCore::PlatformMediaSessionManager::addRestriction):
2648         (WebCore::PlatformMediaSessionManager::removeRestriction):
2649         (WebCore::PlatformMediaSessionManager::restrictions):
2650         * platform/audio/PlatformMediaSessionManager.h:
2651
2652 2017-04-21  Konstantin Tokarev  <annulen@yandex.ru>
2653
2654         [cmake] WTF target should not have wtf and subdirectries in public interface
2655         https://bugs.webkit.org/show_bug.cgi?id=171115
2656
2657         Reviewed by Michael Catanzaro.
2658
2659         In r209665 WEBCORE_FRAMEWORK macro started to export INCLUDE_DIRECTORIES of
2660         targets as their public interface, so that linked targets can use them
2661         implicitly without copying directory lists around. This matches existing
2662         practice for all targets except WTF, headers from which are always included
2663         with full path starting from "<wtf/...".
2664
2665         Since r209665 it became possible to include headers from wtf or its
2666         subdirectories in CMake builds without using "<wtf/..." path. It should
2667         not be allowed.
2668
2669         * platform/graphics/texmap/coordinated/TiledBackingStore.cpp: Fix
2670         incorrect include of WTF header.
2671
2672 2017-04-21  Gwang Yoon Hwang  <yoon@igalia.com>
2673
2674         Do not paint the border of the box if the dirty region does not intersect with border area
2675         https://bugs.webkit.org/show_bug.cgi?id=170988
2676
2677         Reviewed by Simon Fraser.
2678
2679         No new tests, since there is no change in behavior.
2680
2681         * platform/graphics/GeometryUtilities.cpp:
2682         (WebCore::ellipseContainsPoint):
2683         Checks if a point is within an ellipse.
2684
2685         * platform/graphics/GeometryUtilities.h:
2686         Replace header-guards with #pragma once.
2687
2688         * platform/graphics/RoundedRect.cpp:
2689         (WebCore::RoundedRect::contains):
2690         Implemented to know the dirty rectangle intersects with rounded rectangle or not.
2691         * platform/graphics/RoundedRect.h:
2692         * rendering/RenderBoxModelObject.cpp:
2693         (WebCore::RenderBoxModelObject::paintBorder):
2694         When typing in decorated text box, the dirty rect generated only for the
2695         inside of the text box, not for the decorations.  So we can avoid the
2696         calculations to draw borders if the inner border totally covers the
2697         target surface. It will optimize the rendering process since we don't
2698         have to render border decorations whenever we type somethings in side of
2699         the text input element.
2700
2701 2017-04-21  Anders Carlsson  <andersca@apple.com>
2702
2703         Remove another use of toPaymentAuthorizationStatus
2704         https://bugs.webkit.org/show_bug.cgi?id=171114
2705
2706         Reviewed by Dan Bernstein.
2707
2708         * Modules/applepay/ApplePaySession.cpp:
2709         (WebCore::ApplePaySession::completeShippingContactSelection):
2710
2711 2017-04-21  Alex Christensen  <achristensen@webkit.org>
2712
2713         Reduce copies and allocations in SharedBuffer::append
2714         https://bugs.webkit.org/show_bug.cgi?id=170956
2715
2716         Reviewed by Andreas Kling.
2717
2718         SharedBuffer was a mess of different data structures added over the years.
2719         SharedBuffer::append would allocate large Vector<char>s and call memcpy, and that
2720         is inefficient and causes crashes when large allocations fail, and the allocations
2721         and copies aren't even necessary.  There were also const correctness problems in
2722         ResourceLoader::addDataOrBuffer, and iterating a SharedBuffer was strange because
2723         sometimes we don't want to add unnecessary copies.
2724
2725         These problems are solved by making SharedBuffer a Vector of read-only data segments,
2726         which can be contained in various ways but we don't care because all we want to do is
2727         read them.  Appending SharedBuffers is now const correct because we just add to a
2728         Vector<Ref<DataSegment>> and neither SharedBuffer can write to the data.  Sometimes,
2729         though, we want all the data to be in continuous memory, and if there are multiple
2730         segments then the data needs to be copied once to a new segment.  We should audit the
2731         call sites of SharedBuffer::data and see if this is really necessary.
2732
2733         No change in functional behavior.  Fewer copies of the data are made when buffering
2734         data in the NetworkProcess.  No extra memory is allocated for bytes we think we might
2735         need to append in the future.  Data is now only copied into one buffer lazily as needed,
2736         which could slightly change when small delays from memcpy happen, but it's an overall
2737         improvement.  We could have a performance hit if we were to call append() then data()
2738         then append() then data() etc. but that doesn't happen in WebKit because we call append
2739         repeatedly when buffering the data then call data() once when reading the data.
2740
2741         * editing/cocoa/EditorCocoa.mm:
2742         (WebCore::archivedDataForAttributedString):
2743         (WebCore::Editor::selectionInWebArchiveFormat):
2744         (WebCore::Editor::dataInRTFDFormat):
2745         (WebCore::Editor::dataInRTFFormat):
2746         * editing/ios/EditorIOS.mm:
2747         (WebCore::Editor::WebContentReader::readURL):
2748         * editing/mac/EditorMac.mm:
2749         (WebCore::Editor::imageInWebArchiveFormat):
2750         * loader/TextTrackLoader.cpp:
2751         (WebCore::TextTrackLoader::processNewCueData):
2752         * loader/archive/cf/LegacyWebArchive.cpp:
2753         (WebCore::LegacyWebArchive::createResource):
2754         * loader/cache/CachedResource.cpp:
2755         (WebCore::CachedResource::tryReplaceEncodedData):
2756         * loader/cocoa/DiskCacheMonitorCocoa.mm:
2757         (WebCore::DiskCacheMonitor::tryGetFileBackedSharedBufferFromCFURLCachedResponse):
2758         * platform/SharedBuffer.cpp:
2759         (WebCore::SharedBuffer::SharedBuffer):
2760         (WebCore::SharedBuffer::create):
2761         (WebCore::SharedBuffer::combineToOneSegment):
2762         (WebCore::SharedBuffer::data):
2763         (WebCore::SharedBuffer::createArrayBuffer):
2764         (WebCore::SharedBuffer::append):
2765         (WebCore::SharedBuffer::clear):
2766         (WebCore::SharedBuffer::copy):
2767         (WebCore::SharedBuffer::DataSegment::data):
2768         (WebCore::SharedBuffer::DataSegment::size):
2769         (WebCore::segmentIndex): Deleted.
2770         (WebCore::offsetInSegment): Deleted.
2771         (WebCore::allocateSegment): Deleted.
2772         (WebCore::freeSegment): Deleted.
2773         (WebCore::SharedBuffer::~SharedBuffer): Deleted.
2774         (WebCore::SharedBuffer::size): Deleted.
2775         (WebCore::SharedBuffer::duplicateDataBufferIfNecessary): Deleted.
2776         (WebCore::SharedBuffer::appendToDataBuffer): Deleted.
2777         (WebCore::SharedBuffer::clearDataBuffer): Deleted.
2778         (WebCore::SharedBuffer::copyBufferAndClear): Deleted.
2779         (WebCore::SharedBuffer::buffer): Deleted.
2780         (WebCore::SharedBuffer::getSomeData): Deleted.
2781         (WebCore::SharedBuffer::maybeTransferMappedFileData): Deleted.
2782         (WebCore::SharedBuffer::clearPlatformData): Deleted.
2783         (WebCore::SharedBuffer::maybeTransferPlatformData): Deleted.
2784         (WebCore::SharedBuffer::hasPlatformData): Deleted.
2785         (WebCore::SharedBuffer::platformData): Deleted.
2786         (WebCore::SharedBuffer::maybeAppendPlatformData): Deleted.
2787         * platform/SharedBuffer.h:
2788         (WebCore::SharedBuffer::create): Deleted.
2789         (WebCore::SharedBuffer::isEmpty): Deleted.
2790         * platform/SharedBufferChunkReader.cpp:
2791         (WebCore::SharedBufferChunkReader::nextChunk):
2792         (WebCore::SharedBufferChunkReader::peek):
2793         * platform/SharedBufferChunkReader.h:
2794         * platform/URLParser.cpp:
2795         (WebCore::URLParser::URLParser):
2796         * platform/cf/KeyedEncoderCF.cpp:
2797         (WebCore::KeyedEncoderCF::finishEncoding):
2798         * platform/cf/SharedBufferCF.cpp:
2799         (WebCore::SharedBuffer::SharedBuffer):
2800         (WebCore::SharedBuffer::createCFData):
2801         (WebCore::SharedBuffer::create):
2802         (WebCore::SharedBuffer::hintMemoryNotNeededSoon):
2803         (WebCore::SharedBuffer::append):
2804         (WebCore::SharedBuffer::wrapCFData): Deleted.
2805         (WebCore::SharedBuffer::hasPlatformData): Deleted.
2806         (WebCore::SharedBuffer::platformData): Deleted.
2807         (WebCore::SharedBuffer::platformDataSize): Deleted.
2808         (WebCore::SharedBuffer::maybeTransferPlatformData): Deleted.
2809         (WebCore::SharedBuffer::clearPlatformData): Deleted.
2810         (WebCore::SharedBuffer::tryReplaceContentsWithPlatformBuffer): Deleted.
2811         (WebCore::SharedBuffer::maybeAppendPlatformData): Deleted.
2812         (WebCore::SharedBuffer::copyBufferAndClear): Deleted.
2813         (WebCore::SharedBuffer::copySomeDataFromDataArray): Deleted.
2814         (WebCore::SharedBuffer::singleDataArrayBuffer): Deleted.
2815         (WebCore::SharedBuffer::maybeAppendDataArray): Deleted.
2816         * platform/cocoa/NetworkExtensionContentFilter.mm:
2817         (WebCore::NetworkExtensionContentFilter::replacementData):
2818         * platform/cocoa/ParentalControlsContentFilter.mm:
2819         (WebCore::ParentalControlsContentFilter::replacementData):
2820         * platform/cocoa/SharedBufferCocoa.mm:
2821         (-[WebCoreSharedBufferData initWithSharedBufferDataSegment:]):
2822         (-[WebCoreSharedBufferData length]):
2823         (-[WebCoreSharedBufferData bytes]):
2824         (WebCore::SharedBuffer::create):
2825         (WebCore::SharedBuffer::createCFData):
2826         (WebCore::SharedBuffer::createFromReadingFile):
2827         (WebCore::SharedBuffer::createNSDataArray):
2828         (-[WebCoreSharedBufferData initWithSharedBufferDataBuffer:]): Deleted.
2829         (WebCore::SharedBuffer::wrapNSData): Deleted.
2830         (WebCore::SharedBuffer::existingCFData): Deleted.
2831         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
2832         (WebCore::WebCoreAVFResourceLoader::fulfillRequestWithResource):
2833         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
2834         (WebCore::FontPlatformData::openTypeTable):
2835         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
2836         (ResourceHandleStreamingClient::didReceiveBuffer):
2837         * platform/graphics/mac/ImageMac.mm:
2838         (WebCore::Image::loadPlatformResource):
2839         * platform/image-decoders/ImageDecoder.cpp:
2840         (WebCore::ImageDecoder::create):
2841         * platform/image-decoders/png/PNGImageDecoder.cpp:
2842         (WebCore::PNGImageReader::decode):
2843         * platform/ios/PlatformPasteboardIOS.mm:
2844         (WebCore::PlatformPasteboard::readBuffer):
2845         * platform/mac/PasteboardMac.mm:
2846         (WebCore::writeFileWrapperAsRTFDAttachment):
2847         (WebCore::Pasteboard::write):
2848         * platform/mac/PlatformPasteboardMac.mm:
2849         (WebCore::PlatformPasteboard::bufferForType):
2850         * platform/network/BlobResourceHandle.cpp:
2851         (WebCore::BlobResourceHandle::notifyReceiveData):
2852         * platform/network/MIMEHeader.cpp:
2853         * platform/network/MIMEHeader.h:
2854         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
2855         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveData):
2856         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
2857         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveData):
2858         * platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
2859         (-[WebCoreResourceHandleAsDelegate connection:didReceiveData:lengthReceived:]):
2860         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
2861         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveData:lengthReceived:]):
2862         * platform/soup/SharedBufferSoup.cpp:
2863         (WebCore::SharedBuffer::SharedBuffer):
2864         (WebCore::SharedBuffer::createSoupBuffer):
2865         (WebCore::SharedBuffer::clearPlatformData): Deleted.
2866         (WebCore::SharedBuffer::maybeTransferPlatformData): Deleted.
2867         (WebCore::SharedBuffer::hasPlatformData): Deleted.
2868         (WebCore::SharedBuffer::platformData): Deleted.
2869         (WebCore::SharedBuffer::platformDataSize): Deleted.
2870         (WebCore::SharedBuffer::maybeAppendPlatformData): Deleted.
2871         (WebCore::SharedBuffer::tryReplaceContentsWithPlatformBuffer): Deleted.
2872
2873 2017-04-21  Timothy Horton  <timothy_horton@apple.com>
2874
2875         Expose obscured insets to web content (as "safe area insets")
2876         https://bugs.webkit.org/show_bug.cgi?id=171013
2877         <rdar://problem/31564652>
2878
2879         Reviewed by Wenson Hsieh and Dave Hyatt.
2880
2881         Tests: fast/css/variables/constants/invalid-constant-name-fallback.html
2882                fast/css/variables/constants/ios/safe-area-inset-set.html
2883                fast/css/variables/constants/safe-area-inset-cannot-override.html
2884                fast/css/variables/constants/safe-area-inset-zero.html
2885
2886         * CMakeLists.txt:
2887         * WebCore.xcodeproj/project.pbxproj:
2888         * css/CSSValueKeywords.in:
2889         * css/CSSVariableData.cpp:
2890         (WebCore::CSSVariableData::checkVariablesForCyclesWithRange):
2891         (WebCore::CSSVariableData::resolveTokenRange):
2892         * css/parser/CSSVariableParser.cpp:
2893         (WebCore::isValidConstantName):
2894         (WebCore::classifyBlock):
2895         (WebCore::isValidConstantReference):
2896         Add a constant() function, which takes both custom properties and
2897         arbitrary idents which are looked up in ConstantPropertyMap, allowing
2898         fallback from the arbitrary, UA-defined idents to custom properties.
2899
2900         * dom/ConstantPropertyMap.cpp: Added.
2901         (WebCore::ConstantPropertyMap::ConstantPropertyMap):
2902         (WebCore::ConstantPropertyMap::values):
2903         (WebCore::ConstantPropertyMap::nameForProperty):
2904         (WebCore::ConstantPropertyMap::setValueForProperty):
2905         (WebCore::ConstantPropertyMap::buildValues):
2906         (WebCore::variableDataForSafeAreaInset):
2907         (WebCore::ConstantPropertyMap::didChangeObscuredInsets):
2908         * dom/ConstantPropertyMap.h: Added.
2909         Keep a mapping of UA-defined "constants", which can be looked up
2910         from CSS via the aforementioned function. For now, this mapping
2911         includes only safe-area-inset-{top, right, bottom, left}, which
2912         expose the obscured insets (now that they can be painted into via
2913         the viewport parameter clip-to-safe-area-inset=no).
2914
2915         * dom/Document.cpp:
2916         (WebCore::Document::Document):
2917         (WebCore::Document::didChangeObscuredInsets):
2918         * dom/Document.h:
2919         (WebCore::Document::constantProperties):
2920         * page/Page.cpp:
2921         (WebCore::Page::setObscuredInsets):
2922         * page/Page.h:
2923         (WebCore::Page::setObscuredInsets): Deleted.
2924         Make setObscuredInsets and related storage not iOS-specific, though
2925         nothing from the other platforms yet calls this code.
2926
2927         * style/StyleResolveForDocument.cpp:
2928         (WebCore::Style::resolveForDocument):
2929         Grab the constant properties from ConstantPropertyMap and plop them into
2930         the CustomPropertyValueMap. Constant properties aren't allowed to start
2931         with --, and variable properties must, so there is no opportunity here
2932         for exposing things to var() (or allowing custom properties to override
2933         UA-defined constant properties).
2934
2935 2017-04-20  Konstantin Tokarev  <annulen@yandex.ru>
2936
2937         [cmake] Define FORWARDING_HEADERS_DIR in WebKitFS and use it everywhere
2938         https://bugs.webkit.org/show_bug.cgi?id=171071
2939
2940         Reviewed by Michael Catanzaro.
2941
2942         "${DERIVED_SOURCES_DIR}/ForwardingHeaders" path occurs very often in the
2943         build system files. GTK-specifc FORWARDING_HEADERS_DIR variable should
2944         be available for all ports.
2945
2946         * CMakeLists.txt:
2947         * PlatformMac.cmake:
2948         * PlatformWin.cmake:
2949         * PlatformWinCairo.cmake:
2950
2951 2017-04-20  Commit Queue  <commit-queue@webkit.org>
2952
2953         Unreviewed, rolling out r215597.
2954         https://bugs.webkit.org/show_bug.cgi?id=171102
2955
2956         Made all tests crash under GuardMalloc (Requested by ap on
2957         #webkit).
2958
2959         Reverted changeset:
2960
2961         "Expose obscured insets to web content (as "safe area
2962         insets")"
2963         https://bugs.webkit.org/show_bug.cgi?id=171013
2964         http://trac.webkit.org/changeset/215597
2965
2966 2017-04-20  Dean Jackson  <dino@apple.com>
2967
2968         Add Web Sharing to the features under consideration.
2969
2970         * features.json:
2971
2972 2017-04-20  Dean Jackson  <dino@apple.com>
2973
2974         Add Scroll Anchoring to features under consideration.
2975
2976         * features.json:
2977
2978 2017-04-20  Konstantin Tokarev  <annulen@yandex.ru>
2979
2980         Remove unused lamda captures
2981         https://bugs.webkit.org/show_bug.cgi?id=171098
2982
2983         Reviewed by Yusuke Suzuki.
2984
2985         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
2986         (WebCore::IDBServer::SQLiteIDBBackingStore::getOrEstablishDatabaseInfo):
2987         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2988         (WebCore::IDBServer::UniqueIDBDatabase::activateTransactionInBackingStore):
2989         * loader/ResourceLoadStatisticsStore.cpp:
2990         (WebCore::ResourceLoadStatisticsStore::createEncoderFromData):
2991         (WebCore::ResourceLoadStatisticsStore::readDataFromDecoder):
2992
2993 2017-04-20  Timothy Horton  <timothy_horton@apple.com>
2994
2995         Expose obscured insets to web content (as "safe area insets")
2996         https://bugs.webkit.org/show_bug.cgi?id=171013
2997         <rdar://problem/31564652>
2998
2999         Reviewed by Wenson Hsieh and Dave Hyatt.
3000
3001         Tests: fast/css/variables/constants/invalid-constant-name-fallback.html
3002                fast/css/variables/constants/ios/safe-area-inset-set.html
3003                fast/css/variables/constants/safe-area-inset-cannot-override.html
3004                fast/css/variables/constants/safe-area-inset-zero.html
3005
3006         * CMakeLists.txt:
3007         * WebCore.xcodeproj/project.pbxproj:
3008         * css/CSSValueKeywords.in:
3009         * css/CSSVariableData.cpp:
3010         (WebCore::CSSVariableData::checkVariablesForCyclesWithRange):
3011         (WebCore::CSSVariableData::resolveTokenRange):
3012         * css/parser/CSSVariableParser.cpp:
3013         (WebCore::isValidConstantName):
3014         (WebCore::classifyBlock):
3015         (WebCore::isValidConstantReference):
3016         Add a constant() function, which takes both custom properties and
3017         arbitrary idents which are looked up in ConstantPropertyMap, allowing
3018         fallback from the arbitrary, UA-defined idents to custom properties.
3019
3020         * dom/ConstantPropertyMap.cpp: Added.
3021         (WebCore::ConstantPropertyMap::ConstantPropertyMap):
3022         (WebCore::ConstantPropertyMap::values):
3023         (WebCore::ConstantPropertyMap::nameForProperty):
3024         (WebCore::ConstantPropertyMap::setValueForProperty):
3025         (WebCore::ConstantPropertyMap::buildValues):
3026         (WebCore::variableDataForSafeAreaInset):
3027         (WebCore::ConstantPropertyMap::didChangeObscuredInsets):
3028         * dom/ConstantPropertyMap.h: Added.
3029         Keep a mapping of UA-defined "constants", which can be looked up
3030         from CSS via the aforementioned function. For now, this mapping
3031         includes only safe-area-inset-{top, right, bottom, left}, which
3032         expose the obscured insets (now that they can be painted into via
3033         the viewport parameter clip-to-safe-area-inset=no).
3034
3035         * dom/Document.cpp:
3036         (WebCore::Document::Document):
3037         (WebCore::Document::didChangeObscuredInsets):
3038         * dom/Document.h:
3039         (WebCore::Document::constantProperties):
3040         * page/Page.cpp:
3041         (WebCore::Page::setObscuredInsets):
3042         * page/Page.h:
3043         (WebCore::Page::setObscuredInsets): Deleted.
3044         Make setObscuredInsets and related storage not iOS-specific, though
3045         nothing from the other platforms yet calls this code.
3046
3047         * style/StyleResolveForDocument.cpp:
3048         (WebCore::Style::resolveForDocument):
3049         Grab the constant properties from ConstantPropertyMap and plop them into
3050         the CustomPropertyValueMap. Constant properties aren't allowed to start
3051         with --, and variable properties must, so there is no opportunity here
3052         for exposing things to var() (or allowing custom properties to override
3053         UA-defined constant properties).
3054
3055 2017-04-20  Anders Carlsson  <andersca@apple.com>
3056
3057         Remove one use of toPaymentAuthorizationStatus
3058         https://bugs.webkit.org/show_bug.cgi?id=171086
3059
3060         Reviewed by Tim Horton.
3061
3062         Just switch on the individual ApplePaySession::STATUS_ values.
3063
3064         * Modules/applepay/ApplePaySession.cpp:
3065         (WebCore::ApplePaySession::completeShippingMethodSelection):
3066
3067 2017-04-20  Fujii Hironori  <Hironori.Fujii@sony.com>
3068
3069         [WinCairo] Fix build break after updating ANGLE
3070         https://bugs.webkit.org/show_bug.cgi?id=170980
3071
3072         Reviewed by Brent Fulgham.
3073
3074         By stopping using SoftLinking for ANGLE, some changes are needed
3075         for WebCore and WebKit.
3076           - Define a macro 'GL_GLEXT_PROTOTYPES' before #include <GLES2/gl2.h> or <GLES2/gl2ext.h>.
3077           - Link libEGL import library explicitly.
3078
3079         * PlatformWin.cmake: Link libEGL to WebCore.
3080         * platform/graphics/PlatformDisplay.cpp:
3081         (WebCore::PlatformDisplay::initializeEGLDisplay): Removed the code for SoftLinking.
3082         * platform/graphics/GLContext.cpp: Define GL_GLEXT_PROTOTYPES.
3083         * platform/graphics/egl/GLContextEGL.cpp: Ditto.
3084         * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp: Ditto.
3085         * platform/graphics/opengl/Extensions3DOpenGLES.h: Ditto.
3086         * platform/graphics/opengl/TemporaryOpenGLSetting.cpp: Ditto.
3087         * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.cpp: Ditto.
3088
3089 2017-04-20  Matt Baker  <mattbaker@apple.com>
3090
3091         Web Inspector: Add regular expression support to XHR breakpoints
3092         https://bugs.webkit.org/show_bug.cgi?id=170099
3093         <rdar://problem/31558082>
3094
3095         Reviewed by Joseph Pecoraro.
3096
3097         * inspector/InspectorDOMDebuggerAgent.cpp:
3098         (WebCore::InspectorDOMDebuggerAgent::setXHRBreakpoint):
3099         (WebCore::InspectorDOMDebuggerAgent::willSendXMLHttpRequest):
3100         Use ContentSearchUtilities for both Text and RegularExpression breakpoints.
3101
3102         * inspector/InspectorDOMDebuggerAgent.h:
3103         Associate XHR breakpoint with a type.
3104
3105 2017-04-20  Eric Carlson  <eric.carlson@apple.com>
3106
3107         [MediaStream] Cleanup and simplify CoreAudioCaptureSource
3108         https://bugs.webkit.org/show_bug.cgi?id=171064
3109
3110         There is no need for a mutex to guard against internal state changes because we
3111         don't currently change configuration after the audio unit is allocated. Once
3112         we do support reconfiguration on the fly, we can just stop the output unit before
3113         changing configuration because the I/O proc isn't called if the output unit
3114         is stopped, and AudioOutputUnitStop blocks until the audio device has stopped.
3115         
3116         Reviewed by Jer Noble.
3117
3118         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
3119         (WebCore::CoreAudioCaptureSource::~CoreAudioCaptureSource): Call cleanupAudioUnits
3120         instead of duplicating logic. 
3121         (WebCore::CoreAudioCaptureSource::preferredIOBufferDuration): Change preferred
3122         duration from 20ms to 40ms.
3123         (WebCore::CoreAudioCaptureSource::configureMicrophoneProc): Set mSampleRate to the
3124         preferred sample rate if it is 0.
3125         (WebCore::CoreAudioCaptureSource::configureSpeakerProc): Ditto.
3126         (WebCore::CoreAudioCaptureSource::provideSpeakerData): Only increment counter and
3127         check timestamps in debug builds.
3128         (WebCore::CoreAudioCaptureSource::processMicrophoneSamples): Ditto.
3129         (WebCore::CoreAudioCaptureSource::cleanupAudioUnits): We only need the audio unit
3130         name in debug builds.
3131         (WebCore::CoreAudioCaptureSource::setupAudioUnits): Ditto. No more internal state
3132         lock. Don't try to get the default input device on iOS.
3133         (WebCore::CoreAudioCaptureSource::startProducingData): No more internal state lock.
3134         Assert if not called on the main thread.
3135         (WebCore::CoreAudioCaptureSource::stopProducingData): Ditto.
3136         (WebCore::CoreAudioCaptureSource::suspend): Ditto.
3137         (WebCore::CoreAudioCaptureSource::resume): Ditto.
3138         * platform/mediastream/mac/CoreAudioCaptureSource.h:
3139
3140 2017-04-20  Eric Carlson  <eric.carlson@apple.com>
3141
3142         [MediaStream iOS] Hold process assertion while media capture is active
3143         https://bugs.webkit.org/show_bug.cgi?id=171017
3144         <rdar://problem/31719177>
3145
3146         Reviewed by Dean Jackson.
3147
3148         * page/ActivityState.h: Add IsCapturingMedia flag.
3149
3150         * page/Page.cpp:
3151         (WebCore::Page::updateTimerThrottlingState): Enable timer throttling when capture is active
3152         like we do when playing audio.
3153         (WebCore::Page::setActivityState): Ditto.
3154
3155         * page/PerformanceMonitor.cpp:
3156         (WebCore::PerformanceMonitor::updateProcessStateForMemoryPressure): A process is active when
3157         capturing media, as it is when playing audio.
3158
3159 2017-04-20  Wenson Hsieh  <wenson_hsieh@apple.com>
3160
3161         Inline anchor elements cannot be dragged when starting the drag from a block descendant
3162         https://bugs.webkit.org/show_bug.cgi?id=171062
3163         <rdar://problem/31697835>
3164
3165         Reviewed by Tim Horton.
3166
3167         Tweaks DragController::draggableElement to traverse the DOM instead of the render tree when finding a draggable
3168         element. This prevents us from skipping elements that are in the DOM ancestor chain, but appear as siblings to
3169         the hit-tested node's renderer in the render tree.
3170
3171         There was also previously a check to ensure that we skip anonymous RenderObjects while traversing up the chain,
3172         but this is no longer necessary fter this change, since all the elements we traverse in the DOM should have
3173         renderers that are not anonymous.
3174
3175         Test: fast/events/drag-and-drop-link-containing-block.html
3176
3177         * page/DragController.cpp:
3178         (WebCore::DragController::draggableElement):
3179
3180 2017-04-20  Michael Catanzaro  <mcatanzaro@igalia.com>
3181
3182         -Wformat warning on HistoryController.cpp:295:5
3183         https://bugs.webkit.org/show_bug.cgi?id=171028
3184
3185         Reviewed by Daniel Bates.
3186
3187         Need to cast WebCore::FrameLoadType to int before using it in printf.
3188
3189         * loader/HistoryController.cpp:
3190         (WebCore::HistoryController::goToItem):
3191
3192 2017-04-20  Per Arne Vollan  <pvollan@apple.com>
3193
3194         The toleranceBefore parameter in the AVPlayerItem method seekToTime should not be negative.
3195         https://bugs.webkit.org/show_bug.cgi?id=171063
3196
3197         Reviewed by Eric Carlson.
3198
3199         The AVPlayerItem method seekToTime will throw an exception if toleranceBefore is negative.
3200
3201         No new tests since the change is a sanity check.
3202
3203         * html/HTMLMediaElement.cpp:
3204         (WebCore::HTMLMediaElement::seekTask):
3205         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3206         (WebCore::MediaPlayerPrivateAVFoundationObjC::seekToTime):
3207
3208 2017-04-20  Anders Carlsson  <andersca@apple.com>
3209
3210         Replace isFinalStateStatus with isFinalStateResult
3211         https://bugs.webkit.org/show_bug.cgi?id=171072
3212         rdar://problem/31589635
3213
3214         Reviewed by Tim Horton.
3215
3216         This will let us get rid of some of the status enum declarations.
3217
3218         * Modules/applepay/ApplePaySession.cpp:
3219         (WebCore::ApplePaySession::completePayment):
3220         * Modules/applepay/PaymentAuthorizationStatus.h:
3221         (WebCore::isFinalStateStatus): Deleted.
3222         * Modules/applepay/PaymentCoordinator.cpp:
3223         (WebCore::PaymentCoordinator::completePaymentSession):
3224         * Modules/applepay/PaymentRequest.cpp:
3225         (WebCore::isFinalStateResult):
3226         * Modules/applepay/PaymentRequest.h:
3227
3228 2017-04-20  Brent Fulgham  <bfulgham@apple.com>
3229
3230         [Win] REGRESSION(r215486): Windows Release build is broken
3231         https://bugs.webkit.org/show_bug.cgi?id=171024
3232         <rdar://problem/31722618>
3233
3234         Reviewed by Mark Lam.
3235
3236         Add missing include needed for clean Release build on Windows (proper
3237         fix found by Fujii Hironori).
3238
3239         * bindings/js/JSDOMGlobalObject.h:
3240
3241 2017-04-20  Said Abou-Hallawa  <sabouhallawa@apple.com>
3242
3243         CachedImage should cancel loading images for unsupported/unknown types
3244         https://bugs.webkit.org/show_bug.cgi?id=170697
3245
3246         Reviewed by Youenn Fablet.
3247
3248         Currently when the image decoder detects an error with the incoming encoded
3249         data of an image, we mark the image to be a broken image. But the network
3250         process keeps feeding the web process with the rest of the data. We should
3251         cancel loading the rest of the data to save network bandwidth and CPU time
3252         loading and processing useless data.
3253
3254         * loader/cache/CachedImage.cpp:
3255         (WebCore::CachedImage::addIncrementalDataBuffer):
3256         (WebCore::CachedImage::finishLoading):
3257
3258 2017-04-20  Aaron Chu  <aaron_chu@apple.com>
3259
3260         AX: Modern Media Controls Timeline slider should be operable
3261         https://bugs.webkit.org/show_bug.cgi?id=170250
3262
3263         Reviewed by Antoine Quint.
3264
3265         Added a "change" event listener and aria-valuetext to the slider so that when a
3266         VoiceOver user operates the timeline control, VO speaks the updated timestamp
3267
3268         Test: media/modern-media-controls/scrubber/scrubber-has-correct-ax-label.html
3269
3270         * English.lproj/modern-media-controls-localized-strings.js:
3271         * Modules/modern-media-controls/controls/scrubber.js:
3272         (Scrubber.prototype.set inputAccessibleLabel):
3273         (Scrubber.prototype._formatTime):
3274         * Modules/modern-media-controls/controls/slider.js:
3275         (Slider.prototype.handleEvent):
3276         (Slider.prototype._handleInputEvent): Deleted.
3277         * Modules/modern-media-controls/controls/time-control.js:
3278         (TimeControl.prototype.updateScrubberLabel):
3279         * Modules/modern-media-controls/controls/time-label.js:
3280         (TimeLabel.prototype.commitProperty):
3281         (TimeLabel.prototype._formattedTime):
3282         * Modules/modern-media-controls/main.js:
3283         (formatTimeByUnit):
3284         (unitizeTime):
3285
3286 2017-04-20  Andy Estes  <aestes@apple.com>
3287
3288         Fix indentation in AVKitSPI.h
3289         https://bugs.webkit.org/show_bug.cgi?id=171066
3290
3291         Reviewed by Jer Noble.
3292
3293         * platform/spi/cocoa/AVKitSPI.h:
3294
3295 2017-04-20  Jer Noble  <jer.noble@apple.com>
3296
3297         [MediaCapture] gUM() with CoreAudio fails if capturing audio in the UIProcess.
3298         https://bugs.webkit.org/show_bug.cgi?id=171021
3299
3300         Reviewed by Eric Carlson.
3301
3302         Refactor the creation of RealtimeMediaSources to take a persistent device ID rather
3303         than a CaptureDevice directly. This allows WebKit2 to iterate devices in the UIProcess
3304         rather than the WebProcess.
3305
3306         * platform/mediastream/RealtimeMediaSource.h:
3307         * platform/mediastream/mac/AVAudioCaptureSource.mm:
3308         * platform/mediastream/mac/AVVideoCaptureSource.mm:
3309         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
3310         (WebCore::CoreAudioCaptureSource::create):
3311         (WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource):
3312         * platform/mediastream/mac/CoreAudioCaptureSource.h:
3313         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
3314         (WebCore::RealtimeMediaSourceCenterMac::createMediaStream):
3315         (WebCore::RealtimeMediaSourceCenterMac::bestSourcesForTypeAndConstraints):
3316         * platform/mock/MockRealtimeAudioSource.cpp:
3317         * platform/mock/MockRealtimeVideoSource.cpp:
3318
3319 2017-04-20  Tim Horton  <timothy_horton@apple.com>
3320
3321         Make it possible to request the non-expanded scrollbar width from ScrollbarTheme
3322         https://bugs.webkit.org/show_bug.cgi?id=171047
3323
3324         Reviewed by Sam Weinig.
3325
3326         No new tests, new behavior is not exposed in any way.
3327
3328         * platform/ScrollTypes.h:
3329         * platform/ScrollbarTheme.h:
3330         (WebCore::ScrollbarTheme::scrollbarThickness):
3331         * platform/gtk/ScrollbarThemeGtk.cpp:
3332         (WebCore::ScrollbarThemeGtk::scrollbarThickness):
3333         * platform/gtk/ScrollbarThemeGtk.h:
3334         * platform/ios/ScrollbarThemeIOS.h:
3335         * platform/ios/ScrollbarThemeIOS.mm:
3336         (WebCore::ScrollbarThemeIOS::scrollbarThickness):
3337         * platform/mac/ScrollbarThemeMac.h:
3338         * platform/mac/ScrollbarThemeMac.mm:
3339         (WebCore::ScrollbarThemeMac::scrollbarThickness):
3340         * platform/mock/ScrollbarThemeMock.cpp:
3341         (WebCore::ScrollbarThemeMock::scrollbarThickness):
3342         * platform/mock/ScrollbarThemeMock.h:
3343         * platform/win/ScrollbarThemeWin.cpp:
3344         (WebCore::ScrollbarThemeWin::scrollbarThickness):
3345         * platform/win/ScrollbarThemeWin.h:
3346         * rendering/RenderScrollbarTheme.h:
3347         On Mac, when the scrollbar is hovered, it gets bigger.
3348         Currently, scrollbarThickness always returns the big size.
3349         It should be possible to request the smaller, "regular" scrollbar size as well.
3350
3351 2017-04-20  Jon Lee  <jonlee@apple.com>
3352
3353         Update pip placard to "picture in picture"
3354         https://bugs.webkit.org/show_bug.cgi?id=171036
3355         rdar://problem/30201536
3356
3357         Reviewed by Antoine Quint.
3358
3359         Updated media/modern-media-controls/pip-placard/pip-placard.html
3360
3361         Update the text shown with the picture in picture placard.
3362
3363         * English.lproj/mediaControlsLocalizedStrings.js:
3364         * English.lproj/modern-media-controls-localized-strings.js:
3365         * Modules/mediacontrols/mediaControlsApple.js:
3366         (Controller.prototype.updatePictureInPicturePlaceholder):
3367         * Modules/modern-media-controls/controls/pip-placard.js:
3368         (PiPPlacard):
3369
3370 2017-04-20  Youenn Fablet  <youenn@apple.com>
3371
3372         RTCPeerConnection is stopping its backend twice sometimes
3373         https://bugs.webkit.org/show_bug.cgi?id=171043
3374
3375         Reviewed by Eric Carlson.
3376
3377         Test: webrtc/closing-peerconnection.html
3378
3379         Making sure we stop the backend only once.
3380         Adding an internals API to close the peer connection so as to replicate frame disconnection.
3381
3382         * Modules/mediastream/RTCPeerConnection.cpp:
3383         (WebCore::RTCPeerConnection::doClose):
3384         (WebCore::RTCPeerConnection::doStop):
3385         * Modules/mediastream/RTCPeerConnection.h:
3386         * testing/Internals.cpp:
3387         (WebCore::Internals::stopPeerConnection):
3388         * testing/Internals.h:
3389         * testing/Internals.idl:
3390
3391 2017-04-20  Antti Koivisto  <antti@apple.com>
3392
3393         Increase large animation cutoff
3394         https://bugs.webkit.org/show_bug.cgi?id=171051
3395         <rdar://problem/31731532>
3396
3397         Reviewed by Andreas Kling.
3398
3399         We currently switch to per-frame decoding if the animation is larger than 5MB. This is very
3400         power-inefficient and such animations are now common. The cutoff originates from 2007 (r20069),
3401         it is time update it.
3402
3403         Note that the normal low memory handling will still kill animation frames as needed.
3404
3405         * platform/graphics/BitmapImage.h:
3406
3407             Increase cutoff to 30MB. This is enough (with some room to spare) for animations on current
3408             tumblr.com/search/aww.
3409
3410             Also remove the separate cutoff value for iOS.
3411
3412 2017-04-20  Zan Dobersek  <zdobersek@igalia.com>
3413
3414         Register missing AES_CTR, ECDSA and HKDF algorithms in
3415         GCrypt's CryptoAlgorithmRegistry implementation.
3416
3417         Rubber-stamped by Carlos Alberto Lopez Perez.
3418
3419         * crypto/gcrypt/CryptoAlgorithmRegistryGCrypt.cpp:
3420         (WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms):
3421
3422 2017-04-20  Joanmarie Diggs  <jdiggs@igalia.com>
3423
3424         [ATK] Implement support for DPub ARIA roles
3425         https://bugs.webkit.org/show_bug.cgi?id=170679
3426
3427         Reviewed by Chris Fleizach.
3428
3429         Create two new WebCore AccessibilityRole values: TextGroup and ApplicationTextGroup.
3430         These roles make it possible for platforms to distinguish groups which are primarily