Source/WebCore:
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-02-13  Karim H  <karim@karhm.com>
2
3         Added the other missing BSTR roles tag names.
4         https://bugs.webkit.org/show_bug.cgi?id=165545
5
6         Reviewed by Chris Fleizach.
7
8         Test: accessibility/win/bstr-elements-role.html
9
10         * accessibility/AccessibilityRenderObject.cpp:
11         (WebCore::shouldReturnTagNameAsRoleForMSAA):
12
13 2017-02-13  Youenn Fablet  <youennf@gmail.com>
14
15         [WebRTC] Creating RTCPeerConnection with libwebrtc backend is crashing on rwt
16         https://bugs.webkit.org/show_bug.cgi?id=168250
17
18         Reviewed by Alex Christensen.
19
20         Covered by webrtc tests in LayoutTests and in web-platform-tests.
21         Making mock peer connection factory keep a ref of the real libwebrtc peer connection factory.
22         That way, it can create real libwebrtc backends whenever requested by tests.
23
24         Moving LibWebRTCUtils.h routines as static LibWebRTCProvider methods.
25         In the future, we should make them no longer static.
26
27         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
28         (WebCore::LibWebRTCMediaEndpoint::doCreateOffer):
29         (WebCore::LibWebRTCMediaEndpoint::doCreateAnswer):
30         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
31         * WebCore.xcodeproj/project.pbxproj:
32         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp: Renamed from Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCUtils.cpp.
33         (WebCore::LibWebRTCProvider::callOnWebRTCNetworkThread):
34         (WebCore::LibWebRTCProvider::callOnWebRTCSignalingThread):
35         (WebCore::LibWebRTCProvider::factory):
36         (WebCore::LibWebRTCProvider::setPeerConnectionFactory):
37         (WebCore::createActualPeerConnection):
38         (WebCore::LibWebRTCProvider::createPeerConnection):
39         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
40         * platform/mediastream/libwebrtc/LibWebRTCUtils.h: Removed.
41         * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
42         (WebCore::RealtimeOutgoingAudioSource::audioSamplesAvailable):
43         * testing/Internals.cpp:
44         * testing/MockLibWebRTCPeerConnection.cpp:
45         (WebCore::useMockRTCPeerConnectionFactory):
46         (WebCore::MockLibWebRTCPeerConnectionForIceCandidates::gotLocalDescription):
47         (WebCore::releaseInNetworkThread):
48         (WebCore::MockLibWebRTCPeerConnection::SetLocalDescription):
49         (WebCore::MockLibWebRTCPeerConnection::SetRemoteDescription):
50         (WebCore::MockLibWebRTCPeerConnection::CreateOffer):
51         (WebCore::MockLibWebRTCPeerConnection::CreateAnswer):
52
53 2017-02-13  Anders Carlsson  <andersca@apple.com>
54
55         Simplify DragController::startDrag
56         https://bugs.webkit.org/show_bug.cgi?id=168240
57
58         Reviewed by Tim Horton.
59
60         Use early returns instead of assigning to a variable that's returned at the end of the function.
61
62         * page/DragController.cpp:
63         (WebCore::DragController::startDrag):
64
65 2017-02-13  Said Abou-Hallawa  <sabouhallawa@apple.com>
66
67         The current frame of an image should not deleted if another frame is asynchronously being decoded
68         https://bugs.webkit.org/show_bug.cgi?id=167618
69
70         Reviewed by Simon Fraser.
71
72         Test: fast/images/animated-image-draw-while-decode.html
73
74         If the memory cache asks the BitmapImage to destroy all its frames while
75         the next frame is being decoded, a thread contention may happen. This can
76         happen when BitmapImage::draw() is called and the next frame is not ready
77         yet for drawing, so the current frame has to be drawn. This will invoke
78         a frame decoding in the same image from the drawing committing thread.
79
80         We can avoid that by destroying all the frames except the current frame if
81         the image is asynchronously decoding its frames. This should not add extra
82         memory overhead because building the image frame cache and then destroying
83         it, when needed, is an on-going process. The frames will be allocated and
84         decoded all the time and all of them can be destroyed except the current one.
85         
86         * platform/graphics/BitmapImage.cpp:
87         (WebCore::BitmapImage::destroyDecodedData):
88         (WebCore::BitmapImage::destroyDecodedDataIfNecessary):
89         The logic of destroying the ImageFrames was split among BitmapImage, ImageSource
90         and ImageFrameCache. Move all the logic to BitmapImage and have ImageFrameCache
91         be responsible only for destroying a range of ImageFrames.
92
93         (WebCore::BitmapImage::draw): add an ASSERT_IMPLIES to ensure the current frame
94         is ready to be rendered if the next frame is being decoded.
95         
96         * platform/graphics/BitmapImage.h: Move a const from ImageFrameCache.h to BitmapImage.h.
97
98         * platform/graphics/ImageFrameCache.cpp:
99         (WebCore::ImageFrameCache::destroyDecodedData):
100         (WebCore::ImageFrameCache::destroyDecodedDataIfNecessary): Deleted.
101         * platform/graphics/ImageFrameCache.h:
102         (WebCore::ImageFrameCache::destroyAllDecodedData):
103         (WebCore::ImageFrameCache::destroyAllDecodedDataExcludeFrame):
104         (WebCore::ImageFrameCache::destroyDecodedDataBeforeFrame):
105         Make ImageFrameCache be responsible for destroying a range of ImageFrames.
106         This range might include all the frames, all the frames but up to a specific
107         frame, or all the frames but exclude one frame in the middle.
108         
109         * platform/graphics/ImageSource.cpp:
110         (WebCore::ImageSource::clear): No need to call clearFrameBufferCache() from clear().
111         The decision to call clearFrameBufferCache() or clear() is moved to
112         BitmapImage::destroyDecodedData().
113          
114         (WebCore::ImageSource::destroyDecodedData): Deleted.
115         (WebCore::ImageSource::destroyDecodedDataIfNecessary): Deleted.
116         These functions are replaced by another set of functions in ImageSource.h.
117         
118         * platform/graphics/ImageSource.h:
119         (WebCore::ImageSource::destroyAllDecodedData):
120         (WebCore::ImageSource::destroyAllDecodedDataExcludeFrame):
121         (WebCore::ImageSource::destroyDecodedDataBeforeFrame):
122         (WebCore::ImageSource::hasDecodingQueue):
123         These are new wrappers which call the corresponding ImageFrameCache functions.
124
125 2017-02-13  Myles C. Maxfield  <mmaxfield@apple.com>
126
127         [Cocoa] Stop soft-linking CTRunGetBaseAdvancesAndOrigins()
128         https://bugs.webkit.org/show_bug.cgi?id=168256
129
130         Reviewed by Alex Christensen.
131
132         Use of this function is already behind a platform guard.
133
134         No new tests because there is no behavior change.
135
136         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
137         (SOFT_LINK): Deleted.
138
139 2017-02-13  Jiewen Tan  <jiewen_tan@apple.com>
140
141         [WebCrypto] WebInspector should indicate webkitSubtle is deprecated
142         https://bugs.webkit.org/show_bug.cgi?id=165913
143         <rdar://problem/30477222>
144
145         Reviewed by Joseph Pecoraro.
146
147         Covered by existing tests.
148
149         * page/Crypto.cpp:
150         (WebCore::Crypto::webkitSubtle):
151
152 2017-02-13  Simon Fraser  <simon.fraser@apple.com>
153
154         Call WKDestroyRenderingResources() on iOS when tabs are backgrounded
155         https://bugs.webkit.org/show_bug.cgi?id=168261
156         rdar://problem/30481079
157
158         Reviewed by Tim Horton.
159
160         Add CABackingStoreCollectBlocking() to QuartzCoreSPI.h, and fix files in WebCore
161         that do a framework include.
162
163         * platform/graphics/cocoa/TextTrackRepresentationCocoa.mm:
164         * platform/graphics/cocoa/WebActionDisablingCALayerDelegate.h:
165         * platform/spi/cocoa/QuartzCoreSPI.h:
166         * platform/spi/mac/NSViewSPI.h:
167
168 2017-02-13  Youenn Fablet  <youenn@apple.com>
169
170         ASSERTION FAILED: !m_bodyLoader
171         https://bugs.webkit.org/show_bug.cgi?id=166986
172
173         Reviewed by Sam Weinig.
174
175         Refactoring to make the unset/set pending activity part of body loader.
176         This allows ensuring to not forget to do that by simply deleting the body loader.
177
178         * Modules/fetch/FetchResponse.cpp:
179         (WebCore::FetchResponse::fetch):
180         (WebCore::FetchResponse::BodyLoader::didSucceed):
181         (WebCore::FetchResponse::BodyLoader::didFail):
182         (WebCore::FetchResponse::BodyLoader::BodyLoader):
183         (WebCore::FetchResponse::BodyLoader::~BodyLoader):
184         (WebCore::FetchResponse::stop):
185         * Modules/fetch/FetchResponse.h:
186
187 2017-02-13  Aakash Jain  <aakash_jain@apple.com>
188
189         Remove unused WebCoreThreadSafe.h
190         https://bugs.webkit.org/show_bug.cgi?id=168236
191
192         Reviewed by Dan Bernstein.
193
194         * platform/ios/wak/WebCoreThreadSafe.h: Removed.
195         * WebCore.xcodeproj/project.pbxproj: Removed WebCoreThreadSafe.h
196         * platform/ios/wak/WebCoreThread.mm: Removed WebCoreThreadSafe.h and included WAKWindow.h directly
197
198 2017-02-13  Anders Carlsson  <andersca@apple.com>
199
200         Fix iOS build.
201
202         * platform/ios/DragImageIOS.mm:
203         (WebCore::deleteDragImage):
204
205 2017-02-13  Sam Weinig  <sam@webkit.org>
206
207         Rename MediaQueryExp.h/cpp to MediaQueryExpression.h/cpp
208         https://bugs.webkit.org/show_bug.cgi?id=168249
209
210         Reviewed by Dean Jackson.
211
212         Fix a FIXME and rename MediaQueryExp.h/cpp to match the class it contains, MediaQueryExpression.
213
214         * CMakeLists.txt:
215         * WebCore.xcodeproj/project.pbxproj:
216         * css/CSSAllInOne.cpp:
217         * css/MediaQuery.h:
218         * css/MediaQueryEvaluator.h:
219         * css/MediaQueryExp.cpp: Removed.
220         * css/MediaQueryExp.h: Removed.
221         * css/MediaQueryExpression.cpp: Copied from Source/WebCore/css/MediaQueryExp.cpp.
222         * css/MediaQueryExpression.h: Copied from Source/WebCore/css/MediaQueryExp.h.
223         * css/parser/MediaQueryParser.h:
224
225 2017-02-13  Aakash Jain  <aakash_jain@apple.com>
226
227         WAKResponder should be exported from WebCore
228         https://bugs.webkit.org/show_bug.cgi?id=168245
229
230         Reviewed by Dan Bernstein.
231
232         * platform/ios/wak/WAKResponder.h:
233
234 2017-02-13  Simon Fraser  <simon.fraser@apple.com>
235
236         Log to the History Channel in a few more places
237         https://bugs.webkit.org/show_bug.cgi?id=168252
238
239         Reviewed by Brady Eidson.
240
241         *** Aliens ***
242
243         * loader/HistoryController.cpp:
244         (WebCore::HistoryController::restoreScrollPositionAndViewState):
245         (WebCore::HistoryController::updateForReload):
246         * loader/NavigationScheduler.cpp:
247         (WebCore::NavigationScheduler::scheduleHistoryNavigation):
248         (WebCore::NavigationScheduler::timerFired):
249         (WebCore::NavigationScheduler::cancel):
250         * page/History.cpp:
251         (WebCore::History::go):
252
253 2017-02-13  Alex Christensen  <achristensen@webkit.org>
254
255         Percent should be allowed in non-special URL hosts
256         https://bugs.webkit.org/show_bug.cgi?id=168255
257
258         Reviewed by Tim Horton.
259
260         In the last few weeks, the spec has consolidated its sets of code points.
261         Now forbidden host code points replace the old invalid host code points with
262         the modification that percents are allowed in non-special hosts because we
263         percent-encode non-ascii code points in non-special hosts.
264         See https://url.spec.whatwg.org/#concept-opaque-host-parser
265
266         Covered by newly passing web platform tests.
267
268         * platform/URLParser.cpp:
269         (WebCore::isC0Control):
270         (WebCore::isInUserInfoEncodeSet):
271         (WebCore::URLParser::hasForbiddenHostCodePoint):
272         (WebCore::URLParser::parseHostAndPort):
273         (WebCore::isInvalidDomainCharacter): Deleted.
274         (WebCore::URLParser::hasInvalidDomainCharacter): Deleted.
275         * platform/URLParser.h:
276
277 2017-02-13  Anders Carlsson  <andersca@apple.com>
278
279         Fix Windows build.
280
281         * platform/win/PasteboardWin.cpp:
282         (WebCore::Pasteboard::setDragImage):
283
284 2017-02-13  Alex Christensen  <achristensen@webkit.org>
285
286         Fix Yosemite build after r211765
287         https://bugs.webkit.org/show_bug.cgi?id=168246
288         <rdar://problem/30494174>
289
290         Reviewed by Brady Eidson.
291
292         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
293         (SOFT_LINK):
294
295 2017-02-13  Anders Carlsson  <andersca@apple.com>
296
297         Add a DragImage class that wraps a DragImageRef
298         https://bugs.webkit.org/show_bug.cgi?id=168131
299
300         Reviewed by Beth Dakin.
301
302         This allows us to get rid of the explicit deleteDragImage calls and will make additional cleanup of the
303         various drag code paths possible. No functionality change.
304
305         * dom/DataTransfer.cpp:
306         (WebCore::DataTransfer::updateDragImage):
307         * page/DragController.cpp:
308         (WebCore::DragController::startDrag):
309         (WebCore::DragController::doImageDrag):
310         (WebCore::DragController::doSystemDrag):
311         * page/DragController.h:
312         * platform/DragImage.cpp:
313         (WebCore::DragImage::DragImage):
314         (WebCore::DragImage::operator=):
315         (WebCore::DragImage::~DragImage):
316         * platform/DragImage.h:
317         * platform/Pasteboard.h:
318         * platform/StaticPasteboard.h:
319         * platform/mac/PasteboardMac.mm:
320         (WebCore::Pasteboard::setDragImage):
321
322 2017-02-13  Chris Dumez  <cdumez@apple.com>
323
324         Regression(r211455): ASSERTION FAILED: frameView || pageCacheState() == InPageCache in com.apple.WebCore: WebCore::Document::destroyRenderTree
325         https://bugs.webkit.org/show_bug.cgi?id=168237
326         <rdar://problem/30494165>
327
328         Reviewed by Gavin Barraclough.
329
330         Drop bad assertion under document::destroyRenderTree() that was introduced in r211455.
331         The assertion seemed like a good idea but the issue is that CachedFrame::destroy()
332         reset's the document's pageCacheState before calling Document::prepareForDestruction().
333
334         No new tests, this fixes assertion hits on our bots.
335
336         * dom/Document.cpp:
337         (WebCore::Document::destroyRenderTree):
338
339 2017-02-13  Myles C. Maxfield  <mmaxfield@apple.com>
340
341         Update custom line breaking iterators to the latest version of Unicode
342         https://bugs.webkit.org/show_bug.cgi?id=168182
343
344         Reviewed by Zalan Bujtas.
345
346         Clean up our breaking code to be more descriptive about the difference between
347         line-break: auto vs line-break: loose | normal | strict. The only difference is
348         that we have some hardcoded tables to speed up character iteration for
349         line-break: auto.
350
351         Tests: TestWebKitAPI WebKit2.LineBreaking
352
353         * rendering/BreakLines.h:
354         (WebCore::nextBreakablePosition):
355         (WebCore::nextBreakablePositionIgnoringNBSP):
356         (WebCore::nextBreakablePositionWithoutShortcut):
357         (WebCore::nextBreakablePositionIgnoringNBSPWithoutShortcut):
358         (WebCore::isBreakable):
359         (WebCore::nextBreakablePositionNonLoosely): Deleted.
360         (WebCore::nextBreakablePositionLoosely): Deleted.
361         (WebCore::nextBreakablePositionLoose): Deleted.
362         (WebCore::nextBreakablePositionIgnoringNBSPLoose): Deleted.
363         * rendering/RenderText.cpp:
364         (WebCore::RenderText::computePreferredLogicalWidths):
365         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
366         (WebCore::SimpleLineLayout::nextBreakablePositionInSegment):
367         * rendering/line/BreakingContext.h:
368         (WebCore::BreakingContext::handleText):
369         (WebCore::BreakingContext::optimalLineBreakLocationForTrailingWord):
370
371 2017-02-13  Youenn Fablet  <youenn@apple.com>
372
373         Remove @getUserMedia identifier
374         https://bugs.webkit.org/show_bug.cgi?id=168216
375
376         Reviewed by Sam Weinig.
377
378         No change of behavior.
379
380         * Modules/mediastream/MediaDevices.idl:
381         * bindings/js/WebCoreBuiltinNames.h:
382
383 2017-02-13  Carlos Garcia Campos  <cgarcia@igalia.com>
384
385         [GTK] Non-accelerated drawing is broken with HiDPI
386         https://bugs.webkit.org/show_bug.cgi?id=168128
387
388         Reviewed by Michael Catanzaro.
389
390         When device scale factor changes, the page notifies the page overlay controller about it. Then overlay root
391         layers are created to be notified about the device scale factor. That causes us to enter in accelerated
392         compositing mode, because the graphics layer factory is called. But the render layer compositor doesn't really
393         enter in accelerated mode, because there aren't page overlays, the accelerated mode is not forced and the website
394         doesn't require acceleration either. This leaves our drawing area in an inconsistent state, it thinks it's in AC
395         mode because it has a layer tree host, but without a root layer attached, so nothing is rendered. The page
396         overlay controller doesn't need to create the layers when device scale factor changes, when an overlay is
397         installed, layers will be created with the current device scale factor anyway.
398
399         * page/PageOverlayController.cpp:
400         (WebCore::PageOverlayController::didChangeDeviceScaleFactor): Return early if not initialized yet.
401
402 2017-02-13  Csaba Osztrogonác  <ossy@webkit.org>
403
404         REGRESSION(r210845) Build broken with ENABLE_MHTML disabled
405         https://bugs.webkit.org/show_bug.cgi?id=167771
406
407         Reviewed by Daniel Bates.
408
409         * loader/DocumentLoader.cpp:
410         (WebCore::DocumentLoader::commitData):
411
412 2017-02-12  Dan Bernstein  <mitz@apple.com>
413
414         Tried to fix USE(APPLE_INTERNAL_SDK) builds after r212211.
415
416         * platform/spi/mac/TUCallSPI.h: Reverted to r212210.
417
418 2017-02-12  Dan Bernstein  <mitz@apple.com>
419
420         Tried to fix USE(APPLE_INTERNAL_SDK) builds after r212211.
421
422         * platform/spi/mac/TUCallSPI.h:
423
424 2017-02-12  Dan Bernstein  <mitz@apple.com>
425
426         Tried to fix USE(APPLE_INTERNAL_SDK) builds after r212211.
427
428         * platform/spi/mac/TUCallSPI.h:
429
430 2017-02-12  Dan Bernstein  <mitz@apple.com>
431
432         Tried to fix USE(APPLE_INTERNAL_SDK) builds after r212211.
433
434         * platform/spi/mac/NSMenuSPI.h: Replaced declaration of deprecated method with its current
435           equivalent.
436
437 2017-02-12  Dan Bernstein  <mitz@apple.com>
438
439         Tried to fix USE(APPLE_INTERNAL_SDK) builds after r212211.
440
441         * platform/spi/mac/NSImmediateActionGestureRecognizerSPI.h:
442
443 2017-02-12  Ryosuke Niwa  <rniwa@webkit.org>
444
445         parserRemoveChild should unload subframes
446         https://bugs.webkit.org/show_bug.cgi?id=168151
447
448         Reviewed by Darin Adler.
449
450         Fix the bug that the adoption agency algorithm does not unload subframes as it disconnects nodes.
451
452         Also moved calls to nodeWillBeRemoved inside NoEventDispatchAssertion to expand on r211965.
453
454         Tests: fast/parser/adoption-agency-clear-focus-range.html
455                fast/parser/adoption-agency-unload-iframe-1.html
456                fast/parser/adoption-agency-unload-iframe-2.html
457
458         * dom/ContainerNode.cpp:
459         (WebCore::ContainerNode::takeAllChildrenFrom): Rewritten using idioms used in removeChildren and parserAppendChild.
460
461         Disconnect all subframes first since this can synchronously dispatch an unload event. Then update DOM ranges,
462         the focused element, and other states in the document.
463
464         Second, use the regular removeBetween, notifyChildNodeRemoved, childrenChanged sequence of calls to disconnect nodes
465         instead of a single call to removeDetachedChildren to properly disconnect child nodes since those nodes may have
466         already come live due to execution of synchronous scripts prior to the adoption agency algorithm has run, or in
467         response to the unload event we just dispatched.
468
469         Third, append these nodes using parserAppendChild to avoid dispatching mutation events.
470
471         (WebCore::willRemoveChild): Removed the call to nodeWillBeRemoved. It's now called within NoEventDispatchAssertion
472         in each call site of willRemoveChild and willRemoveChildren.
473         (WebCore::willRemoveChildren): Ditto.
474         (WebCore::ContainerNode::removeChild): Call nodeWillBeRemoved inside NoEventDispatchAssertion.
475         (WebCore::ContainerNode::replaceAllChildren): Call nodeWillBeRemoved inside NoEventDispatchAssertion.
476         (WebCore::ContainerNode::parserRemoveChild): Disconnect subframes and update document's states.
477
478         * html/parser/HTMLConstructionSite.cpp:
479         (WebCore::executeTakeAllChildrenAndReparentTask): Add a release assert that new parent does not already have a parent. 
480
481 2017-02-12  Ryosuke Niwa  <rniwa@webkit.org>
482
483         REGRESSION (r179497): Crash inside setAttributeNode
484         https://bugs.webkit.org/show_bug.cgi?id=168161
485         <rdar://problem/30451581>
486
487         Reviewed by Andreas Kling.
488
489         The bug was caused by setAttributeNode calling setAttributeInternal with the same element data as the one used
490         to call removeAttributeInternal despite of the fact removeAttributeInternal could have invoked arbitrary scripts
491         and mutated element's m_elementData.
492
493         Fixed the bug by calling with setAttributeInternal with the result of new invocation of ensureUniqueElementData().
494
495         Test: fast/dom/Attr/make-unique-element-data-while-replacing-attr.html
496
497         * dom/Element.cpp:
498         (WebCore::Element::setAttributeNode):
499
500 2017-02-12  Ryosuke Niwa  <rniwa@webkit.org>
501
502         Rebaseline bindings tests after r212207.
503
504         * bindings/scripts/test/JS/JSTestObj.cpp:
505         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
506
507 2017-02-12  Dan Bernstein  <mitz@apple.com>
508
509         [Cocoa] Some -respondsToSelector: checks are unnecessary
510         https://bugs.webkit.org/show_bug.cgi?id=168183
511
512         Reviewed by Tim Horton.
513
514         * English.lproj/Localizable.strings: Removed a string that’s no longer needed after the
515           change to WebKit2/Platform/mac/MenuUtilities.mm.
516
517         * editing/mac/DictionaryLookup.mm:
518         (WebCore::showPopupOrCreateAnimationController): Removed check whether
519           LULookupDefinitionModule responds to +showDefinitionForTerm:relativeToRect:ofView:options:.
520
521         * platform/cocoa/NetworkExtensionContentFilter.mm:
522         (WebCore::NetworkExtensionContentFilter::initialize): Changed to use
523           -[NEFilterSource setSourceAppIdentifier:], without checking, instead of
524           -setSourceAppBundleID:, which does not exist.
525
526         * platform/cocoa/ScrollController.mm:
527         (systemUptime): Deleted.
528         (WebCore::ScrollController::snapRubberBand): Use -[NSProcessInfo systemUptime] directly.
529
530         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
531         (WebCore::MediaPlaybackTargetPickerMac::showPlaybackTargetPicker): Remove unnecessary check.
532
533         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
534         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer): Ditto.
535         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenMode): Ditto.
536         (WebCore::MediaPlayerPrivateAVFoundationObjC::didPassCORSAccessCheck): Replaced
537           -respondsToSelector: check with -isKindOfClass: check corresponding to the above cast.
538         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldDisableSleep): Removed unnecessary
539           check.
540
541         * platform/graphics/avfoundation/objc/VideoFullscreenLayerManager.mm:
542         (WebCore::VideoFullscreenLayerManager::setVideoFullscreenLayer): Removed unnecessary checks.
543
544         * platform/graphics/mac/WebGLLayer.mm:
545         (-[WebGLLayer initWithGraphicsContext3D:]): Ditto.
546
547         * platform/mac/PlatformEventFactoryMac.mm:
548         (WebCore::typeForEvent): Removed check whether NSMenu responds to +menuTypeForEvent: and
549           all code to handle that case that it doesn’t.
550
551         * platform/mac/WebVideoFullscreenController.mm:
552         (-[WebVideoFullscreenController applicationDidResignActive:]): Removed check whether
553           NSWindow responds to -isOnActiveSpace.
554         (-[WebVideoFullscreenController updateMenuAndDockForFullscreen]): Removed check whether
555           NSApplication responds to -setPresentationOptions:
556
557         * platform/mac/WebVideoFullscreenInterfaceMac.mm:
558         (-[WebVideoFullscreenInterfaceMacObjC updateIsPlaying:newPlaybackRate:]): Removed
559           unnecessary -respondsToSelector: check.
560         (-[WebVideoFullscreenInterfaceMacObjC setVideoDimensions:]): Ditto.
561         (-[WebVideoFullscreenInterfaceMacObjC setUpPIPForVideoView:withFrame:inWindow:]): Ditto.
562
563         * platform/spi/cf/CFNetworkSPI.h: Moved declarations of
564           -[NSURLCache _initWithMemoryCapacity:diskCapacity:relativePath:] and
565           -[NSURLCache _CFURLCache] to the !USE(APPLE_INTERNAL_SDK) section.
566
567         * platform/spi/cocoa/NEFilterSourceSPI.h: Added declaration of NEFilterSource’
568           sourceAppIdentifier property to the !USE(APPLE_INTERNAL_SDK) section and deleted
569           unconditional declaration of sourceAppBundleID property, which doesn’t exist.
570
571         * platform/spi/cocoa/QuartzCoreSPI.h: Removed redundant declarations.
572
573         * platform/spi/ios/DataDetectorsUISPI.h: Moved declarations of DDDetectionController methods
574           from WebKit2/UIProcess/ios/{WKActionSheetAssistant,WKContentViewInteraction}.mm to here.
575           Removed an unused declaration.
576
577         * platform/spi/mac/LookupSPI.h: Moved redundant declarations into the
578           !USE(APPLE_INTERNAL_SDK) section.
579
580         * platform/spi/mac/NSMenuSPI.h: Changed to import NSMenu_Private.h when using the
581           Apple internal SDK. Cleaned up the declarations for the other case.
582
583         * platform/spi/mac/TUCallSPI.h: Changed to import TUCall_Strings.h when use the Apple
584           internal SDK.
585
586 2017-02-11  Sam Weinig  <sam@webkit.org>
587
588         Remove the remaining functions out of JSDOMBinding
589         https://bugs.webkit.org/show_bug.cgi?id=168179
590
591         Reviewed by Darin Adler.
592
593         Move utility functions into more appropriate locations.
594         - Move hasIteratorMethod to runtime/IteratorOperations.h
595         - Move nonCachingStaticFunctionGetter to runtime/Lookup.h
596         - Move addImpureProperty to CommonVM
597
598         Remove toJS overload that took a Vector<T>. Replace it's usage
599         with toJS<IDLSequence<T>> usage. To make this work, added two
600         new types, IDLIDBKeyData and IDLIDBValue.
601
602         * Modules/indexeddb/IDBCursor.cpp:
603         (WebCore::IDBCursor::setGetResult):
604         * Modules/indexeddb/IDBRequest.cpp:
605         (WebCore::IDBRequest::setResult):
606         (WebCore::IDBRequest::setResultToStructuredClone):
607         Adopt JSDOMConvert infrastructure for conversions using new types.
608
609         * bindings/IDLTypes.h:
610         * bindings/js/JSDOMConvertIndexedDB.h:
611         (WebCore::JSConverter<IDLIDBKeyData>::convert):
612         (WebCore::JSConverter<IDLIDBValue>::convert):
613         Add new types for IDBKeyData and IDBValue.
614
615         * bindings/js/CommonVM.cpp:
616         (WebCore::addImpureProperty):
617         * bindings/js/CommonVM.h:
618         Move addImpureProperty here from JSDOMBinding.
619
620         * bindings/js/IDBBindingUtilities.cpp:
621         (WebCore::idbKeyDataToScriptValue): Deleted.
622         * bindings/js/IDBBindingUtilities.h:
623         Remove unused idbKeyDataToScriptValue, and group like functions
624         together.
625
626         * bindings/js/JSDOMBinding.cpp: Removed.
627         * bindings/js/JSDOMBinding.h:
628         (WebCore::nonCachingStaticFunctionGetter): Deleted.
629         (WebCore::toJS): Deleted.
630         Move/remove functions.
631
632         * bindings/js/JSDOMConvertUnion.h:
633         Update for move of hasIteratorMethod to runtime/IteratorOperations.h
634
635         * bindings/js/JSDOMWindowCustom.cpp:
636         * bindings/js/JSHTMLDocumentCustom.cpp:
637         * bindings/js/JSLocationCustom.cpp:
638         Update for move of nonCachingStaticFunctionGetter to runtime/Lookup.h
639
640         * bindings/js/JSSubtleCryptoCustom.cpp:
641         Remove unneeded include of runtime/IteratorOperations.h
642
643         * bindings/scripts/CodeGeneratorJS.pm:
644         (GenerateOverloadedFunctionOrConstructor):
645         Include runtime/IteratorOperations when needing to distinguish a sequence.
646
647         * html/HTMLDocument.cpp:
648         Replace include of JSDOMBinding.h with CommonVM.h for addImpureProperty.
649
650 2017-02-12  Carlos Garcia Campos  <cgarcia@igalia.com>
651
652         [GTK] Handle caps lock indicator in event modifiers
653         https://bugs.webkit.org/show_bug.cgi?id=168186
654
655         Reviewed by Michael Catanzaro.
656
657         Add helper function to check if caps lock is present in the given modifiers. We need this because in GDK
658         GDK_LOCK_MASK might be either CapsLock or ShiftLock in X11. We use this new method in all platform event
659         implementations to add the appropriate modifiers.
660
661         Fixes: fast/events/special-key-events-in-input-text.html
662
663         * platform/PlatformKeyboardEvent.h:
664         * platform/gtk/PlatformKeyboardEventGtk.cpp:
665         (WebCore::modifiersForGdkKeyEvent):
666         (WebCore::PlatformKeyboardEvent::modifiersContainCapsLock):
667         * platform/gtk/PlatformMouseEventGtk.cpp:
668         (WebCore::PlatformMouseEvent::PlatformMouseEvent):
669         * platform/gtk/PlatformWheelEventGtk.cpp:
670         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
671
672 2017-02-11  Sam Weinig  <sam@webkit.org>
673
674         Remove custom bindings for XSLTProcessor.idl
675         https://bugs.webkit.org/show_bug.cgi?id=168174
676
677         Reviewed by Andreas Kling.
678
679         * CMakeLists.txt:
680         * WebCore.xcodeproj/project.pbxproj:
681         * bindings/js/JSBindingsAllInOne.cpp:
682         * bindings/js/JSXSLTProcessorCustom.cpp: Removed.
683         Remove file.
684  
685         * bindings/js/JSDOMBinding.cpp:
686         (WebCore::jsStringOrUndefined): Deleted.
687         * bindings/js/JSDOMBinding.h:
688         Remove now unused jsStringOrUndefined.
689
690         * xml/XSLTProcessor.cpp:
691         (WebCore::XSLTProcessor::setParameter):
692         (WebCore::XSLTProcessor::getParameter):
693         (WebCore::XSLTProcessor::removeParameter):
694         * xml/XSLTProcessor.idl:
695         Replace custom bindings bindings with early returns. One subtle difference
696         between the custom bindings and this, is that getParameter will return 
697         jsNull() rather than jsUndefined() for null String returns. This matches
698         all other bindings.
699
700 2017-02-11  Olivier Blin  <olivier.blin@softathome.com>
701
702         [GStreamer][MSE][EME] Fix decryptor assignment
703         https://bugs.webkit.org/show_bug.cgi?id=168122
704
705         Reviewed by Michael Catanzaro.
706
707         The new decryptor is a floating reference so we should not use the
708         adopt GRefPtr constructor, but use the regular assignment operator
709         that will sink the object (clear the floating flag).
710
711         This fixes assertions in debug build.
712
713         See previous pipeline fix in r210851 and WPE commit
714         06020b18831e1c0eead34e2c1a5a4b7d026c227d.
715
716         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
717         (WebCore::AppendPipeline::parseDemuxerSrcPadCaps):
718         Do not use adoptGRef(), it prevented the object from being sunk.
719
720 2017-02-11  Simon Fraser  <simon.fraser@apple.com>
721
722         Avoid a redundant scroll to 0,0 when navigating back to a url with no fragment
723         https://bugs.webkit.org/show_bug.cgi?id=168177
724
725         Reviewed by Sam Weinig.
726
727         FrameView::scrollToFragment() is called from FrameLoader::scrollToFragmentWithParentBoundary()
728         when navigating within the page. If the URL had no fragment identifier, this code would
729         call into FrameView::scrollToAnchor() with an empty name, where maintainScrollPositionAtAnchor()
730         used the document as the anchor, thus scrolling to 0,0. Later, history().restoreScrollPositionAndViewState()
731         the restores the scroll position from history.
732         
733         This scroll to 0,0 happened to be not visible to the page because of scroll event
734         coalescing, but it makes implementation of history.scrollRestoration harder, so avoid it
735         by just returning early from FrameView::scrollToFragment() if there is no fragment,
736         making sure to clear the document's CSSTarget.
737
738         * dom/Document.cpp:
739         (WebCore::Document::setCSSTarget):
740         * page/FrameView.cpp:
741         (WebCore::FrameView::scrollToFragment):
742         (WebCore::FrameView::scrollToAnchor):
743
744 2017-02-11  Chris Dumez  <cdumez@apple.com>
745
746         Implement URL's toJSON()
747         https://bugs.webkit.org/show_bug.cgi?id=167979
748
749         Reviewed by Sam Weinig.
750
751         Implement URL's toJSON() as per:
752         - https://url.spec.whatwg.org/#dom-url-tojson
753
754         This is already supported by Firefox.
755
756         Also, drop URLUtils.idl as it is no longer in the specification.
757         Merge its content to DOMURL.idl as per the URL specification.
758
759         Finally, mark href attribute as stringifier and drop the toString()
760         operation to match the specification. This fixes a bug where our
761         toString property was not enumerable but should have been.
762
763         Tests: fast/url/url-tojson.html
764                imported/w3c/web-platform-tests/url/url-tojson.html
765
766         * CMakeLists.txt:
767         * DerivedSources.make:
768         * WebCore.xcodeproj/project.pbxproj:
769         * html/DOMURL.idl:
770         * html/URLUtils.h:
771         (WebCore::URLUtils<T>::toJSON):
772         * html/URLUtils.idl: Removed.
773
774 2017-02-11  Carlos Garcia Campos  <cgarcia@igalia.com>
775
776         [GTK][EFL] Implement MIMETypeRegistry::getPreferredExtensionForMIMEType
777         https://bugs.webkit.org/show_bug.cgi?id=168163
778
779         Reviewed by Michael Catanzaro.
780
781         It's missing causing several HTML anchor download tests to fail because the suggested filename missed the
782         extension. This patch moves MIMETypeRegistry::appendFileExtensionIfNecessary() from the cocoa specific file to the
783         common file because it's not actually platform specific. MIMETypeRegistry::getPreferredExtensionForMIMEType() is
784         what platforms should implement.
785
786         Fixes: fast/dom/HTMLAnchorElement/anchor-download-user-triggered-synthetic-click.html
787                fast/dom/HTMLAnchorElement/anchor-download.html
788                fast/dom/HTMLAnchorElement/anchor-file-blob-download-no-extension.html
789                fast/dom/HTMLAnchorElement/anchor-nodownload-set.html
790
791         * platform/MIMETypeRegistry.cpp:
792         (WebCore::MIMETypeRegistry::appendFileExtensionIfNecessary):
793         * platform/cocoa/MIMETypeRegistryCocoa.mm:
794         (WebCore::MIMETypeRegistry::appendFileExtensionIfNecessary): Deleted.
795         * platform/efl/MIMETypeRegistryEfl.cpp:
796         (WebCore::MIMETypeRegistry::getPreferredExtensionForMIMEType):
797         * platform/gtk/MIMETypeRegistryGtk.cpp:
798         (WebCore::MIMETypeRegistry::getPreferredExtensionForMIMEType):
799
800 2017-02-11  Carlos Garcia Campos  <cgarcia@igalia.com>
801
802         Unreviewed. Update imageTitle translatable string.
803
804         To match mac port. Fixes fast/images/imageDocument-title.html.
805
806         * platform/gtk/LocalizedStringsGtk.cpp:
807         (WebCore::imageTitle):
808
809 2017-02-10  John Wilander  <wilander@apple.com>
810
811         Updates to Resource Load Statistics: Get the right website data store and introduce timeout for user interaction
812         https://bugs.webkit.org/show_bug.cgi?id=167474
813         <rdar://problem/24681808>
814         <rdar://problem/24703286>
815         <rdar://problem/30290270>
816
817         This patch does the following:
818         1. Gets the right website data store. API::WebsiteDataStore::defaultDataStore()
819             does not provide the right data store.
820         2. Introduces timeout for user interaction. A domain needs interaction every 30
821             days to stay in that category.
822         3. Adds grandfathered to the statistics model in preparation for grandfathering of
823             existing data records.
824         4. Adds test infrastructure to allow testing of the various rules in place for
825             data records removal.
826         5. Fixes various smaller bugs that were found as part of setting up the tests.
827         6. Regresses the data records removal counting. We need to come up with a thread
828             safe way of gathering removal statistics from more than one data store now
829             that we potentially interact with multiple stores.
830         7. Adds a first set of layout tests for resource load statistics.
831
832         Reviewed by Andy Estes.
833
834         Tests: http/tests/loading/resourceLoadStatistics/non-prevalent-resource-with-user-interaction.html
835                http/tests/loading/resourceLoadStatistics/non-prevalent-resource-without-user-interaction.html
836                http/tests/loading/resourceLoadStatistics/prevalent-resource-with-user-interaction-timeout.html
837                http/tests/loading/resourceLoadStatistics/prevalent-resource-with-user-interaction.html
838                http/tests/loading/resourceLoadStatistics/prevalent-resource-without-user-interaction.html
839
840         * dom/Document.cpp:
841         (WebCore::Document::updateLastHandledUserGestureTimestamp):
842             This now calls ResourceLoadObserver::logUserInteraction() every time since
843             we want to keep track of the most recent user interaction.
844         * loader/ResourceLoadObserver.cpp:
845         (WebCore::ResourceLoadObserver::statisticsStore):
846             New getter used by WebResourceLoadStatisticsManager::resetToConsistentState().
847         (WebCore::reduceTimeResolutionToOneDay):
848             Convenience function.
849         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
850             Reduces time resolution for privacy reasons.
851         (WebCore::ResourceLoadObserver::logUserInteraction):
852         (WebCore::ResourceLoadObserver::clearUserInteraction):
853         (WebCore::ResourceLoadObserver::hasHadUserInteraction):
854         (WebCore::ResourceLoadObserver::setPrevalentResource):
855         (WebCore::ResourceLoadObserver::isPrevalentResource):
856         (WebCore::ResourceLoadObserver::clearPrevalentResource):
857         (WebCore::ResourceLoadObserver::setTimeToLiveUserInteraction):
858         (WebCore::ResourceLoadObserver::fireDataModificationHandler):
859             New functions that allow WebKitTestRunner to stage exact
860             statistics, fire the handler, and test the outcome.
861         * loader/ResourceLoadObserver.h:
862         * loader/ResourceLoadStatistics.cpp:
863         (WebCore::ResourceLoadStatistics::encode):
864         (WebCore::ResourceLoadStatistics::decode):
865         (WebCore::ResourceLoadStatistics::toString):
866         (WebCore::ResourceLoadStatistics::merge):
867             Support for statistics mostRecentUserInteraction, grandfathered, and
868             dataRecordsRemoved.
869         * loader/ResourceLoadStatistics.h:
870         * loader/ResourceLoadStatisticsStore.cpp:
871         (WebCore::ResourceLoadStatisticsStore::setTimeToLiveUserInteraction):
872             New function that allows WebKitTestRunner to test 
873             aging out of user interaction.
874         (WebCore::ResourceLoadStatisticsStore::hasHadRecentUserInteraction):
875             Now takes into account the timestamp and ages
876             out user interaction.
877         (WebCore::ResourceLoadStatisticsStore::prevalentResourceDomainsWithoutUserInteraction):
878             Now makes use of ResourceLoadStatisticsStore::hasHadRecentUserInteraction().
879         * loader/ResourceLoadStatisticsStore.h:
880
881 2017-02-10  Sam Weinig  <sam@webkit.org>
882
883         [WebIDL] Cleanup XMLHttpRequest's bindings
884         https://bugs.webkit.org/show_bug.cgi?id=168067
885
886         Reviewed by Chris Dumez.
887
888         * bindings/js/JSDOMBinding.cpp:
889         (WebCore::jsOwnedStringOrNull): Deleted.
890         * bindings/js/JSDOMBinding.h:
891         Remove jsOwnedStringOrNull and inline it into it's one use
892         in JSXMLHttpRequestCustom.
893
894         * bindings/js/JSXMLHttpRequestCustom.cpp:
895         (WebCore::JSXMLHttpRequest::responseText):
896         (WebCore::SendFunctor::SendFunctor): Deleted.
897         (WebCore::SendFunctor::line): Deleted.
898         (WebCore::SendFunctor::column): Deleted.
899         (WebCore::SendFunctor::url): Deleted.
900         (WebCore::SendFunctor::operator()): Deleted.
901         (WebCore::JSXMLHttpRequest::send): Deleted.
902         * xml/XMLHttpRequest.cpp:
903         (WebCore::XMLHttpRequest::send):
904         * xml/XMLHttpRequest.h:
905         Remove custom send, replacing it with a single send implementation that
906         takes a variant.
907
908         * xml/XMLHttpRequest.idl:
909         Cleanup the IDL to better match the spec. Update correct types where trivial.
910
911 2017-02-10  Chris Dumez  <cdumez@apple.com>
912
913         document.origin doesn't match spec
914         https://bugs.webkit.org/show_bug.cgi?id=168022
915
916         Reviewed by Sam Weinig.
917
918         Update document.origin to return the origin in the expected format:
919         - https://dom.spec.whatwg.org/#dom-document-origin
920
921         Change: "https_webkit.org_0 -> "https://webkit.org".
922
923         The new behavior matches Firefox and Chrome.
924
925         No new tests, updated existing tests.
926
927         * dom/Document.cpp:
928         (WebCore::Document::origin):
929
930 2017-02-10  Daniel Bates  <dabates@apple.com>
931
932         Attempt to fix the build following <https://trac.webkit.org/changeset/212173>
933         (https://bugs.webkit.org/show_bug.cgi?id=166774)
934
935         * dom/Document.cpp:
936         (WebCore::Document::detachFromCachedFrame): Use ASSER_UNUSED() instead of ASSERT() since
937         the parameter cachedFrame is unused in non-debug build.
938
939 2017-02-10  Daniel Bates  <dabates@apple.com>
940
941         Detach frame from document when entering page cache
942         https://bugs.webkit.org/show_bug.cgi?id=166774
943         <rdar://problem/29904368>
944
945         Reviewed by Chris Dumez.
946
947         When a page enters the page cache it is unnecessary for it to hold a reference to its
948         associated frame because subsequent interactions with the page do not need to make use
949         of it. Once a page exits the page cache we associate it with its frame.
950
951         * dom/Document.cpp:
952         (WebCore::Document::frameDestroyed): Update comment to reflect the renaming of disconnectFromFrame().
953         (WebCore::Document::attachToCachedFrame): Added.
954         (WebCore::Document::detachFromCachedFrame): Added.
955         (WebCore::Document::prepareForDestruction): Only call CSSAnimationController::detachFromDocument() if
956         we have a frame. Substitute detachFromFrame() for disconnectFromFrame() as the latter was renamed to
957         the former.
958         (WebCore::Document::hasEverCalledWindowOpen): Deleted.
959         (WebCore::Document::markHasCalledWindowOpen): Deleted.
960         (WebCore::Document::disconnectFromFrame): Renamed to detachFromFrame.
961         * dom/Document.h:
962         (WebCore::Document::detachFromFrame): Renamed; formerly named disconnectFromFrame(). Changed
963         visibility from public to private and made this function inline.
964         * history/CachedFrame.cpp:
965         (WebCore::CachedFrameBase::pruneDetachedChildFrames): Remove cached child frames that were
966         removed from the page when it was in the page cache as there is no need to restore such frames.
967         (WebCore::CachedFrameBase::restore): Call pruneDetachedChildFrames() before restoring the
968         frame tree.
969         (WebCore::CachedFrame::CachedFrame): Detach from the frame.
970         (WebCore::CachedFrame::open): Assert that we have a document and re-attach the frame.
971         (WebCore::CachedFrame::destroy): Update assertion as this function should only be called for a
972         frameless document. Only detach the FrameView, DocumentLoader, and Page when the cached frame is for
973         subframe and is associated with a Page object. Call CSSAnimationController::detachFromDocument() to
974         detach the animation controller from the document as it is being destroyed. We have to do this here
975         because the document does not have a frame. And Document::prepareForDestruction() only calls
976         CSSAnimationController::detachFromDocument() if the document has a frame.
977         * history/CachedFrame.h:
978         * history/PageCache.cpp:
979         (WebCore::canCachePage): Remove logic that prevents caching of a page that called window.open()
980         or has an opener as it is feasible to keep such pages in the page cache.
981         * html/HTMLFrameElementBase.cpp:
982         (WebCore::HTMLFrameElementBase::finishedInsertingSubtree): Fix style nit.
983         * loader/FrameLoader.cpp:
984         (WebCore::FrameLoader::frameDetached): Only stop all loaders and stop active DOM objects if the
985         page is not in- or about to enter- the page cache. A page in the page cache has finished loading
986         and its active DOM objects are suspended. Also fix style nit in comment.
987         (WebCore::FrameLoader::detachFromParent): Only stop all loaders if the page is not in- or about to
988         enter- the page cache. A page in the page cache has finished loading. Also added a comment to explain
989         that we protect the frame because stopAllLoaders() can cause the frame to be deallocated.
990         * page/DOMWindow.cpp:
991         (WebCore::DOMWindow::createWindow): Remove logic to call markHasCalledWindowOpen() as this
992         function will be removed.
993         * page/DiagnosticLoggingKeys.cpp:
994         (WebCore::DiagnosticLoggingKeys::hasCalledWindowOpenKey): Deleted.
995         (WebCore::DiagnosticLoggingKeys::hasOpenerKey): Deleted.
996         * page/DiagnosticLoggingKeys.h:
997         * page/Page.cpp:
998         (WebCore::Page::openedByWindowOpen): Deleted.
999         * page/Page.h:
1000         * page/Settings.in: Remove setting allowsPageCacheWithWindowOpener.
1001
1002 2017-02-10  Simon Fraser  <simon.fraser@apple.com>
1003
1004         REGRESSION (r211845): [ios-simulator] LayoutTest compositing/masks/solid-color-masked.html is a flaky failure
1005         https://bugs.webkit.org/show_bug.cgi?id=168054
1006
1007         Reviewed by Tim Horton.
1008
1009         When adding mask layers, there was an ordering dependency. There was a hack in GraphicsLayerCA::setVisibleAndCoverageRects()
1010         to propagate m_intersectsCoverageRect to masks. However, if GraphicsLayerCA::setVisibleAndCoverageRects()
1011         ran on the masked layer before the mask was added, nothing updated the "m_intersectsCoverageRect" state of the mask layer.
1012
1013         Fix by explicitly calling setVisibleAndCoverageRects() on the mask layer, passing the same rects and
1014         viewport-constrained state as for its host layer (we already assume that their geometry matches).
1015
1016         Tested by compositing/masks/solid-color-masked.html
1017
1018         * platform/graphics/ca/GraphicsLayerCA.cpp:
1019         (WebCore::GraphicsLayerCA::setVisibleAndCoverageRects):
1020         (WebCore::GraphicsLayerCA::recursiveCommitChanges):
1021
1022 2017-02-10  Commit Queue  <commit-queue@webkit.org>
1023
1024         Unreviewed, rolling out r212154, r212154, and r212156.
1025         https://bugs.webkit.org/show_bug.cgi?id=168156
1026
1027         broke internal builds (Requested by smfr on #webkit).
1028
1029         Reverted changesets:
1030
1031         "Add a DragImage class that wraps a DragImageRef"
1032         https://bugs.webkit.org/show_bug.cgi?id=168131
1033         http://trac.webkit.org/changeset/212154
1034
1035         "Add a DragImage class that wraps a DragImageRef"
1036         https://bugs.webkit.org/show_bug.cgi?id=168131
1037         http://trac.webkit.org/changeset/212154
1038
1039         "Try to fix the iOS and Windows builds."
1040         http://trac.webkit.org/changeset/212156
1041
1042 2017-02-10  Csaba Osztrogonác  <ossy@webkit.org>
1043
1044         Fix the !ENABLE(WEBGL) build
1045         https://bugs.webkit.org/show_bug.cgi?id=168112
1046
1047         Reviewed by Alex Christensen.
1048
1049         * html/canvas/WebGLRenderingContextBase.h:
1050
1051 2017-02-10  Youenn Fablet  <youenn@apple.com>
1052
1053         [Fetch API] fetch fails when undefined is passed as headers
1054         https://bugs.webkit.org/show_bug.cgi?id=168043
1055
1056         Reviewed by Geoffrey Garen.
1057
1058         Covered by updated test.
1059
1060         * Modules/fetch/FetchInternals.js:
1061         (fillFetchHeaders): Exit early in case of undefined headers, since it is an optional parameter.
1062
1063 2017-02-10  Csaba Osztrogonác  <ossy@webkit.org>
1064
1065         Fix the !ENABLE(WEB_TIMING) build
1066         https://bugs.webkit.org/show_bug.cgi?id=168113
1067
1068         Reviewed by Alex Christensen.
1069
1070         * workers/WorkerGlobalScope.cpp:
1071         (WebCore::WorkerGlobalScope::WorkerGlobalScope):
1072
1073 2017-02-10  Joseph Pecoraro  <pecoraro@apple.com>
1074
1075         Update features.json for Performance Timing APIs
1076         https://bugs.webkit.org/show_bug.cgi?id=168148
1077
1078         Reviewed by Simon Fraser.
1079
1080         * features.json:
1081
1082 2017-02-10  Anders Carlsson  <andersca@apple.com>
1083
1084         Try to fix the iOS and Windows builds.
1085
1086         * platform/ios/DragImageIOS.mm:
1087         (WebCore::deleteDragImage):
1088         * platform/win/PasteboardWin.cpp:
1089         (WebCore::Pasteboard::setDragImage):
1090
1091 2017-02-10  Anders Carlsson  <andersca@apple.com>
1092
1093         Add a DragImage class that wraps a DragImageRef
1094         https://bugs.webkit.org/show_bug.cgi?id=168131
1095
1096         Reviewed by Beth Dakin.
1097
1098         This allows us to get rid of the explicit deleteDragImage calls and will make additional cleanup of the
1099         various drag code paths possible. No functionality change.
1100
1101         * dom/DataTransfer.cpp:
1102         (WebCore::DataTransfer::updateDragImage):
1103         * page/DragController.cpp:
1104         (WebCore::DragController::startDrag):
1105         (WebCore::DragController::doImageDrag):
1106         (WebCore::DragController::doSystemDrag):
1107         * page/DragController.h:
1108         * platform/DragImage.cpp:
1109         (WebCore::DragImage::DragImage):
1110         (WebCore::DragImage::operator=):
1111         (WebCore::DragImage::~DragImage):
1112         * platform/DragImage.h:
1113         * platform/Pasteboard.h:
1114         * platform/StaticPasteboard.h:
1115         * platform/mac/PasteboardMac.mm:
1116         (WebCore::Pasteboard::setDragImage):
1117
1118 2017-02-10  Simon Fraser  <simon.fraser@apple.com>
1119
1120         Make sure the "inwindow" flag propagates to TiledBackings for masks and reflections
1121         https://bugs.webkit.org/show_bug.cgi?id=168127
1122         rdar://problem/30467120
1123
1124         Reviewed by Tim Horton.
1125         
1126         Replace the special-case, but wrong, GraphicsLayer traversal in setIsInWindowIncludingDescendants()
1127         which forgot to hit masks and replica layers with a generic traverse() function, which
1128         is then used for setting 'inWindow' as well as resetting tracked repaints.
1129
1130         Tests: compositing/tiling/tiled-mask-inwindow.html
1131                compositing/tiling/tiled-reflection-inwindow.html
1132
1133         * page/PageOverlayController.cpp:
1134         (WebCore::PageOverlayController::layerWithDocumentOverlays):
1135         (WebCore::PageOverlayController::layerWithViewOverlays):
1136         * platform/graphics/GraphicsLayer.cpp:
1137         (WebCore::GraphicsLayer::setIsInWindow):
1138         (WebCore::GraphicsLayer::setReplicatedByLayer):
1139         (WebCore::GraphicsLayer::traverse):
1140         (WebCore::GraphicsLayer::setIsInWindowIncludingDescendants): Deleted.
1141         * platform/graphics/GraphicsLayer.h:
1142         * rendering/RenderLayerCompositor.cpp:
1143         (WebCore::RenderLayerCompositor::setIsInWindow):
1144         (WebCore::RenderLayerCompositor::resetTrackedRepaintRects):
1145         (WebCore::resetTrackedRepaintRectsRecursive): Deleted.
1146
1147 2017-02-09  Simon Fraser  <simon.fraser@apple.com>
1148
1149         Tiled layers are sometimes left with some tiles when outside the viewport
1150         https://bugs.webkit.org/show_bug.cgi?id=168104
1151         rdar://problem/30459055
1152
1153         Reviewed by Tim Horton.
1154
1155         When the coverage rect of a TiledBacking goes from a non-empty rect to an empty rect, we
1156         shouldn't just early return from TileGrid::revalidateTiles(), otherwise we are left with some
1157         tiles. Run through the function as normal, which will remove all the tiles for an empty coverage rect.
1158         
1159         Minor logging changes.
1160
1161         Test: tiled-drawing/tile-coverage-iframe-to-zero-coverage.html
1162
1163         * platform/graphics/ca/TileGrid.cpp:
1164         (WebCore::TileGrid::revalidateTiles):
1165
1166 2017-02-10  Zalan Bujtas  <zalan@apple.com>
1167
1168         Mail hangs when removing multiple rows from large table.
1169         https://bugs.webkit.org/show_bug.cgi?id=168103
1170         <rdar://problem/30090186>
1171
1172         Reviewed by Ryosuke Niwa.
1173
1174         DeleteSelectionCommand::removeNode doesn't actually destroy table structure items,
1175         but instead it removes their content. In order to be able to continue editing the table after
1176         the delete, we need to ensure that its cells' width and height are > 0. Currently we issue layout on
1177         each table item recursively.
1178         This patch delays the layout until after we've finished with the entire subtree delete (10x progression).
1179
1180         Performance test added.
1181
1182         * editing/DeleteSelectionCommand.cpp:
1183         (WebCore::DeleteSelectionCommand::insertBlockPlaceholderForTableCellIfNeeded):
1184         (WebCore::DeleteSelectionCommand::removeNodeUpdatingStates):
1185         (WebCore::shouldRemoveContentOnly):
1186         (WebCore::DeleteSelectionCommand::removeNode):
1187         * editing/DeleteSelectionCommand.h:
1188
1189 2017-02-10  Joseph Pecoraro  <pecoraro@apple.com>
1190
1191         [Resource Timing] Enable Resource Timing by default in Tests
1192         https://bugs.webkit.org/show_bug.cgi?id=168145
1193
1194         Reviewed by Ryosuke Niwa.
1195
1196         * loader/ResourceTimingInformation.cpp:
1197         (WebCore::ResourceTimingInformation::addResourceTiming):
1198         * testing/InternalSettings.cpp:
1199         (WebCore::InternalSettings::Backup::Backup):
1200         (WebCore::InternalSettings::Backup::restoreTo):
1201         (WebCore::InternalSettings::setResourceTimingEnabled): Deleted.
1202         * testing/InternalSettings.h:
1203         * testing/InternalSettings.idl:
1204         No longer needed for tests.
1205
1206 2017-02-10  Dan Bernstein  <mitz@apple.com>
1207
1208         [Cocoa] Add shouldChangeSelectedRange to WKWebProcessPlugInEditingDelegate
1209         https://bugs.webkit.org/show_bug.cgi?id=168097
1210
1211         Reviewed by Tim Horton.
1212
1213         Added a userTriggered argument to FrameSelection::setSelectedRange so that WebKit2 can
1214         indicate that changes should be agreed to by the delegate.
1215
1216         * editing/FrameSelection.cpp:
1217         (WebCore::FrameSelection::setSelectedRange): If the change is user-triggered, check with
1218           shouldChangeSelection.
1219         * editing/FrameSelection.h:
1220
1221 2017-02-10  Jonathan Bedard  <jbedard@apple.com>
1222
1223         Removing LayoutTestRelay
1224         https://bugs.webkit.org/show_bug.cgi?id=165927
1225
1226         Reviewed by Daniel Bates.
1227         Part 2
1228
1229         LayoutTestRelay uses SPI, since recent versions of the iOS SDK allow for installing apps on
1230         simulators through simctl (iOS 10 and later), use this functionality instead.
1231
1232         * platform/RuntimeApplicationChecks.mm:
1233         (WebCore::IOSApplication::isDumpRenderTree): Update comment to reflect removal of LayoutTestRelay.
1234
1235 2017-02-10  Youenn Fablet  <youenn@apple.com>
1236
1237         [WebRTC] Implement Outgoing libwebrtc audio source support
1238         https://bugs.webkit.org/show_bug.cgi?id=168118
1239
1240         Reviewed by Eric Carlson.
1241
1242         No new automated tests as we need the audio rendering to work to test the whole loop.
1243
1244         Using an AudioSampleDataSource to convert the captured data to libwebrtc expected format.
1245         Capturing and pushing data happens in the capture thread.
1246         Pulling of converted data happens in libwebrtc thread.
1247
1248         Introducing LibWebRTCAudioFormat.h to centralize libwbebrtc expected audio format.
1249
1250         * WebCore.xcodeproj/project.pbxproj:
1251         * platform/audio/WebAudioBufferList.cpp:
1252         (WebCore::WebAudioBufferList::WebAudioBufferList): Missing initialization leads to assertion failure.
1253         * platform/audio/mac/AudioSampleBufferList.cpp:
1254         (WebCore::AudioSampleBufferList::copyFrom): In case of interleaved channels, there is one buffer but two channels.
1255         * platform/audio/mac/AudioSampleDataSource.cpp:
1256         (WebCore::AudioSampleDataSource::pushSamples):
1257         (WebCore::AudioSampleDataSource::pullAvalaibleSamplesAsChunks):
1258         * platform/audio/mac/AudioSampleDataSource.h:
1259         * platform/mediastream/libwebrtc/LibWebRTCAudioFormat.h: Added.
1260         * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
1261         (WebCore::libwebrtcAudioFormat):
1262         (WebCore::RealtimeOutgoingAudioSource::RealtimeOutgoingAudioSource):
1263         (WebCore::RealtimeOutgoingAudioSource::sourceMutedChanged):
1264         (WebCore::RealtimeOutgoingAudioSource::audioSamplesAvailable):
1265         (WebCore::RealtimeOutgoingAudioSource::pullAudioData):
1266         * platform/mediastream/mac/RealtimeOutgoingAudioSource.h:
1267
1268 2017-02-10  Ryosuke Niwa  <rniwa@webkit.org>
1269
1270         HTMLConstructionSiteTask::Insert should never be called on a node with a parent
1271         https://bugs.webkit.org/show_bug.cgi?id=168099
1272
1273         Reviewed by Sam Weinig.
1274
1275         insertAlreadyParsedChild always use HTMLConstructionSiteTask::InsertAlreadyParsedChild instead
1276         of using HTMLConstructionSiteTask::Insert when fostering a child.
1277
1278         Also combine the step to take all children and re-parenting into a single task instead of
1279         separately issuing TakeAllChildren and Reparent tasks.
1280
1281         No new tests since this is a refactoring.
1282
1283         * html/parser/HTMLConstructionSite.cpp:
1284         (WebCore::insert): Now asserts that the child node never have a parent.
1285         (WebCore::executeInsertAlreadyParsedChildTask): Moved the code to remove the parent here.
1286         (WebCore::executeTakeAllChildrenAndReparentTask): Renamed from executeTakeAllChildrenTask
1287         now that this function also does the reparenting.
1288         (WebCore::executeTask):
1289         (WebCore::HTMLConstructionSite::reparent): Removed the variant only used with takeAllChildren.
1290         (WebCore::HTMLConstructionSite::insertAlreadyParsedChild): Always use InsertAlreadyParsedChild
1291         instead of calling fosterParent which uses Insert when fostering parents.
1292         (WebCore::HTMLConstructionSite::takeAllChildrenAndReparent): Renamed from takeAllChildren.
1293         * html/parser/HTMLConstructionSite.h:
1294         (WebCore::HTMLConstructionSiteTask:Operation):
1295         * html/parser/HTMLTreeBuilder.cpp:
1296         (WebCore::HTMLTreeBuilder::callTheAdoptionAgency):
1297
1298 2017-02-10  Dave Hyatt  <hyatt@apple.com>
1299
1300         [CSS Parser] Make intercap property values serialize correctly
1301         https://bugs.webkit.org/show_bug.cgi?id=168073
1302
1303         Reviewed by Zalan Bujtas.
1304
1305         Fix CSS value keywords to preserve case when the value contains capital
1306         letters. Examples include optimizeSpeed, translateX, scaleY, etc.
1307
1308         * css/CSSPrimitiveValueMappings.h:
1309         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
1310         (WebCore::CSSPrimitiveValue::operator EPointerEvents):
1311         (WebCore::CSSPrimitiveValue::operator TextRenderingMode):
1312         (WebCore::CSSPrimitiveValue::operator EImageRendering):
1313         (WebCore::CSSPrimitiveValue::operator EColorInterpolation):
1314         (WebCore::CSSPrimitiveValue::operator EColorRendering):
1315         (WebCore::CSSPrimitiveValue::operator EShapeRendering):
1316         * css/MediaQueryEvaluator.cpp:
1317         (WebCore::colorGamutEvaluate):
1318         * css/SVGCSSValueKeywords.in:
1319         * css/TransformFunctions.cpp:
1320         (WebCore::transformOperationType):
1321         (WebCore::transformsForValue):
1322         * css/makevalues.pl:
1323         * css/parser/CSSParserFastPaths.cpp:
1324         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
1325         (WebCore::parseTransformTranslateArguments):
1326         (WebCore::parseSimpleTransformValue):
1327         * css/parser/CSSPropertyParser.cpp:
1328         (WebCore::consumeTransformValue):
1329         * css/parser/CSSPropertyParserHelpers.cpp:
1330         (WebCore::CSSPropertyParserHelpers::parseColorFunctionParameters):
1331
1332 2017-02-10  Zan Dobersek  <zdobersek@igalia.com>
1333
1334         [EME] Implement MediaKeySession::load()
1335         https://bugs.webkit.org/show_bug.cgi?id=168041
1336
1337         Reviewed by Xabier Rodriguez-Calvar.
1338
1339         Implement the MediaKeySession::load() method, tracing the steps as they
1340         are defined in the EME specification. The only exception is step 8.3,
1341         which requires additional facility that tracks currently open sessions
1342         and provides information whether for a given session ID there's already
1343         a MediaKeySession that's not yet been closed.
1344
1345         Session ID sanitization is done through the CDM::sanitizeSessionId()
1346         method, which relays the task to the CDMPrivate implementation.
1347
1348         The CDMInstance::loadSession() virtual method is called with the session
1349         type, sanitized ID, the Document's origin (in string form) and the
1350         callback that's invoked upon completion of the task. The callback
1351         checks whether the operation was successful, or examines the reason for
1352         the load failure in case it wasn't, rejecting the promise in the latter
1353         case either immediately or in the following task at the latest.
1354
1355         When the load was successful, the optional known keys, expiration time
1356         and message are handled appropriately, and the promise is resolved.
1357
1358         MockCDM::sanitizeSessionId() implementation only treats
1359         'valid-loaded-session' as a valid session ID.
1360         MockCDMInstance::loadSession() implementation is kept slim for now, only
1361         providing the 'license-renewal' message when invoking the passed-in
1362         callback. Known keys and expiration time will also be tested once the
1363         relevant MediaKeySession algorithms are implemented.
1364
1365         Test: media/encrypted-media/mock-MediaKeySession-load.html
1366
1367         * Modules/encryptedmedia/CDM.cpp:
1368         (WebCore::CDM::sanitizeSessionId):
1369         * Modules/encryptedmedia/CDM.h:
1370         * Modules/encryptedmedia/CDMInstance.h:
1371         * Modules/encryptedmedia/CDMPrivate.h:
1372         * Modules/encryptedmedia/MediaKeySession.cpp:
1373         (WebCore::MediaKeySession::load):
1374         * testing/MockCDMFactory.cpp:
1375         (WebCore::MockCDM::sanitizeSessionId):
1376         (WebCore::MockCDMInstance::loadSession):
1377         * testing/MockCDMFactory.h:
1378
1379 2017-02-10  Zan Dobersek  <zdobersek@igalia.com>
1380
1381         [EME] Implement MediaKeySession::sessionClosed()
1382         https://bugs.webkit.org/show_bug.cgi?id=168039
1383
1384         Reviewed by Xabier Rodriguez-Calvar.
1385
1386         Implement the 'session closed' algorithm for MediaKeySession by
1387         following the specified steps. After this algorithm is run, the
1388         session should be considered closed, which we track via the m_closed
1389         member variable on the class. This is set to true before the promise
1390         that's accessible through the 'closed' attribute is resolved.
1391
1392         Because the algorithm requires the CDM instance to store any record
1393         of key usage when the session's type is 'persistent-usage-record', the
1394         storeRecordOfKeyUsage() virtual method is added to the CDMInstance
1395         interface. MockCDMInstance implementation is left unimplemented for now.
1396
1397         JSMediaKeySession::closed() accessor now has a custom implementation
1398         that creates a deferred promise for that object if there's none yet, and
1399         shares it with the wrapped class through the registerClosedPromise()
1400         method, storing a reference to the promise in the m_closedPromise
1401         member variable, or resolving the promise immediately if the session was
1402         already closed.
1403
1404         Test cases added to media/encrypted-media/mock-MediaKeySession-close.html.
1405
1406         * Modules/encryptedmedia/CDMInstance.h:
1407         * Modules/encryptedmedia/MediaKeySession.cpp:
1408         (WebCore::MediaKeySession::registerClosedPromise):
1409         (WebCore::MediaKeySession::sessionClosed):
1410         * Modules/encryptedmedia/MediaKeySession.h:
1411         * bindings/js/JSMediaKeySessionCustom.cpp:
1412         (WebCore::JSMediaKeySession::closed):
1413         * testing/MockCDMFactory.cpp:
1414         (WebCore::MockCDMInstance::storeRecordOfKeyUsage):
1415         * testing/MockCDMFactory.h:
1416
1417 2017-02-10  Zan Dobersek  <zdobersek@igalia.com>
1418
1419         [EME] Implement MediaKeySession::updateKeyStatuses(), MediaKeyStatusMap
1420         https://bugs.webkit.org/show_bug.cgi?id=167888
1421
1422         Reviewed by Xabier Rodriguez-Calvar.
1423
1424         Implement MediaKeySession::updateKeyStatuses(), transforming the passed-in
1425         KeyStatusVector into a Vector mapping the key IDs to MediaKeyStatus values.
1426         A keystatuseschange event is fired on the MediaKeySession object afterwards.
1427         The queueing of the task that runs the 'attemp to resume playback' on the
1428         related HTMLMediaElement objects isn't done yet since that algorithm isn't
1429         implemented yet.
1430
1431         The statuses Vector is stored on the MediaKeySession object. That Vector is
1432         then exposed through the MediaKeyStatusMap object, each such object being
1433         unique to one MediaKeySession object. The implementation of MediaKeyStatusMap
1434         thus keeps a reference to the session object as long as that object is alive,
1435         and queries the MediaKeySession::statuses() getter to access the Vector that
1436         contains status information for all the key IDs.
1437
1438         MediaKeyStatusMap::Iterator object keeps a reference to the MediaKeyStatusMap
1439         object and accesses the statuses by indexing into the status Vector of the
1440         related MediaKeySession object.
1441
1442         CDMInstance::updateLicense() now accepts the session ID string as the first
1443         argument, making it possible to specify which session should be updated.
1444
1445         MockCDMFactory::keysForSessionWithID() returns an optional reference to the
1446         Vector value in the session map that lists all the key IDs that are being
1447         stored for that session.
1448
1449         MockCDMInstance::updateLicense() now detects the 'keys-changed' entry in the
1450         passed-in response data, and upon detecting that constructs a KeyStatusVector
1451         object containing all the keys for that session. KeyStatus::Usable is returned
1452         for each object at the moment, but this should be adjustable in the future
1453         through additional parameters passed through the response data. The Vector
1454         object is then passed to the callback and is then passed to the 'update key
1455         statuses' algorithm in MediaKeySession.
1456
1457         Covered by a test case in media/encrypted-media/mock-MediaKeySession-update.html.
1458
1459         * Modules/encryptedmedia/CDMInstance.h:
1460         * Modules/encryptedmedia/MediaKeySession.cpp:
1461         (WebCore::MediaKeySession::MediaKeySession):
1462         (WebCore::MediaKeySession::~MediaKeySession):
1463         (WebCore::MediaKeySession::update):
1464         (WebCore::MediaKeySession::updateKeyStatuses):
1465         * Modules/encryptedmedia/MediaKeySession.h:
1466         * Modules/encryptedmedia/MediaKeyStatusMap.cpp:
1467         (WebCore::MediaKeyStatusMap::MediaKeyStatusMap):
1468         (WebCore::MediaKeyStatusMap::detachSession):
1469         (WebCore::MediaKeyStatusMap::size):
1470         (WebCore::keyIdsMatch):
1471         (WebCore::MediaKeyStatusMap::has):
1472         (WebCore::MediaKeyStatusMap::get):
1473         (WebCore::MediaKeyStatusMap::Iterator::Iterator):
1474         (WebCore::MediaKeyStatusMap::Iterator::next):
1475         * Modules/encryptedmedia/MediaKeyStatusMap.h:
1476         (WebCore::MediaKeyStatusMap::create):
1477         * Modules/encryptedmedia/MediaKeyStatusMap.idl:
1478         * testing/MockCDMFactory.cpp:
1479         (WebCore::MockCDMFactory::keysForSessionWithID):
1480         (WebCore::MockCDMInstance::updateLicense):
1481         * testing/MockCDMFactory.h:
1482
1483 2017-02-09  Simon Fraser  <simon.fraser@apple.com>
1484
1485         Improve IOSurfacePool logging
1486         https://bugs.webkit.org/show_bug.cgi?id=168098
1487
1488         Reviewed by Tim Horton.
1489
1490         Pass a string to DUMP_POOL_STATISTICS so we can tell what's triggering the
1491         logging.
1492
1493         * platform/graphics/cg/IOSurfacePool.cpp:
1494         (WebCore::IOSurfacePool::takeSurface):
1495         (WebCore::IOSurfacePool::addSurface):
1496         (WebCore::IOSurfacePool::evict):
1497         (WebCore::IOSurfacePool::collectionTimerFired):
1498         (WebCore::IOSurfacePool::showPoolStatistics):
1499         * platform/graphics/cg/IOSurfacePool.h:
1500
1501 2017-02-09  Alex Christensen  <achristensen@webkit.org>
1502
1503         Unreviewed, rolling out r212040.
1504
1505         Broke build.  I'm not surprised
1506
1507         Reverted changeset:
1508
1509         "[WebRTC][Mac] Activate libwebrtc"
1510         https://bugs.webkit.org/show_bug.cgi?id=167293
1511         http://trac.webkit.org/changeset/212040
1512
1513 2017-02-09  Chris Dumez  <cdumez@apple.com>
1514
1515         [Mac][WK2] Use MIME type to add file extension to downloads' suggested filenames when missing
1516         https://bugs.webkit.org/show_bug.cgi?id=168077
1517         <rdar://problem/30412595>
1518
1519         Reviewed by Alex Christensen.
1520
1521         Add utility function to MIMETypeRegistry that appends an extension to
1522         a filename if necessary, based on a provided MIME type.
1523
1524         Tests: fast/dom/HTMLAnchorElement/anchor-file-blob-download-no-extension.html
1525                http/tests/download/anchor-download-no-extension.html
1526
1527         * platform/MIMETypeRegistry.cpp:
1528         (WebCore::MIMETypeRegistry::appendFileExtensionIfNecessary):
1529         * platform/MIMETypeRegistry.h:
1530         * platform/cocoa/MIMETypeRegistryCocoa.mm:
1531         (WebCore::MIMETypeRegistry::appendFileExtensionIfNecessary):
1532
1533 2017-02-09  Youenn Fablet  <youenn@apple.com>
1534
1535         [WebRTC][Mac] Activate libwebrtc
1536         https://bugs.webkit.org/show_bug.cgi?id=167293
1537
1538         Reviewed by Alex Christensen.
1539
1540         * Configurations/WebCore.xcconfig:
1541         * Configurations/WebCoreTestSupport.xcconfig:
1542
1543 2017-02-09  Philip Rogers  <pdr@google.com>
1544
1545         SVG clip-path references can clip out later content
1546         https://bugs.webkit.org/show_bug.cgi?id=164181
1547
1548         Reviewed by Said Abou-Hallawa.
1549
1550         RenderSVGResourceClipper can modify the GraphicsContext state (through the path-only
1551         clipping codepath) so we need to ensure RenderLayer::setupClipPath saves the context
1552         and its caller restores it back so later content is not clipped as well.
1553
1554         This patch is based on a chromium patch by fs@opera.com:
1555         https://chromium.googlesource.com/chromium/src/+/b3f7e7d2c4afb3c7e5c7eb438ff5933cbe2109b3
1556
1557         Test: css3/masking/clip-path-reference-restore.html
1558
1559         * rendering/RenderLayer.cpp:
1560         (WebCore::RenderLayer::setupClipPath): Add a GC save and return true to restore. Also switch to downcast instead of static_cast.
1561
1562 2017-02-09  Filip Pizlo  <fpizlo@apple.com>
1563
1564         SharedArrayBuffer does not need to be in the transfer list
1565         https://bugs.webkit.org/show_bug.cgi?id=168079
1566
1567         Reviewed by Geoffrey Garen and Keith Miller.
1568
1569         Tests: workers/sab/multi-memory-multi-buffer.html
1570                workers/sab/multi-memory.html
1571                workers/sab/no-transfer.html
1572                workers/sab/postMessage-clones.html
1573                workers/sab/sent-from-worker-no-transfer.html
1574                workers/sab/sent-from-worker-transfer.html
1575
1576         The SAB API that we originally implemented required that SABs get put in transfer lists
1577         when they are sent to workers.
1578         
1579         The new SAB API that everyone is converging towards requires that you do not put the
1580         SAB in the transfer list. That's supposed to be an error. Instead, anytime that a SAB
1581         is part of any message to or from a dedicated worker then it is automatically shared.
1582         
1583         The new API provides a lot more clarity about what is supposed to happen in contexts
1584         that support transfering but don't support sharing.
1585         
1586         Right now this patch allows both styles to work, but I hope we can disable the transfer
1587         list capability soon.
1588
1589         * bindings/js/IDBBindingUtilities.cpp:
1590         (WebCore::deserializeIDBValueToJSValue):
1591         * bindings/js/JSMessageEventCustom.cpp:
1592         (WebCore::JSMessageEvent::data):
1593         * bindings/js/SerializedScriptValue.cpp:
1594         (WebCore::CloneSerializer::serialize):
1595         (WebCore::CloneSerializer::CloneSerializer):
1596         (WebCore::CloneSerializer::dumpIfTerminal):
1597         (WebCore::CloneDeserializer::deserialize):
1598         (WebCore::CloneDeserializer::CloneDeserializer):
1599         (WebCore::CloneDeserializer::readTerminal):
1600         (WebCore::SerializedScriptValue::SerializedScriptValue):
1601         (WebCore::SerializedScriptValue::create):
1602         (WebCore::SerializedScriptValue::deserialize):
1603         * bindings/js/SerializedScriptValue.h:
1604         (): Deleted.
1605         * dom/CustomEvent.cpp:
1606         (WebCore::CustomEvent::trySerializeDetail):
1607         * dom/ErrorEvent.cpp:
1608         (WebCore::ErrorEvent::trySerializeError):
1609         * dom/MessageEvent.cpp:
1610         (WebCore::MessageEvent::trySerializeData):
1611         * dom/PopStateEvent.cpp:
1612         (WebCore::PopStateEvent::trySerializeState):
1613         * workers/DedicatedWorkerGlobalScope.cpp:
1614         (WebCore::DedicatedWorkerGlobalScope::postMessage):
1615         * workers/Worker.cpp:
1616         (WebCore::Worker::postMessage):
1617
1618 2017-02-09  Brent Fulgham  <bfulgham@apple.com>
1619
1620         Unreviewed build fix after r212025.
1621
1622         inDocument -> isConnected
1623
1624         * html/FormAssociatedElement.cpp:
1625         (WebCore::FormAssociatedElement::didMoveToNewDocument):
1626         (WebCore::FormAssociatedElement::resetFormAttributeTargetObserver):
1627         * html/HTMLFormElement.cpp:
1628         (WebCore::HTMLFormElement::formElementIndex):
1629
1630 2017-02-09  Chris Dumez  <cdumez@apple.com>
1631
1632         Make sure Event keeps its current target element alive
1633         https://bugs.webkit.org/show_bug.cgi?id=167885
1634         <rdar://problem/30376972>
1635
1636         Reviewed by Brent Fulgham.
1637
1638         Make sure Event keeps its current target element alive to avoid
1639         crashes if it is accessed by JS after it has been garbage collected.
1640
1641         Test: fast/events/currentTarget-gc-crash.html
1642
1643         * dom/Event.cpp:
1644         (WebCore::Event::setCurrentTarget):
1645         * dom/Event.h:
1646         (WebCore::Event::currentTarget):
1647
1648 2017-02-09  Ryosuke Niwa  <rniwa@webkit.org>
1649
1650         Crash in render tree after dynamically mutating the slot value
1651         https://bugs.webkit.org/show_bug.cgi?id=167502
1652
1653         Reviewed by Antti Koivisto.
1654
1655         The crash was caused by attributeChanged not destructing the render tree after an assigned element had been
1656         removed from its slot. Since the style resolver can no longer find this element in the flat tree, we need to
1657         delete its render object as if the element had been removed from the DOM tree.
1658
1659         Tests: fast/html/details-summary-slot.html
1660                fast/shadow-dom/shadow-slot-attribute-change-crash.html
1661
1662         * dom/Element.cpp:
1663         (WebCore::Element::attributeChanged):
1664         * html/HTMLSummaryElement.cpp:
1665         (WebCore::SummarySlotElement): Added. Always use the default slot regardless of the slot attribute's value.
1666         (WebCore::HTMLSummaryElement::create): Use SummarySlotElement
1667
1668 2017-02-09  Antti Koivisto  <antti@apple.com>
1669
1670         Details element doesn't work correctly when mutating content between closing and opening
1671         https://bugs.webkit.org/show_bug.cgi?id=167310
1672
1673         Reviewed by Ryosuke Niwa.
1674
1675         Tests: fast/html/details-close-modify-open.html
1676                fast/shadow-dom/slot-remove-mutate-add.html
1677
1678         * dom/SlotAssignment.cpp:
1679         (WebCore::SlotAssignment::didChangeSlot):
1680
1681             Always reset the slot assignment when content is mutated.
1682
1683 2017-02-09  Chris Dumez  <cdumez@apple.com>
1684
1685         Crash under FormSubmission::create()
1686         https://bugs.webkit.org/show_bug.cgi?id=167200
1687         <rdar://problem/30096323>
1688
1689         Reviewed by Darin Adler.
1690
1691         The issue is that FormSubmission::create() was iterating over
1692         form.associatedElements() as was calling Element::appendFormData()
1693         in the loop. HTMLObjectElement::appendFormData() was calling
1694         pluginWidget(PluginLoadingPolicy::Load) which causes a synchronous
1695         layout and can fire events (such as focus event) synchronously.
1696         Firing those events synchronously allows the JS to modify the
1697         form.associatedElements() vector we are currently iterating on.
1698
1699         To avoid this issue, we now call pluginWidget(PluginLoadingPolicy::DoNotLoad)
1700         in HTMLObjectElement::appendFormData() as we are not allowed to fire
1701         synchronous events at this point. I also added a security assertion
1702         in FormSubmission::create() to catch cases where we fire JS events
1703         while iterating over the form associated elements to more easily
1704         notice these things in the future.
1705
1706         Test: fast/forms/formsubmission-appendFormData-crash.html
1707
1708         * html/HTMLObjectElement.cpp:
1709         (WebCore::HTMLObjectElement::appendFormData):
1710         * loader/FormSubmission.cpp:
1711         (WebCore::FormSubmission::create):
1712
1713 2017-02-09  Chris Dumez  <cdumez@apple.com>
1714
1715         Crash under HTMLFormElement::registerFormElement()
1716         https://bugs.webkit.org/show_bug.cgi?id=167162
1717
1718         Reviewed by Ryosuke Niwa.
1719
1720         didMoveToNewDocument() was re-registering FormAttributeTargetObserver
1721         even if the element's inDocument was not set yet. As a result, it was
1722         possible for FormAssociatedElement::resetFormOwner() to be called
1723         when the element was in the tree but with its inDocument still being
1724         false (because insertedInto() has not been called yet). This could
1725         end up calling HTMLFormElement::registerFormElement() even though
1726         the element is still recognized as detached. This is an issue because
1727         HTMLFormElement::m_associatedElements's order and its corresponding
1728         indexes (m_associatedElementsBeforeIndex / m_associatedElementsAfterIndex)
1729         rely on the position of the element with regards to the form element
1730         (before / inside / after).
1731
1732         To address the issue, we now only register the FormAttributeTargetObserver
1733         in didMoveToNewDocument() if the inDocument flag is set to true. This
1734         is similar to what is done at other call sites of
1735         resetFormAttributeTargetObserver(). We also ignore the form content
1736         attribute in HTMLFormElement::formElementIndex() if the element is
1737         not connected.
1738
1739         As per the HTML specification [1], the form content attribute is only
1740         taken if the element is connected (i.e. inDocument flag is true).
1741
1742         Note that FormAssociatedElement::findAssociatedForm() was already
1743         ignoring the form content attribute if the element is disconnected.
1744
1745         [1] https://html.spec.whatwg.org/#reset-the-form-owner (step 3)
1746
1747         Test: fast/forms/registerFormElement-crash.html
1748
1749         * html/FormAssociatedElement.cpp:
1750         (WebCore::FormAssociatedElement::didMoveToNewDocument):
1751         Only call resetFormAttributeTargetObserver() if inDocument flag is set,
1752         similarly to what is done at other call sites.
1753
1754         (WebCore::FormAssociatedElement::resetFormAttributeTargetObserver):
1755         Add an assertion to make sure no one call this method on an element that
1756         is not connected.
1757
1758         * html/HTMLFormElement.cpp:
1759         (WebCore::HTMLFormElement::formElementIndex):
1760         Ignore the form content attribute if the element is not connected, as
1761         per the HTML specification [1].
1762
1763 2017-02-09  Antti Koivisto  <antti@apple.com>
1764
1765         Tear down existing renderers when adding a shadow root.
1766         https://bugs.webkit.org/show_bug.cgi?id=167117
1767
1768         Reviewed by Andreas Kling.
1769
1770         Adding a shadow root may cause children no longer be part of the flat tree. If they had renderers
1771         tear down code would no longer reach them.
1772
1773         Test: fast/shadow-dom/attach-shadow-teardown.html
1774
1775         * dom/Element.cpp:
1776         (WebCore::Element::addShadowRoot):
1777
1778             Tear down existing render tree when adding a shadow root.
1779
1780 2017-02-09  Brent Fulgham  <bfulgham@apple.com>
1781
1782         Handle synchronous layout when setting a selection range
1783         https://bugs.webkit.org/show_bug.cgi?id=167092
1784         <rdar://problem/30041640>
1785
1786         Reviewed by Antti Koivisto.
1787
1788         The 'innerTextElement' of a form control can change during layout due
1789         to arbitrary JavaScript executing. Handle the case where the inner text
1790         element has changed so that current render box height is while setting
1791         a selection range.
1792
1793         Test: fast/forms/input-type-change-during-selection.html
1794
1795         * html/HTMLTextFormControlElement.cpp:
1796         (WebCore::HTMLTextFormControlElement::setSelectionRange):
1797
1798 2017-02-09  Alex Christensen  <achristensen@webkit.org>
1799
1800         Fix CMake build.
1801
1802         * PlatformMac.cmake:
1803
1804 2017-02-09  Brent Fulgham  <bfulgham@apple.com>
1805
1806         Disconnect shadow children of root when detaching a frame
1807         https://bugs.webkit.org/show_bug.cgi?id=166851
1808         <rdar://problem/29930443>
1809
1810         Reviewed by Andy Estes.
1811
1812         If the root of the tree we are disconnecting has a shadow element, include it in the set of
1813         things to disconnect.
1814
1815         Tests: fast/shadow-dom/shadow-at-root-during-disconnect.html
1816
1817         * dom/ContainerNodeAlgorithms.cpp:
1818         (WebCore::disconnectSubframes):
1819
1820 2017-02-09  Alexey Proskuryakov  <ap@apple.com>
1821
1822         Remove unused WebThreadRunSync
1823         https://bugs.webkit.org/show_bug.cgi?id=168024
1824
1825         Reviewed by Tim Horton.
1826
1827         * platform/ios/wak/WebCoreThreadRun.cpp:
1828         * platform/ios/wak/WebCoreThreadRun.h:
1829         * platform/ios/wak/WebCoreThreadSystemInterface.cpp:
1830         (InitWebCoreThreadSystemInterface):
1831
1832 2017-02-09  Ryan Haddad  <ryanhaddad@apple.com>
1833
1834         Unreviewed, rolling out r211802.
1835
1836         This change caused fast/regions/inline-block-inside-anonymous-
1837         overflow-with-covered-controls.html to be a flaky failure.
1838
1839         Reverted changeset:
1840
1841         "[Modern Media Controls] Improve handling of <video> with only
1842         audio tracks"
1843         https://bugs.webkit.org/show_bug.cgi?id=167836
1844         http://trac.webkit.org/changeset/211802
1845
1846 2017-02-09  Alex Christensen  <achristensen@webkit.org>
1847
1848         Fix i386 libwebrtc build
1849         https://bugs.webkit.org/show_bug.cgi?id=168038
1850
1851         * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h:
1852         DataChannelInterface::buffered_amount returns a uint64_t, and we want a size_t.
1853         If this overflows, then we've run out of memory and crashed a long time ago.
1854
1855 2017-02-09  Andreas Kling  <akling@apple.com>
1856
1857         Document::settings() should return a const Settings&.
1858         <https://webkit.org/b/168061>
1859
1860         Reviewed by Geoffrey Garen.
1861
1862         - Make Document::settings() return a const reference.
1863         - Added Document::mutableSettings() for all your non-const needs.
1864         - Fixed up settings generator to produce const getters.
1865         - Simplify a few settings() call sites that exposed themselves.
1866
1867         * Modules/applepay/ApplePaySession.cpp:
1868         (WebCore::shouldDiscloseApplePayCapability):
1869         * Modules/mediastream/UserMediaRequest.cpp:
1870         (WebCore::canCallGetUserMedia):
1871         * css/CSSFontFace.cpp:
1872         (WebCore::CSSFontFace::appendSources):
1873         * css/CSSFontSelector.cpp:
1874         (WebCore::resolveGenericFamily):
1875         * css/StyleResolver.h:
1876         (WebCore::StyleResolver::settings):
1877         * dom/Document.h:
1878         (WebCore::Document::settings):
1879         (WebCore::Document::mutableSettings):
1880         * html/FTPDirectoryDocument.cpp:
1881         (WebCore::createTemplateDocumentData):
1882         * html/HTMLCanvasElement.cpp:
1883         (WebCore::shouldEnableWebGL):
1884         * html/HTMLEmbedElement.cpp:
1885         (WebCore::HTMLEmbedElement::rendererIsNeeded):
1886         * html/HTMLSelectElement.cpp:
1887         (WebCore::HTMLSelectElement::menuListDefaultEventHandler):
1888         * html/ImageDocument.cpp:
1889         (WebCore::ImageDocument::updateDuringParsing):
1890         * page/csp/ContentSecurityPolicy.cpp:
1891         (WebCore::ContentSecurityPolicy::allowContentSecurityPolicySourceStarToMatchAnyProtocol):
1892         * page/make_settings.pl:
1893         (printGetterAndSetter):
1894         * rendering/SimpleLineLayout.cpp:
1895         (WebCore::SimpleLineLayout::toggleSimpleLineLayout):
1896
1897 2017-02-09  Jer Noble  <jer.noble@apple.com>
1898
1899         Make passing PlatformAudioData in audioSamplesAvaliable const-correct.
1900         https://bugs.webkit.org/show_bug.cgi?id=168051
1901
1902         Reviewed by Eric Carlson.
1903
1904         Modify all the functions which take a (conceptually) read-only audio buffer const-correct.
1905
1906         Drive-by fix: AudioSampleBufferList::copyFrom() set a ivar pointer to the passed in
1907         AudioBufferList. Ensure that the ivar is reset when copyFrom() returns by using a
1908         SetForScope.
1909
1910         * platform/audio/mac/AudioSampleBufferList.cpp:
1911         (WebCore::AudioSampleBufferList::copyFrom):
1912         * platform/audio/mac/AudioSampleBufferList.h:
1913         * platform/audio/mac/AudioSampleDataSource.cpp:
1914         (WebCore::AudioSampleDataSource::pushSamplesInternal):
1915         (WebCore::AudioSampleDataSource::pushSamples):
1916         * platform/audio/mac/AudioSampleDataSource.h:
1917         * platform/mediastream/RealtimeMediaSource.cpp:
1918         (WebCore::RealtimeMediaSource::audioSamplesAvailable):
1919         * platform/mediastream/RealtimeMediaSource.h:
1920         (WebCore::RealtimeMediaSource::Observer::audioSamplesAvailable):
1921         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
1922         (WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable):
1923         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.h:
1924         * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
1925         (WebCore::RealtimeOutgoingAudioSource::audioSamplesAvailable):
1926         * platform/mediastream/mac/RealtimeOutgoingAudioSource.h:
1927
1928 2017-02-09  Jer Noble  <jer.noble@apple.com>
1929
1930         Fix some logging statements in MediaPlayerPrivateMediaStreamAVFObjC
1931         https://bugs.webkit.org/show_bug.cgi?id=168063
1932
1933         Reviewed by Eric Carlson.
1934
1935         Make the format string match the types passed in (i.e., floats, not strings).
1936
1937         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
1938         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateSampleTimes):
1939
1940 2017-02-09  Eric Carlson  <eric.carlson@apple.com>
1941
1942         [MediaStream Mac] Handle NULL m_sampleBufferDisplayLayer
1943         https://bugs.webkit.org/show_bug.cgi?id=168060
1944
1945         Reviewed by Jer Noble.
1946
1947         No new tests, this avoids an occasional crash on the bots.
1948
1949         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
1950         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::layerStatusDidChange): Don't assume
1951         m_sampleBufferDisplayLayer is valid.
1952
1953 2017-02-09  Chris Dumez  <cdumez@apple.com>
1954
1955         Object.getPrototypeOf(NodeFilter) should be Function.prototype, not Object.prototype
1956         https://bugs.webkit.org/show_bug.cgi?id=167964
1957
1958         Reviewed by Youenn Fablet.
1959
1960         Object.getPrototypeOf(NodeFilter) should be Function.prototype, not Object.prototype
1961         after the following WebIDL spec change:
1962         - https://github.com/heycam/webidl/issues/96
1963
1964         This aligns our behavior with other browsers as the spec has been updated to match
1965         the majority.
1966
1967         No new tests, rebaselined existing test.
1968
1969         * bindings/scripts/CodeGeneratorJS.pm:
1970         (GenerateConstructorHelperMethods):
1971         * bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
1972         (WebCore::JSTestCallbackInterfaceConstructor::prototypeForStructure):
1973
1974 2017-02-09  Miguel Gomez  <magomez@igalia.com>
1975
1976         [GTK] scroll with transparent background not repainted after scrollY >= 32768
1977         https://bugs.webkit.org/show_bug.cgi?id=154283
1978
1979         Reviewed by Carlos Garcia Campos.
1980
1981         Due to a limitation of the pixman backend, which uses 16 bits to hold signed integers, cairo is
1982         not able to draw anything when using transformation matrices with values bigger than 32768. When
1983         drawing patterns into large pages, the matrices values can overflow those 16 bits, so cairo doesn't
1984         draw anything in, which causes the reported transparent backgrounds.
1985
1986         The patch modifies the transformation matrices both from the current context and the pattern we
1987         are painting, to avoid them to hold values that cannot stored in 16 bits.
1988
1989         There's still the possibility that this happens, but it would require using a pattern with a size
1990         bigger than 32768.
1991
1992         Based on a previous patch by Gwang Yoon Hwang  <yoon@igalia.com>.
1993
1994         No new tests.
1995
1996         * platform/graphics/cairo/CairoUtilities.cpp:
1997         (WebCore::drawPatternToCairoContext):
1998
1999 2017-02-09  Brent Fulgham  <bfulgham@apple.com>
2000
2001         Unreviewed build fix after r211965.
2002
2003         * dom/Document.cpp:
2004         (WebCore::Document::adoptNode): inDocument -> isConnected
2005
2006 2017-02-09  Ryosuke Niwa  <rniwa@webkit.org>
2007
2008         Adopting a child node of a script element can run script
2009         https://bugs.webkit.org/show_bug.cgi?id=167318
2010
2011         Reviewed by Darin Adler.
2012
2013         The bug was caused by ScriptElement::childrenChanged indiscriminately running the script.
2014         Do this only if some node has been inserted as spec'ed:
2015
2016         https://html.spec.whatwg.org/multipage/scripting.html#script-processing-model
2017         "The script element is connected and a node or document fragment is inserted into
2018         the script element, after any script elements inserted at that time."
2019
2020         Split NonContentsChildChanged into NonContentsChildInserted and NonContentsChildRemoved to disambiguate
2021         non-contents child such as text and element being removed or inserted. New behavior matches that of
2022         Gecko and Chrome as well as the latest HTML5 specification.
2023
2024         Also deploy NoEventDispatchAssertion in more places. Unfortunately, this results in some DOM trees
2025         internal to WebKit to be mutated while there is NoEventDispatchAssertion in the stack. Added a new RAII
2026         object "EventAllowedScope" to temporarily disable this assertion within such a tree. CachedSVGFont's
2027         ensureCustomFontData used to completely disable this assertion but we no longer have to do this either.
2028
2029         To clarify the new semantics, renamed isEventDispatchForbidden to isEventAllowedInMainThread with
2030         the negated boolean value, and added a new variant isEventDispatchAllowedInSubtree, which checks
2031         isEventDispatchForbidden() is true or if the node was one of an internal DOM node or its descendent
2032         held by EventAllowedScope.
2033
2034         Inspired by https://chromium.googlesource.com/chromium/src/+/604e798ec6ee30f44d57a5c4a44ce3dab3a871ed
2035
2036         Tests: fast/html/script-must-not-run-when-child-is-adopted.html
2037                fast/html/script-must-not-run-when-child-is-removed.html
2038
2039         * dom/CharacterData.cpp:
2040         (WebCore::CharacterData::notifyParentAfterChange): Added NoEventDispatchAssertion.
2041         * dom/ContainerNode.cpp:
2042         (WebCore::ContainerNode::insertBefore): Added NoEventDispatchAssertion around TreeScope's adoptIfNeeded
2043         and insertBeforeCommon as done elsewhere.
2044         (WebCore::ContainerNode::appendChildCommon): Added NoEventDispatchAssertion.
2045         (WebCore::ContainerNode::changeForChildInsertion): Use NonContentsChildInserted here.
2046         (WebCore::ContainerNode::notifyChildRemoved): Added NoEventDispatchAssertion.
2047         (WebCore::ContainerNode::replaceChild): Moved adoptIfNeeded into NoEventDispatchAssertion.
2048         (WebCore::ContainerNode::removeChild): Added NoEventDispatchAssertion.
2049         (WebCore::ContainerNode::parserRemoveChild): Added NoEventDispatchAssertion.
2050         (WebCore::ContainerNode::removeChildren): Call childrenChanged in NoEventDispatchAssertion.
2051         (WebCore::ContainerNode::appendChildWithoutPreInsertionValidityCheck): Moved adoptIfNeeded into
2052         NoEventDispatchAssertion.
2053         (WebCore::dispatchChildInsertionEvents): Check the forbidden-ness more precisely.
2054         (WebCore::dispatchChildRemovalEvents): Ditto.
2055         * dom/ContainerNode.h:
2056         (WebCore::ContainerNode::ChildChange::isInsertion): Added.
2057         * dom/ContainerNodeAlgorithms.cpp:
2058         (WebCore::notifyChildNodeInserted): Check the forbidden-ness more precisely. Here, we check against
2059         insertionPoint since EventAllowedScope checks against the root node.
2060         * dom/Document.cpp:
2061         (WebCore::Document::adoptNode): Assert the node to be adopted has not been inserted back, or else
2062         remove() had resulted in an exception before calling TreeScope::adoptIfNeeded.
2063         * dom/Element.cpp:
2064         (WebCore::Element::childrenChanged):
2065         * dom/NoEventDispatchAssertion.h:
2066         (WebCore::NoEventDispatchAssertion::isEventDispatchForbidden): Added a new variant that takes a node.
2067         If this node is a descendent of a node "marked as safe" by EventAllowedScope, then we don't consider
2068         the event dispatch to be forbidden.
2069         (WebCore::NoEventDispatchAssertion::dropTemporarily): Deleted.
2070         (WebCore::NoEventDispatchAssertion::restoreDropped): Deleted.
2071         (WebCore::NoEventDispatchAssertion::EventAllowedScope): Added. A RAII object which marks descendants of
2072         a given node as "safe" for the purpose of checking isEventDispatchForbidden.
2073         (WebCore::NoEventDispatchAssertion::EventAllowedScope::EventAllowedScope): Added. There can be a chain
2074         of EventAllowedScope objects in the stack. s_currentScope points to the most recently instantiated
2075         RAII object, and each instance remembers prior instance. 
2076         (WebCore::NoEventDispatchAssertion::EventAllowedScope::~EventAllowedScope): Added.
2077         (WebCore::NoEventDispatchAssertion::EventAllowedScope::isAllowedNode): Added. Returns true if the given
2078         node is a descendent of any node held by instances of EventAllowedScope.
2079         (WebCore::NoEventDispatchAssertion::EventAllowedScope::isAllowedNodeInternal): Added. A helper function
2080         for isAllowedNode.
2081         * dom/Node.cpp:
2082         (WebCore::Node::dispatchSubtreeModifiedEvent): Check the forbidden-ness more precisely.
2083         * dom/ScriptElement.cpp:
2084         (WebCore::ScriptElement::childrenChanged): Only prepare the script if we've inserted nodes.
2085         (WebCore::ScriptElement::executeClassicScript): Assert isEventDispatchForbidden is false since running
2086         arbitrary author scripts can, indeed, result dispatch any events.
2087         * dom/ScriptElement.h:
2088         * html/HTMLElement.cpp:
2089         (WebCore::textToFragment): Made this a static local function and not return an exception since there
2090         is no way appendChild called in this function can throw an exception.
2091         (WebCore::HTMLElement::setInnerText): Create EventAllowedScope for the fragment. It's called called by
2092         HTMLTextAreaElement's childrenChanged to update its UA shadow tree, and it's dispatching as event on
2093         a new fragment can't execute arbitrary scripts since it has never been exposed to author scripts.
2094         Because of the precise-ness of this check, this does not disable the assertion for "this" element.
2095         HTMLTextFormControlElement::setInnerTextValue explicitly creates another EventAllowedScope to mark
2096         the shadow tree into which the fragment is inserted safe.
2097         (WebCore::HTMLElement::setOuterText):
2098         * html/HTMLElement.h:
2099         * html/HTMLScriptElement.cpp:
2100         (WebCore::HTMLScriptElement::childrenChanged):
2101         * html/HTMLTextFormControlElement.cpp:
2102         (WebCore::HTMLTextFormControlElement::setInnerTextValue): See above (setInnerText).
2103         * html/track/VTTCue.cpp:
2104         (WebCore::VTTCue::createCueRenderingTree): Create EventAllowedScope for the cloned fragment here since
2105         the VTT tree is never exposed to author scripts.
2106         (WebCore::VTTCue::updateDisplayTree): Ditto.
2107         * loader/cache/CachedSVGFont.cpp:
2108         (WebCore::CachedSVGFont::ensureCustomFontData): Use EventAllowedScope to disable assertions only on
2109         the new SVG document we just created instead of disabling for all DOM trees.
2110         * svg/SVGScriptElement.cpp:
2111         (WebCore::SVGScriptElement::childrenChanged):
2112
2113 2017-02-09  Andreas Kling  <akling@apple.com>
2114
2115         Document should always have a Settings.
2116         <https://webkit.org/b/120172>
2117
2118         Reviewed by Antti Koivisto.
2119
2120         Since a Document can't move between Frames, and it's either frameless
2121         or partnered with a Frame provided at construction time, we know that
2122         it will never need to switch between different Settings objects either.
2123
2124         Give Document a Ref<Settings> that contains either the Frame's Settings
2125         or a default-constructed Settings object if frameless.
2126         Document::settings() is promoted to a reference getter.
2127
2128         The bulk of this patch is removing now-unnecessary null checks.
2129
2130         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
2131         (WebCore::WebKitMediaKeySession::mediaKeysStorageDirectory):
2132         * Modules/plugins/PluginReplacement.h:
2133         (WebCore::ReplacementPlugin::isEnabledBySettings):
2134         * Modules/plugins/QuickTimePluginReplacement.h:
2135         * Modules/plugins/QuickTimePluginReplacement.mm:
2136         (WebCore::QuickTimePluginReplacement::isEnabledBySettings):
2137         * Modules/plugins/YouTubePluginReplacement.cpp:
2138         (WebCore::YouTubePluginReplacement::isEnabledBySettings):
2139         * Modules/plugins/YouTubePluginReplacement.h:
2140         * Modules/webaudio/AudioContext.cpp:
2141         (WebCore::AudioContext::constructCommon):
2142         * bindings/js/CachedScriptFetcher.cpp:
2143         (WebCore::CachedScriptFetcher::requestScriptWithCache):
2144         * css/CSSFontFace.cpp:
2145         (WebCore::CSSFontFace::appendSources):
2146         (WebCore::CSSFontFace::webFontsShouldAlwaysFallBack):
2147         * css/CSSFontSelector.cpp:
2148         (WebCore::CSSFontSelector::fallbackFontCount):
2149         (WebCore::CSSFontSelector::fallbackFontAt):
2150         * css/StyleBuilderConverter.h:
2151         (WebCore::StyleBuilderConverter::convertResize):
2152         * css/StyleBuilderCustom.h:
2153         (WebCore::StyleBuilderCustom::applyValueFontFamily):
2154         * css/StyleResolver.cpp:
2155         (WebCore::StyleResolver::StyleResolver):
2156         (WebCore::StyleResolver::defaultStyleForElement):
2157         (WebCore::StyleResolver::adjustRenderStyle):
2158         (WebCore::StyleResolver::checkForGenericFamilyChange):
2159         (WebCore::StyleResolver::initializeFontStyle):
2160         * css/StyleResolver.h:
2161         (WebCore::StyleResolver::settings):
2162         (WebCore::StyleResolver::documentSettings): Deleted.
2163         * css/parser/CSSParser.cpp:
2164         (WebCore::CSSParserContext::CSSParserContext):
2165         * dom/Document.cpp:
2166         (WebCore::Document::Document):
2167         (WebCore::Document::setReadyState):
2168         (WebCore::Document::setVisualUpdatesAllowed):
2169         (WebCore::Document::defaultCharsetForLegacyBindings):
2170         (WebCore::Document::recalcStyle):
2171         (WebCore::Document::implicitClose):
2172         (WebCore::Document::minimumLayoutDelay):
2173         (WebCore::Document::setDomain):
2174         (WebCore::Document::audioPlaybackRequiresUserGesture):
2175         (WebCore::Document::videoPlaybackRequiresUserGesture):
2176         (WebCore::Document::storageBlockingStateDidChange):
2177         (WebCore::Document::isTelephoneNumberParsingEnabled):
2178         (WebCore::Document::initSecurityContext):
2179         (WebCore::Document::initDNSPrefetch):
2180         (WebCore::Document::getCachedLocale):
2181         (WebCore::Document::shouldEnforceContentDispositionAttachmentSandbox):
2182         (WebCore::Document::settings): Deleted.
2183         * dom/Document.h:
2184         (WebCore::Document::settings):
2185         * dom/Element.cpp:
2186         (WebCore::subpixelMetricsEnabled):
2187         * dom/ExtensionStyleSheets.cpp:
2188         (WebCore::ExtensionStyleSheets::pageUserSheet):
2189         * dom/ScriptExecutionContext.cpp:
2190         (WebCore::ScriptExecutionContext::dispatchErrorEvent):
2191         * dom/ScriptableDocumentParser.cpp:
2192         (WebCore::ScriptableDocumentParser::ScriptableDocumentParser):
2193         * dom/ScriptedAnimationController.cpp:
2194         (WebCore::ScriptedAnimationController::requestAnimationFrameEnabled):
2195         * dom/make_names.pl:
2196         (printConstructorInterior):
2197         * editing/Editor.cpp:
2198         * editing/markup.cpp:
2199         (WebCore::createMarkupInternal):
2200         * html/FTPDirectoryDocument.cpp:
2201         (WebCore::createTemplateDocumentData):
2202         * html/HTMLAnchorElement.cpp:
2203         (WebCore::HTMLAnchorElement::setActive):
2204         (WebCore::HTMLAnchorElement::sendPings):
2205         (WebCore::HTMLAnchorElement::treatLinkAsLiveForEventType):
2206         * html/HTMLAppletElement.cpp:
2207         (WebCore::HTMLAppletElement::canEmbedJava):
2208         * html/HTMLCanvasElement.cpp:
2209         (WebCore::HTMLCanvasElement::getContext2d):
2210         (WebCore::shouldEnableWebGL):
2211         (WebCore::HTMLCanvasElement::shouldAccelerate):
2212         * html/HTMLFormElement.cpp:
2213         (WebCore::HTMLFormElement::submitImplicitly):
2214         * html/HTMLFrameElementBase.cpp:
2215         (WebCore::HTMLFrameElementBase::setLocation):
2216         * html/HTMLImageElement.cpp:
2217         (WebCore::HTMLImageElement::updateImageControls):
2218         * html/HTMLImageLoader.cpp:
2219         (WebCore::HTMLImageLoader::sourceURI):
2220         * html/HTMLInputElement.cpp:
2221         (WebCore::HTMLInputElement::setupDateTimeChooserParameters):
2222         * html/HTMLLinkElement.cpp:
2223         (WebCore::HTMLLinkElement::process):
2224         * html/HTMLMediaElement.cpp:
2225         (WebCore::HTMLMediaElement::HTMLMediaElement):
2226         (WebCore::HTMLMediaElement::mediaPlayerMediaKeysStorageDirectory):
2227         (WebCore::HTMLMediaElement::mediaPlayerAcceleratedCompositingEnabled):
2228         (WebCore::HTMLMediaElement::enterFullscreen):
2229         (WebCore::HTMLMediaElement::exitFullscreen):
2230         (WebCore::HTMLMediaElement::mediaPlayerNeedsSiteSpecificHacks):
2231         (WebCore::HTMLMediaElement::mediaPlayerNetworkInterfaceName):
2232         (WebCore::HTMLMediaElement::setMediaControlsDependOnPageScaleFactor):
2233         (WebCore::HTMLMediaElement::doesHaveAttribute):
2234         * html/HTMLVideoElement.cpp:
2235         (WebCore::HTMLVideoElement::HTMLVideoElement):
2236         * html/MediaElementSession.cpp:
2237         (WebCore::MediaElementSession::wirelessVideoPlaybackDisabled):
2238         (WebCore::MediaElementSession::requiresFullscreenForVideoPlayback):
2239         (WebCore::MediaElementSession::allowsAutomaticMediaDataLoading):
2240         (WebCore::MediaElementSession::allowsPictureInPicture):
2241         (WebCore::MediaElementSession::maximumMediaSourceBufferSize):
2242         * html/parser/HTMLParserOptions.cpp:
2243         (WebCore::HTMLParserOptions::HTMLParserOptions):
2244         * html/shadow/MediaControlElements.cpp:
2245         (WebCore::MediaControlFullscreenButtonElement::defaultEventHandler):
2246         * loader/LinkLoader.cpp:
2247         (WebCore::LinkLoader::loadLink):
2248         * page/csp/ContentSecurityPolicy.cpp:
2249         (WebCore::ContentSecurityPolicy::allowContentSecurityPolicySourceStarToMatchAnyProtocol):
2250         * rendering/SimpleLineLayout.cpp:
2251         (WebCore::SimpleLineLayout::toggleSimpleLineLayout):
2252         * style/StyleFontSizeFunctions.cpp:
2253         (WebCore::Style::computedFontSizeFromSpecifiedSize):
2254         (WebCore::Style::fontSizeForKeyword):
2255         (WebCore::Style::legacyFontSizeForPixelSize):
2256         * style/StyleScope.cpp:
2257         (WebCore::Style::Scope::collectActiveStyleSheets):
2258         * xml/XMLHttpRequest.cpp:
2259         (WebCore::XMLHttpRequest::usesDashboardBackwardCompatibilityMode):
2260
2261 2017-02-09  Antti Koivisto  <antti@apple.com>
2262
2263         Use all cacheable speculatively loaded responses
2264         https://bugs.webkit.org/show_bug.cgi?id=168052
2265
2266         Reviewed by Andreas Kling.
2267
2268         * platform/network/CacheValidation.cpp:
2269         (WebCore::isStatusCodeCacheableByDefault):
2270         (WebCore::isStatusCodePotentiallyCacheable):
2271
2272         Moved here from WebKit2.
2273
2274         * platform/network/CacheValidation.h:
2275
2276 2017-02-09  Eric Carlson  <eric.carlson@apple.com>
2277
2278         [MediaStream] Remove legacy Navigator.webkitGetUserMedia
2279         https://bugs.webkit.org/show_bug.cgi?id=168016
2280
2281         Reviewed by Youenn Fablet.
2282
2283         No new tests, existing tests updated.
2284
2285         * WebCore.xcodeproj/project.pbxproj: NavigatorUserMedia.
2286         * DerivedSources.make: Ditto.
2287         * CMakeLists.txt: Ditto.
2288         * Modules/mediastream/NavigatorUserMedia.idl: Removed.
2289         * Modules/mediastream/NavigatorUserMedia.js: Removed.
2290         * WebCore.xcodeproj/project.pbxproj:
2291         * page/Navigator.idl: Add some whitespace to force derived sources to be rebuild correctly.
2292
2293 2017-02-09  Antoine Quint  <graouts@apple.com>
2294
2295         [Modern Media Controls] Tapping the skip back button on iOS inline media controls make the controls disappear
2296         https://bugs.webkit.org/show_bug.cgi?id=168049
2297         <rdar://problem/30442660>
2298
2299         Reviewed by Eric Carlson.
2300
2301         Calling elementAtPoint() on the Document will not return an element in the ShadowRoot,
2302         we need to call it on the ShadowRoot. So we now iterate over ancestors of the controls
2303         bar to find the ShadowRoot, if any, and check whether the tapped element is contained
2304         within the controls bar. We only fade the controls bar out if the tapped element is
2305         outside of the controls bar hierarchy.
2306
2307         Test: media/modern-media-controls/media-controller/media-controller-ios-do-not-hide-controls-when-tapping-button.html
2308
2309         * Modules/modern-media-controls/controls/controls-bar.js:
2310         (ControlsBar.prototype.gestureRecognizerStateDidChange):
2311
2312 2017-02-09  Jer Noble  <jer.noble@apple.com>
2313
2314         Configure MockRealtimeAudioSourceMac to generate stereo audio
2315         https://bugs.webkit.org/show_bug.cgi?id=168027
2316
2317         Reviewed by Eric Carlson.
2318
2319         Update MockRealtimeAudioSourceMac to generate stereo audio.
2320
2321         First, because the pattern of creating a AudioBufferList structure (with all it's quirks and
2322         weird requirements) was repeated multiple places, add a new wrapper around ABL called
2323         WebAudioBufferList which takes care of correctly initializing the ABL structure and manages
2324         the lifetime of its data members.
2325
2326         * WebCore.xcodeproj/project.pbxproj:
2327         * platform/audio/PlatformAudioData.h: Added.
2328         (WebCore::PlatformAudioData::kind):
2329         * platform/audio/WebAudioBufferList.cpp: Added.
2330         (WebCore::WebAudioBufferList::WebAudioBufferList):
2331         (WebCore::WebAudioBufferList::buffers):
2332         (WebCore::WebAudioBufferList::bufferCount):
2333         (WebCore::WebAudioBufferList::buffer):
2334         * platform/audio/WebAudioBufferList.h: Added.
2335         (WebCore::WebAudioBufferList::list):
2336         (WebCore::WebAudioBufferList::operator AudioBufferList&):
2337         (WebCore::WebAudioBufferList::kind):
2338         (isType):
2339
2340         Then update existing code to work in terms of WebAudioBufferList:
2341
2342         * platform/audio/mac/AudioSampleBufferList.cpp:
2343         (WebCore::AudioSampleBufferList::AudioSampleBufferList):
2344         (WebCore::AudioSampleBufferList::mixFrom):
2345         (WebCore::AudioSampleBufferList::copyFrom):
2346         (WebCore::AudioSampleBufferList::copyTo):
2347         (WebCore::AudioSampleBufferList::reset):
2348         (WebCore::AudioSampleBufferList::configureBufferListForStream): Deleted.
2349         * platform/audio/mac/AudioSampleBufferList.h:
2350         (WebCore::AudioSampleBufferList::bufferList):
2351         * platform/audio/mac/AudioSampleDataSource.cpp:
2352         (WebCore::AudioSampleDataSource::pushSamples):
2353         * platform/audio/mac/AudioSampleDataSource.h:
2354         * platform/mediastream/RealtimeMediaSource.cpp:
2355         (WebCore::RealtimeMediaSource::audioSamplesAvailable):
2356         * platform/mediastream/RealtimeMediaSource.h:
2357         (WebCore::RealtimeMediaSource::Observer::audioSamplesAvailable):
2358         * platform/mediastream/mac/AVAudioCaptureSource.h:
2359         * platform/mediastream/mac/AVAudioCaptureSource.mm:
2360         (WebCore::AVAudioCaptureSource::captureOutputDidOutputSampleBufferFromConnection):
2361         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
2362         (WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable):
2363         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.h:
2364         * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
2365         (WebCore::RealtimeOutgoingAudioSource::audioSamplesAvailable):
2366         * platform/mediastream/mac/RealtimeOutgoingAudioSource.h:
2367
2368         Finally, actually update MockRealtimeAudioSource to emit stereo samples. Importantly, set
2369         the correct values for the m_streamFormat; mBytesPerFrame and mBytesPerPacket are not
2370         multiplied by the channelCount. When generating audio, write to both channels of data.
2371
2372         * platform/mediastream/mac/MockRealtimeAudioSourceMac.h:
2373         * platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
2374         (WebCore::MockRealtimeAudioSourceMac::emitSampleBuffers):
2375         (WebCore::MockRealtimeAudioSourceMac::reconfigure):
2376         (WebCore::MockRealtimeAudioSourceMac::render):
2377
2378 2017-02-09  Antti Koivisto  <antti@apple.com>
2379
2380         Nullptr crash under styleForFirstLetter
2381         https://bugs.webkit.org/show_bug.cgi?id=167756
2382         rdar://problem/30029354
2383
2384         Reviewed by Zalan Bujtas.
2385
2386         Don't know how we get here. Paper over the crash.
2387
2388         * rendering/RenderBlock.cpp:
2389         (WebCore::styleForFirstLetter):
2390
2391             Use parent first line style if we compute null style for the first letter renderer.
2392
2393 2017-02-09  Antoine Quint  <graouts@apple.com>
2394
2395         [Modern Media Controls] Playing an <audio> element on iOS makes the controls disappear
2396         https://bugs.webkit.org/show_bug.cgi?id=168047
2397         <rdar://problem/30441939>
2398
2399         Reviewed by Eric Carlson.
2400
2401         The controls bar auto-hide behavior is disabled for <audio> elements, but on iOS we have
2402         a TapGestureRecognizer to identify when controls are tapped to toggle controls visibility.
2403         This gesture recognizer would be on at all times, but it should only be enabled when
2404         fadesToIdle is set to true.
2405
2406         Test: media/modern-media-controls/media-controller/media-controller-ios-only-enable-tap-gesture-recognizer-with-fades-when-idle.html
2407
2408         * Modules/modern-media-controls/controls/controls-bar.js:
2409         (ControlsBar.prototype.set fadesWhileIdle):
2410
2411 2017-02-09  Antoine Quint  <graouts@apple.com>
2412
2413         [Modern Media Controls] <audio> element does not show any background on iOS
2414         https://bugs.webkit.org/show_bug.cgi?id=168046
2415         <rdar://problem/30441872>
2416
2417         Reviewed by Eric Carlson.
2418
2419         Use a solid gray background for <audio> elements on iOS.
2420
2421         Test: media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-audio-background.html
2422
2423         * Modules/modern-media-controls/controls/ios-inline-media-controls.css:
2424         (:host(audio) .media-controls.ios.inline > .controls-bar:before):
2425
2426 2017-02-09  Antoine Quint  <graouts@apple.com>
2427
2428         [Modern Media Controls] Controls fail to instantiate in an XHTML document
2429         https://bugs.webkit.org/show_bug.cgi?id=168045
2430         <rdar://problem/30290095>
2431
2432         Reviewed by Eric Carlson.
2433
2434         Always use valid HTML and XHTML strings when creating HTML elements.
2435
2436         Test: media/modern-media-controls/media-controller/media-controller-in-xhtml.xhtml
2437
2438         * Modules/modern-media-controls/controls/button.js:
2439         (Button):
2440         * Modules/modern-media-controls/controls/buttons-container.js:
2441         * Modules/modern-media-controls/controls/controls-bar.js:
2442         * Modules/modern-media-controls/controls/macos-inline-media-controls.js:
2443         * Modules/modern-media-controls/controls/media-controls.js:
2444         * Modules/modern-media-controls/controls/slider.js:
2445         * Modules/modern-media-controls/controls/status-label.js:
2446         * Modules/modern-media-controls/controls/time-control.js:
2447         * Modules/modern-media-controls/controls/time-label.js:
2448         * Modules/modern-media-controls/controls/tracks-panel.js:
2449
2450 2017-02-09  Michael Catanzaro  <mcatanzaro@igalia.com>
2451
2452         Unreviewed, fix typo in comment
2453
2454         * loader/DocumentWriter.cpp:
2455         (WebCore::DocumentWriter::replaceDocument):
2456
2457 2017-02-09  Andreas Kling  <akling@apple.com>
2458
2459         Disallow accelerated rendering for ginormous 2D canvases.
2460         <https://webkit.org/b/167968>
2461         <rdar://problem/30119483>
2462
2463         Reviewed by Antti Koivisto.
2464
2465         Add a "maximumAccelerated2dCanvasSize" setting that defaults to 5120x2880
2466         which is the 5K resolution for 16:9.
2467
2468         Also added a way to include the "accelerates drawing" flag in layer tree dumps.
2469
2470         Test: compositing/canvas/accelerated-canvas-compositing-size-limit.html
2471
2472         * html/HTMLCanvasElement.cpp:
2473         (WebCore::HTMLCanvasElement::shouldAccelerate):
2474         * page/Frame.h:
2475         * page/Settings.in:
2476         * platform/graphics/GraphicsLayer.cpp:
2477         (WebCore::GraphicsLayer::dumpProperties):
2478         * platform/graphics/GraphicsLayerClient.h:
2479         * rendering/RenderLayerCompositor.cpp:
2480         (WebCore::RenderLayerCompositor::layerTreeAsText):
2481         * testing/Internals.cpp:
2482         (WebCore::toLayerTreeFlags):
2483         * testing/Internals.h:
2484         * testing/Internals.idl:
2485
2486 2017-02-09  Antti Koivisto  <antti@apple.com>
2487
2488         Remove most cases of #if ENABLE(CACHE_PARTITIONING)
2489         https://bugs.webkit.org/show_bug.cgi?id=167990
2490
2491         Reviewed by Sam Weinig.
2492
2493         We'll just return empty string for the partition if partitioning is not enabled.
2494
2495         * html/DOMURL.cpp:
2496         (WebCore::DOMURL::revokeObjectURL):
2497         * inspector/InspectorPageAgent.cpp:
2498         (WebCore::InspectorPageAgent::cachedResource):
2499         * loader/FrameLoader.cpp:
2500         (WebCore::FrameLoader::loadURL):
2501         * loader/archive/cf/LegacyWebArchive.cpp:
2502         (WebCore::LegacyWebArchive::create):
2503         * loader/cache/CachedResource.h:
2504         (WebCore::CachedResource::url):
2505         (WebCore::CachedResource::cachePartition):
2506         * loader/cache/CachedResourceLoader.cpp:
2507         (WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
2508         (WebCore::CachedResourceLoader::requestResource):
2509         * loader/cache/CachedResourceRequest.cpp:
2510         (WebCore::CachedResourceRequest::setDomainForCachePartition):
2511         * loader/cache/CachedResourceRequest.h:
2512         * loader/cache/MemoryCache.cpp:
2513         (WebCore::MemoryCache::add):
2514         (WebCore::MemoryCache::revalidationSucceeded):
2515         (WebCore::MemoryCache::resourceForRequestImpl):
2516         (WebCore::MemoryCache::addImageToCache):
2517         (WebCore::MemoryCache::removeImageFromCache):
2518         (WebCore::MemoryCache::remove):
2519         (WebCore::MemoryCache::removeResourcesWithOrigin):
2520         (WebCore::MemoryCache::removeResourcesWithOrigins):
2521         (WebCore::MemoryCache::getOriginsWithCache):
2522         (WebCore::MemoryCache::originsWithCache):
2523         * loader/cache/MemoryCache.h:
2524         * page/SecurityOrigin.cpp:
2525         (WebCore::SecurityOrigin::domainForCachePartition):
2526         * page/SecurityOrigin.h:
2527         * platform/SchemeRegistry.cpp:
2528         (WebCore::cachePartitioningSchemes):
2529         (WebCore::SchemeRegistry::shouldPartitionCacheForURLScheme):
2530         * platform/SchemeRegistry.h:
2531         * platform/ios/WebCoreSystemInterfaceIOS.mm:
2532         * platform/mac/WebCoreSystemInterface.h:
2533         * platform/mac/WebCoreSystemInterface.mm:
2534         * platform/network/ResourceRequestBase.cpp:
2535         (WebCore::ResourceRequestBase::setAsIsolatedCopy):
2536         (WebCore::ResourceRequestBase::setCachePartition):
2537         (WebCore::ResourceRequestBase::partitionName):
2538         * platform/network/ResourceRequestBase.h:
2539         (WebCore::ResourceRequestBase::cachePartition):
2540         (WebCore::ResourceRequestBase::setDomainForCachePartition):
2541         * platform/network/cf/ResourceRequest.h:
2542         (WebCore::ResourceRequest::cachePartition): Deleted.
2543         (WebCore::ResourceRequest::setCachePartition): Deleted.
2544         (WebCore::ResourceRequest::setDomainForCachePartition): Deleted.
2545         * platform/network/cf/ResourceRequestCFNet.cpp:
2546         (WebCore::ResourceRequest::doUpdatePlatformRequest):
2547         (WebCore::ResourceRequest::doUpdateResourceRequest):
2548         (WebCore::ResourceRequest::partitionName): Deleted.
2549         (WebCore::ResourceRequest::doPlatformSetAsIsolatedCopy): Deleted.
2550         * platform/network/cf/ResourceResponse.h:
2551         * platform/network/cocoa/ResourceRequestCocoa.mm:
2552         (WebCore::ResourceRequest::doUpdateResourceRequest):
2553         (WebCore::ResourceRequest::doUpdatePlatformRequest):
2554         * testing/Internals.cpp:
2555         (WebCore::Internals::isLoadingFromMemoryCache):
2556
2557 2017-02-09  Ryosuke Niwa  <rniwa@webkit.org>
2558
2559         Add Web Bluetooth as Not Considering
2560         https://bugs.webkit.org/show_bug.cgi?id=168042
2561
2562         Reviewed by Yusuke Suzuki.
2563
2564         Add Web Bluetooth as a feature not being considered to be implemented in WebKit.
2565
2566         * features.json:
2567
2568 2017-02-08  Simon Fraser  <simon.fraser@apple.com>
2569
2570         Put names on more UIViews for ease of debugging
2571         https://bugs.webkit.org/show_bug.cgi?id=168035
2572
2573         Reviewed by Tim Horton.
2574
2575         Name the page overlay layers.
2576
2577         * page/PageOverlayController.cpp:
2578         (WebCore::PageOverlayController::createRootLayersIfNeeded):
2579         (WebCore::PageOverlayController::installPageOverlay):
2580
2581 2017-02-08  Commit Queue  <commit-queue@webkit.org>
2582
2583         Unreviewed, rolling out r211912.
2584         https://bugs.webkit.org/show_bug.cgi?id=168034
2585
2586         http/tests/media/media-stream/disconnected-frame-permission-
2587         denied.html should be updated (Requested by youenn on
2588         #webkit).
2589
2590         Reverted changeset:
2591
2592         "[MediaStream] Remove legacy Navigator.webkitGetUserMedia"
2593         https://bugs.webkit.org/show_bug.cgi?id=168016
2594         http://trac.webkit.org/changeset/211912
2595
2596 2017-02-08  Youenn Fablet  <youennf@gmail.com>
2597
2598         HTML Link elements should load data URLs as same origin
2599         https://bugs.webkit.org/show_bug.cgi?id=168032
2600         <rdar://problem/30275036>
2601
2602         Reviewed by Alex Christensen.
2603
2604         Test: fast/dom/data-url-css-link-element-cors-active.html
2605
2606         Making CSS data URLs resources considered as same origin when loaded through link elements.
2607         In the future, we should consider remove the data URL same origin flag and fully align with the fetch and HTML spec.
2608
2609         * html/HTMLLinkElement.cpp:
2610         (WebCore::HTMLLinkElement::process):
2611
2612 2017-02-08  Sam Weinig  <sam@webkit.org>
2613
2614         REGRESSION (r193286): Promise chain no longer prevent UI refresh
2615         <rdar://problem/28062149>
2616         https://bugs.webkit.org/show_bug.cgi?id=161291
2617
2618         Reviewed by Geoffrey Garen.
2619
2620         Add new subtest to js/dom/Promise.html
2621
2622         * dom/Microtasks.cpp:
2623         (WebCore::MicrotaskQueue::append):
2624         (WebCore::MicrotaskQueue::remove):
2625         (WebCore::MicrotaskQueue::performMicrotaskCheckpoint):
2626         * dom/Microtasks.h:
2627         The microtask queue needs to be completely drained, even of new microtasks added while
2628         the previous task was run. Remove the m_tasksAppendedDuringMicrotaskCheckpoint as it is
2629         no longer needed.
2630
2631 2017-02-08  Eric Carlson  <eric.carlson@apple.com>
2632
2633         [MediaStream] Remove legacy Navigator.webkitGetUserMedia
2634         https://bugs.webkit.org/show_bug.cgi?id=168016
2635
2636         Reviewed by Youenn Fablet.
2637
2638         No new tests, existing tests updated.
2639
2640         * WebCore.xcodeproj/project.pbxproj: NavigatorUserMedia.
2641         * DerivedSources.make: Ditto.
2642         * CMakeLists.txt: Ditto.
2643         * Modules/mediastream/NavigatorUserMedia.idl: Removed.
2644         * Modules/mediastream/NavigatorUserMedia.js: Removed.
2645         * WebCore.xcodeproj/project.pbxproj:
2646         * page/Navigator.idl: Add some whitespace to force derived sources to be rebuild correctly.
2647
2648 2017-02-08  Chris Dumez  <cdumez@apple.com>
2649
2650         Use smaller tiles in windows that are not active to facilitate App Napping
2651         https://bugs.webkit.org/show_bug.cgi?id=167997
2652         <rdar://problem/30358835>
2653
2654         Reviewed by Simon Fraser.
2655
2656         Use smaller / non-adaptative tiles in windows that are not active to facilitate
2657         App Napping after <https://trac.webkit.org/r197594>.
2658
2659         Test: compositing/tiling/non-active-window-tiles-size.html
2660
2661         * page/FrameView.cpp:
2662         (WebCore::FrameView::contentsResized):
2663         (WebCore::FrameView::addedOrRemovedScrollbar):
2664         (WebCore::FrameView::computeScrollability):
2665         (WebCore::FrameView::updateTiledBackingAdaptiveSizing):
2666         (WebCore::FrameView::unobscuredContentSizeChanged):
2667         (WebCore::FrameView::setViewExposedRect):
2668         * page/FrameView.h:
2669         * page/Page.cpp:
2670         (WebCore::Page::setActivityState):
2671         (WebCore::Page::isWindowActive):
2672         * page/Page.h:
2673         * platform/graphics/TiledBacking.h:
2674         * platform/graphics/ca/TileController.cpp:
2675         (WebCore::TileController::setTileSizeUpdateDelayDisabledForTesting):
2676         (WebCore::TileController::notePendingTileSizeChange):
2677         * platform/graphics/ca/TileController.h:
2678         * testing/Internals.cpp:
2679         (WebCore::Internals::resetToConsistentState):
2680         (WebCore::Internals::disableTileSizeUpdateDelay):
2681         * testing/Internals.h:
2682         * testing/Internals.idl:
2683
2684 2017-02-08  Chris Dumez  <cdumez@apple.com>
2685
2686         Unreviewed, rolling out r211907.
2687
2688         Broke the build
2689
2690         Reverted changeset:
2691
2692         "[MediaStream] Remove legacy Navigator.webkitGetUserMedia"
2693         https://bugs.webkit.org/show_bug.cgi?id=168016
2694         http://trac.webkit.org/changeset/211907
2695
2696 2017-02-08  Eric Carlson  <eric.carlson@apple.com>
2697
2698         [MediaStream] Remove legacy Navigator.webkitGetUserMedia
2699         https://bugs.webkit.org/show_bug.cgi?id=168016
2700
2701         Reviewed by Youenn Fablet.
2702
2703         No new tests, existing tests updated.
2704
2705         * WebCore.xcodeproj/project.pbxproj: NavigatorUserMedia.
2706         * DerivedSources.make: Ditto.
2707         * CMakeLists.txt: Ditto.
2708         * Modules/mediastream/NavigatorUserMedia.idl: Removed.
2709         * Modules/mediastream/NavigatorUserMedia.js: Removed.
2710         * WebCore.xcodeproj/project.pbxproj:
2711
2712 2017-02-08  Wenson Hsieh  <wenson_hsieh@apple.com>
2713
2714         Add kUTTypeUTF8PlainText and kUTTypeJPEG to the list of compatible content types in DragData
2715         https://bugs.webkit.org/show_bug.cgi?id=167942
2716         <rdar://problem/30315079>
2717
2718         Reviewed by Tim Horton.
2719
2720         Adds UTI types for dragging UTF8 plain text and JPEG images to the list of supported types in DragDataMac.mm.
2721         Also handles reading these types in PasteboardMac.mm. I verified manually with a test app that if a platform
2722         NSView vends only UTF8 plaintext or JPEG images when dragging, WebKit is able to read the contents of the
2723         pasteboard as text and an image, respectively.
2724
2725         New TestWebKitAPI tests in DragAndDropPasteboardTests.mm.
2726
2727         * platform/mac/DragDataMac.mm:
2728         (WebCore::DragData::containsCompatibleContent):
2729         * platform/mac/PasteboardMac.mm:
2730         (WebCore::Pasteboard::read):
2731
2732 2017-02-08  Said Abou-Hallawa  <sabouhallawa@apple.com>
2733
2734         getIntersectionList always returns empty NodeList until layout is complete
2735         https://bugs.webkit.org/show_bug.cgi?id=81423
2736
2737         Reviewed by Simon Fraser.
2738
2739         Layout needs to be forced before trying to figure out which SVGElements
2740         intersect with a given SVGRect. We do the same thing in the DOM API
2741         Element::getBoundingClientRect().
2742
2743         Test: svg/custom/intersection-list-before-layout.html
2744
2745         * svg/SVGSVGElement.cpp:
2746         (WebCore::SVGSVGElement::getIntersectionList):
2747
2748 2017-02-08  Antoine Quint  <graouts@apple.com>
2749
2750         [Modern Media Controls] Implement reduced and tight padding modes
2751         https://bugs.webkit.org/show_bug.cgi?id=167933
2752         <rdar://problem/30396994>
2753
2754         Reviewed by Dean Jackson.
2755
2756         The design specs for modern media controls mandate the following for inline media controls:
2757
2758             - controls at or below 300pt width use a 12pt left margin for the left buttons container,
2759             and a 12pt right margin for the right buttons container, and 16pth button margin inside
2760             both containers ("reduced padding mode").
2761
2762             - when dropping at or below 120pt width, controls use an 8pt left margin for
2763             the left buttons container, and an 8pt right margin for the right buttons container, and
2764             12pt button margin inside both containers and a shorter bar (25pt) ("compact mode").
2765
2766             - in the case of audio controls, at 400pt or less, controls switch to 12pt margins and
2767             button margins for both buttons containers ("tight padding mode").
2768
2769         The "compact" mode was already implemented as a dedicated MacOSInlineMediaControls subclass.
2770         Since we now have a more generic need to vary the metrics used for inline media controls on
2771         macOS, we add new features to MacOSInlineMediaControls to support varying metrics based on
2772         the controls' "layoutTraits" property.
2773
2774         So MediaController is changed such that it knows to use the new TightPadding and ReducedPadding
2775         layout traits based on the conditions defined above, and _updateControlsIfNeeded() is changed
2776         to set the "layoutTraits" property on the controls whenever called, which in our case is most
2777         relevantly a "resize" event on the shadow root or a TrackEvent on the video tracks (to determine
2778         when we're possibly changing between a video and audio file).
2779
2780         As a result, the "layoutTraits" setter is called on MacOSInlineMediaControls, which updates
2781         the metrics for the various buttons containers, but also notifies the buttons contained
2782         within that layout traits may have changed, since some buttons support a "compact" appearance
2783         that is shorter and require a different image file. To that end, IconButton has been updated
2784         so that it may be notified of a layout traits change through a new layoutTraitsDidChange()
2785         method, that checks whether the current layout traits differ from those last used when loading
2786         the icon.
2787
2788         Tests: media/modern-media-controls/icon-button/icon-button-change-layout-traits.html
2789                media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-compact-buttons-styles.html
2790                media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-compact-controls-bar-styles.html
2791                media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-compact.html
2792                media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-reduced-padding.html
2793                media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-tight-padding.html
2794                media/modern-media-controls/media-controller/media-controller-compact.html
2795                media/modern-media-controls/media-controller/media-controller-reduced-padding.html
2796                media/modern-media-controls/media-controller/media-controller-tight-padding.html
2797
2798         * Modules/modern-media-controls/controls/icon-button.js:
2799         (IconButton.prototype.set iconName):
2800         (IconButton.prototype.layoutTraitsDidChange):
2801         (IconButton.prototype._loadImage):
2802         * Modules/modern-media-controls/controls/layout-item.js:
2803         * Modules/modern-media-controls/controls/macos-compact-inline-media-controls.js: Removed.
2804         * Modules/modern-media-controls/controls/macos-inline-media-controls.js:
2805         (MacOSInlineMediaControls.prototype.get layoutTraits):
2806         (MacOSInlineMediaControls.prototype.set layoutTraits):
2807         (MacOSInlineMediaControls.prototype._matchLayoutTraits):
2808         * Modules/modern-media-controls/js-files:
2809         * Modules/modern-media-controls/media/media-controller.js:
2810         (MediaController):
2811         (MediaController.prototype.get layoutTraits):
2812         (MediaController.prototype.handleEvent):
2813         (MediaController.prototype._updateControlsIfNeeded):
2814         (MediaController.prototype._controlsClassForLayoutTraits):
2815         (MediaController.prototype._shouldFadeBetweenControls): Deleted.
2816         (MediaController.prototype._controlsClass): Deleted.
2817         * WebCore.xcodeproj/project.pbxproj:
2818
2819 2017-02-08  Aakash Jain  <aakash_jain@apple.com>
2820
2821         Move private methods from WKGraphics.h to a separate header file
2822         https://bugs.webkit.org/show_bug.cgi?id=167996
2823
2824         Reviewed by Alexey  Proskuryakov.
2825
2826         * platform/ios/wak/WKGraphicsInternal.h: Added.
2827         * WebCore.xcodeproj/project.pbxproj: Added WKGraphicsInternal.h
2828         * platform/ios/wak/WKGraphics.h: Moved methods to WKGraphicsInternal.h
2829         * platform/graphics/mac/GraphicsContextMac.mm: Included new header file.
2830         * platform/ios/wak/WKGraphics.mm: Same.
2831
2832 2017-02-08  Brady Eidson  <beidson@apple.com>
2833
2834         Opt-out iBooks from synchronous willSendRequest on iOS.
2835         <rdar://problem/30129966> and https://bugs.webkit.org/show_bug.cgi?id=168006
2836
2837         Reviewed by Brent Fulgham.
2838
2839         No new tests (Not a testable behavior change at this time).
2840
2841         * platform/network/mac/ResourceHandleMac.mm:
2842         (WebCore::synchronousWillSendRequestEnabled): iBooks never gets synchronous willSendRequest:
2843
2844 2017-02-08  Sam Weinig  <sam@webkit.org>
2845
2846         Split JSDOMConstructor.h/cpp up by class
2847         https://bugs.webkit.org/show_bug.cgi?id=167958
2848
2849         Reviewed by Tim Horton.
2850
2851         Splits JSDOMConstructor up by class.
2852         - Renames DOMConstructorObject to JSDOMConstructorBase.
2853         - Renames DOMConstructorWithDocument to JSDOMConstructorWithDocument.
2854         - Renames DOMConstructorJSBuiltinObject to JSDOMBuiltinConstructorBase.
2855         - Renames JSBuiltinConstructor to JSDOMBuiltinConstructor.
2856
2857         * CMakeLists.txt:
2858         * WebCore.xcodeproj/project.pbxproj:
2859         * bindings/js/JSBindingsAllInOne.cpp:
2860         Add new files.
2861
2862         * bindings/js/JSDOMBinding.h:
2863         (WebCore::propertyNameToString): Deleted.
2864         (WebCore::propertyNameToAtomicString): Deleted.
2865         * bindings/js/JSDOMBuiltinConstructor.h: Copied from Source/WebCore/bindings/js/JSDOMConstructor.h.
2866         * bindings/js/JSDOMBuiltinConstructorBase.cpp: Copied from Source/WebCore/bindings/js/JSDOMConstructor.cpp.
2867         * bindings/js/JSDOMBuiltinConstructorBase.h: Copied from Source/WebCore/bindings/js/JSDOMConstructor.h.
2868         * bindings/js/JSDOMConstructor.cpp: Removed.
2869         * bindings/js/JSDOMConstructor.h: Remove all classes other than JSDOMConstructor.
2870         * bindings/js/JSDOMConstructorBase.cpp: Copied from Source/WebCore/bindings/js/JSDOMConstructor.cpp.
2871         * bindings/js/JSDOMConstructorBase.h: Copied from Source/WebCore/bindings/js/JSDOMConstructor.h.
2872         * bindings/js/JSDOMConstructorNotConstructable.h: Copied from Source/WebCore/bindings/js/JSDOMConstructor.h.
2873         * bindings/js/JSDOMConstructorWithDocument.cpp: Copied from Source/WebCore/bindings/js/JSDOMConstructor.cpp.
2874         * bindings/js/JSDOMConstructorWithDocument.h: Copied from Source/WebCore/bindings/js/JSDOMConstructor.h.
2875         * bindings/js/JSDOMNamedConstructor.h: Copied from Source/WebCore/bindings/js/JSDOMConstructor.h.
2876
2877         * bindings/js/JSDOMConvertStrings.h:
2878         (WebCore::propertyNameToString):
2879         (WebCore::propertyNameToAtomicString):
2880         Move these here from JSDOMBinding.
2881
2882         * bindings/js/JSHTMLElementCustom.cpp:
2883         (WebCore::constructJSHTMLElement):
2884         * bindings/js/JSMutationObserverCustom.cpp:
2885         (WebCore::constructJSMutationObserver):
2886         * bindings/js/JSReadableStreamPrivateConstructors.cpp:
2887         * bindings/js/JSStorageCustom.cpp:
2888         * bindings/js/JSUserMessageHandlersNamespaceCustom.cpp:
2889         (WebCore::JSUserMessageHandlersNamespace::getOwnPropertySlotDelegate):
2890         * bindings/js/JSWorkerCustom.cpp:
2891         (WebCore::constructJSWorker):
2892         * bindings/scripts/CodeGeneratorJS.pm:
2893         (GetConstructorTemplateClassName):
2894         (GenerateConstructorDeclaration):
2895         Update includes/names.
2896
2897         * dom/StaticRange.cpp:
2898         (WebCore::StaticRange::~StaticRange):
2899         * dom/StaticRange.h:
2900         Add out-of-line destructor, so Node.h does not have to be included.
2901
2902 2017-02-08  Joseph Pecoraro  <pecoraro@apple.com>
2903
2904         Initialize the main RunLoop in iOS WebKitLegacy
2905         https://bugs.webkit.org/show_bug.cgi?id=167953
2906
2907         Reviewed by Alexey Proskuryakov.
2908
2909         * platform/ios/wak/WebCoreThread.mm:
2910         (StartWebThread):
2911         Initialize the main runloop on the main thread during iOS WebKit initialization.
2912
2913 2017-02-08  Aakash Jain  <aakash_jain@apple.com>
2914
2915         Move private methods from WKContentObservation.h to a separate header file
2916         https://bugs.webkit.org/show_bug.cgi?id=167998
2917
2918         Reviewed by Alexey Proskuryakov.
2919
2920         * WebCore.xcodeproj/project.pbxproj: Added WKContentObservationInternal.h
2921         * platform/ios/wak/WKContentObservationInternal.h: Added.
2922         * platform/ios/wak/WKContentObservation.h: Moved methods to WKContentObservationInternal.h
2923         * platform/ios/wak/WKContentObservation.cpp: Included new header file.
2924         * page/DOMTimer.cpp: Same.
2925         * page/DOMWindow.cpp: Same.
2926         * style/RenderTreeUpdater.cpp: Same.
2927
2928 2017-02-08  Youenn Fablet  <youenn@apple.com>
2929
2930         RTCPeerConnection constructor can take null as input
2931         https://bugs.webkit.org/show_bug.cgi?id=167992
2932
2933         Reviewed by Chris Dumez.
2934
2935         Covered by updated test.
2936
2937         RTCPeerConnection takes an optional Dictionary as input.
2938         As per https://heycam.github.io/webidl/#es-dictionary, null is converted to an empty dictionary.
2939
2940         * Modules/mediastream/RTCPeerConnection.js:
2941         (initializeRTCPeerConnection):
2942
2943 2017-02-08  Andreas Kling  <akling@apple.com>
2944
2945         No need for CachedFrame to detach custom scrollbars.
2946         <https://webkit.org/b/167995>
2947
2948         Reviewed by Sam Weinig.
2949
2950         Custom scrollbars have already been torn down with the rest of the render tree
2951         by the time we're creating a CachedFrame.
2952
2953         * history/CachedFrame.cpp:
2954         (WebCore::CachedFrame::CachedFrame):
2955
2956 2017-02-08  Zalan Bujtas  <zalan@apple.com>
2957
2958         Simple line layout: Fix printReason for unsupported overflow values.
2959         https://bugs.webkit.org/show_bug.cgi?id=168000
2960
2961         Reviewed by Simon Fraser.
2962
2963         Not testable.
2964
2965         * rendering/SimpleLineLayout.cpp:
2966         (WebCore::SimpleLineLayout::canUseForStyle):
2967         (WebCore::SimpleLineLayout::printReason):
2968
2969 2017-02-08  Aakash Jain  <aakash_jain@apple.com>
2970
2971         Remove WebCoreObjCDeallocWithWebThreadLock from header file
2972         https://bugs.webkit.org/show_bug.cgi?id=167987
2973
2974         Reviewed by Alexey Proskuryakov.
2975
2976         * platform/ios/wak/WebCoreThread.mm: Added WebCoreObjCDeallocWithWebThreadLock.
2977         * platform/ios/wak/WebCoreThreadMessage.h: Removed WebCoreObjCDeallocWithWebThreadLock.
2978
2979 2017-02-08  Aakash Jain  <aakash_jain@apple.com>
2980
2981         Move WKMouseInRect to WAKView.mm
2982         https://bugs.webkit.org/show_bug.cgi?id=167989
2983
2984         Reviewed by Alexey Proskuryakov.
2985
2986         * platform/ios/wak/WAKAppKitStubs.h: Removed WKMouseInRect.
2987         * platform/ios/wak/WAKAppKitStubs.m:
2988         (WKMouseInRect): Deleted.
2989         * platform/ios/wak/WAKView.mm: 
2990         (-[WAKView mouse:inRect:]): Added the logic of WKMouseInRect here instead of separate function call.
2991
2992 2017-02-08  Aakash Jain  <aakash_jain@apple.com>
2993
2994         Remove unused method WebCore::PluginData::pluginNameForMimeType
2995         https://bugs.webkit.org/show_bug.cgi?id=167986
2996
2997         Reviewed by Anders Carlsson.
2998
2999         * plugins/PluginData.cpp:
3000         (WebCore::PluginData::pluginNameForWebVisibleMimeType): Deleted.
3001         * plugins/PluginData.h: Removed pluginNameForWebVisibleMimeType.
3002
3003 2017-02-08  Carlos Garcia Campos  <cgarcia@igalia.com>
3004
3005         [GTK] Fix translatable form validation messages
3006         https://bugs.webkit.org/show_bug.cgi?id=167984
3007
3008         Reviewed by Michael Catanzaro.
3009
3010         Most of them are just wrong. Use the same mesages than mac, which also makes some tests pass.
3011
3012         Fixes: fast/forms/validation-message-maxLength.html
3013                fast/forms/validationMessage.html
3014
3015         * platform/gtk/LocalizedStringsGtk.cpp:
3016         (WebCore::validationMessageValueMissingText):
3017         (WebCore::validationMessageValueMissingForCheckboxText):
3018         (WebCore::validationMessageValueMissingForFileText):
3019         (WebCore::validationMessageValueMissingForMultipleFileText):
3020         (WebCore::validationMessageValueMissingForRadioText):
3021         (WebCore::validationMessageValueMissingForSelectText):
3022         (WebCore::validationMessageTypeMismatchText):
3023         (WebCore::validationMessageTypeMismatchForEmailText):
3024         (WebCore::validationMessageTypeMismatchForMultipleEmailText):
3025         (WebCore::validationMessageTypeMismatchForURLText):
3026         (WebCore::validationMessagePatternMismatchText):
3027         (WebCore::validationMessageTooShortText):
3028         (WebCore::validationMessageTooLongText):
3029         (WebCore::validationMessageRangeUnderflowText):
3030         (WebCore::validationMessageRangeOverflowText):
3031         (WebCore::validationMessageStepMismatchText):
3032         (WebCore::validationMessageBadInputForNumberText):
3033
3034 2017-02-08  Chris Dumez  <cdumez@apple.com>
3035
3036         Add support for enhanced privacy diagnostic logging
3037         https://bugs.webkit.org/show_bug.cgi?id=167948
3038         <rdar://problem/30385112>
3039
3040         Reviewed by Antti Koivisto.
3041
3042         Add new logDiagnosticMessageWithEnhancedPrivacy() method to DiagnosticLoggingClient
3043         that is used for enhanced privacy logging. Start using this new API to log domains
3044         that are visited.
3045
3046         * loader/EmptyClients.cpp:
3047         * loader/FrameLoader.cpp:
3048         (WebCore::logNavigation):
3049         (WebCore::FrameLoader::loadWithDocumentLoader):
3050         * page/DiagnosticLoggingClient.h:
3051         * page/DiagnosticLoggingKeys.cpp:
3052         (WebCore::DiagnosticLoggingKeys::domainVisitedKey):
3053         * page/DiagnosticLoggingKeys.h:
3054
3055 2017-02-08  Carlos Garcia Campos  <cgarcia@igalia.com>
3056
3057         [GStreamer] Critical warnings when media player is destroyed
3058         https://bugs.webkit.org/show_bug.cgi?id=167981
3059
3060         Reviewed by Xabier Rodriguez-Calvar.
3061
3062         It can happen that the source doesn't have a parent when we try to disconnect the element-added signal.
3063
3064         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3065         (WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer):
3066         (WebCore::MediaPlayerPrivateGStreamer::sourceChanged):
3067
3068 2017-02-08  Miguel Gomez  <magomez@igalia.com>
3069
3070         [GTK] Reduce TiledBackingStore tile coverage when on memory pressure state
3071         https://bugs.webkit.org/show_bug.cgi?id=167980
3072
3073         Reviewed by Carlos Garcia Campos.
3074
3075         Use a smaller coverAreaMultiplier in the TiledBackingStore when in memory pressure situation, to reduce
3076         the amount of tiles created.
3077
3078         No new tests.
3079
3080         * platform/graphics/texmap/coordinated/TiledBackingStore.cpp:
3081         (WebCore::TiledBackingStore::createTilesIfNeeded):
3082         (WebCore::TiledBackingStore::createTiles):
3083         * platform/graphics/texmap/coordinated/TiledBackingStore.h:
3084
3085 2017-02-08  Zan Dobersek  <zdobersek@igalia.com>
3086
3087         [EME] Implement MediaKeySession::remove()
3088         https://bugs.webkit.org/show_bug.cgi?id=167870
3089
3090         Reviewed by Xabier Rodriguez-Calvar.
3091
3092         Implement MediaKeySession::remove() as outlined in the specification.
3093
3094         The CDMInstance::removeSessionData() virtual method is added. CDMInstance
3095         implementors should remove any session data stored for the session that's
3096         represented by the passed-in session ID and session type.
3097
3098         Once the session data is removed, the passed-in callback should be invoked
3099         by the CDMInstance object so that MediaKeySession can immediately queue a
3100         task in which it updates key statuses and expiration, reject the promise if
3101         the data removal failed, or enqueue any license-release message and finally
3102         successfully resolve the promise.
3103
3104         MockCDMFactory gains the removeKeysFromSessionWithID() method that purges
3105         the keys for a given session ID. The method is called from
3106         MockCDMInstance::removeSessionData() implementation, which passes the
3107         removed keys to the RemoveSessionDataCallback, along with a license-release
3108         message that is checked in the tests. The key removal itself isn't tested
3109         yet because the MediaKeySession's `update key statuses` algorithm isn't
3110         implemented yet.
3111
3112         Test: media/encrypted-media/mock-MediaKeySession-remove.html
3113
3114         * Modules/encryptedmedia/CDMInstance.h:
3115         * Modules/encryptedmedia/MediaKeySession.cpp:
3116         (WebCore::MediaKeySession::remove):
3117         * testing/MockCDMFactory.cpp:
3118         (WebCore::MockCDMFactory::removeKeysFromSessionWithID):
3119         (WebCore::MockCDMInstance::removeSessionData):
3120         * testing/MockCDMFactory.h:
3121
3122 2017-02-08  Zan Dobersek  <zdobersek@igalia.com>
3123
3124         [EME] Implement MediaKeySession::close()
3125         https://bugs.webkit.org/show_bug.cgi?id=167869
3126
3127         Reviewed by Xabier Rodriguez-Calvar.
3128
3129         Implement MediaKeySession::close() as outlined in the specification.
3130
3131         The CDMInstance::closeSession() virtual method, when called, should
3132         close the session that's represented by the passed-in session ID on
3133         the CDMInstance implementor object. That's the same session ID that
3134         the CDMInstance object passes to the MediaKeySession class through
3135         the callback that's provided to the updateLicense call.
3136
3137         The CloseSessionCallback, passed to CDMInstance::closeSession(),
3138         should be invoked by the CDMInstance implementor once the session
3139         is closed. When that is invoked, another task is queued for the
3140         MediaKeySession object that runs the `session closed` algorithm
3141         and resolves the promise.
3142
3143         MockCDMInstance::closeSession() is defined to remove the session
3144         from the MockCDMFactory object and invoke the CloseSessionCallback.
3145
3146         Test: media/encrypted-media/mock-MediaKeySession-close.html
3147
3148         * Modules/encryptedmedia/CDMInstance.h:
3149         * Modules/encryptedmedia/MediaKeySession.cpp:
3150         (WebCore::MediaKeySession::close):
3151         * testing/MockCDMFactory.cpp:
3152         (WebCore::MockCDMInstance::closeSession):
3153         * testing/MockCDMFactory.h:
3154
3155 2017-02-08  Zan Dobersek  <zdobersek@igalia.com>
3156
3157         [EME] Alias CDMInstance enums to the specification-defined enums
3158         https://bugs.webkit.org/show_bug.cgi?id=167896
3159
3160         Reviewed by Sam Weinig.
3161
3162         Simplify the enums in the CDMInstance class by simply aliasing them
3163         to the EME specification-defined enums. CDMInstance::KeyStatus and
3164         CDMInstance::MessageType were already direct copies of the
3165         MediaKeyStatus and MediaKeyMessageType enums, while the
3166         CDMInstance::LicenseType had the members as MediaKeySessionType,
3167         but with slightly different names.
3168
3169         No changes in behavior.
3170
3171         * Modules/encryptedmedia/CDMInstance.h:
3172         * Modules/encryptedmedia/MediaKeySession.cpp:
3173         (WebCore::MediaKeySession::generateRequest):
3174         (WebCore::MediaKeySession::update):
3175         * testing/MockCDMFactory.cpp:
3176         (WebCore::MockCDMInstance::requestLicense):
3177
3178 2017-02-07  Carlos Garcia Campos  <cgarcia@igalia.com>
3179
3180         REGRESSION(r210740): [GTK] 2.15 broke embedded videos in GNOME's yelp app
3181         https://bugs.webkit.org/show_bug.cgi?id=167887
3182
3183         Reviewed by Michael Catanzaro.
3184
3185         Update the m_renderingCanBeAccelerated when accelerated rendering state changes.
3186
3187         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
3188         (WebCore::MediaPlayerPrivateGStreamerBase::acceleratedRenderingStateChanged):
3189         (WebCore::MediaPlayerPrivateGStreamerBase::createVideoSink):
3190         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
3191
3192 2017-02-07  Carlos Garcia Campos  <cgarcia@igalia.com>
3193
3194         [GTK] Handle extended colors in cairo and texture mapper backends
3195         https://bugs.webkit.org/show_bug.cgi?id=167943
3196
3197         Reviewed by Michael Catanzaro.
3198
3199         Fixes: css3/color/backgrounds-and-borders.html
3200                css3/color/box-shadows.html
3201                css3/color/canvas.html
3202                css3/color/composited-solid-backgrounds.html
3203                css3/color/text.html
3204
3205         * platform/graphics/Color.cpp:
3206         (WebCore::premultipliedARGBFromColor): Handle the case of color being extended.
3207         * platform/graphics/cairo/CairoUtilities.cpp:
3208         (WebCore::setSourceRGBAFromColor): Ditto.
3209         * platform/graphics/cairo/GraphicsContextCairo.cpp:
3210         (WebCore::fillRectWithColor): Use isVisible() instead of alpha().
3211         (WebCore::GraphicsContext::drawEllipse): Ditto.
3212         * platform/graphics/gtk/ColorGtk.cpp:
3213         (WebCore::Color::operator GdkRGBA): Handle the case of color being extended.
3214         * platform/graphics/texmap/TextureMapperGL.cpp:
3215         (WebCore::TextureMapperGL::drawNumber): Ditto.
3216         * platform/graphics/texmap/TextureMapperLayer.cpp:
3217         (WebCore::blendWithOpacity): Ditto.
3218         (WebCore::TextureMapperLayer::paintSelf): Use isVisible() instead of alpha().
3219         (WebCore::TextureMapperLayer::computeOverlapRegions): Ditto.
3220
3221 2017-02-07  Wenson Hsieh  <wenson_hsieh@apple.com>
3222
3223         WebItemProviderPasteboard should use -registerLoadHandlersToItemProvider: when creating a new UIItemProvider
3224         https://bugs.webkit.org/show_bug.cgi?id=167918
3225         <rdar://problem/30382347>
3226
3227         Reviewed by Tim Horton.
3228
3229         Adopts SPI in WebItemProviderPasteboard for object types that the platform knows how to serialize. Since we use
3230         -createObjectOfClass: to initialize data when reading off of the pasteboard, we need to match the format that
3231         objects conforming to UIItemProviderReading will expect. Thus, for all given objects that conform to
3232         UIItemProviderWriting, we have them register themselves to the item provider.
3233
3234         We register other UTI types due to the fact that PlatformPasteboardIOS does not care about the specific
3235         pasteboard used. This should not be necessary, however, since data written to the WebItemProviderPasteboard
3236         should never need to be read by an actual UIPasteboard. This will be refactored in a future patch to add a
3237         special type of WebItemProviderPasteboard-aware PlatformPasteboard.
3238
3239         Also fixes some reference counting issues in WebItemProviderPasteboard by changing the array of _itemProviders
3240         to be a RetainPtr.
3241
3242         * platform/ios/WebItemProviderPasteboard.mm:
3243         (-[WebItemProviderPasteboard init]):
3244         (-[WebItemProviderPasteboard pasteboardTypes]):
3245         (-[WebItemProviderPasteboard itemProviders]):
3246         (-[WebItemProviderPasteboard setItemProviders:]):
3247         (-[WebItemProviderPasteboard numberOfItems]):
3248         (-[WebItemProviderPasteboard setItems:]):
3249         (-[WebItemProviderPasteboard valuesForPasteboardType:inItemSet:]):
3250         (-[WebItemProviderPasteboard itemProviderAtIndex:]):
3251         (-[WebItemProviderPasteboard dealloc]): Deleted.
3252
3253 2017-02-06  Ryosuke Niwa  <rniwa@webkit.org>
3254
3255         WebContent process repeatedly jetsams on BuzzFeed's Another Round page
3256         https://bugs.webkit.org/show_bug.cgi?id=167830
3257         <rdar://problem/30187368>
3258
3259         Reviewed by Simon Fraser.
3260
3261         The jetsams on https://www.buzzfeed.com/anotherround were caused by WebKit creating the backing store
3262         for every iframe's layer on the page regardless of whether they're in the viewport or not.
3263
3264         This was caused by GraphicsLayerCA's setVisibleAndCoverageRects not setting CoverageRectChanged on
3265         m_uncommittedChanges on the very first call. Fixed the bug by initializing m_uncommittedChanges
3266         to always have CoverageRectChanged so that the coverage rect would get updated properly.
3267
3268         Unfortunately, no new tests since somehow the backing store doesn't get created inside the test runner.
3269
3270         * platform/graphics/ca/GraphicsLayerCA.h:
3271         (WebCore::GraphicsLayerCA):
3272
3273 2017-02-07  Youenn Fablet  <youennf@gmail.com>
3274
3275         [WebRTC] LibWebRTCEndpoint should not own objects that should be destroyed on the main thread
3276         https://bugs.webkit.org/show_bug.cgi?id=167816
3277
3278         Reviewed by Alex Christensen.
3279
3280         Tests: webrtc/libwebrtc/release-while-creating-offer.html
3281                webrtc/libwebrtc/release-while-getting-stats.html
3282                webrtc/libwebrtc/release-while-setting-local-description.html
3283
3284         Moving AV sources, stats promises, ICE candidates from LibWebRTCEndpoint to LibWebRTCPeerConnectionBackend.
3285         This allows ensuring these are destroyed in the main thread.
3286
3287         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
3288         (WebCore::MediaEndpointPeerConnection::getStats):
3289         * Modules/mediastream/MediaEndpointPeerConnection.h:
3290         * Modules/mediastream/PeerConnectionBackend.h:
3291         * Modules/mediastream/RTCPeerConnection.cpp:
3292         (WebCore::RTCPeerConnection::getStats):
3293         * Modules/mediastream/RTCPeerConnection.h:
3294         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
3295         (WebCore::LibWebRTCMediaEndpoint::doCreateOffer):
3296         (WebCore::LibWebRTCMediaEndpoint::doCreateAnswer):
3297         (WebCore::LibWebRTCMediaEndpoint::getStats):
3298         (WebCore::LibWebRTCMediaEndpoint::StatsCollector::StatsCollector):
3299         (WebCore::LibWebRTCMediaEndpoint::StatsCollector::OnStatsDelivered):
3300         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
3301         (WebCore::LibWebRTCMediaEndpoint::addIceCandidate):
3302         (WebCore::LibWebRTCMediaEndpoint::isStopped):
3303         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
3304         (WebCore::LibWebRTCPeerConnectionBackend::~LibWebRTCPeerConnectionBackend):
3305         (WebCore::LibWebRTCPeerConnectionBackend::getStats):
3306         (WebCore::LibWebRTCPeerConnectionBackend::iceCandidateSucceeded):
3307         (WebCore::LibWebRTCPeerConnectionBackend::iceCandidateFailed):
3308         (WebCore::LibWebRTCPeerConnectionBackend::doSetLocalDescription):
3309         (WebCore::LibWebRTCPeerConnectionBackend::doSetRemoteDescription):
3310         (WebCore::LibWebRTCPeerConnectionBackend::doAddIceCandidate):
3311         (WebCore::LibWebRTCPeerConnectionBackend::addAudioSource):
3312         (WebCore::LibWebRTCPeerConnectionBackend::addVideoSource):
3313         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
3314         * testing/MockLibWebRTCPeerConnection.cpp:
3315         (WebCore::MockLibWebRTCPeerConnectionReleasedInNetworkThreadWhileCreatingOffer::MockLibWebRTCPeerConnectionReleasedInNetworkThreadWhileCreatingOffer):
3316         (WebCore::releaseInNetworkThread):
3317         (WebCore::MockLibWebRTCPeerConnectionReleasedInNetworkThreadWhileCreatingOffer::CreateOffer):
3318         (WebCore::MockLibWebRTCPeerConnectionReleasedInNetworkThreadWhileGettingStats::MockLibWebRTCPeerConnectionReleasedInNetworkThreadWhileGettingStats):
3319         (WebCore::MockLibWebRTCPeerConnectionReleasedInNetworkThreadWhileGettingStats::GetStats):
3320         (WebCore::MockLibWebRTCPeerConnectionReleasedInNetworkThreadWhileSettingDescription::MockLibWebRTCPeerConnectionReleasedInNetworkThreadWhileSettingDescription):
3321         (WebCore::MockLibWebRTCPeerConnectionReleasedInNetworkThreadWhileSettingDescription::SetLocalDescription):
3322         (WebCore::MockLibWebRTCPeerConnectionFactory::CreatePeerConnection):
3323         * testing/MockLibWebRTCPeerConnection.h:
3324
3325 2017-02-07  Myles C. Maxfield  <mmaxfield@apple.com>
3326
3327         [Win] [GTK] [EFL] Compile (but don't use, yet) the platform-independent piece of ComplexTextController
3328         https://bugs.webkit.org/show_bug.cgi?id=167927
3329
3330         Reviewed by Brent Fulgham.
3331
3332         This patch simply moves some functions around to enable the Win, GTK, and EFL ports to compile the
3333         platform-independent pieces of ComplexTextController. Those parts of ComplexTextController have
3334         some dependencies which were previously only available on the Cocoa ports; however, those
3335         dependencies are easily created or moved from elsewhere. The next step is to populate the
3336         ComplexTextController::collectComplexTextRunsForCharacters() function for DirectWrite and HarfBuzz.
3337         Once that is done, UniscribeController and HarfBuzzShaper can be deleted.
3338
3339         Adds ComplexTextController TestWebKitAPI tests to the Win and GTK ports.
3340
3341         * CMakeLists.txt: Everyone can compile the platform-independent piece of ComplexTextController.
3342         * PlatformEfl.cmake: Add the HarfBuzz-specific piece.
3343         * PlatformGTK.cmake: Ditto.
3344         * PlatformWin.cmake: Add the DirectWrite-specific piece.
3345         * platform/graphics/ComplexTextController.cpp:
3346         (WebCore::TextLayoutDeleter::operator()): ComplexTextController shouldn't be enabled yet for Win,
3347         GTK, or EFL.
3348         (WebCore::FontCascade::createLayout): Ditto.
3349         (WebCore::FontCascade::width): Ditto.
3350         (WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun): Moved shared code to the shared
3351         file.
3352         * platform/graphics/Font.cpp:
3353         (WebCore::Font::noSynthesizableFeaturesFont): Default implementation for other ports.
3354         (WebCore::Font::variantCapsSupportsCharacterForSynthesis): Ditto.
3355         * platform/graphics/FontCascade.cpp:
3356         (WebCore::FontCascade::fontForCombiningCharacterSequence): Ditto.
3357         (WebCore::FontCascade::drawEmphasisMarksForComplexText): Ditto.
3358         (WebCore::FontCascade::createLayout): Deleted. Moved to ComplexTextController.
3359         (WebCore::TextLayoutDeleter::operator()): Deleted. Ditto.
3360         * platform/graphics/FontCascade.h: fontForCombiningCharacterSequence() should exist on all ports.
3361         * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
3362         (WebCore::FontCascade::drawEmphasisMarksForComplexText): Deleted. Shared among all ports.
3363         * platform/graphics/cocoa/FontCascadeCocoa.mm:
3364         (WebCore::FontCascade::drawEmphasisMarksForComplexText): Deleted. Ditto.
3365         * platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp: Added.
3366         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters): Empty implementation of
3367         HarfBuzz-specific piece of ComplexTextController.
3368         * platform/graphics/mac/ComplexTextControllerCoreText.mm: Moved constructors to shared file.
3369         * platform/graphics/win/ComplexTextControllerDirectWrite.cpp: Added.
3370         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters): Empty implementation of
3371         Direct Write-specific piece of ComplexTextController.
3372         * platform/graphics/win/FontWin.cpp:
3373         (WebCore::FontCascade::drawEmphasisMarksForComplexText): Deleted. Shared among all ports.
3374
3375 2017-02-07  Alex Christensen  <achristensen@webkit.org>
3376
3377         Revert r166597
3378         https://bugs.webkit.org/show_bug.cgi?id=167951
3379
3380         Reviewed by Andreas Kling.
3381
3382         * platform/spi/cf/CFNetworkSPI.h:
3383         Remove now-unused SPI declaration.
3384
3385 2017-02-07  Sam Weinig  <sam@webkit.org>
3386
3387         Try to fix the windows build.
3388
3389         * bindings/js/ReadableStreamDefaultController.cpp:
3390
3391 2017-02-07  Youenn Fablet  <youennf@gmail.com>
3392
3393         [WebRTC] LibWebRTC WK2 network stack is not providing correct ports for ICE candidates
3394         https://bugs.webkit.org/show_bug.cgi?id=167939
3395
3396         Reviewed by Sam Weinig.
3397
3398         Test: webrtc/no-port-zero-in-upd-candidates.html
3399
3400         * testing/MockLibWebRTCPeerConnection.cpp:
3401         (WebCore::MockLibWebRTCPeerConnectionFactory::MockLibWebRTCPeerConnectionFactory): Adding a way to create one real PC in WTR environment.
3402
3403 2017-02-07  Sam Weinig  <sam@webkit.org>
3404
3405         Update bindings tests results for additional include.
3406
3407         * bindings/scripts/test/JS/JSTestObj.cpp:
3408         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
3409
3410 2017-02-07  Sam Weinig  <sam@webkit.org>
3411
3412         Try to fix the windows build.
3413
3414         * bindings/js/JSDOMConvertNumbers.h:
3415
3416 2017-02-07  Alex Christensen  <achristensen@webkit.org>
3417
3418         Fix libwebrtc build after r211728
3419         https://bugs.webkit.org/show_bug.cgi?id=167821
3420
3421         * platform/mediastream/mac/RealtimeIncomingVideoSource.cpp:
3422         (WebCore::RealtimeIncomingVideoSource::processNewSample):
3423         * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
3424         (WebCore::RealtimeOutgoingAudioSource::audioSamplesAvailable):
3425         (WebCore::RealtimeOutgoingAudioSource::sourceHasMoreMediaData): Deleted.
3426         * platform/mediastream/mac/RealtimeOutgoingAudioSource.h:
3427         * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
3428         (WebCore::RealtimeOutgoingVideoSource::RealtimeOutgoingVideoSource):
3429         (WebCore::RealtimeOutgoingVideoSource::videoSampleAvailable):
3430         (WebCore::RealtimeOutgoingVideoSource::sourceHasMoreMediaData): Deleted.
3431         * platform/mediastream/mac/RealtimeOutgoingVideoSource.h:
3432
3433 2017-02-07  Tim Horton  <timothy_horton@apple.com>
3434
3435         Remove accidentally-added (in r211409) patch reject file
3436
3437         * bindings/scripts/test/JS/JSTestSerialization.cpp.rej: Removed.
3438
3439 2017-02-07  Sam Weinig  <sam@webkit.org>
3440
3441         JSDOMConvert is too big. Split it up!
3442         https://bugs.webkit.org/show_bug.cgi?id=167806
3443
3444         Rubber-stamped by Geoff Garen.
3445
3446         Split JSDOMConvert up roughly by IDL type. Some are grouped for convenience, e.g. all the
3447         string types are together, all the numeric types are together. Also moved helpers from 
3448         JSDOMBinding to their respective JSDOMConvertFoo header. For now, JSDOMConvert.h as an
3449         umbrella of all the sub headers, but it will be removed, and the code generator taught
3450         to include the right header in a subsequent patch.
3451
3452         * CMakeLists.txt:
3453         * WebCore.xcodeproj/project.pbxproj:
3454         Add new files.
3455
3456         * bindings/js/IDBBindingUtilities.cpp:
3457         * bindings/js/IDBBindingUtilities.h:
3458         Remove toJS that takes a std::optional<IDBKeyPath>, it was unused, and update date code
3459         to only call valueToDate once, and pass things by reference.
3460
3461         * bindings/js/JSDOMBinding.cpp:
3462         * bindings/js/JSDOMBinding.h:
3463         Move most of the conversion helpers into their respective JSDOMConvertFoo header.
3464
3465         * bindings/js/JSDOMConvert.h:
3466         Leave for now, just has includes of all the broken out headers.
3467
3468         * bindings/js/JSDOMConvertAny.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
3469         * bindings/js/JSDOMConvertBase.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
3470         * bindings/js/JSDOMConvertBoolean.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
3471         * bindings/js/JSDOMConvertBufferSource.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
3472         * bindings/js/JSDOMConvertCallbacks.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
3473         * bindings/js/JSDOMConvertDate.cpp: Copied from Source/WebCore/bindings/js/JSDOMBinding.cpp.
3474         * bindings/js/JSDOMConvertDate.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
3475         * bindings/js/JSDOMConvertDictionary.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
3476         * bindings/js/JSDOMConvertEnumeration.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
3477         * bindings/js/JSDOMConvertEventListener.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
3478         * bindings/js/JSDOMConvertIndexedDB.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
3479         * bindings/js/JSDOMConvertInterface.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
3480         * bindings/js/JSDOMConvertJSON.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
3481         * bindings/js/JSDOMConvertNull.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
3482         * bindings/js/JSDOMConvertNullable.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
3483         * bindings/js/JSDOMConvertNumbers.cpp: Copied from Source/WebCore/bindings/js/JSDOMBinding.cpp.
3484         * bindings/js/JSDOMConvertNumbers.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
3485         * bindings/js/JSDOMConvertObject.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
3486         * bindings/js/JSDOMConvertRecord.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
3487         * bindings/js/JSDOMConvertSequences.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
3488         * bindings/js/JSDOMConvertSerializedScriptValue.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
3489         * bindings/js/JSDOMConvertStrings.cpp: Copied from Source/WebCore/bindings/js/JSDOMBinding.cpp.
3490         * bindings/js/JSDOMConvertStrings.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
3491         * bindings/js/JSDOMConvertUnion.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
3492         * bindings/js/JSDOMConvertVariadic.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
3493         * bindings/js/JSDOMConvertWebGL.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
3494         * bindings/js/JSDOMConvertXPathNSResolver.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
3495
3496         * bindings/scripts/CodeGeneratorJS.pm:
3497         (GenerateParametersCheck):
3498         Add include of JSDOMConvertVariadic.h rather than JSDOMConvert.
3499
3500         * bindings/js/JSCryptoCustom.cpp:
3501         * bindings/js/JSCryptoOperationData.cpp:
3502         * bindings/js/JSImageDataCustom.cpp:
3503         * bindings/js/ReadableStreamDefaultController.h:
3504         * bindings/js/WebCoreTypedArrayController.cpp:
3505         * html/canvas/WebGLAny.cpp:
3506         * platform/mac/SerializedPlatformRepresentationMac.mm:
3507         Add includes for specific JSDOMConvert header now that helpers have 
3508         been moved their from JSDOMBinding.h
3509
3510 2017-02-07  Sam Weinig  <sam@webkit.org>
3511
3512         Remove unnecessary exports on inline functions. They were causing build failures
3513         with some compilers.
3514
3515         * Modules/mediasource/SampleMap.h:
3516         (WebCore::PresentationOrderSampleMap::begin):
3517         (WebCore::PresentationOrderSampleMap::end):
3518         (WebCore::PresentationOrderSampleMap::rbegin):
3519         (WebCore::PresentationOrderSampleMap::rend):
3520         (WebCore::DecodeOrderSampleMap::begin):
3521         (WebCore::DecodeOrderSampleMap::end):
3522         (WebCore::DecodeOrderSampleMap::rbegin):
3523         (WebCore::DecodeOrderSampleMap::rend):
3524         (WebCore::SampleMap::sizeInBytes):
3525         (WebCore::SampleMap::decodeOrder):
3526         (WebCore::SampleMap::presentationOrder):
3527         (WebCore::SampleMap::addRange):
3528         (WebCore::SampleMap::SampleMap): Deleted.
3529
3530 2017-02-07  Yusuke Suzuki  <utatane.tea@gmail.com>
3531
3532         Unreviewed, manual roll out of r211777
3533         https://bugs.webkit.org/show_bug.cgi?id=167457
3534
3535         * bindings/js/ScriptModuleLoader.cpp:
3536         (WebCore::ScriptModuleLoader::importModule):
3537
3538 2017-02-07  Carlos Garcia Campos  <cgarcia@igalia.com>
3539
3540         [GStreamer] Deadlock when media player is destroyed
3541         https://bugs.webkit.org/show_bug.cgi?id=167861
3542
3543         Reviewed by Michael Catanzaro.
3544
3545         The problem is that we are calling notifyOne() for the draw mutex without taking the lock.
3546
3547         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
3548         (WebCore::MediaPlayerPrivateGStreamerBase::repaint):
3549
3550 2017-02-07  Zan Dobersek  <zdobersek@igalia.com>
3551
3552         MediaSourceClientGStreamerMSE: wrap FastMalloc-ed memory into pipeline-bound GstBuffers
3553         https://bugs.webkit.org/show_bug.cgi?id=167928
3554
3555         Reviewed by Xabier Rodriguez-Calvar.
3556
3557         The buffers created in MediaSourceClientGStreamerMSE can be large enough in size
3558         that repetitive allocations can cause larger heap fragmentation in different libc
3559         allocators. To avoid that occurrence, we should simply use FastMalloc to allocate
3560         memory for these buffers.
3561
3562         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
3563         (WebCore::MediaSourceClientGStreamerMSE::append):
3564
3565 2017-02-07  Antoine Quint  <graouts@apple.com>
3566
3567         [Modern Media Controls] Handle media durations of an hour or more gracefully
3568         https://bugs.webkit.org/show_bug.cgi?id=167882
3569         <rdar://problem/29601260>
3570
3571         Reviewed by Eric Carlson.
3572
3573         We add a new "labelsMayDisplayTimesOverAnHour" to TimeControl so that time labels
3574         to the left and right of the scrubber may have extra room to display to account for
3575         the extra "xx:" characters that may appear. We don't lay the time out dynamically
3576         such that we don't see layout jumps as the times shown in the labels go around
3577         the hour mark.
3578
3579         We also refactor the ElapsedTimeSupport and RemainingTimeSupport in a single
3580         TimeLabelsSupport class which updates both elapsed and remaining time labels
3581         and sets the "labelsMayDisplayTimesOverAnHour" on the TimeControl should a
3582         "durationchange" happen to make the media duration reach or go past the hour mark.
3583
3584         Tests: http/tests/media/modern-media-controls/time-labels-support/long-time.html
3585                media/modern-media-controls/time-control/time-control-labels-may-display-times-over-an-hour.html
3586                media/modern-media-controls/time-labels-support/elapsed-time.html
3587                media/modern-media-controls/time-labels-support/remaining-time.html
3588
3589         * Modules/modern-media-controls/controls/time-control.js:
3590         (TimeControl.prototype.get labelsMayDisplayTimesOverAnHour):
3591         (TimeControl.prototype.set labelsMayDisplayTimesOverAnHour):
3592         (TimeControl.prototype.set width):
3593         * Modules/modern-media-controls/controls/time-label.css:
3594         (.time-label):
3595         * Modules/modern-media-controls/js-files:
3596         * Modules/modern-media-controls/media/elapsed-time-support.js: Removed.
3597         * Modules/modern-media-controls/media/media-controller.js:
3598         (MediaController.prototype._updateControlsIfNeeded):
3599         * Modules/modern-media-controls/media/time-labels-support.js: Renamed from Source/WebCore/Modules/modern-media-controls/media/remaining-time-support.js.
3600         (TimeLabelsSupport.prototype.get control):
3601         (TimeLabelsSupport.prototype.syncControl):
3602         (TimeLabelsSupport):
3603         * WebCore.xcodeproj/project.pbxproj:
3604
3605 2017-02-06  Per Arne Vollan  <pvollan@apple.com>
3606
3607         Read stroke width of subtitles from MediaAccessibility framework.
3608         https://bugs.webkit.org/show_bug.cgi?id=167871
3609         <rdar://problem/29265906>
3610
3611         Reviewed by Brent Fulgham.
3612
3613         Read MACaptionFontAttributeStrokeWidth from CTFontDescriptorRef.
3614
3615         * page/CaptionUserPreferencesMediaAF.cpp:
3616         (WebCore::CaptionUserPreferencesMediaAF::strokeWidth):
3617         (WebCore::CaptionUserPreferencesMediaAF::captionsTextEdgeCSS):
3618         * page/CaptionUserPreferencesMediaAF.h:
3619         * platform/cf/MediaAccessibilitySoftLink.cpp:
3620         * platform/cf/MediaAccessibilitySoftLink.h:
3621
3622 2017-02-07  Antoine Quint  <graouts@apple.com>
3623
3624         [Modern Media Controls] Improve handling of <video> with only audio tracks
3625         https://bugs.webkit.org/show_bug.cgi?id=167836
3626         <rdar://problem/30255812>
3627
3628         Reviewed by Dean Jackson.
3629
3630         We now check for the availability of video tracks before considering a <video>
3631         element is displaying an actual video file and turning auto-hide on. We also
3632         check that we have video tracks before enabling the fullscreen button. This
3633         brings the behavior of a <video> pointing to a resource with no video tracks
3634         to be the same as an <audio> element.
3635
3636         Test: media/modern-media-controls/media-controller/media-controller-video-with-only-audio.html
3637
3638         * Modules/modern-media-controls/media/controls-visibility-support.js:
3639         (ControlsVisibilitySupport.prototype.get tracksToMonitor):
3640         (ControlsVisibilitySupport.prototype._updateControls):
3641         (ControlsVisibilitySupport):
3642         * Modules/modern-media-controls/media/fullscreen-support.js:
3643         (FullscreenSupport.prototype.syncControl):
3644         (FullscreenSupport):
3645
3646 2017-02-07  Romain Bellessort  <romain.bellessort@crf.canon.fr>
3647
3648         [Readable Streams API] Implement ReadableByteStreamController enqueue()
3649         https://bugs.webkit.org/show_bug.cgi?id=167786
3650
3651         Reviewed by Youenn Fablet.
3652
3653         Implemented ReadableByteStreamController enqueue() method. Also replaced
3654         @queue by an Array instead of a dedicated queue object (said object is
3655         useful for ReadableStreamDefaultController, but not for ReadableByteStreamController).
3656
3657         Added 8 tests to cover newly added code as well as code that was previously unreachable.
3658
3659         * Modules/streams/ReadableByteStreamController.js:
3660         (enqueue): Implemented as defined by spec.
3661         * Modules/streams/ReadableByteStreamInternals.js:
3662         (privateInitializeReadableByteStreamController): Updated @queue.
3663         (readableByteStreamControllerCancel): Updated @queue.
3664         (readableByteStreamControllerError): Updated @queue.
3665         (readableByteStreamControllerPull): Updated @queue.
3666         (readableByteStreamControllerEnqueue): Added.
3667         (readableByteStreamControllerEnqueueChunkToQueue): Added.
3668         * Modules/streams/ReadableStreamInternals.js:
3669         (readableStreamFulfillReadRequest): Added (used at different places).
3670
3671 2017-02-07  Chris Dumez  <cdumez@apple.com>
3672
3673         Object.preventExtensions() on a Location object should throw a TypeError
3674         https://bugs.webkit.org/show_bug.cgi?id=167917
3675
3676         Reviewed by Alex Christensen.
3677
3678         Object.preventExtensions() on a Location object should throw a TypeError:
3679         - https://html.spec.whatwg.org/#location-preventextensions
3680         - https://www.ecma-international.org/ecma-262/7.0/index.html#sec-object.preventextensions
3681
3682         Firefox already implements this.
3683
3684         No new tests, rebaselined existing tests.
3685
3686         * bindings/js/JSLocationCustom.cpp:
3687         (WebCore::JSLocation::preventExtensions):
3688
3689 2017-02-07  Yusuke Suzuki  <utatane.tea@gmail.com>
3690
3691         Web Inspector: allow import() inside the inspector
3692         https://bugs.webkit.org/show_bug.cgi?id=167457
3693
3694         Reviewed by Ryosuke Niwa.
3695
3696         When evaluating `import("...")`, we need the caller's context to resolve
3697         the module specifier correctly. For example, if `import("./cocoa.js")` is
3698         evaluated in the script "drinks/hot.js", this module name is resolved to
3699         "drinks/cocoa.js". If the same import operator is evaluated in the script
3700         "menu/all.js", the module specifier becomes "menu/cocoa.js".
3701
3702         Previously we reject the import operator if the caller does not have such
3703         a context. These context is SourceOrigin and its ScriptFetcher. While they
3704         are offered in the script tag and other code evaluations, the inspector
3705         console does not offer that. These class are offered in the WebCore side
3706         and we should not touch these classes in the JSC's inspector code.
3707
3708         Now we relax the above restriction. If the above caller information is not
3709         offered, we fallback to the default one. In the web page, we use the page's
3710         URL as the caller's source origin. This allows us to evaluate the import
3711         operator in the inspector console.
3712
3713         And as of r167698, the console recognizes `await import("...")` form. We use
3714         this to test this `import()` in the console functionality.
3715
3716         * bindings/js/ScriptModuleLoader.cpp:
3717         (WebCore::ScriptModuleLoader::importModule):
3718
3719 2017-02-07  Myles C. Maxfield  <mmaxfield@apple.com>
3720
3721         Move platform-independent parts of ComplexTextController out of mac/ subfolder
3722         https://bugs.webkit.org/show_bug.cgi?id=167922
3723
3724         Reviewed by Jon Lee.
3725
3726         Just a mechanical git mv, and updating the Xcode projects.
3727
3728         No new tests because there is no behavior change.
3729
3730         * WebCore.xcodeproj/project.pbxproj:
3731         * platform/graphics/ComplexTextController.cpp: Renamed from Source/WebCore/platform/graphics/mac/ComplexTextController.cpp.
3732         * platform/graphics/ComplexTextController.h: Renamed from Source/WebCore/platform/graphics/mac/ComplexTextController.h.
3733
3734 2017-02-06  Carlos Garcia Campos  <cgarcia@igalia.com>
3735
3736         Overlay scrolling with iframe-s broken
3737         https://bugs.webkit.org/show_bug.cgi?id=165056
3738
3739         Reviewed by Antonio Gomes.
3740
3741         Mouse press events for overlay scrollbars are ignored if there's a subframe under the scrollbar. This doesn't
3742         happen with normal scrollbars, because the subframe is not really under the scrollbar, so events are always
3743         correctly passed to the scrollbar. With overlay scrollbars, the hit test detects the scrollbar, but events are
3744         always passed first to the subframe. Scrollbars are correctly updated on hover though, because
3745         handleMouseMoveEvent checks the presence of scrollbars before checking for subframes and move events are
3746         actually passed to both, the scrollbar and the subframe. Overlay scrollbars should always take precedence over
3747         subframes to handle mouse press events, so we should check first if mouse is over a scrollbar and never pass the
3748         event to a subframe in that case. Another problem is that the cursor is not updated either when the overlay
3749         scrollbar is hovered and there's a subframe. This is because in handleMouseMoveEvent we pass the event to both
3750         the scrollbar and subframe but we never update the cursor when a suframe was found. So, here again we need to make
3751         an exception for scrollbars and upate the cursor when mouse is over the scrollbar even if a subframe was found.
3752
3753         Test: fast/scrolling/scroll-animator-overlay-scrollbars-clicked.html
3754
3755         * page/EventHandler.cpp:
3756         (WebCore::EventHandler::handleMousePressEvent): Move the scrollbar check before the subframe check.
3757         (WebCore::EventHandler::handleMouseMoveEvent): Update the cursor when hovering a scrollbar even if a subframe
3758         was found.
3759         (WebCore::EventHandler::updateLastScrollbarUnderMouse): Use an enum instead of a boolean for setLast parameter.
3760         * page/EventHandler.h:
3761
3762 2017-02-06  Chris Dumez  <cdumez@apple.com>
3763
3764         Symbols exposed on cross-origin Window / Location objects should be configurable
3765         https://bugs.webkit.org/show_bug.cgi?id=167920
3766
3767         Reviewed by Ryosuke Niwa.
3768
3769         Symbols exposed on cross-origin Window / Location objects should be configurable:
3770         - https://html.spec.whatwg.org/#crossorigingetownpropertyhelper-(-o,-p-) (Step 1)
3771
3772         Firefox behaves as per specification.
3773
3774         No new tests, rebaselined existing test.
3775
3776         * bindings/js/JSDOMWindowCustom.cpp:
3777         (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
3778         * bindings/js/JSLocationCustom.cpp:
3779         (WebCore::JSLocation::getOwnPropertySlotDelegate):
3780
3781 2017-02-06  Joseph Pecoraro  <pecoraro@apple.com>
3782
3783         Web Inspector: Do not use RunLoop when dispatching inspector GC event
3784         https://bugs.webkit.org/show_bug.cgi?id=167683
3785         <rdar://problem/30167791>
3786
3787         Reviewed by Brian Burg.
3788
3789         Covered by existing tests.
3790
3791         * CMakeLists.txt:
3792         * WebCore.xcodeproj/project.pbxproj:
3793         * inspector/InspectorAllInOne.cpp:
3794         Add new file.
3795
3796         * inspector/PageHeapAgent.cpp:
3797         (WebCore::PageHeapAgent::PageHeapAgent):
3798         (WebCore::PageHeapAgent::enable):
3799         (WebCore::PageHeapAgent::disable):
3800         * inspector/PageHeapAgent.h:
3801         Extend WebHeapAgent.
3802
3803         * inspector/WorkerInspectorController.cpp:
3804         (WebCore::WorkerInspectorController::WorkerInspectorController):
3805         Use WebHeapAgent.
3806
3807         * inspector/WebHeapAgent.cpp: Added.
3808         (WebCore::SendGarbageCollectionEventsTask::SendGarbageCollectionEventsTask):
3809         (WebCore::SendGarbageCollectionEventsTask::addGarbageCollection):
3810         (WebCore::SendGarbageCollectionEventsTask::reset):
3811         (WebCore::SendGarbageCollectionEventsTask::timerFired):
3812         (WebCore::WebHeapAgent::WebHeapAgent):
3813         (WebCore::WebHeapAgent::~WebHeapAgent):
3814         (WebCore::WebHeapAgent::disable):
3815         (WebCore::WebHeapAgent::dispatchGarbageCollectedEvent):
3816         (WebCore::WebHeapAgent::dispatchGarbageCollectionEventsAfterDelay):
3817         * inspector/WebHeapAgent.h:
3818         Move the defered event dispatch from InspectorHeapAgent here where a RunLoop is guarenteed.
3819
3820 2017-02-06  Joseph Pecoraro  <pecoraro@apple.com>
3821
3822         ExtendedColor leaks seen on leaks bot
3823         https://bugs.webkit.org/show_bug.cgi?id=167912
3824
3825         Reviewed by Alexey Proskuryakov.
3826
3827         * platform/graphics/Color.cpp:
3828         (WebCore::Color::operator=):
3829         Before overwriting m_colorData, we must deref the extended color inside it.
3830
3831 2017-02-06  Simon Fraser  <simon.fraser@apple.com>
3832
3833         Re-land r210095 (avoid a tile revalidation on scale change)
3834         https://bugs.webkit.org/show_bug.cgi?id=167866
3835
3836         Reviewed by Tim Horton.
3837         
3838         r210095 was rolled out in r211230 but now that all TileControllers unparent
3839         offscreen tiles, we can roll it back it.
3840         
3841         Also add more Tiling logging.
3842
3843         * platform/graphics/ca/TileGrid.cpp:
3844         (WebCore::validationPolicyAsString):
3845         (WebCore::TileGrid::setScale):
3846         (WebCore::TileGrid::prepopulateRect):
3847         (WebCore::TileGrid::revalidateTiles):
3848         (WebCore::TileGrid::ensureTilesForRect):
3849
3850 2017-02-06  Myles C. Maxfield  <mmaxfield@apple.com>
3851
3852         Migrate ComplexTextController to use platform-independent types
3853         https://bugs.webkit.org/show_bug.cgi?id=167833
3854
3855         Reviewed by Brent Fulgham.
3856
3857         ComplexTextController will eventually be used on all ports to perform complex text layout.
3858         This is a mechanical patch which migrates the shared parts of ComplexTextController away from
3859         using CoreGraphics and CoreFoundation types in favor of WebCore/platform types. Eventually,
3860         ComplexTextController will get moved to PAL but there is a layering violation (TextLayout) to
3861         fix first.
3862
3863         No new tests because there is no behavior change.
3864
3865         * platform/graphics/GlyphBuffer.h:
3866         (WebCore::GlyphBufferAdvance::GlyphBufferAdvance):
3867         * platform/graphics/mac/ComplexTextController.cpp:
3868         (WebCore::ComplexTextController::offsetForPosition):
3869         (WebCore::advanceByCombiningCharacterSequence):
3870         (WebCore::ComplexTextController::ComplexTextRun::indexAt):
3871         (WebCore::ComplexTextController::ComplexTextRun::setIsNonMonotonic):
3872         (WebCore::ComplexTextController::advance):
3873         (WebCore::ComplexTextController::adjustGlyphsAndAdvances):
3874         * platform/graphics/mac/ComplexTextController.h:
3875         (WebCore::ComplexTextController::ComplexTextRun::create):
3876         (WebCore::ComplexTextController::ComplexTextRun::stringLength):
3877         (WebCore::ComplexTextController::ComplexTextRun::indexBegin):
3878         (WebCore::ComplexTextController::ComplexTextRun::indexEnd):
3879         (WebCore::ComplexTextController::ComplexTextRun::endOffsetAt):
3880         (WebCore::ComplexTextController::ComplexTextRun::glyphs):
3881         (WebCore::ComplexTextController::ComplexTextRun::growInitialAdvanceHorizontally):
3882         (WebCore::ComplexTextController::ComplexTextRun::initialAdvance):
3883         (WebCore::ComplexTextController::ComplexTextRun::baseAdvances):
3884         (WebCore::ComplexTextController::ComplexTextRun::glyphOrigins):
3885         (WebCore::ComplexTextController::glyphOrigin):
3886         (WebCore::ComplexTextController::ComplexTextRun::createForTesting): Deleted.
3887         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
3888         (SOFT_LINK):
3889         (WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun):
3890         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
3891
3892 2017-02-06  Brent Fulgham  <bfulgham@apple.com>
3893
3894         Correct File Path Handling in SecurityOrigin and FileSystem
3895         https://bugs.webkit.org/show_bug.cgi?id=167894
3896         <rdar://problem/30380080>
3897
3898         Reviewed by Alexey Proskuryakov.
3899
3900         Roll out the URL decoding being done in the FileSystem class (added in Bug 167894), and instead ensure that
3901         SecurityOrigin properly handles file URLs, and only passes valid file strings to the FileSystem interface.
3902
3903         Tested by FileSystemTests and SecurityOriginTests in TestWebKitAPI.
3904
3905         * page/SecurityOrigin.cpp:
3906         (WebCore::SecurityOrigin::SecurityOrigin): Initialize m_filePath using the url's fileSystemPath, not
3907         the %-encoded 'path' property.
3908         (WebCore::SecurityOrigin::canDisplay): Pass the 'fileSystemPath' to 'filesHaveSameVolume', rather than
3909         the %-encoded 'path' property.
3910         * page/SecurityOrigin.h:
3911         * platform/FileSystem.cpp:
3912         (WebCore::filesHaveSameVolume): Do not use 'decodeURLEscapeSequences' in 'filesHaveSameVolume'.
3913
3914 2017-02-06  Andy Estes  <aestes@apple.com>
3915
3916         [Cocoa] Split FileSystemMac.mm into Mac and Cocoa parts
3917         https://bugs.webkit.org/show_bug.cgi?id=167908
3918
3919         Reviewed by Sam Weinig.
3920
3921         Kept the Mac-only functions in FileSystemMac.mm and moved the rest into FileSystemCocoa.mm.
3922
3923         * PlatformMac.cmake:
3924         * WebCore.xcodeproj/project.pbxproj:
3925         * platform/cocoa/FileSystemCocoa.mm: Copied from Source/WebCore/platform/mac/FileSystemMac.mm.
3926         * platform/mac/FileSystemMac.mm:
3927         (-[WebFileManagerDelegate fileManager:shouldProceedAfterError:movingItemAtURL:toURL:]): Moved to FileSystemCocoa.mm.
3928         (WebCore::homeDirectoryPath): Ditto.
3929         (WebCore::openTemporaryFile): Ditto.
3930         (WebCore::moveFile): Ditto.
3931         (WebCore::getVolumeFreeSpace): Ditto.
3932
3933 2017-02-06  Eric Carlson  <eric.carlson@apple.com>
3934
3935         [MediaStream Mac] Remove some unused code
3936         https://bugs.webkit.org/show_bug.cgi?id=167913
3937
3938         Reviewed by Jer Noble.
3939
3940         No new tests, no functional change.
3941
3942         * platform/mediastream/CaptureDeviceManager.h:
3943         (WebCore::CaptureSessionInfo::~CaptureSessionInfo): Deleted.
3944         (WebCore::CaptureSessionInfo::supportsVideoSize): Deleted.
3945         (WebCore::CaptureSessionInfo::bestSessionPresetForVideoDimensions): Deleted.
3946         * platform/mediastream/mac/AVCaptureDeviceManager.h:
3947         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
3948         (WebCore::AVCaptureDeviceManager::refreshCaptureDeviceList):
3949         (WebCore::AVCaptureSessionInfo::AVCaptureSessionInfo): Deleted.
3950         (WebCore::AVCaptureSessionInfo::supportsVideoSize): Deleted.
3951         (WebCore::AVCaptureSessionInfo::bestSessionPresetForVideoDimensions): Deleted.
3952         * platform/mediastream/mac/AVMediaCaptureSource.mm:
3953         (WebCore::AVMediaCaptureSource::AVMediaCaptureSource):
3954
3955 2017-02-06  Youenn Fablet  <youennf@gmail.com>
3956
3957         Allow some schemes to opt-out of CORS
3958         https://bugs.webkit.org/show_bug.cgi?id=167795
3959
3960         Reviewed by Alex Christensen.
3961
3962         Test: http/tests/security/bypassing-cors-checks-for-extension-urls.html
3963
3964         Adding the possibility to opt out of CORS for DocumentThreadableLoader clients (fetch and XHR).
3965         This is made specific to the case of user extension URLs for pages running user scripts.
3966         Introducing a boolean flag in Page for that purpose.
3967         Introducing a helper routine in SchemeRegistry to centralize the various user script extension schemes.
3968
3969         * loader/DocumentThreadableLoader.cpp:
3970         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
3971         * page/Frame.cpp:
3972         (WebCore::Frame::injectUserScripts):
3973         * page/Page.h:
3974         (WebCore::Page::setAsRunningUserScripts):
3975         (WebCore::Page::isRunningUserScripts):
3976         * platform/SchemeRegistry.cpp:
3977         (WebCore::SchemeRegistry::isUserExtensionScheme):
3978         * platform/SchemeRegistry.h:
3979         * testing/Internals.cpp:
3980         (WebCore::Internals::setAsRunningUserScripts):
3981         * testing/Internals.h:
3982         * testing/Internals.idl:
3983
3984 2017-02-06  Chris Dumez  <cdumez@apple.com>
3985
3986         Align [[OwnPropertyKeys]] with the HTML specification for cross-origin Window / Location objects
3987         https://bugs.webkit.org/show_bug.cgi?id=167647
3988         <rdar://problem/30339489>
3989