[Cocoa] Report the first paint after committing a load as a rendering progress event
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-07-08  Sungmann Cho  <sungmann.cho@navercorp.com>
2
3         [GTK] The "Missing Plug-in" buttons are not showing up on some flash contents.
4         https://bugs.webkit.org/show_bug.cgi?id=146707
5
6         Reviewed by Martin Robinson.
7
8         Currently, WebKitGTK+ doesn't show the "Missing Plug-in" buttons if the plugin-related tags
9         don't have a "type" attribute. In such a case, WebCore tries to guess the MIME type from
10         the extensions by using MIMETypeRegistry::getMIMETypeForExtension(). For WebKitGTK+,
11         MIMETypeRegistry::getMIMETypeForExtension() goes through |extensionMap|, which is a simple
12         array of <extension, mime type>, looking for the mime type for the given extension.
13         But |extensionMap| in MIMETypeRegistryGtk.cpp doesn't have the information for ".swf",
14         so WebCore fails to guess the MIME type and regard the content type as ObjectContentFrame,
15         not ObjectContentNetscapePlugin.
16
17         * platform/gtk/MIMETypeRegistryGtk.cpp:
18
19 2015-07-08  Brady Eidson  <beidson@apple.com>
20
21         Crash calling [WebView close] in didFinishLoadForFrame callback.
22         <rdar://problem/21690765> and https://bugs.webkit.org/show_bug.cgi?id=146773
23
24         Reviewed by David Kilzer.
25
26         Added API Test "WebViewCloseInsideDidFinishLoadForFrame"
27
28         * loader/FrameLoader.cpp:
29         (WebCore::FrameLoader::checkLoadCompleteForThisFrame): After the delegate callback,
30           don't use the local Page* variable from earlier, but instead refetch it from m_frame.
31
32 2015-07-08  Daniel Bates  <dabates@apple.com>
33
34         Cleanup: Make ContentSecurityPolicy::ReportingStatus an enum class
35         https://bugs.webkit.org/show_bug.cgi?id=146670
36
37         Reviewed by Darin Adler.
38
39         Make calling the ContentSecurityPolicy::allow* functions less error prone by making
40         ContentSecurityPolicy::ReportingStatus an enum class. Among other benefits this will
41         prevent a caller from inadvertently passing an enumerator of ContentSecurityPolicy::ReportingStatus
42         as the boolean argument overridingContentSecurityPolicy, which is taken by the various
43         ContentSecurityPolicy::allow* functions, by causing a compile-time error (since an enum class
44         enumerator cannot be implicitly converted to an integral type).
45
46         * bindings/js/ScriptController.cpp:
47         (WebCore::ScriptController::initScript):
48         * page/ContentSecurityPolicy.cpp:
49         (WebCore::CSPDirectiveList::allowJavaScriptURLs):
50         (WebCore::CSPDirectiveList::allowInlineEventHandlers):
51         (WebCore::CSPDirectiveList::allowInlineScript):
52         (WebCore::CSPDirectiveList::allowInlineStyle):
53         (WebCore::CSPDirectiveList::allowEval):
54         (WebCore::CSPDirectiveList::allowPluginType):
55         (WebCore::CSPDirectiveList::allowScriptFromSource):
56         (WebCore::CSPDirectiveList::allowObjectFromSource):
57         (WebCore::CSPDirectiveList::allowChildFrameFromSource):
58         (WebCore::CSPDirectiveList::allowImageFromSource):
59         (WebCore::CSPDirectiveList::allowStyleFromSource):
60         (WebCore::CSPDirectiveList::allowFontFromSource):
61         (WebCore::CSPDirectiveList::allowMediaFromSource):
62         (WebCore::CSPDirectiveList::allowConnectToSource):
63         (WebCore::CSPDirectiveList::allowFormAction):
64         (WebCore::CSPDirectiveList::allowBaseURI):
65         (WebCore::ContentSecurityPolicy::didReceiveHeader):
66         (WebCore::ContentSecurityPolicy::evalDisabledErrorMessage):
67         * page/ContentSecurityPolicy.h:
68         * page/DOMSecurityPolicy.cpp:
69         (WebCore::DOMSecurityPolicy::allowsEval):
70
71 2015-07-08  Matthew Daiter  <mdaiter@apple.com>
72
73         Activate DOMURLMediaStream
74         https://bugs.webkit.org/show_bug.cgi?id=146764
75         <rdar://problem/21738101>
76
77         Reviewed by Eric Carlson.
78
79         * DerivedSources.make: Added DOMURLMediaStream.idl to list
80         * WebCore.xcodeproj/project.pbxproj: Added DOMURLMediaStream.cpp and
81         DOMURLMediaStream.h to compile
82
83 2015-07-08  Matthew Daiter  <mdaiter@apple.com>
84
85         Make sure MediaStream uses blob protocol
86         https://bugs.webkit.org/show_bug.cgi?id=146752
87         <rdar://problem/21736057>
88
89         Reviewed by Eric Carlson.
90
91         * html/HTMLMediaElement.cpp:
92         (WebCore::HTMLMediaElement::selectNextSourceChild): Added MediaStream
93         blob protocol
94
95 2015-07-08  Andreas Kling  <akling@apple.com>
96
97         Videos on apple.com don't show up when restored from page cache.
98         <https://webkit.org/b/146766>
99         <rdar://problem/21712311>
100
101         Reviewed by Darin Adler.
102
103         Break out most of HTMLMediaElement::stop() (override of ActiveDOMObject::stop(), to be clear)
104         into a stopWithoutDestroyingMediaPlayer() function that both stop() and suspend() can call.
105
106         Before this change, suspend() would call stop() when moving into the page cache, killing the
107         internal MediaPlayer object which caused the video to disappear from the page.
108
109         Test: LayoutTests/media/restore-from-page-cache.html (amended)
110
111         * html/HTMLMediaElement.cpp:
112         (WebCore::HTMLMediaElement::stopWithoutDestroyingMediaPlayer):
113         (WebCore::HTMLMediaElement::stop):
114         (WebCore::HTMLMediaElement::suspend):
115         * html/HTMLMediaElement.h:
116
117 2015-07-08  Matthew Daiter  <mdaiter@apple.com>
118
119         Make MediaStream conform to its private client like MediaSource does
120         https://bugs.webkit.org/show_bug.cgi?id=146756
121         <rdar://problem/21736457>
122
123         Reviewed by Brent Fulgham.
124
125         MediaStream should be inheriting its PrivateClient's getters and
126         setters for RefCounted, not inheriting its own.
127
128         * Modules/mediastream/MediaStream.h: Changed MediaStream's inherit
129         statements
130         * platform/mediastream/MediaStreamPrivate.h: Changed
131         MediaStreamPrivateClient to inherit RefCounted<MediaStreamPrivateClient>
132
133 2015-07-08  Matthew Daiter  <mdaiter@apple.com>
134
135         Made AVMediaCaptureSource's session accessor public
136         https://bugs.webkit.org/show_bug.cgi?id=146758
137         <rdar://problem/21736651>
138
139         Reviewed by Brent Fulgham.
140
141         * platform/mediastream/mac/AVMediaCaptureSource.h:
142         (WebCore::AVMediaCaptureSource::session): Changed to public
143
144 2015-07-08  Matthew Daiter  <mdaiter@apple.com>
145
146         Make sure MediaStream engine loaded for interpreting MediaStreams
147         https://bugs.webkit.org/show_bug.cgi?id=146748
148         <rdar://problem/21735416>
149
150         Reviewed by Brent Fulgham.
151
152         Prevent the MediaSource engine from being used to process
153         MediaStreams, since they are not compatible
154
155         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: 
156         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsType):
157         Changed MediaStream to never be loaded
158         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
159         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
160         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsType): 
161         Changed MediaStream to never be loaded
162
163
164 2015-07-08  Benjamin Poulain  <bpoulain@apple.com>
165
166         [Content Extensions] Fuse undistinguishable actions as much as possible
167         https://bugs.webkit.org/show_bug.cgi?id=146762
168
169         Reviewed by Alex Christensen.
170
171         Our previous code that fused actions was based on test lists that were
172         grouping similar actions in the input.
173
174         The input we get from developers is more distributed. It is very common to
175         have trigger flags all over the place, and "css-display-none" mixed with "block".
176
177         This patch refines the merging code to merge those cases as much as possible.
178
179         The size taken by the actions is negligible, but having different actions make
180         nodes unkillable by the Minimizer. By merging many more actions, the minimizer
181         no longer see those subtrees as distinguishable and can do a better job.
182
183         On a large test list, this cuts the bytecode size by 2 megabytes.
184
185         Tests: http/tests/contentextensions/css-display-none-after-ignore-previous-rules.html
186                http/tests/contentextensions/single-css-display-none.html
187
188         * contentextensions/ContentExtensionCompiler.cpp:
189         (WebCore::ContentExtensions::resolvePendingDisplayNoneActions):
190         (WebCore::ContentExtensions::serializeActions):
191
192 2015-07-08  Matthew Daiter  <mdaiter@apple.com>
193
194         Cleared contentMIMETypes for MediaStreams
195         https://bugs.webkit.org/show_bug.cgi?id=146750
196         <rdar://problem/21735678>
197
198         Reviewed by Brent Fulgham.
199
200         * platform/graphics/MediaPlayer.cpp:
201         (WebCore::MediaPlayer::load): Needed to clear contentMIMETypes
202
203 2015-07-08  Dean Jackson  <dino@apple.com>
204
205         Audio elements with controls force their enclosing stacking context to composite
206         https://bugs.webkit.org/show_bug.cgi?id=146751
207         <rdar://problem/21466572>
208
209         Reviewed by Simon Fraser.
210
211         There were a number of issues with audio controls, on both iOS and OS X.
212
213         - they used a blurry background which was not the intended design
214         - they cause the page to composite, which causes a degradation in
215           text rendering quality
216         - they inserted 20px of padding above every audio element, which
217           could break existing page designs.
218
219         Removing the need for compositing and blending means that the
220         colors used for control tints need to be adjusted for the non-blended
221         case. Wherever I could, I kept as much as possible in a shared
222         rule and made specific changes for audio or video.
223
224         The controls were also unintentionally relying on the compositing
225         to create stacking contexts and control the rendering order. Without
226         them, I needed to add some explicit stacking.
227
228         I also made some drive-by whitespace clean-ups.
229
230         * Modules/mediacontrols/mediaControlsApple.css: Remove as much compositing
231         as possible in audio controls.
232
233         * Modules/mediacontrols/mediaControlsApple.js:
234         (Controller.prototype.drawTimelineBackground): Use specific colors for audio.
235
236         * Modules/mediacontrols/mediaControlsiOS.css: Remove as much need for compositing
237         as possible.
238
239 2015-07-08  Said Abou-Hallawa  <sabouhallawa@apple.com>
240
241         Crash when appending an SVG <use> element dynamically which has animated SVG <path> element
242         https://bugs.webkit.org/show_bug.cgi?id=146690
243         <rdar://problem/20790376>
244
245         Reviewed by Dean Jackson.
246
247         Test: svg/animations/insert-animate-use-path-while-animation.svg
248
249         The crashing call stack shows that
250         SVGAnimatedListPropertyTearOff<SVGPathSegList>::m_animVal is null when
251         trying to access it in synchronizeWrappersIfNeeded(). This happens because
252         animationStarted() was not called for this animatedType.
253         
254         SVGAnimateElementBase::resetAnimatedType() calls
255         SVGAnimatedPathAnimator::startAnimValAnimation() at the beginning of the
256         animation. For the target element and all its instances, this function calls
257         SVGAnimatedPathSegListPropertyTearOff::animationStarted() which calls
258         SVGAnimatedListPropertyTearOff<SVGPathSegList>::animationStarted(). This
259         last function allocates the member m_animVal when calling
260         SVGAnimatedListPropertyTearOff<SVGPathSegList>::animVal(). 
261         
262         When adding a new instance of the same animating target element, 
263         SVGAnimateElementBase::resetAnimatedType() just keeps calling
264         SVGAnimatedPathAnimator::animValDidChange() for all the instances of the
265         targetElement without ensuring that all of them have started their
266         animations.
267         
268         The fix is to make SVGAnimatedPathAnimator::resetAnimValToBaseVal() ensure
269         that animationStarted() is called for the targetElement and all its instances.
270
271         * svg/SVGAnimatedPath.cpp:
272         (WebCore::SVGAnimatedPathAnimator::startAnimValAnimation): Move resetting
273         the animation value and starting the animatedTypes code to a new overriding
274         function which is named resetAnimValToBaseVal().
275         
276         (WebCore::SVGAnimatedPathAnimator::resetAnimValToBaseVal): Call the overriding
277         function which calls buildSVGPathByteStreamFromSVGPathSegList() as before
278         and ensure that all the animatedTypes have started their animations.
279         
280         * svg/SVGAnimatedPath.h:
281
282 2015-07-08  Brady Eidson  <beidson@apple.com>
283
284         Move PingLoaders to the NetworkingProcess.
285         <rdar://problem/18860263> and https://bugs.webkit.org/show_bug.cgi?id=146710
286
287         Reviewed by Tim Horton.
288
289         No new tests.
290         There's no current solution for communicating back to a page that a ping load has reached its target.
291         Until we have such a solution, any attempt at a layout test will be fragile at best.
292
293         * WebCore.xcodeproj/project.pbxproj:
294         
295         * loader/LoaderStrategy.cpp:
296         (WebCore::LoaderStrategy::createPingHandle): Default implementation is create the PingHandle directly.
297         * loader/LoaderStrategy.h:
298
299         PingLoader becomes a static class for now that crafts the ResourceRequest then passes it off
300         to the LoaderStrategy:        
301         * loader/PingLoader.cpp:
302         (WebCore::PingLoader::loadImage):
303         (WebCore::PingLoader::sendPing):
304         (WebCore::PingLoader::sendViolationReport):
305         (WebCore::PingLoader::startPingLoad):
306         (WebCore::PingLoader::createPingLoader): Deleted.
307         (WebCore::PingLoader::PingLoader): Deleted.
308         (WebCore::PingLoader::~PingLoader): Deleted.
309         * loader/PingLoader.h:
310         (WebCore::PingLoader::timeoutTimerFired): Deleted.
311
312         PingHandle does what PingLoader used to - It's a basic ResourceHandleClient that simply waits
313         for any response/completion/failure and then deletes itself.
314         * platform/network/PingHandle.h: Added.
315         (WebCore::PingHandle::PingHandle):
316         (WebCore::PingHandle::usesAsyncCallbacks):
317         (WebCore::PingHandle::timeoutTimerFired):
318         (WebCore::PingHandle::~PingHandle):
319
320 2015-07-08  Csaba Osztrogonác  <ossy@webkit.org>
321
322         Add new sources to StyleAllInOne.cpp
323         https://bugs.webkit.org/show_bug.cgi?id=146584
324
325         Reviewed by Brent Fulgham.
326
327         * WebCore.vcxproj/WebCore.vcxproj:
328         * rendering/style/StyleAllInOne.cpp:
329
330 2015-07-08  Csaba Osztrogonác  <ossy@webkit.org>
331
332         Add new sources to DOMAllInOne.cpp
333         https://bugs.webkit.org/show_bug.cgi?id=146587
334
335         Reviewed by Brent Fulgham.
336
337         * WebCore.vcxproj/WebCore.vcxproj:
338         * dom/DOMAllInOne.cpp:
339
340 2015-07-08  Csaba Osztrogonác  <ossy@webkit.org>
341
342         Add new sources to AccessibilityAllInOne.cpp
343         https://bugs.webkit.org/show_bug.cgi?id=146582
344
345         Reviewed by Brent Fulgham.
346
347         * WebCore.vcxproj/WebCore.vcxproj:
348         * accessibility/AccessibilityAllInOne.cpp:
349
350 2015-07-08  Eric Carlson  <eric.carlson@apple.com>
351
352         [Mac] Two clicks required to enable AirPlay at youtube.com
353         https://bugs.webkit.org/show_bug.cgi?id=146733
354         <rdar://problem/21556356>
355
356         Reviewed by Brent Fulgham.
357
358         * Modules/mediasession/WebMediaSessionManager.cpp:
359         (WebCore::WebMediaSessionManager::clientStateDidChange): Only log when state has changed.
360           Don't steal the route if another client is actively playing to the device.
361         (WebCore::WebMediaSessionManager::setPlaybackTarget): Set m_targetChanged.
362         (WebCore::WebMediaSessionManager::configurePlaybackTargetClients): Don't consider the
363           requestedPicker flag until after a target change.
364         * Modules/mediasession/WebMediaSessionManager.h:
365
366         * html/HTMLMediaElement.cpp:
367         (WebCore::HTMLMediaElement::webkitShowPlaybackTargetPicker): Add logging.
368         (WebCore::HTMLMediaElement::setShouldPlayToPlaybackTarget): Ditto.
369
370         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
371         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldPlayToPlaybackTarget): Always log.
372
373 2015-07-08  Zalan Bujtas  <zalan@apple.com>
374
375         Do not waste window server memory for placeholder windows initiated by ThemeMac.
376         https://bugs.webkit.org/show_bug.cgi?id=146730
377         rdar://problem/20321222
378
379         Using defer:YES prevents us from wasting any window server resources for WebCoreThemeWindow(s).
380
381         Patch by Darin Adler.
382         Reviewed by Zalan Bujtas.
383
384         Not testable.
385
386         * platform/mac/ThemeMac.mm:
387         (-[WebCoreThemeView window]):
388
389 2015-07-08  Xabier Rodriguez Calvar  <calvaris@igalia.com>
390
391         [GTK] Deactivate GObject bindings for static methods
392         https://bugs.webkit.org/show_bug.cgi?id=146717
393
394         Reviewed by Carlos Garcia Campos.
395
396         Static methods are currently not supported by GObject bindings so we deactivate them from the generation.
397
398         Current tests suffice. Expectations updated.
399
400         * bindings/scripts/CodeGeneratorGObject.pm:
401         (SkipFunction): Skip isStatic functions.
402         * bindings/scripts/test/GObject/WebKitDOMTestInterface.h:
403         * bindings/scripts/test/GObject/WebKitDOMTestInterface.cpp:
404         (webkit_dom_test_interface_implements_method4): Deleted.
405         (webkit_dom_test_interface_supplemental_method4): Deleted.
406         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
407         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
408         (webkit_dom_test_obj_class_method): Deleted.
409         (webkit_dom_test_obj_class_method_with_optional): Deleted.
410         (webkit_dom_test_obj_overloaded_method1): Deleted.
411
412 2015-07-07  Benjamin Poulain  <bpoulain@apple.com>
413
414         Remove the overflow checks from the important vectors used by the content extensions machines
415         https://bugs.webkit.org/show_bug.cgi?id=146703
416
417         Reviewed by Andreas Kling.
418
419         Most of the overflow checks cannot be eliminated by clang. Removing them
420         explicitly removes 400 ms from the compile time of a very large test list.
421
422         * contentextensions/ContentExtensionsDebugging.h:
423         * contentextensions/DFA.h:
424         * contentextensions/DFACombiner.cpp:
425         * contentextensions/DFAMinimizer.cpp:
426         * contentextensions/ImmutableNFA.h:
427         * contentextensions/MutableRangeList.h:
428         * contentextensions/NFAToDFA.cpp:
429         (WebCore::ContentExtensions::epsilonClosureExcludingSelf):
430         (WebCore::ContentExtensions::resolveEpsilonClosures):
431         (WebCore::ContentExtensions::extendSetWithClosure):
432         (WebCore::ContentExtensions::DataConverterWithEpsilonClosure::convert):
433         (WebCore::ContentExtensions::DataConverterWithEpsilonClosure::extend):
434         (WebCore::ContentExtensions::createCombinedTransition):
435         (WebCore::ContentExtensions::getOrCreateDFANode):
436         (WebCore::ContentExtensions::NFAToDFA::convert):
437
438 2015-07-07  Dean Jackson  <dino@apple.com>
439
440         [iOS] MediaControls: Start Play and Can't Play buttons need to be cutout and blurred
441         https://bugs.webkit.org/show_bug.cgi?id=146226
442
443         Reviewed by Simon Fraser.
444
445         This patch takes what Said Abou-Hallawa posted in an earlier revision and
446         makes a few tweaks to workaround the bugs he's listed.
447
448         Replicate the iOS System blur backdrop in pure CSS, so that the large
449         start button looks more correct. Also add artwork for a failure state.
450
451         * Modules/mediacontrols/mediaControlsiOS.css: New style rules for the start
452         button, which now is a collection of elements rather than a <button>.
453         (video::-webkit-media-controls-start-playback-button):
454         (video::-webkit-media-controls-start-playback-background):
455         (video::-webkit-media-controls-start-playback-tint):
456
457         * Modules/mediacontrols/mediaControlsiOS.js:
458         (ControllerIOS.prototype.createBase): Replace the <button> with the hierarchy of
459         elements to replicate the blur. Give some of them a class attribute, so they
460         can match selectors (see the bugs Said filed in the original bugzilla).
461         (ControllerIOS.prototype.handleStartPlaybackButtonTouchStart): Toggle classes on
462         the hierarchy as needed.
463         (ControllerIOS.prototype.handleStartPlaybackButtonTouchEnd): Ditto.
464         (ControllerIOS.prototype.updateStatusDisplay): Ditto.
465
466 2015-07-07  Zalan Bujtas  <zalan@apple.com>
467
468         Crash when parent iframe is set to display none and the child frame is mutated the same time.
469         https://bugs.webkit.org/show_bug.cgi?id=146699
470         rdar://problem/16207881
471
472         Reviewed by Andreas Kling.
473
474         When the parent iframe is set to display: none, we destroy the associated renderer (RenderIFrame).
475         However if the child frame is mutated the same time, during layout we try to access this RenderIFrame
476         to check whether it needs frame flattening.
477         This patch checks whether the parent render widget is still valid.
478
479         Test: fast/frames/crash-display-none-iframe-during-onbeforeload.html
480
481         * page/FrameView.cpp:
482         (WebCore::FrameView::isInChildFrameWithFrameFlattening): rearrange early returns.
483
484 2015-07-06  Matt Rajca  <mrajca@apple.com>
485
486         Media Session: remove seek forward/backward attributes
487         https://bugs.webkit.org/show_bug.cgi?id=146645
488
489         Reviewed by Eric Carlson.
490
491         * Modules/mediasession/MediaRemoteControls.h:
492         * Modules/mediasession/MediaRemoteControls.idl:
493
494 2015-07-07  Brent Fulgham  <bfulgham@apple.com>
495
496         REGRESSION (r183133-r183138): Secondary clicking in whitespace selects preceding word
497         https://bugs.webkit.org/show_bug.cgi?id=146695
498         <rdar://problem/21441466>
499
500         Reviewed by Tim Horton.
501
502         When we would currently use dictionary lookup to decide on our text selection, first check if we
503         are targeting an editable field. If we are, use the original selection behavior. Otherwise, use
504         the new "dictionary lookup" selection.
505
506         * page/EventHandler.cpp:
507         (WebCore::EventHandler::selectClosestContextualWordOrLinkFromMouseEvent): Only use dictionary lookup
508         when our target node is not editable.
509         
510
511 2015-07-07  Brady Eidson  <beidson@apple.com>
512
513         Another attempt to fix CURL/Soup builds after r186476
514
515         Reviewed by NOBODY.
516
517         * platform/network/curl/SocketStreamHandle.h:
518
519         * platform/network/soup/SocketStreamHandle.h:
520
521 2015-07-07  Brady Eidson  <beidson@apple.com>
522
523         Attempt to fix CURL/Soup builds after r186476
524
525         Reviewed by NOBODY.
526
527         * platform/network/curl/SocketStreamHandle.h:
528         (WebCore::SocketStreamHandle::create):
529
530         * platform/network/soup/SocketStreamHandle.h:
531         (WebCore::SocketStreamHandle::create):
532
533 2015-07-07  Brady Eidson  <beidson@apple.com>
534
535         HTTP Auth cached after disabling private browsing/reset.
536         <rdar://problem/8293055> and https://bugs.webkit.org/show_bug.cgi?id=146654
537
538         Reviewed by Tim Horton.
539
540         Test: http/tests/security/private-browsing-http-auth.html
541
542         - Change most static CredentialStorage methods to be instance methods instead.
543         - Make a CredentialStorage objects be per-NetworkStorageSession.
544
545         * Modules/websockets/WebSocketChannel.cpp:
546         (WebCore::WebSocketChannel::WebSocketChannel):
547         (WebCore::WebSocketChannel::connect): Only start the web socket load if a networking
548           context is available.
549
550         * platform/network/CredentialStorage.cpp:
551         (WebCore::CredentialStorage::defaultCredentialStorage): Returns the credential storage
552           from the default NetworkStorageSession.
553         (WebCore::CredentialStorage::set):
554         (WebCore::CredentialStorage::get):
555         (WebCore::CredentialStorage::remove):
556         (WebCore::CredentialStorage::findDefaultProtectionSpaceForURL):
557         (WebCore::CredentialStorage::clearCredentials):
558         (WebCore::protectionSpaceToCredentialMap): Deleted.
559         (WebCore::originsWithCredentials): Deleted.
560         (WebCore::pathToDefaultProtectionSpaceMap): Deleted.
561         (WebCore::findDefaultProtectionSpaceForURL): Deleted.
562         (WebCore::CredentialStorage::setPrivateMode): Deleted. Was a no-op anyways.
563         * platform/network/CredentialStorage.h:
564         
565         * platform/network/NetworkStorageSession.h:
566         (WebCore::NetworkStorageSession::credentialStorage):
567         
568         * platform/network/cf/ResourceHandleCFNet.cpp:
569         (WebCore::ResourceHandle::createCFURLConnection):
570         (WebCore::ResourceHandle::willSendRequest):
571         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
572         (WebCore::ResourceHandle::receivedCredential):
573         
574         * platform/network/cf/SocketStreamHandle.h:
575         (WebCore::SocketStreamHandle::create):
576         * platform/network/cf/SocketStreamHandleCFNet.cpp:
577         (WebCore::SocketStreamHandle::SocketStreamHandle):
578         (WebCore::SocketStreamHandle::getStoredCONNECTProxyCredentials):
579         (WebCore::getStoredCONNECTProxyCredentials): Deleted.
580         
581         * platform/network/curl/ResourceHandleCurl.cpp:
582         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
583         (WebCore::ResourceHandle::receivedCredential):
584         * platform/network/curl/ResourceHandleManager.cpp:
585         (WebCore::ResourceHandleManager::applyAuthenticationToRequest):
586         
587         * platform/network/mac/ResourceHandleMac.mm:
588         (WebCore::ResourceHandle::createNSURLConnection):
589         (WebCore::ResourceHandle::willSendRequest):
590         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
591         (WebCore::ResourceHandle::receivedCredential):
592         
593         * platform/network/soup/ResourceHandleSoup.cpp:
594         (WebCore::applyAuthenticationToRequest):
595         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
596         (WebCore::ResourceHandle::receivedCredential):
597         
598 2015-07-07  Zalan Bujtas  <zalan@apple.com>
599
600         REGRESSION(169105): CSS Regions: renderer returns wrong selection root when it is inside a column flow.
601         https://bugs.webkit.org/show_bug.cgi?id=146529
602         rdar://problem/21613670
603
604         Reviewed by Mihnea Ovidenie and David Kilzer.
605
606         This patch ensures that RenderObject::selectionRoot() handles column flows properly while searching for the associated
607         selection root.
608         When the renderer is inside a column flow and the column flow is part of a named flow, we stop
609         traversing the ancestor chain, searching for the selection root, when we reach the column flow.
610         Since the column flow is not a selection root, we mistakenly fall back to the RenderView as selection root.
611         Instead, we should check if the column is inside a named flow and return the selection root accordingly.
612         Returning the wrong selection root confuses RenderView::splitSelectionBetweenSubtrees() logic and this particular
613         RenderObject could end up in multiple selection trees.
614
615         Test: fast/regions/selection/crash-when-element-is-inside-column-and-the-containing-block-is-inside-flow.html
616
617         * rendering/RenderObject.cpp:
618         (WebCore::RenderObject::selectionRoot):
619
620 2015-07-07  Brent Fulgham  <bfulgham@apple.com>
621
622         [Mac] REGRESSION (r184794): Play/Pause control doesn't update state in full screen
623         https://bugs.webkit.org/show_bug.cgi?id=146689
624         <rdar://problem/21393490>
625
626         Reviewed by Dean Jackson.
627
628         The changes in r184794 did not take full screen mode into account. This needed to be corrected.
629
630         * Modules/mediacontrols/mediaControlsApple.js:
631         (Controller.prototype.handlePanelTransitionEnd):
632         (Controller.prototype.setPlaying):
633         (Controller.prototype.showControls):
634
635 2015-07-07  Wenson Hsieh  <whsieh@berkeley.edu>
636         
637         Snap point regions containing X and Y snap points should do a better job animating
638         https://bugs.webkit.org/show_bug.cgi?id=142523
639         <rdar://problem/20100753>
640
641         Reviewed by Brent Fulgham.
642
643         Reimplemented snap point animations to use a single timer for both horizontal and
644         vertical axes to better support 2D snap scrolling. Instead of making velocity
645         dependent on progress to the snap point and handling 2D snapping with different
646         timer update functions, this implementation uses a fixed animation time to coordinate
647         the snapping animation across both axes.
648
649         Test: platform/mac-wk2/tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-2d-overflow.html
650
651         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h: Refactored to use a single scroll snap timer.
652         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm: See above.
653         (WebCore::ScrollingTreeFrameScrollingNodeMac::startScrollSnapTimer): See above.
654         (WebCore::ScrollingTreeFrameScrollingNodeMac::stopScrollSnapTimer): See above.
655         * platform/cocoa/ScrollController.h: Refactored to use a single scroll snap timer and update function to handle
656             snapping in both axes. This entails removing the ScrollEventAxis parameter from various functions below. Also
657             removed methods that computed "snap" and "glide" offsets.
658         (WebCore::ScrollControllerClient::startScrollSnapTimer): See above.
659         (WebCore::ScrollControllerClient::stopScrollSnapTimer): See above.
660         * platform/cocoa/ScrollController.mm: See above.
661         (WebCore::ScrollController::ScrollController): Added new constants used to compute animation offsets.
662         (WebCore::ScrollController::snapRubberBandTimerFired):  Added a check to prevent the rubber band timer from firing
663             alongside the scroll snap timer. This results in scroll snapping taking precedence over rubber banding when
664             scrolling against the edge of a container in the case of 2D scrolling. We didn't run into this issue before
665             because snapping wasn't working properly at the edges of a 2D scrolling container. In the future, we may want
666             to unify both snap scrolling and rubber banding timers to solve this issue.
667         (WebCore::ScrollController::isScrollSnapInProgress): Refactored to use a single scroll snap timer.
668         (WebCore::ScrollController::processWheelEventForScrollSnapOnAxis): Fixed an issue where wheel deltas were being pushed
669             to the snap state incorrectly.
670         (WebCore::ScrollController::processWheelEventForScrollSnap): Fixed an issue with 2D snapping where scrolling in 2 axes
671             simultaneously would cause the vertical axis to override the horizontal axis. This is more like a sub-issue of fixing
672             2D scrolling, and is required for 2D snap animations to work properly.
673         (WebCore::ScrollController::startScrollSnapTimer): Refactored to use a single scroll snap timer.
674         (WebCore::ScrollController::stopScrollSnapTimer): See above.
675         (WebCore::ScrollController::scrollSnapTimerFired): This new method handles snap scroll updates on both axes.
676         (WebCore::ScrollController::beginScrollSnapAnimation): Refactored to account for single scroll snap timer.
677         (WebCore::ScrollController::endScrollSnapAnimation): See above.
678         (WebCore::ScrollController::initializeScrollSnapAnimationParameters): New method that initializes parameters used to
679             coordinate the animation state across horizontal and vertical axes.
680         (WebCore::ScrollController::isSnappingOnAxis):  Checks whether or not a given axis is currently scroll snapping. This will
681             return true in the case of active 2D scroll snapping.
682         (WebCore::ScrollController::hasActiveScrollSnapTimerForAxis): Deleted.
683         (WebCore::ScrollController::horizontalScrollSnapTimerFired): Deleted.
684         (WebCore::ScrollController::verticalScrollSnapTimerFired): Deleted.
685         (WebCore::ScrollController::scrollSnapAnimationUpdate): Deleted.
686         (WebCore::ScrollController::initializeGlideParameters): Deleted.
687         (WebCore::snapProgress): Deleted.
688         (WebCore::clampedSnapMagnitude): Deleted.
689         (WebCore::ScrollController::computeSnapDelta): Deleted.
690         (WebCore::snapGlide): Deleted.
691         (WebCore::ScrollController::computeGlideDelta): Deleted.
692         * platform/cocoa/ScrollSnapAnimatorState.h:  Added a new datastructure, ScrollSnapAnimationCurveState, which tracks
693             the scroll snap animation state across both axes.
694         * platform/cocoa/ScrollSnapAnimatorState.mm: Removed fields relevant to the former "gliding" model and renamed the
695             initial wheel delta variable to reflect this.
696         (WebCore::ScrollSnapAnimatorState::averageInitialWheelDelta): Fixed an issue where wheel deltas were being pushed
697             to the snap state incorrectly.
698         (WebCore::ScrollSnapAnimatorState::clearInitialWheelDeltaWindow): Tiny for loop incrementor style fix.
699         (WebCore::ScrollSnapAnimatorState::isSnapping): Checks whether this state is in either snapping or gliding mode.
700         (WebCore::ScrollSnapAnimatorState::canReachTargetWithCurrentInitialScrollDelta): Checks whether the scroll velocity is
701             consistent with the initial and target offsets.
702         (WebCore::ScrollSnapAnimatorState::interpolatedOffsetAtProgress): Interpolates the offset for a given progress value.
703         (WebCore::ScrollSnapAnimationCurveState::ScrollSnapAnimationCurveState): New constants.
704         (WebCore::ScrollSnapAnimationCurveState::initializeSnapProgressCurve): Abstracts out part of the initialization process.
705         (WebCore::ScrollSnapAnimationCurveState::initializeInterpolationCoefficientsIfNecessary): Abstracts out part of the
706             initialization process.
707         (WebCore::ScrollSnapAnimationCurveState::interpolatedPositionAtProgress): Abstracts out curve interpolation.
708         (WebCore::ScrollSnapAnimationCurveState::shouldCompleteSnapAnimationImmediatelyAtTime): Added.
709         (WebCore::ScrollSnapAnimationCurveState::animationProgressAtTime): Added.
710         
711 2015-07-07  Chris Dumez  <cdumez@apple.com>
712
713         Unreviewed, attempt to fix iOS build.
714
715         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
716         (WebVideoFullscreenInterfaceAVKit::setupFullscreen):
717
718 2015-07-07  Andreas Kling  <akling@apple.com>
719
720         REGRESSION(r183706): HTMLImageElement sometimes fails to register as document named item.
721         <https://webkit.org/b/146679>
722         <rdar://problem/21613839>
723
724         Reviewed by Antti Koivisto.
725
726         After r183706, Element::hasName() no longer returns outdated information when called
727         inside a parseAttribute() override. HTMLImageElement was relying on this to check
728         if it *used* to have a name attribute before the currently parsing one was set.
729
730         Since parseAttribute() only shows subclasses the new attribute value, I'm adding a
731         flag to HTMLImageElement that remembers whether we had a name attribute or not.
732
733         Test: fast/dom/HTMLImageElement/remove-img-with-name-from-document-crash.html
734
735         * html/HTMLImageElement.cpp:
736         (WebCore::HTMLImageElement::parseAttribute):
737         * html/HTMLImageElement.h:
738
739 2015-07-07  Youenn Fablet  <youenn.fablet@crf.canon.fr>
740
741         [Streams API] Remove ReadableStreamReader.read() custom binding
742         https://bugs.webkit.org/show_bug.cgi?id=146643
743
744         Reviewed by Darin Adler.
745
746         Moved ReadableStreamReader.read handling from callbacks to promises.
747         Introduced DOMPromiseIteratorWithCallback for that purpose: it takes resolve() to resolve a promise with a not-ending iterator value,
748         resolveEnd() to resolve a promise with a terminating iterator value and reject().
749         Added template helper routine to convert typed values to JS iterator wrapping the value.
750         Removed ReadableStreamReader.read custom binding.
751
752         Covered by rebased tests.
753
754         * Modules/streams/ReadableStream.cpp: Updated code to use DOMPromiseIteratorWithCallback API.
755         (WebCore::ReadableStream::releaseReader):
756         (WebCore::ReadableStream::changeStateToErrored):
757         (WebCore::ReadableStream::read):
758         (WebCore::ReadableStream::resolveReadCallback):
759         * Modules/streams/ReadableStream.h:
760         * Modules/streams/ReadableStreamReader.cpp:
761         (WebCore::ReadableStreamReader::read):
762         * Modules/streams/ReadableStreamReader.h:
763         * Modules/streams/ReadableStreamReader.idl: Removed custom binding.
764         * bindings/js/JSDOMBinding.h:
765         (WebCore::toJSIterator): create JS iterator from typed value.
766         (WebCore::toJSIteratorEnd): create JS end iterator.
767         * bindings/js/JSDOMPromise.cpp:
768         (WebCore::DeferredWrapper::globalObject): Added globaObject getter and removed promise getter.
769         * bindings/js/JSDOMPromise.h:
770         (WebCore::DOMPromiseIteratorWithCallback::DOMPromiseIteratorWithCallback):
771         (WebCore::Error>::resolve):
772         (WebCore::Error>::resolveEnd):
773         (WebCore::Error>::reject):
774         * bindings/js/JSReadableStreamReaderCustom.cpp: Removed custom binding.
775
776 2015-07-06  Zalan Bujtas  <zalan@apple.com>
777
778         REGRESSION: Slider thumb does not render properly (image tests with <input type="range">)
779         https://bugs.webkit.org/show_bug.cgi?id=146669
780         rdar://problem/21677831
781
782         Reviewed by Simon Fraser.
783
784         Draw NSSliderCell's knob only when slider's thumb paint is requested.
785
786         Covered by existing tests.
787
788         * rendering/RenderThemeMac.mm:
789         (WebCore::RenderThemeMac::paintSliderThumb):
790
791 2015-07-06  Csaba Osztrogonác  <ossy@webkit.org>
792
793         Move shouldIgnoreAttributeCase inline function to Element.h
794         https://bugs.webkit.org/show_bug.cgi?id=146588
795
796         Reviewed by Andreas Kling.
797
798         * dom/Element.cpp:
799         (WebCore::shouldIgnoreAttributeCase): Deleted.
800         * dom/Element.h:
801         (WebCore::shouldIgnoreAttributeCase):
802         * dom/NamedNodeMap.cpp:
803         (WebCore::shouldIgnoreAttributeCase): Deleted.
804
805 2015-07-06  Brent Fulgham  <bfulgham@apple.com>
806
807         Ensure media playback is stopped during page close
808         https://bugs.webkit.org/show_bug.cgi?id=146554
809         <rdar://problem/18033944>
810
811         Reviewed by Brady Eidson.
812
813         * Modules/webaudio/AudioContext.cpp:
814         (WebCore::WebAudio::hostingDocument): Added.
815         * Modules/webaudio/AudioContext.h:
816         * html/HTMLMediaElement.h:
817         (WebCore::HTMLMediaElement::hostingDocument): Added.
818         * dom/Document.cpp:
819         (WebCore::Document::~Document): Call new 'stopAllMediaPlaybackForDocument' at destruction time.
820         * platform/audio/PlatformMediaSession.h:
821         Made PlatformMediaSessionManager a friend so it can access the protected 'client' accessor.
822         Updated PlatformMediaSessionClient to require clients to have a "hostingDocument" member.
823         * platform/audio/PlatformMediaSessionManager.cpp:
824         (WebCore::PlatformMediaSessionManager::stopAllMediaPlaybackForDocument): Added. Only pauses
825         playback on elements that match the provided document.
826         (WebCore::PlatformMediaSessionManager::stopAllMediaPlaybackForProcess): Added. Pauses playback
827         on all elements in the current process.
828         * platform/audio/PlatformMediaSessionManager.h:
829
830 2015-07-06  Daniel Bates  <dabates@apple.com>
831
832         Isolated worlds should respect Content Security Policy; User Agent Shadow DOM
833         should be exempt from Content Security Policy
834         https://bugs.webkit.org/show_bug.cgi?id=144830
835         <rdar://problem/18860261>
836
837         Inadvertently omitted argument overrideContentSecurityPolicy in calls to ContentSecurityPolicy::allowEval()
838         that explicitly specified a report status. And the report status, which is an enum, was being implicitly
839         converted to bool.
840
841         * bindings/js/ScriptController.cpp:
842         (WebCore::ScriptController::initScript):
843         * page/DOMSecurityPolicy.cpp:
844         (WebCore::DOMSecurityPolicy::allowsEval):
845
846 2015-07-06  Commit Queue  <commit-queue@webkit.org>
847
848         Unreviewed, rolling out r186385.
849         https://bugs.webkit.org/show_bug.cgi?id=146668
850
851         crashes 3 webaudio tests in debug builds (Requested by
852         alexchristensen on #webkit).
853
854         Reverted changeset:
855
856         "Ensure media playback is stopped during page close"
857         https://bugs.webkit.org/show_bug.cgi?id=146554
858         http://trac.webkit.org/changeset/186385
859
860 2015-07-06  Andreas Kling  <akling@apple.com>
861
862         Crash when setting text direction via MakeTextWritingDirection* editing commands.
863         <https://webkit.org/b/146665>
864         <rdar://problem/20835477>
865
866         Reviewed by Ryosuke Niwa.
867
868         Fix two buggy clients of enclosingBlock(node) that would fail if the returned
869         element is the same as the node passed in.
870
871         Test: editing/style/change-text-direction-crash.html
872
873         * editing/ApplyStyleCommand.cpp:
874         (WebCore::ApplyStyleCommand::splitAncestorsWithUnicodeBidi):
875         (WebCore::ApplyStyleCommand::removeEmbeddingUpToEnclosingBlock):
876
877 2015-07-06  Simon Fraser  <simon.fraser@apple.com>
878
879         Revert use of  SVG <mask> elements for -webkit-mask-image (r176798, r177494)
880         https://bugs.webkit.org/show_bug.cgi?id=146653
881
882         Reviewed by Dean Jackson.
883
884         Fixes rdar://problem/21435233.
885
886         r177494 caused a number of regressions (bugs 141857, 146509, 146561), added new layering violations, and
887         was not being maintained, so revert it.
888
889         This patch reverts r176798.
890
891         * CMakeLists.txt:
892         * WebCore.vcxproj/WebCore.vcxproj:
893         * WebCore.vcxproj/WebCore.vcxproj.filters:
894         * WebCore.xcodeproj/project.pbxproj:
895         * css/CSSValue.cpp:
896         (WebCore::CSSValue::cssText): Deleted.
897         (WebCore::CSSValue::destroy): Deleted.
898         * css/CSSValue.h:
899         (WebCore::CSSValue::isWebKitCSSResourceValue): Deleted.
900         * css/StyleBuilderConverter.h:
901         (WebCore::maskImageValueFromIterator): Deleted.
902         * css/StyleResolver.cpp:
903         (WebCore::StyleResolver::State::clear): Deleted.
904         * css/StyleResolver.h:
905         (WebCore::StyleResolver::State::maskImagesWithPendingSVGDocuments): Deleted.
906         * css/WebKitCSSResourceValue.cpp: Removed.
907         * css/WebKitCSSResourceValue.h: Removed.
908         * loader/cache/CachedResourceLoader.cpp:
909         (WebCore::CachedResourceLoader::addCachedResource): Deleted.
910         * loader/cache/CachedResourceLoader.h:
911         * loader/cache/CachedSVGDocument.cpp:
912         (WebCore::CachedSVGDocument::finishLoading):
913         (WebCore::CachedSVGDocument::CachedSVGDocument): Deleted.
914         * loader/cache/CachedSVGDocument.h:
915         * loader/cache/CachedSVGDocumentReference.cpp:
916         (WebCore::CachedSVGDocumentReference::CachedSVGDocumentReference):
917         (WebCore::CachedSVGDocumentReference::~CachedSVGDocumentReference):
918         (WebCore::CachedSVGDocumentReference::load):
919         * loader/cache/CachedSVGDocumentReference.h:
920         * page/FrameView.cpp:
921         (WebCore::FrameView::containsSVGDocument): Deleted.
922         * page/FrameView.h:
923         * page/Page.cpp:
924         (WebCore::Page::createPageFromBuffer): Deleted.
925         * page/Page.h:
926         * platform/ScrollView.h:
927         (WebCore::ScrollView::containsSVGDocument): Deleted.
928         * platform/graphics/MaskImageOperation.cpp: Removed.
929         * platform/graphics/MaskImageOperation.h: Removed.
930         * rendering/RenderLayer.cpp:
931         (WebCore::RenderLayer::RenderLayer): Deleted.
932         * rendering/RenderLayer.h:
933         * rendering/RenderLayerFilterInfo.cpp:
934         * rendering/RenderLayerFilterInfo.h:
935         * rendering/RenderLayerMaskImageInfo.h: Removed.
936         * rendering/style/FillLayer.cpp:
937         (WebCore::FillLayer::operator==):
938         (WebCore::FillLayer::cullEmptyLayers):
939         (WebCore::layerImagesIdentical):
940         (WebCore::FillLayer::FillLayer): Deleted.
941         (WebCore::FillLayer::operator=): Deleted.
942         (WebCore::FillLayer::hasNonEmptyMaskImage): Deleted.
943         (WebCore::FillLayer::imagesAreLoaded): Deleted.
944         * rendering/style/FillLayer.h:
945         (WebCore::FillLayer::maskImage): Deleted.
946         (WebCore::FillLayer::imageOrMaskImage): Deleted.
947         (WebCore::FillLayer::setMaskImage): Deleted.
948         (WebCore::FillLayer::clearMaskImage): Deleted.
949         (WebCore::FillLayer::hasMaskImage): Deleted.
950         * rendering/svg/RenderSVGResourceMasker.cpp:
951         (WebCore::RenderSVGResourceMasker::applyResource):
952         (WebCore::RenderSVGResourceMasker::applySVGMask): Deleted.
953         (WebCore::RenderSVGResourceMasker::drawMaskForRenderer): Deleted.
954         * rendering/svg/RenderSVGResourceMasker.h:
955         * svg/SVGMaskElement.cpp:
956         (WebCore::SVGMaskElement::createElementRenderer):
957         (WebCore::SVGMaskElement::addClientRenderLayer): Deleted.
958         (WebCore::SVGMaskElement::removeClientRenderLayer): Deleted.
959         * svg/SVGMaskElement.h:
960         * svg/SVGUseElement.cpp:
961         (WebCore::SVGUseElement::updateExternalDocument):
962         * svg/graphics/SVGImage.cpp:
963         (WebCore::SVGImage::dataChanged):
964
965 2015-07-06  Simon Fraser  <simon.fraser@apple.com>
966
967         Revert use of SVG <mask> elements for -webkit-mask-image (r176798, r177494, r186180)
968         https://bugs.webkit.org/show_bug.cgi?id=146653
969
970         Reviewed by Dean Jackson.
971
972         Fixes rdar://problem/21435233.
973
974         r177494 caused a number of regressions (bugs 141857, 146509, 146561), added new layering violations, and
975         was not being maintained, so revert it.
976
977         This patch reverts r177494.
978
979         * WebCore.xcodeproj/project.pbxproj:
980         * css/CSSComputedStyleDeclaration.cpp:
981         (WebCore::ComputedStyleExtractor::propertyValue):
982         * css/CSSParser.cpp:
983         (WebCore::CSSParser::parseFillProperty):
984         (WebCore::CSSParser::parseMaskImage): Deleted.
985         * css/CSSParser.h:
986         * css/CSSPropertyNames.in:
987         * css/CSSValue.h:
988         * css/StyleBuilderConverter.h:
989         (WebCore::StyleBuilderConverter::convertMaskImageOperations): Deleted.
990         * css/StyleResolver.cpp:
991         (WebCore::StyleResolver::loadPendingSVGDocuments):
992         (WebCore::StyleResolver::loadPendingImages):
993         (WebCore::StyleResolver::adjustStyleForMaskImages): Deleted.
994         (WebCore::StyleResolver::applyMatchedProperties): Deleted.
995         * css/StyleResolver.h:
996         * page/FrameView.cpp:
997         (WebCore::FrameView::containsSVGDocument):
998         * page/FrameView.h:
999         * page/animation/CSSPropertyAnimation.cpp:
1000         (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
1001         (WebCore::blendFunc): Deleted.
1002         (WebCore::MaskImagePropertyWrapper::MaskImagePropertyWrapper): Deleted.
1003         (WebCore::MaskImagePropertyWrapper::equals): Deleted.
1004         * platform/ScrollView.h:
1005         (WebCore::ScrollView::containsSVGDocument):
1006         * platform/graphics/MaskImageOperation.cpp:
1007         (WebCore::MaskImageOperation::~MaskImageOperation): Deleted.
1008         (WebCore::MaskImageOperation::operator==): Deleted.
1009         * platform/graphics/MaskImageOperation.h:
1010         * rendering/RenderBox.cpp:
1011         (WebCore::RenderBox::maskClipRect):
1012         * rendering/RenderBoxModelObject.cpp:
1013         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
1014         * rendering/RenderElement.cpp:
1015         (WebCore::RenderElement::updateFillImages):
1016         (WebCore::RenderElement::~RenderElement): Deleted.
1017         * rendering/RenderLayer.cpp:
1018         (WebCore::RenderLayer::~RenderLayer): Deleted.
1019         (WebCore::RenderLayer::calculateClipRects): Deleted.
1020         * rendering/RenderLayer.h:
1021         * rendering/RenderLayerMaskImageInfo.cpp: Removed.
1022         * rendering/style/FillLayer.h:
1023         (WebCore::FillLayer::image):
1024         (WebCore::FillLayer::imageOrMaskImage):
1025         * rendering/style/RenderStyle.cpp:
1026         (WebCore::RenderStyle::setMaskImage): Deleted.
1027         * rendering/style/RenderStyle.h:
1028
1029 2015-07-06  Simon Fraser  <simon.fraser@apple.com>
1030
1031         Revert use of SVG <mask> elements for -webkit-mask-image (r176798, r177494, r186180)
1032         https://bugs.webkit.org/show_bug.cgi?id=146653
1033         
1034         Fixes rdar://problem/21435233.
1035
1036         This patch reverts r186180, but keeps the layout test.
1037
1038         This feature caused a number of regressions (bugs 141857, 146509, 146561), added new layering violations, and
1039         was not being maintained, so revert it.
1040         
1041         * loader/cache/CachedResourceLoader.cpp:
1042         (WebCore::CachedResourceLoader::requestResource): Deleted.
1043         * loader/cache/CachedResourceRequest.h:
1044         (WebCore::CachedResourceRequest::acceptOverride): Deleted.
1045         (WebCore::CachedResourceRequest::setAcceptOverride): Deleted.
1046         * loader/cache/CachedSVGDocumentReference.cpp:
1047         (WebCore::CachedSVGDocumentReference::load): Deleted.
1048         * loader/cache/CachedSVGDocumentReference.h:
1049         (WebCore::CachedSVGDocumentReference::setAcceptsAnyImageType): Deleted.
1050         * platform/graphics/MaskImageOperation.cpp:
1051         (WebCore::MaskImageOperation::ensureCachedSVGDocumentReference):
1052         (WebCore::MaskImageOperation::notifyFinished):
1053
1054 2015-07-06  Daniel Bates  <dabates@apple.com>
1055
1056         Fix the Windows build following <https://trac.webkit.org/changeset/186388>
1057         (https://bugs.webkit.org/show_bug.cgi?id=144830)
1058
1059         As we for for Mac in WebCoreAVFResourceLoader::startLoading(), instantiate ResourceLoaderOptions
1060         with ContentSecurityPolicyImposition::DoPolicyCheck.
1061
1062         * platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
1063         (WebCore::WebCoreAVCFResourceLoader::startLoading):
1064
1065 2015-07-06  Daniel Bates  <dabates@apple.com>
1066
1067         Isolated worlds should respect Content Security Policy; User Agent Shadow DOM
1068         should be exempt from Content Security Policy
1069         https://bugs.webkit.org/show_bug.cgi?id=144830
1070         <rdar://problem/18860261>
1071
1072         Reviewed by Geoffrey Garen.
1073
1074         Make scripts that run in an isolated world be subject to the Content Security Policy (CSP) of the page
1075         and exempt features implemented using a user agent shadow DOM. As a side effect of this change,
1076         Safari Content Extensions will respect the CSP policy of the page when loading subresources (e.g. an image).
1077
1078         Tests: http/tests/security/contentSecurityPolicy/userAgentShadowDOM/allow-audio.html
1079                http/tests/security/contentSecurityPolicy/userAgentShadowDOM/allow-css-background.html
1080                http/tests/security/contentSecurityPolicy/userAgentShadowDOM/allow-css-cursor.html
1081                http/tests/security/contentSecurityPolicy/userAgentShadowDOM/allow-css-filter-on-image.html
1082                http/tests/security/contentSecurityPolicy/userAgentShadowDOM/allow-css-webkit-image-set.html
1083                http/tests/security/contentSecurityPolicy/userAgentShadowDOM/allow-embed-plugin.html
1084                http/tests/security/contentSecurityPolicy/userAgentShadowDOM/allow-external-script.html
1085                http/tests/security/contentSecurityPolicy/userAgentShadowDOM/allow-iframe.html
1086                http/tests/security/contentSecurityPolicy/userAgentShadowDOM/allow-image-after-redirect.html
1087                http/tests/security/contentSecurityPolicy/userAgentShadowDOM/allow-image.html
1088                http/tests/security/contentSecurityPolicy/userAgentShadowDOM/allow-inline-script.html
1089                http/tests/security/contentSecurityPolicy/userAgentShadowDOM/allow-inline-style.html
1090                http/tests/security/contentSecurityPolicy/userAgentShadowDOM/allow-inline-stylesheet.html
1091                http/tests/security/contentSecurityPolicy/userAgentShadowDOM/allow-object-plugin.html
1092                http/tests/security/contentSecurityPolicy/userAgentShadowDOM/allow-object.html
1093                http/tests/security/contentSecurityPolicy/userAgentShadowDOM/allow-svg-feimage-element.html
1094                http/tests/security/contentSecurityPolicy/userAgentShadowDOM/allow-svg-font.html
1095                http/tests/security/contentSecurityPolicy/userAgentShadowDOM/allow-svg-use-element.html
1096                http/tests/security/contentSecurityPolicy/userAgentShadowDOM/allow-track.html
1097                http/tests/security/contentSecurityPolicy/userAgentShadowDOM/allow-video.html
1098                http/tests/security/contentSecurityPolicy/userAgentShadowDOM/block-loading-user-agent-image-from-non-user-agent-content.html
1099                http/tests/security/contentSecurityPolicy/userAgentShadowDOM/default-src-object-data-url-allowed.html
1100                http/tests/security/contentSecurityPolicy/userAgentShadowDOM/default-src-object-data-url-blocked.html
1101                http/tests/security/contentSecurityPolicy/userAgentShadowDOM/default-src-object-data-url-blocked2.html
1102                http/tests/security/contentSecurityPolicy/userAgentShadowDOM/default-src-object-data-url-blocked3.html
1103                http/tests/security/contentSecurityPolicy/userAgentShadowDOM/video-controls-allowed.html
1104                http/tests/security/isolatedWorld/image-load-should-not-bypass-main-world-csp.html
1105
1106         * Modules/websockets/WebSocket.cpp:
1107         (WebCore::WebSocket::connect): Pass shouldBypassMainWorldContentSecurityPolicy to ContentSecurityPolicy::allowConnectToSource().
1108         * css/CSSCanvasValue.h:
1109         (WebCore::CSSCanvasValue::loadSubimages): Modified to take argument ResourceLoaderOptions (unused).
1110         * css/CSSCrossfadeValue.cpp:
1111         (WebCore::CSSCrossfadeValue::fixedSize): Explicitly instantiate default ResourceLoaderOptions and pass
1112         pass it when requesting a cached image. Added FIXME comment to skip Content Security Policy check when
1113         the cross fade is applied to an element in a user agent shadow tree.
1114         (WebCore::CSSCrossfadeValue::loadSubimages): Take a ResourceLoaderOptions as an argument and passes it
1115         as appropriate.
1116         (WebCore::CSSCrossfadeValue::image): Explicitly instantiate default ResourceLoaderOptions and pass it
1117         when requesting a cached image. Added FIXME comment to skip Content Security Policy check when the cross
1118         fade is applied to an element in a user agent shadow tree.
1119         * css/CSSCrossfadeValue.h:
1120         * css/CSSCursorImageValue.cpp:
1121         (WebCore::CSSCursorImageValue::cachedImage): Take a ResourceLoaderOptions as an argument and passes it
1122         as appropriate.
1123         * css/CSSCursorImageValue.h:
1124         * css/CSSFilterImageValue.cpp:
1125         (WebCore::CSSFilterImageValue::fixedSize): Explicitly instantiate default ResourceLoaderOptions and pass
1126         pass it when requesting a cached image. Added FIXME comment to skip Content Security Policy check when
1127         the cross fade is applied to an element in a user agent shadow tree.
1128         (WebCore::CSSFilterImageValue::loadSubimages): Take a ResourceLoaderOptions as an argument and passes it
1129         as appropriate.
1130         (WebCore::CSSFilterImageValue::loadSubimages): Explicitly instantiate default ResourceLoaderOptions and pass
1131         pass it when requesting a cached image. Added FIXME comment to skip Content Security Policy check when
1132         the cross fade is applied to an element in a user agent shadow tree.
1133         (WebCore::CSSFilterImageValue::image):
1134         * css/CSSFilterImageValue.h:
1135         * css/CSSFontFaceSrcValue.cpp:
1136         (WebCore::CSSFontFaceSrcValue::cachedFont): Take a boolean, isInitiatingElementInUserAgentShadowTree,
1137         so as to determine the appropriate CSP imposition. In particular, we skip the CSP check when the initiating element
1138         (e.g. SVG font-face element) is in a user agent shadow tree.
1139         * css/CSSFontFaceSrcValue.h:
1140         * css/CSSFontSelector.cpp:
1141         (WebCore::CSSFontSelector::addFontFaceRule): Take a boolean, isInitiatingElementInUserAgentShadowTree, and passes
1142         it as appropriate.
1143         * css/CSSFontSelector.h:
1144         * css/CSSGradientValue.h:
1145         (WebCore::CSSGradientValue::loadSubimages): Take a ResourceLoaderOptions as an argument and passes it
1146         as appropriate.
1147         * css/CSSImageGeneratorValue.cpp:
1148         (WebCore::CSSImageGeneratorValue::loadSubimages): Ditto.
1149         (WebCore::CSSImageGeneratorValue::cachedImageForCSSValue): Ditto.
1150         * css/CSSImageGeneratorValue.h:
1151         * css/CSSImageSetValue.cpp:
1152         (WebCore::CSSImageSetValue::cachedImageSet): Deleted.
1153         * css/CSSImageSetValue.h:
1154         * css/CSSImageValue.cpp:
1155         (WebCore::CSSImageValue::cachedImage): Deleted.
1156         * css/CSSImageValue.h:
1157         * css/RuleSet.cpp:
1158         (WebCore::RuleSet::addChildRules): Take a boolean, isInitiatingElementInUserAgentShadowTree, and passes
1159         it as appropriate.
1160         (WebCore::RuleSet::addRulesFromSheet): Added FIXME comment to skip Content Security Policy check when
1161         when stylesheet is in a user agent shadow tree.
1162         * css/RuleSet.h:
1163         * css/StyleResolver.cpp:
1164         (WebCore::StyleResolver::StyleResolver): Determine whether the SVG font-face element is in a user agent shadow tree
1165         and pass the appropriate value when calling CSSFontSelector::addFontFaceRule(). Also, modernized code; used C++11 range
1166         -based for-loop instead of const_iterator idiom.
1167         (WebCore::StyleResolver::loadPendingSVGDocuments): Skip CSP check when requesting subresources as a byproduct of
1168         resolving style for an element in a user agent shadow tree.
1169         (WebCore::StyleResolver::loadPendingImage): Ditto.
1170         (WebCore::StyleResolver::loadPendingShapeImage): Ditto.
1171         * css/StyleRuleImport.cpp:
1172         (WebCore::StyleRuleImport::requestStyleSheet): Added FIXME comment to skip Content Security Policy check when
1173         when stylesheet is in a user agent shadow tree.
1174         * dom/Element.h:
1175         * dom/InlineStyleSheetOwner.cpp:
1176         (WebCore::InlineStyleSheetOwner::createSheet): Skip CSP check for an inline <style> that is in a user agent shadow tree.
1177         * dom/Node.cpp:
1178         (WebCore::Node::isInUserAgentShadowTree): Added.
1179         * dom/Node.h:
1180         * dom/ScriptElement.cpp:
1181         (WebCore::ScriptElement::requestScript): Skip CSP check for an external JavaScript script in a user agent shadow tree.
1182         (WebCore::ScriptElement::executeScript): Skip CSP check for an inline JavaScript script that is in a user agent shadow tree.
1183         * dom/StyledElement.cpp:
1184         (WebCore::StyledElement::styleAttributeChanged): Skip CSP check when modifying the inline style of an element in a user
1185         agent shadow tree.
1186         * html/HTMLMediaElement.cpp:
1187         (WebCore::HTMLMediaElement::isSafeToLoadURL): Skip CSP check for a <audio>, <video> in a user agent shadow tree.
1188         (WebCore::HTMLMediaElement::outOfBandTrackSources): Ditto.
1189         * html/HTMLTrackElement.cpp:
1190         (WebCore::HTMLTrackElement::canLoadURL): Ditto.
1191         * html/track/LoadableTextTrack.cpp:
1192         (WebCore::LoadableTextTrack::loadTimerFired): Determine whether the <track> is in a user agent shadow tree
1193         and pass the appropriate value when calling TextTrackLoader::load().
1194         * loader/DocumentLoader.cpp:
1195         (WebCore::DocumentLoader::startLoadingMainResource): Do CSP check when loading a resource by default.
1196         * loader/ImageLoader.cpp:
1197         (WebCore::ImageLoader::updateFromElement): Skip CSP check for an image that is in a user agent shadow tree.
1198         * loader/MediaResourceLoader.cpp:
1199         (WebCore::MediaResourceLoader::start): Instantiate ResourceLoaderOptions passing placeholder value ContentSecurityPolicyImposition::DoPolicyCheck.
1200         This value does not affect the request because we do not check the Content Security Policy for raw resource requests.
1201         * loader/NetscapePlugInStreamLoader.cpp:
1202         (WebCore::NetscapePlugInStreamLoader::NetscapePlugInStreamLoader): Added FIXME comment to skip Content Security Policy check
1203         when when associated plugin element is in a user agent shadow tree.
1204         * loader/PolicyChecker.cpp:
1205         (WebCore::PolicyChecker::checkNavigationPolicy): Skip CSP check for a <iframe> in a user agent shadow tree.
1206         * loader/ResourceLoaderOptions.h: Defined enum class ContentSecurityPolicyImposition with explicit type uint8_t so
1207         as to provide a hint to the compiler (for better packing) when it computes the memory layout for struct that
1208         contains an instance of this class.
1209         (WebCore::ResourceLoaderOptions::ResourceLoaderOptions): Added argument contentSecurityPolicyImposition.
1210         (WebCore::ResourceLoaderOptions::contentSecurityPolicyImposition): Added.
1211         (WebCore::ResourceLoaderOptions::setContentSecurityPolicyImposition): Added.
1212         * loader/SubframeLoader.cpp:
1213         (WebCore::SubframeLoader::pluginIsLoadable): Skip CSP check for a plugin element that is in a user agent shadow tree.
1214         (WebCore::SubframeLoader::createJavaAppletWidget): Skip CSP check for an applet element that is in a user agent shadow tree.
1215         * loader/TextTrackLoader.cpp:
1216         (WebCore::TextTrackLoader::load): Take a boolean, isInitiatingElementInUserAgentShadowTree, and sets the appropriate
1217         Content Security Policy imposition for the text track request.
1218         * loader/TextTrackLoader.h:
1219         * loader/cache/CachedResourceLoader.cpp:
1220         (WebCore::CachedResourceLoader::requestUserCSSStyleSheet): Skip CSP check for a user-specified stylesheet.
1221         (WebCore::CachedResourceLoader::canRequest): Only check the CSP of the page if specified in the resource loader options for the request.
1222         (WebCore::CachedResourceLoader::defaultCachedResourceOptions): Add ContentSecurityPolicyImposition::DoPolicyCheck to the default
1223         resource loader options so that do check the CSP policy of the page before performing a resource request by default.
1224         * loader/cache/CachedSVGDocumentReference.cpp:
1225         (WebCore::CachedSVGDocumentReference::load): Take a ResourceLoaderOptions as an argument and passes it as appropriate.
1226         * loader/cache/CachedSVGDocumentReference.h:
1227         * loader/icon/IconLoader.cpp:
1228         (WebCore::IconLoader::startLoading): Instantiate ResourceLoaderOptions passing placeholder value ContentSecurityPolicyImposition::DoPolicyCheck.
1229         This value does not affect the request because we do not check the Content Security Policy for raw resource requests.
1230         * page/ContentSecurityPolicy.cpp:
1231         (WebCore::ContentSecurityPolicy::allowJavaScriptURLs): Take an argument called overrideContentSecurityPolicy (defaults to false). When
1232         overrideContentSecurityPolicy := true, this function unconditionally returns true.
1233         (WebCore::ContentSecurityPolicy::allowInlineEventHandlers): Ditto.
1234         (WebCore::ContentSecurityPolicy::allowInlineScript): Ditto.
1235         (WebCore::ContentSecurityPolicy::allowInlineStyle): Ditto.
1236         (WebCore::ContentSecurityPolicy::allowEval): Ditto.
1237         (WebCore::ContentSecurityPolicy::allowPluginType): Ditto.
1238         (WebCore::ContentSecurityPolicy::allowScriptFromSource): Ditto.
1239         (WebCore::ContentSecurityPolicy::allowObjectFromSource): Ditto.
1240         (WebCore::ContentSecurityPolicy::allowChildFrameFromSource): Ditto.
1241         (WebCore::ContentSecurityPolicy::allowImageFromSource): Ditto.
1242         (WebCore::ContentSecurityPolicy::allowStyleFromSource): Ditto.
1243         (WebCore::ContentSecurityPolicy::allowFontFromSource): Ditto.
1244         (WebCore::ContentSecurityPolicy::allowMediaFromSource): Ditto.
1245         (WebCore::ContentSecurityPolicy::allowConnectToSource): Ditto.
1246         (WebCore::ContentSecurityPolicy::allowFormAction): Ditto.
1247         (WebCore::ContentSecurityPolicy::allowBaseURI): Ditto.
1248         * page/ContentSecurityPolicy.h:
1249         * page/DOMSecurityPolicy.cpp:
1250         * page/EventSource.cpp:
1251         (WebCore::EventSource::create): Pass shouldBypassMainWorldContentSecurityPolicy to ContentSecurityPolicy::allowConnectToSource().
1252         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
1253         (WebCore::WebCoreAVFResourceLoader::startLoading): Instantiate ResourceLoaderOptions passing placeholder value ContentSecurityPolicyImposition::DoPolicyCheck.
1254         This value does not affect the request because we do not check the Content Security Policy for raw resource requests.
1255         * svg/SVGFEImageElement.cpp:
1256         (WebCore::SVGFEImageElement::requestImageResource): Skip CSP check for a SVG FEImage element in a user agent shadow tree.
1257         * svg/SVGFontFaceUriElement.cpp:
1258         (WebCore::SVGFontFaceUriElement::loadFont): Skip CSP check for a SVG font-face-uri element in a user agent shadow tree.
1259         * svg/SVGUseElement.cpp:
1260         (WebCore::SVGUseElement::updateExternalDocument): Skip CSP check for a SVG use element in a user agent shadow tree.
1261         * testing/Internals.cpp:
1262         (WebCore::Internals::ensureUserAgentShadowRoot): Added.
1263         * testing/Internals.h:
1264         * testing/Internals.idl: Added declaration for ensureUserAgentShadowRoot().
1265         * xml/XMLHttpRequest.cpp:
1266         (WebCore::XMLHttpRequest::open): Pass shouldBypassMainWorldContentSecurityPolicy to ContentSecurityPolicy::allowConnectToSource().
1267
1268 2015-07-06  Brent Fulgham  <bfulgham@apple.com>
1269
1270         Ensure media playback is stopped during page close
1271         https://bugs.webkit.org/show_bug.cgi?id=146554
1272         <rdar://problem/18033944>
1273
1274         Reviewed by Brady Eidson.
1275
1276         * Modules/webaudio/AudioContext.h:
1277         (WebCore::WebAudio::hostingDocument): Added.
1278         * html/HTMLMediaElement.h:
1279         (WebCore::HTMLMediaElement::hostingDocument): Added.
1280         * dom/Document.cpp:
1281         (WebCore::Document::~Document): Call new 'stopAllMediaPlaybackForDocument' at destruction time.
1282         * platform/audio/PlatformMediaSession.h:
1283         Made PlatformMediaSessionManager a friend so it can access the protected 'client' accessor.
1284         Updated PlatformMediaSessionClient to require clients to have a "hostingDocument" member.
1285         * platform/audio/PlatformMediaSessionManager.cpp:
1286         (WebCore::PlatformMediaSessionManager::stopAllMediaPlaybackForDocument): Added. Only pauses
1287         playback on elements that match the provided document.
1288         (WebCore::PlatformMediaSessionManager::stopAllMediaPlaybackForProcess): Added. Pauses playback
1289         on all elements in the current process.
1290         * platform/audio/PlatformMediaSessionManager.h:
1291
1292 2015-07-06  Alex Christensen  <achristensen@webkit.org>
1293
1294         [Content Extensions] Remove memory page reporting
1295         https://bugs.webkit.org/show_bug.cgi?id=146659
1296
1297         Reviewed by Benjamin Poulain.
1298
1299         * contentextensions/CompiledContentExtension.cpp:
1300         (WebCore::ContentExtensions::CompiledContentExtension::~CompiledContentExtension):
1301         (WebCore::ContentExtensions::CompiledContentExtension::globalDisplayNoneSelectors):
1302         * contentextensions/CompiledContentExtension.h:
1303         * contentextensions/ContentExtension.cpp:
1304         (WebCore::ContentExtensions::ContentExtension::globalDisplayNoneStyleSheet):
1305         * contentextensions/ContentExtension.h:
1306         (WebCore::ContentExtensions::ContentExtension::compiledExtension):
1307         * contentextensions/ContentExtensionsBackend.cpp:
1308         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
1309         * contentextensions/DFABytecodeInterpreter.cpp:
1310         (WebCore::ContentExtensions::getBits):
1311         (WebCore::ContentExtensions::getInstruction):
1312         (WebCore::ContentExtensions::jumpSizeInBytes):
1313         (WebCore::ContentExtensions::getJumpSize):
1314         (WebCore::ContentExtensions::getJumpDistance):
1315         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpretAppendAction):
1316         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpretTestFlagsAndAppendAction):
1317         (WebCore::ContentExtensions::DFABytecodeInterpreter::actionsForDefaultStylesheetFromDFARoot):
1318         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
1319         * contentextensions/DFABytecodeInterpreter.h:
1320         Don't keep track of memory page usage.  It wasn't even correct anyways.
1321
1322 2015-07-06  Alex Christensen  <achristensen@webkit.org>
1323
1324         [Content Extensions] Increase maxNFASize
1325         https://bugs.webkit.org/show_bug.cgi?id=146656
1326
1327         Reviewed by Benjamin Poulain.
1328
1329         Because of memory improvements in r186375, r186374, and r186079,
1330         we can now increase the maximum number of NFA nodes in order to avoid
1331         long compile times of some large, complicated content blockers.
1332         This also improves the interpreting time of content blockers.
1333
1334         * contentextensions/ContentExtensionCompiler.cpp:
1335         (WebCore::ContentExtensions::compileRuleList):
1336         Increase maxNFASize to 75000 to avoid long compile times.
1337
1338 2015-07-06  Dean Jackson  <dino@apple.com>
1339
1340         Memory corruption in WebGLRenderingContext::simulateVertexAttrib0
1341         https://bugs.webkit.org/show_bug.cgi?id=146652
1342         <rdar://problem/21567767>
1343
1344         Follow-up fix.
1345
1346         * html/canvas/WebGLRenderingContextBase.cpp:
1347         (WebCore::WebGLRenderingContextBase::simulateVertexAttrib0):
1348
1349 2015-07-06  Dean Jackson  <dino@apple.com>
1350
1351         Memory corruption in WebGLRenderingContext::simulateVertexAttrib0
1352         https://bugs.webkit.org/show_bug.cgi?id=146652
1353         <rdar://problem/21567767>
1354
1355         Reviewed by Brent Fulgham.
1356
1357         The expression "(numVertex + 1) * 4 * sizeof(GC3Dfloat)" could potentially
1358         overflow. Make it use checked arithmetic.
1359
1360         I couldn't make a test case that reliably exercised this.
1361
1362         * html/canvas/WebGLRenderingContextBase.cpp:
1363         (WebCore::WebGLRenderingContextBase::simulateVertexAttrib0): Used Checked<GC3Dsizeiptr>
1364         for calculating the size of the buffer.
1365
1366 2015-07-06  Said Abou-Hallawa  <sabouhallawa@apple.com>
1367
1368         [Mac] REGRESSION: (r181403) Enter/Exit full screen on 1x secondary display plugged into 2x Mac displays WebView as 1/4 size during transition
1369         https://bugs.webkit.org/show_bug.cgi?id=146651
1370
1371         Reviewed by Simon Fraser.
1372
1373         * platform/mac/WebCoreFullScreenPlaceholderView.mm: set layerContentsPlacement
1374         to NSViewLayerContentsPlacementScaleProportionallyToFit so AppKit resizes the
1375         content CALayer to fit in the WebView.
1376
1377 2015-07-06  Benjamin Poulain  <benjamin@webkit.org>
1378
1379         Reduce the memory usage of the prefix tree
1380         https://bugs.webkit.org/show_bug.cgi?id=146615
1381
1382         Reviewed by Sam Weinig.
1383
1384         This patch introduces two little changes that reduces the size
1385         of the prefix tree by about 40%.
1386
1387         First, the Terms are interned. The new class CombinedFiltersAlphabet
1388         takes care of keeping a unique version of each term for use
1389         by the CombinedURLFilters.
1390
1391         Since each Term is fairly big but we have a small number of
1392         unique term, we significantly reduce the edge size.
1393
1394         Second, the actions are no longer stored on each Vertex.
1395         They are now stored on the side, in a HashMap indexed by
1396         their Vertex.
1397
1398         This works well because the Actions are sparse over the tree.
1399         Typically, only the leaves have actions. Internal vertices
1400         sometime get actions but that's uncommon.
1401
1402         ---
1403
1404         The next step to reduce the memory footprint would be to
1405         make PrefixTreeVertex into a custom packed structure instead
1406         of using a Vector.
1407
1408         Such change is very invasive and more error prone so I decided
1409         against it for this patch.
1410
1411         * WebCore.xcodeproj/project.pbxproj:
1412         * contentextensions/CombinedFiltersAlphabet.cpp: Copied from Source/WebCore/contentextensions/CombinedURLFilters.h.
1413         (WebCore::ContentExtensions::TermCreatorTranslator::hash):
1414         (WebCore::ContentExtensions::TermCreatorTranslator::equal):
1415         (WebCore::ContentExtensions::TermCreatorTranslator::translate):
1416         (WebCore::ContentExtensions::CombinedFiltersAlphabet::interned):
1417         (WebCore::ContentExtensions::CombinedFiltersAlphabet::memoryUsed):
1418         * contentextensions/CombinedFiltersAlphabet.h: Copied from Source/WebCore/contentextensions/CombinedURLFilters.h.
1419         (WebCore::ContentExtensions::CombinedFiltersAlphabet::TermPointerHash::hash):
1420         (WebCore::ContentExtensions::CombinedFiltersAlphabet::TermPointerHash::equal):
1421         * contentextensions/CombinedURLFilters.cpp:
1422         (WebCore::ContentExtensions::recursiveMemoryUsed):
1423         (WebCore::ContentExtensions::CombinedURLFilters::memoryUsed):
1424         (WebCore::ContentExtensions::prefixTreeVertexToString):
1425         (WebCore::ContentExtensions::recursivePrint):
1426         (WebCore::ContentExtensions::CombinedURLFilters::addPattern):
1427         (WebCore::ContentExtensions::generateNFAForSubtree):
1428         (WebCore::ContentExtensions::CombinedURLFilters::processNFAs):
1429         * contentextensions/CombinedURLFilters.h:
1430         * contentextensions/ContentExtensionsDebugging.h:
1431         * contentextensions/Term.h:
1432         (WebCore::ContentExtensions::Term::isValid):
1433         (WebCore::ContentExtensions::Term::destroy):
1434         (WebCore::ContentExtensions::Term::memoryUsed):
1435         (WebCore::ContentExtensions::Term::toString): Deleted.
1436         (WebCore::ContentExtensions::TermHash::hash): Deleted.
1437         (WebCore::ContentExtensions::TermHash::equal): Deleted.
1438         (WebCore::ContentExtensions::Term::Term): Deleted.
1439         (WebCore::ContentExtensions::Term::isKnownToMatchAnyString): Deleted.
1440         (WebCore::ContentExtensions::Term::hasFixedLength): Deleted.
1441         (WebCore::ContentExtensions::Term::operator==): Deleted.
1442         (WebCore::ContentExtensions::Term::hash): Deleted.
1443         (WebCore::ContentExtensions::Term::isDeletedValue): Deleted.
1444         (WebCore::ContentExtensions::Term::isUniversalTransition): Deleted.
1445         (WebCore::ContentExtensions::Term::generateSubgraphForAtom): Deleted.
1446
1447 2015-07-06  Benjamin Poulain  <benjamin@webkit.org>
1448
1449         [Content Extensions] Make the DFA transitions ranges instead of characters
1450         https://bugs.webkit.org/show_bug.cgi?id=146575
1451
1452         Reviewed by Alex Christensen.
1453
1454         This patch changes the DFA and code using the DFA to use ranges
1455         to represent the transitions between any two nodes.
1456
1457         This patch builds on top of the tools introduced in r186079.
1458
1459         The DFA structure is basically the same as ImmutableNFA but without
1460         any epsilon transitions.
1461
1462         This patch introduces a transition iterator to make the DFA
1463         compatible with the existing algorithms.
1464
1465         ---
1466
1467         The DFA combiner is rebuilt on top of MutableRangeList. Combining the transitions
1468         of two nodes is one by merging the range list of each not into a common
1469         MutableRangeList.
1470         The data converter takes care of creating the signature of the combination.
1471
1472         The code got simpler since MutableRangeList does most of the work now. It is also
1473         much faster.
1474
1475         ---
1476
1477         The minimizer is more intersting.
1478
1479         With the current algorithm, we cannot resolve overlaps between ranges. On the other
1480         hand, the minimizer does not care about the symbol of the transitions if we are careful
1481         to partition transitions of the same symbol together.
1482
1483         What I did was to turn the minimizer into a pure transition based one, BUT each
1484         "symbol" is actually an unbreakable range.
1485
1486         The first step is to go over all the transitions of all the nodes and find the largest
1487         ranges such that the alphabet of interest is covered but there is not a single intersection
1488         between any two nodes (what I called "singular transitions" in the code). 
1489
1490         This can be done efficiently with MutableRangeList.
1491         A little trick there is that I also used the converter to count how many real transition
1492         overlaps any singular transition.
1493
1494         Those singular transitions become the alphabet of our minimizer. The "symbol" of our alphabet
1495         is simply the position of the singular transition in the list.
1496
1497         The partition of transition is created by populating each set with all the transition that
1498         overlaps the symbols.
1499         Note that since the partition is created on the fly, the Transition structure used for
1500         repartitioning only contains the source of the transitions.
1501
1502         Once our transition parition has been carefuly created, we can completely forget about
1503         the symbols and only work with subsets.
1504
1505         Since the singular transitions have no overlap (unlike fallback transitions), this new minimizer
1506         will find the minimial solution for well formed input.
1507
1508         * WebCore.xcodeproj/project.pbxproj:
1509         * contentextensions/DFA.cpp:
1510         (WebCore::ContentExtensions::DFA::memoryUsed):
1511         (WebCore::ContentExtensions::printTransitions):
1512         (WebCore::ContentExtensions::DFANode::actions): Deleted.
1513         (WebCore::ContentExtensions::DFANode::transitions): Deleted.
1514         (WebCore::ContentExtensions::DFANode::fallbackTransitionDestination): Deleted.
1515         (WebCore::ContentExtensions::DFANode::changeFallbackTransition): Deleted.
1516         (WebCore::ContentExtensions::DFANode::addFallbackTransition): Deleted.
1517         (WebCore::ContentExtensions::DFANode::containsTransition): Deleted.
1518         (WebCore::ContentExtensions::DFANode::kill): Deleted.
1519         (WebCore::ContentExtensions::DFA::debugPrintDot): Deleted.
1520         * contentextensions/DFA.h:
1521         (WebCore::ContentExtensions::DFANode::ConstRangeIterator::range):
1522         (WebCore::ContentExtensions::DFANode::ConstRangeIterator::target):
1523         (WebCore::ContentExtensions::DFANode::RangeIterator::range):
1524         (WebCore::ContentExtensions::DFANode::RangeIterator::target):
1525         (WebCore::ContentExtensions::DFANode::RangeIterator::resetTarget):
1526         * contentextensions/DFABytecodeCompiler.cpp:
1527         (WebCore::ContentExtensions::DFABytecodeCompiler::ranges):
1528         (WebCore::ContentExtensions::DFABytecodeCompiler::nodeTransitionsMaxBytecodeSize):
1529         (WebCore::ContentExtensions::DFABytecodeCompiler::compileNodeTransitions):
1530         * contentextensions/DFACombiner.cpp:
1531         (WebCore::ContentExtensions::DFAMerger::TargetConverter::convert):
1532         (WebCore::ContentExtensions::DFAMerger::TargetConverter::extend):
1533         (WebCore::ContentExtensions::DFAMerger::TargetConverter::setHalfSignature):
1534         (WebCore::ContentExtensions::DFAMerger::merge):
1535         (WebCore::ContentExtensions::DFAMerger::getOrCreateCombinedNode):
1536         (WebCore::ContentExtensions::DFAMerger::setHalfSignature): Deleted.
1537         (WebCore::ContentExtensions::DFAMerger::populateTransitions): Deleted.
1538         (WebCore::ContentExtensions::DFAMerger::populateFromFallbackTransitions): Deleted.
1539         (WebCore::ContentExtensions::DFAMerger::createTransitions): Deleted.
1540         (WebCore::ContentExtensions::DFAMerger::createFallbackTransitionIfNeeded): Deleted.
1541         * contentextensions/DFAMinimizer.cpp:
1542         (WebCore::ContentExtensions::DFAMinimizer::minimize):
1543         * contentextensions/DFANode.cpp: Added.
1544         (WebCore::ContentExtensions::DFANode::actions):
1545         (WebCore::ContentExtensions::DFANode::containsTransition):
1546         (WebCore::ContentExtensions::DFANode::kill):
1547         (WebCore::ContentExtensions::DFANode::canUseFallbackTransition):
1548         (WebCore::ContentExtensions::DFANode::bestFallbackTarget):
1549         * contentextensions/DFANode.h:
1550         (WebCore::ContentExtensions::CharRange::size):
1551         (WebCore::ContentExtensions::DFANode::ConstRangeIterator::operator*):
1552         (WebCore::ContentExtensions::DFANode::ConstRangeIterator::operator==):
1553         (WebCore::ContentExtensions::DFANode::ConstRangeIterator::operator!=):
1554         (WebCore::ContentExtensions::DFANode::ConstRangeIterator::operator++):
1555         (WebCore::ContentExtensions::DFANode::ConstRangeIterator::first):
1556         (WebCore::ContentExtensions::DFANode::ConstRangeIterator::last):
1557         (WebCore::ContentExtensions::DFANode::ConstRangeIterator::data):
1558         (WebCore::ContentExtensions::DFANode::IterableConstRange::begin):
1559         (WebCore::ContentExtensions::DFANode::IterableConstRange::end):
1560         (WebCore::ContentExtensions::DFANode::transitions):
1561         (WebCore::ContentExtensions::DFANode::RangeIterator::operator*):
1562         (WebCore::ContentExtensions::DFANode::RangeIterator::operator==):
1563         (WebCore::ContentExtensions::DFANode::RangeIterator::operator!=):
1564         (WebCore::ContentExtensions::DFANode::RangeIterator::operator++):
1565         (WebCore::ContentExtensions::DFANode::RangeIterator::first):
1566         (WebCore::ContentExtensions::DFANode::RangeIterator::last):
1567         (WebCore::ContentExtensions::DFANode::RangeIterator::data):
1568         (WebCore::ContentExtensions::DFANode::IterableRange::begin):
1569         (WebCore::ContentExtensions::DFANode::IterableRange::end):
1570         (WebCore::ContentExtensions::DFANode::hasFallbackTransition): Deleted.
1571         (WebCore::ContentExtensions::DFANode::transitionsLength): Deleted.
1572         (WebCore::ContentExtensions::DFANode::transitionsStart): Deleted.
1573         (WebCore::ContentExtensions::DFANode::resetTransitions): Deleted.
1574         (WebCore::ContentExtensions::DFANode::setHasFallbackTransitionWithoutChangingDFA): Deleted.
1575         * contentextensions/ImmutableNFA.h:
1576         (WebCore::ContentExtensions::ImmutableNFA::ConstRangeIterator::first):
1577         (WebCore::ContentExtensions::ImmutableNFA::ConstRangeIterator::last):
1578         (WebCore::ContentExtensions::ImmutableNFA::ConstRangeIterator::data):
1579         (WebCore::ContentExtensions::ImmutableNFA::ConstRangeIterator::range):
1580         (WebCore::ContentExtensions::ImmutableNFA::ConstRangeIterator::operator*): Deleted.
1581         (WebCore::ContentExtensions::ImmutableNFA::ConstRangeIterator::operator->): Deleted.
1582         * contentextensions/ImmutableNFANodeBuilder.h:
1583         (WebCore::ContentExtensions::ImmutableNFANodeBuilder::FakeRangeIterator::first):
1584         (WebCore::ContentExtensions::ImmutableNFANodeBuilder::FakeRangeIterator::last):
1585         (WebCore::ContentExtensions::ImmutableNFANodeBuilder::FakeRangeIterator::operator*): Deleted.
1586         (WebCore::ContentExtensions::ImmutableNFANodeBuilder::FakeRangeIterator::operator->): Deleted.
1587         * contentextensions/MutableRange.h:
1588         (WebCore::ContentExtensions::MutableRange::size): Deleted.
1589         * contentextensions/MutableRangeList.h:
1590         (WebCore::ContentExtensions::MutableRangeList::ConstIterator::first):
1591         (WebCore::ContentExtensions::MutableRangeList::ConstIterator::last):
1592         (WebCore::ContentExtensions::MutableRangeList::ConstIterator::data):
1593         (WebCore::ContentExtensions::MutableRangeList::extend):
1594         (WebCore::ContentExtensions::MutableRangeList::size):
1595         (WebCore::ContentExtensions::MutableRangeList::initializeFrom):
1596         * contentextensions/NFAToDFA.cpp:
1597         (WebCore::ContentExtensions::NFAToDFA::convert):
1598         (WebCore::ContentExtensions::canUseFallbackTransition): Deleted.
1599         (WebCore::ContentExtensions::findBestFallbackTarget): Deleted.
1600
1601 2015-07-06  Timothy Hatcher  <timothy@apple.com>
1602
1603         Fix ASSERT causing crashes in Inspector tests on the bots.
1604
1605         * inspector/InspectorPageAgent.cpp:
1606         (WebCore::InspectorPageAgent::enable): Reset stopwatch before starting it.
1607
1608 2015-07-06  Brady Eidson  <beidson@apple.com>
1609
1610         Remove unused "m_isPrivate" flag on NetworkStorageSession.
1611         https://bugs.webkit.org/show_bug.cgi?id=146648
1612
1613         Reviewed by Alex Christensen.
1614
1615         No new tests (No behavior change).
1616
1617         * platform/network/NetworkStorageSession.h:
1618         (WebCore::NetworkStorageSession::isPrivateBrowsingSession): Deleted.
1619
1620         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
1621         (WebCore::NetworkStorageSession::NetworkStorageSession): Deleted.
1622         (WebCore::NetworkStorageSession::createPrivateBrowsingSession): Deleted.
1623
1624         * platform/network/soup/NetworkStorageSessionSoup.cpp:
1625         (WebCore::NetworkStorageSession::NetworkStorageSession): Deleted.
1626         (WebCore::NetworkStorageSession::createPrivateBrowsingSession): Deleted.
1627
1628 2015-07-04  Timothy Hatcher  <timothy@apple.com>
1629
1630         Web Inspector: Add a dedicated Network tab that is always live
1631         https://bugs.webkit.org/show_bug.cgi?id=146568
1632
1633         Make sure the executionStopwatch is always started and never stops so resource loads
1634         always get timestamps, even when Timeline is not recording.
1635
1636         Reviewed by Joseph Pecoraro.
1637
1638         * inspector/InspectorPageAgent.cpp:
1639         (WebCore::InspectorPageAgent::enable): Start executionStopwatch.
1640         (WebCore::InspectorPageAgent::frameStartedLoading): Reset and start executionStopwatch.
1641         * inspector/InspectorTimelineAgent.cpp:
1642         (WebCore::InspectorTimelineAgent::internalStart): Removed executionStopwatch code.
1643         (WebCore::InspectorTimelineAgent::internalStop): Ditto.
1644
1645 2015-07-02  Timothy Hatcher  <timothy@apple.com>
1646
1647         Update the localized strings file.
1648
1649         * English.lproj/Localizable.strings: Updated with the script.
1650
1651 2015-07-06  Zalan Bujtas  <zalan@apple.com>
1652
1653         Crash: LayoutState root's container is nullptr when the layout root is detached.
1654         https://bugs.webkit.org/show_bug.cgi?id=146646
1655         rdar://problem/21371544
1656
1657         Reviewed by Simon Fraser.
1658
1659         This is a speculative fix to ensure that when the root of the LayoutState is detached
1660         we don't try to access its container (nullptr).
1661         This is related to trac.webkit.org/r185484.
1662
1663         Not reproducible.
1664
1665         * rendering/LayoutState.cpp:
1666         (WebCore::LayoutState::LayoutState):
1667         * rendering/LayoutState.h:
1668         (WebCore::LayoutState::LayoutState): Deleted.
1669
1670 2015-07-06  Eric Carlson  <eric.carlson@apple.com>
1671
1672         [Mac] Inactive AirPlay route should automatically timeout
1673         https://bugs.webkit.org/show_bug.cgi?id=146642
1674         <rdar://problem/21602955>
1675
1676         Automatically clear a media element's AirPlay connection after it has been paused
1677         for 60 minutes, or after 8 minutes if it played to the end before pausing.
1678
1679         Reviewed by Brent Fulgham.
1680
1681         * Modules/mediasession/WebMediaSessionManager.cpp:
1682         (WebCore::WebMediaSessionManager::WebMediaSessionManager): Initialize m_watchdogTimer.
1683         (WebCore::WebMediaSessionManager::clientStateDidChange): Schedule watchdog timer configuration
1684           if the client started playing or paused.
1685         (WebCore::WebMediaSessionManager::configurePlaybackTargetClients): Schedule watchdog timer configuration.
1686         (WebCore::WebMediaSessionManager::toString): Print watchdog configuration flag.
1687         (WebCore::WebMediaSessionManager::taskTimerFired): Call configureWatchdogTimer.
1688         (WebCore::WebMediaSessionManager::configureWatchdogTimer): New, start or stop watchdog timer.
1689         (WebCore::WebMediaSessionManager::watchdogTimerFired): Stop monitoring for targets, which 
1690           clears the route.
1691         * Modules/mediasession/WebMediaSessionManager.h:
1692
1693         * html/HTMLMediaElement.cpp:
1694         (WebCore::HTMLMediaElement::mediaState): Set DidPlayToEnd when appropriate.
1695
1696         * page/MediaProducer.h: Add DidPlayToEnd.
1697
1698         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
1699         (WebCore::MediaPlaybackTargetPickerMac::~MediaPlaybackTargetPickerMac): Clear m_client, call
1700           stopMonitoringPlaybackTargets.
1701         (WebCore::MediaPlaybackTargetPickerMac::pendingActionTimerFired): Send a neutered 
1702           MediaPlaybackTarget when m_outputDeviceMenuController is NULL.
1703         (WebCore::MediaPlaybackTargetPickerMac::devicePicker): Add logging.
1704         (WebCore::MediaPlaybackTargetPickerMac::stopMonitoringPlaybackTargets): Clear the menu
1705           controller to cancel the route.
1706
1707 2015-07-06  Zan Dobersek  <zdobersek@igalia.com>
1708
1709         [GTK] Fix build errors with OpenGL ES
1710         https://bugs.webkit.org/show_bug.cgi?id=146626
1711
1712         Reviewed by Carlos Garcia Campos.
1713
1714         * platform/graphics/ANGLEWebKitBridge.h: Include <GLES2/gl2.h>
1715         when building with OpenGL ES 2 support enabled.
1716         (WebCore::ANGLEShaderSymbol::isSampler): Don't test for
1717         OpenGL-specific GL_SAMPLER_2D_RECT_ARB value when OpenGL ES 2
1718         support is enabled.
1719
1720 2015-07-06  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1721
1722         [Streams API] Remove ReadableStream custom constructor
1723         https://bugs.webkit.org/show_bug.cgi?id=146547
1724
1725         Reviewed by Darin Adler.
1726
1727         Removed custom binding.
1728         Made use of Dictionary in lieu of JSObject to reduce readable stream constructor parameter parsing.
1729         Added support for passing ExecState to construtor within binding generator.
1730
1731         No change in behavior.
1732
1733         * Modules/streams/ReadableStream.cpp:
1734         (WebCore::ReadableStream::create):
1735         * Modules/streams/ReadableStream.h:
1736         (WebCore::ReadableStream::create):
1737         * Modules/streams/ReadableStream.idl:
1738         * bindings/js/JSDictionary.cpp:
1739         (WebCore::JSDictionary::convertValue):
1740         * bindings/js/JSDictionary.h:
1741         * bindings/js/JSReadableStreamCustom.cpp:
1742         * bindings/js/ReadableJSStream.cpp:
1743         (WebCore::ReadableJSStream::create):
1744         (WebCore::ReadableJSStream::ReadableJSStream):
1745         * bindings/js/ReadableJSStream.h:
1746         * bindings/scripts/CodeGeneratorJS.pm:
1747         (GenerateConstructorDefinition):
1748         * bindings/scripts/IDLAttributes.txt:
1749
1750 2015-07-06  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1751
1752         Promise-returning functions should reject promises if the callee is not of the expected type
1753         https://bugs.webkit.org/show_bug.cgi?id=146585
1754
1755         Reviewed by Darin Adler.
1756
1757         Updated binding generator to reject promise in case the casting of the thisValue is not working properly
1758         (i.e. the callee is not wrapping a DOM object of the expected class.
1759
1760         Covered by rebased test and binding expectations.
1761
1762         * bindings/js/JSDOMPromise.h:
1763         (WebCore::callPromiseFunction): Removed wrapper class parameter.
1764         * bindings/scripts/CodeGeneratorJS.pm:
1765         (GenerateImplementation):
1766         * bindings/scripts/test/JS/JSTestObj.cpp: Updated binding expectations.
1767         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunction):
1768         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionPromise):
1769         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgument):
1770         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgumentPromise):
1771         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithException):
1772         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithExceptionPromise):
1773         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithOptionalIntArgument):
1774         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithOptionalIntArgumentPromise):
1775
1776 2015-07-05  Chris Dumez  <cdumez@apple.com>
1777
1778         [WK2] Current page's scroll position is lost when transferring sessionState from one view to another
1779         https://bugs.webkit.org/show_bug.cgi?id=146625
1780         <rdar://problem/21585268>
1781
1782         Reviewed by Gavin Barraclough.
1783
1784         Export HistoryController:saveScrollPositionAndViewStateToItem()
1785         so that it can be called from WebKit2.
1786
1787         * loader/HistoryController.h:
1788
1789 2015-07-05  Simon Fraser  <simon.fraser@apple.com>
1790
1791         REGRESSION (r180582): background-attachment: local; does not scroll the background image when scrolling the the element's contents
1792         https://bugs.webkit.org/show_bug.cgi?id=146623
1793
1794         Reviewed by Zalan Bujtas.
1795         
1796         r180582 erroneously asserted that m_destOrigin in BackgroundImageGeometry was unused.
1797         However, it is needed to compute the correct phase when the destination rect is
1798         altered by clipping.
1799
1800         Test: fast/backgrounds/background-attachment-local.html
1801
1802         * rendering/RenderBoxModelObject.cpp:
1803         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
1804         (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry):
1805         * rendering/RenderBoxModelObject.h:
1806         (WebCore::BackgroundImageGeometry::BackgroundImageGeometry):
1807         (WebCore::BackgroundImageGeometry::relativePhase):
1808         * rendering/svg/RenderSVGResourceMasker.cpp:
1809         (WebCore::RenderSVGResourceMasker::drawMaskForRenderer):
1810
1811 2015-07-05  Chris Dumez  <cdumez@apple.com>
1812
1813         [WK2] WebBackForwardListItems' pageState is not kept up-to-date
1814         https://bugs.webkit.org/show_bug.cgi?id=146614
1815         <rdar://problem/21585268>
1816
1817         Reviewed by Gavin Barraclough.
1818
1819         WebBackForwardListItems' pageState on UIProcess-side were not kept
1820         up-to-date when it was updated on WebContent process side. This meant
1821         that we were losing the scroll position (among other things) when
1822         transferring the session state over from one view to another.
1823
1824         We now call notifyHistoryItemChanged(item) after saving the scroll
1825         position and the view state on the HistoryItem. As a result, the
1826         WebBackForwardListProxy will send the updated pageState to the
1827         UIProcess.
1828
1829         * history/HistoryItem.cpp:
1830         (WebCore::HistoryItem::notifyChanged):
1831         * history/HistoryItem.h:
1832         * loader/HistoryController.cpp:
1833         (WebCore::HistoryController::saveScrollPositionAndViewStateToItem):
1834
1835 2015-07-04  Chris Dumez  <cdumez@apple.com>
1836
1837         Unreviewed Windows build fix after r186279.
1838
1839         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
1840         (WebCore::AVFWrapper::destroyVideoLayer):
1841         * platform/graphics/ca/win/CACFLayerTreeHost.cpp:
1842         (WebCore::CACFLayerTreeHost::destroyRenderer):
1843
1844 2015-07-04  Chris Dumez  <cdumez@apple.com>
1845
1846         Drop RefPtr::clear() method
1847         https://bugs.webkit.org/show_bug.cgi?id=146556
1848
1849         Reviewed by Brady Eidson.
1850
1851         Drop RefPtr::clear() method in favor of "= nullptr;" pattern.
1852
1853 2015-07-03  Dan Bernstein  <mitz@apple.com>
1854
1855         Fixed the iOS 8 build.
1856
1857         * editing/cocoa/HTMLConverter.mm:
1858
1859 2015-07-03  Chris Dumez  <cdumez@apple.com>
1860
1861         REGRESSION (r178097): HTMLSelectElement.add(option, undefined) prepends option to the list of options; should append to the end of the list of options
1862         https://bugs.webkit.org/show_bug.cgi?id=146566
1863         <rdar://problem/21663919>
1864
1865         Reviewed by Ryosuke Niwa.
1866
1867         HTMLSelectElement.add(X, undefined) is supposed to be equivalent to
1868         HTMLSelectElement.add(X) which should *append* X. The same is true
1869         for HTMLOptionsCollection.add(X, undefined).
1870
1871         However, due to a bug in our bindings generator for overloaded
1872         operations, the actual behavior was not the expected one. The
1873         second overload would be chosen: add(X, index) and undefined would
1874         be converted as 0-index, which would *prepend* X.
1875
1876         This patch fixes the bindings generator so that undefined is allowed
1877         for optional parameters of an overload operation, when doing the
1878         overload resolution.
1879
1880         Tests:
1881         - fast/dom/HTMLSelectElement/add.html
1882         - fast/dom/HTMLSelectElement/options-collection-add.html
1883         - http/tests/websocket/tests/hybi/undefined-protocol.html
1884
1885         * bindings/scripts/CodeGeneratorJS.pm:
1886         (GenerateParametersCheckExpression):
1887         Allow undefined value for optional parameters when doing the overload
1888         resolution.
1889
1890         * bindings/scripts/test/JS/JSTestObj.cpp:
1891         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod):
1892         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter1):
1893         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter2):
1894         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter):
1895         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
1896         (WebCore::JSTestOverloadedConstructorsConstructor::constructJSTestOverloadedConstructors):
1897         * bindings/scripts/test/TestObj.idl:
1898         Add bindings tests coverage and rebaseline.
1899
1900 2015-07-03  Dan Bernstein  <mitz@apple.com>
1901
1902         Fixed the Mavericks build after r186236.
1903
1904         * loader/cache/CachedResource.h:
1905         (WebCore::CachedResource::url): Removed the export macro from this inline function.
1906
1907 2015-07-03  Dan Bernstein  <mitz@apple.com>
1908
1909         Tried to fix the iOS build.
1910
1911         * bridge/objc/objc_class.mm:
1912         (JSC::Bindings::ObjcClass::fieldNamed):
1913
1914 2015-07-03  Dan Bernstein  <mitz@apple.com>
1915
1916         Tried to fix the iOS build.
1917
1918         * editing/cocoa/HTMLConverter.mm:
1919
1920 2015-07-03  Dan Bernstein  <mitz@apple.com>
1921
1922         Tried to fix the iOS build.
1923
1924         * page/FrameView.cpp:
1925         (WebCore::FrameView::calculateExtendedBackgroundMode):
1926
1927 2015-07-03  Dan Bernstein  <mitz@apple.com>
1928
1929         [Xcode] Update some build settings as recommended by Xcode 7
1930         https://bugs.webkit.org/show_bug.cgi?id=146597
1931
1932         Reviewed by Sam Weinig.
1933
1934         * Configurations/Base.xcconfig: Enabled CLANG_WARN_UNREACHABLE_CODE,
1935         GCC_WARN_UNDECLARED_SELECTOR, and GCC_NO_COMMON_BLOCKS. Removed GCC_MODEL_TUNING.
1936
1937         * WebCore.xcodeproj/project.pbxproj: Updated LastUpgradeCheck. Disabled -Wunreachable-code
1938         for two bison-generated source files. Updated for rename of WebScriptObject.h.
1939
1940         * bindings/objc/WebScriptObject.mm:
1941         (-[WebUndefined dealloc]): Removed unreachable code and suppressed warning about not calling
1942         super.
1943         * bridge/objc/WebScriptObject.h: Renamed to WebScriptObjectProtocol.h to enabled inlcuding
1944         the other WebScriptObject.h.
1945         * bridge/objc/WebScriptObjectProtocol.h: Renamed from WebScriptObject.h.
1946
1947         * bridge/objc/objc_class.mm: Updated for rename and included WebScriptObject.h because we
1948         use selectors declared in that file.
1949
1950         * bridge/objc/objc_instance.mm: Ditto.
1951         (ObjCRuntimeMethod::create): Resolved ambiguity between JSC::JSValue and the Objective-C
1952         JSValue class.
1953         (ObjCRuntimeMethod::createStructure): Ditto.
1954         (ObjcInstance::invokeMethod): Ditto.
1955         (ObjcInstance::invokeObjcMethod): Ditto.
1956         (ObjcInstance::invokeDefaultMethod): Ditto.
1957         (ObjcInstance::setValueOfUndefinedField): Ditto.
1958         (ObjcInstance::getValueOfUndefinedField): Ditto.
1959         (ObjcInstance::defaultValue): Ditto.
1960         (ObjcInstance::stringValue): Ditto.
1961         (ObjcInstance::numberValue): Ditto.
1962         (ObjcInstance::booleanValue): Ditto.
1963         (ObjcInstance::valueOf): Ditto,
1964
1965         * bridge/objc/objc_runtime.h: Moved definition of isFallbackMethod() from here to the
1966         implementation.
1967         * bridge/objc/objc_runtime.mm: Updated for rename and included WebScriptObject.h because we
1968         use selectors declared in that file.
1969         (JSC::Bindings::ObjcMethod::isFallbackMethod): Moved definition from the header to here.
1970
1971         * bridge/objc/objc_utility.mm: Updated for rename.
1972
1973         * cssjit/SelectorCompiler.cpp:
1974         (WebCore::SelectorCompiler::addScrollbarPseudoClassType): Removed unreachable code.
1975
1976         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
1977         Added declarations to the WebCoreMovieObserver interface.
1978         (WebCore::MediaPlayerPrivateQTKit::disableUnsupportedTracks): Suppressed
1979         -Wundeclared-selector around invocation of a selector that is not declared anywhere.
1980
1981 2015-07-03  Kyounga Ra  <kyounga@alticast.com>
1982
1983         Memory leak for a protected Element having pending events in ImageLoader. 
1984         https://bugs.webkit.org/show_bug.cgi?id=146538
1985
1986         Reviewed by Brady Eidson.
1987
1988         If ImageLoader is destroyed before an active derefElementTimer is fired, protected element's refCount never be zero..
1989
1990         * loader/ImageLoader.cpp:
1991         (WebCore::ImageLoader::~ImageLoader):
1992         (WebCore::ImageLoader::updateFromElement):
1993         (WebCore::ImageLoader::updateRenderer):
1994         (WebCore::ImageLoader::updatedHasPendingEvent):
1995         (WebCore::ImageLoader::timerFired):
1996         * loader/ImageLoader.h:
1997
1998 2015-07-03  Daniel Bates  <dabates@apple.com>
1999
2000         REGRESSION (r178097): JavaScript TypeError after clicking on compose button in Yahoo Mail
2001         https://bugs.webkit.org/show_bug.cgi?id=146515
2002         <rdar://problem/21348421>
2003
2004         Reviewed by Chris Dumez.
2005
2006         Fixes an issue where extra arguments passed to a Web IDL overloaded function, whose implementation
2007         is generated by the bindings generator script, are not ignored as per the note in section "Interface object [[Call]] method"
2008         of the Web IDL spec, <http://www.w3.org/TR/2012/CR-WebIDL-20120419/> (19 April 2012).
2009
2010         Currently for an overloaded function the JavaScript bindings generator script emits code to
2011         throw a TypeError when it cannot find a candidate function that takes the same number of
2012         arguments as passed by a caller. Prior to the change made in bug #139179 (r178097), the
2013         bindings code for HTMLSelectElement.add() was written by hand and ignored extra arguments
2014         that were passed to it. Following this change, the bindings code for HTMLSelectElement.add()
2015         is generated by the bindings generator script. Therefore, we throw a TypeError when Yahoo Mail
2016         calls HTMLSelectElement.add() with extra arguments because the code emitted by the bindings
2017         generator script does not ignore them.
2018
2019         * bindings/scripts/CodeGeneratorJS.pm:
2020         (LengthOfLongestFunctionParameterList): Added. Computes the length of longest overload parameter list.
2021         (GenerateOverloadedFunction): Emit code that ignores more arguments than LengthOfLongestFunctionParameterList().
2022         (GenerateOverloadedConstructorDefinition): Ditto.
2023         * bindings/scripts/test/JS/JSTestObj.cpp:
2024         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod12): Added; expected result for an overloaded
2025         function that takes a variadic number of Blob elements.
2026         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod): Update expected result. The added
2027         if-conditional expression for the IDL declaration overloadedMethod(Blob... blobArgs) is empty
2028         because we do not support overloading of functions with variadic arguments.
2029         (WebCore::jsTestObjConstructorFunctionOverloadedMethod1):
2030         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
2031         (WebCore::JSTestOverloadedConstructorsConstructor::constructJSTestOverloadedConstructors5): Added; expected
2032         result for an overloaded constructors that takes a variadic number of long arguments.
2033         (WebCore::JSTestOverloadedConstructorsConstructor::constructJSTestOverloadedConstructors): Update expected
2034         result. The added if-conditional expression for the IDL declaration Constructor(long... longArgs) is empty
2035         because we do not support overloading of constructors with variadic arguments.
2036         * bindings/scripts/test/TestObj.idl: Added declaration overloadedMethod(Blob...). Also fixed
2037         typo in license block text.
2038         * bindings/scripts/test/TestOverloadedConstructors.idl: Added declaration Constructor(long... longArgs).
2039         Also fixed typo in license block text.
2040
2041 2015-07-03  Mario Sanchez Prada  <mario@endlessm.com>
2042
2043         Crash on xLarge memory allocation using bmalloc on 32bit systems
2044         https://bugs.webkit.org/show_bug.cgi?id=146440
2045
2046         Reviewed by Gustavo Noronha Silva.
2047
2048         Disable the gcc's -ftree-sra optimization (automatically enabled
2049         with -O1 and higher levels) for WebCore and 32bit Intel architectures,
2050         as that causes the crash in bmalloc when allocating large amounts of
2051         memory from the texture mapper's tiled backing store implementation.
2052
2053         * CMakeLists.txt: Pass -fno-free-sra to gcc on 32bit Intel architectures.
2054
2055 2015-07-03  Csaba Osztrogonác  <ossy@webkit.org>
2056
2057         Fix the !ENABLE(VIDEO) build after r186054
2058         https://bugs.webkit.org/show_bug.cgi?id=146592
2059
2060         Reviewed by Eric Carlson.
2061
2062         * platform/MemoryPressureHandler.cpp:
2063         (WebCore::MemoryPressureHandler::releaseCriticalMemory):
2064
2065 2015-07-03  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2066
2067         [Streams API] Remove ReadableStream and Reader cancel() custom binding
2068         https://bugs.webkit.org/show_bug.cgi?id=146458
2069
2070         Reviewed by Darin Adler.
2071
2072         Removed stream and reader cancel custom binding.
2073         Updated binding generator to correctly handle promise-based APIs with optional parameters.
2074
2075         No behavior changes.
2076
2077         * Modules/streams/ReadableStream.idl: Removed custom
2078         * Modules/streams/ReadableStreamReader.idl: Ditto.
2079         * bindings/js/JSReadableStreamCustom.cpp:
2080         (WebCore::JSReadableStream::cancel): Deleted.
2081         * bindings/js/JSReadableStreamReaderCustom.cpp:
2082         (WebCore::JSReadableStreamReader::cancel): Deleted.
2083         * bindings/scripts/CodeGeneratorJS.pm: Handling of promise parameter in case of optional arguments.
2084         (GenerateParametersCheck):
2085         (GenerateReturnParameters): Utility function to generate return parameters (exception and promise).
2086         * bindings/scripts/test/JS/JSTestObj.cpp:
2087         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithOptionalIntArgument):
2088         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithOptionalIntArgumentPromise):
2089         * bindings/scripts/test/TestObj.idl:
2090
2091
2092 2015-07-02  Doug Russell  <d_russell@apple.com>
2093
2094         AX: Selection change as a result of focusing an element should include that 
2095         information in the intent
2096         https://bugs.webkit.org/show_bug.cgi?id=146533
2097
2098         Reviewed by Chris Fleizach.
2099
2100         Added focusChange flag to AXTextStateChangeIntent.
2101         Added intent support to selection logic called by Element::updateFocusAppearance().
2102         Added NSAccessibilityTextSelectionChangedFocus to mac notifications.
2103
2104         Test: platform/mac/accessibility/selection-notification-focus-change.html
2105
2106         * accessibility/AXObjectCache.cpp:
2107         (WebCore::AXObjectCache::postTextStateChangeNotification):
2108         * accessibility/AXTextStateChangeIntent.h:
2109         * accessibility/AccessibilityRenderObject.cpp:
2110         (WebCore::setTextSelectionIntent):
2111         (WebCore::AccessibilityRenderObject::setFocused):
2112         * accessibility/mac/AXObjectCacheMac.mm:
2113         (WebCore::AXObjectCache::postTextStateChangePlatformNotification):
2114         * dom/Element.cpp:
2115         (WebCore::Element::updateFocusAppearance):
2116         * dom/Element.h:
2117         (WebCore::Element::defaultFocusTextStateChangeIntent):
2118         * editing/FrameSelection.cpp:
2119         (WebCore::FrameSelection::moveWithoutValidationTo):
2120         (WebCore::FrameSelection::setSelectionByMouseIfDifferent):
2121         (WebCore::FrameSelection::selectAll):
2122         * editing/FrameSelection.h:
2123         * html/HTMLInputElement.cpp:
2124         (WebCore::HTMLInputElement::updateFocusAppearance):
2125         * html/HTMLTextAreaElement.cpp:
2126         (WebCore::HTMLTextAreaElement::updateFocusAppearance):
2127         * html/HTMLTextFormControlElement.cpp:
2128         (WebCore::HTMLTextFormControlElement::select):
2129         (WebCore::HTMLTextFormControlElement::setSelectionRange):
2130         (WebCore::HTMLTextFormControlElement::restoreCachedSelection):
2131         * html/HTMLTextFormControlElement.h:
2132         * page/EventHandler.cpp:
2133         (WebCore::setInitialKeyboardSelection):
2134         * page/FocusController.cpp:
2135         (WebCore::FocusController::advanceFocusInDocumentOrder):
2136
2137 2015-07-02  Przemek Piorkowski  <piorkowskiprzemyslaw@gmail.com>
2138
2139         [EFL] test_ewk2_application_cache_manager has been failed since r185527
2140         https://bugs.webkit.org/show_bug.cgi?id=146016
2141
2142         Reviewed by Gyuyoung Kim.
2143
2144         In order to handle properly WebApplicationCacheManagerProxy implementation which use
2145         WebsiteDataRecord it is necessary to enable PUBLIC_SUFFIX_LIST for EFL. 
2146         Implementation of PUBLIC_SUFFIX_LIST already exists for soup so EFL can use it as well.
2147
2148         * PlatformEfl.cmake: PublicSuffixSoup.cpp added to source files.
2149
2150 2015-07-02  Commit Queue  <commit-queue@webkit.org>
2151
2152         Unreviewed, rolling out r186251.
2153         https://bugs.webkit.org/show_bug.cgi?id=146573
2154
2155         caused crashes in webaudio tests (Requested by cdumez on
2156         #webkit).
2157
2158         Reverted changeset:
2159
2160         "Ensure media playback is stopped during page close"
2161         https://bugs.webkit.org/show_bug.cgi?id=146554
2162         http://trac.webkit.org/changeset/186251
2163
2164 2015-07-02  Brent Fulgham  <bfulgham@apple.com>
2165
2166         Ensure media playback is stopped during page close
2167         https://bugs.webkit.org/show_bug.cgi?id=146554
2168         <rdar://problem/18033944>
2169
2170         Reviewed by Zalan Bujtas.
2171
2172         Add new method to Page class to stop all media playback. It just uses the process
2173         MediaSessionManager singleton to inform all hosted in a particular document to stop.
2174
2175         * Modules/webaudio/AudioContext.h:
2176         (WebCore::WebAudio::hostingDocument): Added.
2177         * html/HTMLMediaElement.h:
2178         (WebCore::HTMLMediaElement::hostingDocument): Added.
2179         * dom/Document.cpp:
2180         (WebCore::Document::commonTeardown): Call the new PlatformMediaSessionManager::stopAllMediaPlaybackForDocument
2181         method on document cleanup.
2182         * platform/audio/PlatformMediaSession.h:
2183         Made PlatformMediaSessionManager a friend so it can access the protected 'client' accessor.
2184         Updated PlatformMediaSessionClient to require clients to have a "hostingDocument" member.
2185         * platform/audio/PlatformMediaSessionManager.cpp:
2186         (WebCore::PlatformMediaSessionManager::stopAllMediaPlaybackForDocument): Added. Only pauses
2187         playback on elements that match the provided document.
2188         * platform/audio/PlatformMediaSessionManager.h:
2189
2190 2015-07-02  Dean Jackson  <dino@apple.com>
2191
2192         Tapping a video in Safari causes the video to flash gray for a quick moment
2193         https://bugs.webkit.org/show_bug.cgi?id=146570
2194         <rdar://problem/21325181>
2195
2196         Reviewed by Brent Fulgham.
2197
2198         On iOS, video elements should not show the tap highlight.
2199
2200         * css/html.css:
2201         (video):
2202
2203 2015-07-02  Dean Jackson  <dino@apple.com>
2204
2205         WebKit should use 80% white background for PiP indicator
2206         https://bugs.webkit.org/show_bug.cgi?id=146444
2207         <rdar://problem/21555726>
2208
2209         Reviewed by Brent Fulgham.
2210
2211         The designers wanted 80% white, not 80% black (r186104).
2212         I've also reverted the AirPlay background back to black.
2213
2214         * Modules/mediacontrols/mediaControlsiOS.css:
2215         (audio::-webkit-media-controls-wireless-playback-status):
2216         (audio::-webkit-media-controls-wireless-playback-status.small):
2217         (audio::-webkit-media-controls-wireless-playback-status.picture-in-picture):
2218
2219 2015-07-02  Eric Carlson  <eric.carlson@apple.com>
2220
2221         [Mac] Clear current AirPlay source before setting another
2222         https://bugs.webkit.org/show_bug.cgi?id=145959
2223
2224         Reviewed by Brent Fulgham.
2225
2226         * Modules/mediasession/WebMediaSessionManager.cpp:
2227         (WebCore::WebMediaSessionManager::clientStateDidChange): Don't make a client begin playing 
2228           to the target just because it has paused.
2229         (WebCore::WebMediaSessionManager::configurePlaybackTargetClients): Always select a client that
2230           requrested the picker, and never consider paused clients when choosing a client to begin
2231           playing to the targer. Call setShouldPlayToPlaybackTarget(true) after all of the other 
2232           clients have been told to stop playing to the target.
2233
2234 2015-07-02  Beth Dakin  <bdakin@apple.com>
2235
2236         Allow the UIDelegate to customize an image preview
2237         https://bugs.webkit.org/show_bug.cgi?id=146557
2238         -and corresponding-
2239         rdar://problem/21657424
2240
2241         Reviewed by Tim Horton.
2242
2243         Add WEBCORE_EXPORT to use this in WK2.
2244         * loader/cache/CachedResource.h:
2245         (WebCore::CachedResource::url):
2246
2247 2015-07-02  Brady Eidson  <beidson@apple.com>
2248
2249         Add preference to disable all http-equiv.
2250         <rdar://problem/9091261> and https://bugs.webkit.org/show_bug.cgi?id=146553
2251
2252         Reviewed by Sam Weinig.
2253
2254         No new tests (Covered by existing test)
2255
2256         * dom/Document.cpp:
2257         (WebCore::Document::processHttpEquiv):
2258         * page/Settings.in:
2259
2260 2015-07-02  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2261
2262         [Streams API] Remove ReadableStreamController.enqueue() custom binding
2263         https://bugs.webkit.org/show_bug.cgi?id=146455
2264
2265         Reviewed by Darin Adler.
2266
2267         Made enqueue not custom. Updated error to use Default=Undefined in IDL.
2268
2269         No change in behavior.
2270
2271         * Modules/streams/ReadableStreamController.h:
2272         (WebCore::ReadableStreamController::error): Removed unneeded variation of error.
2273         (WebCore::ReadableStreamController::enqueue): Calling ReadableJSStream enqueue method.
2274         * Modules/streams/ReadableStreamController.idl: Updated error with Default=Undefined and made enqueue not custom.
2275         * bindings/js/JSDOMBinding.cpp:
2276         (WebCore::createDOMException): Adding support for RangeError exceptions.
2277         * bindings/js/JSReadableStreamControllerCustom.cpp:
2278         (WebCore::constructJSReadableStreamController): Deleted.
2279         * bindings/js/ReadableJSStream.cpp:
2280         (WebCore::ReadableJSStream::error): Updated to pass error value as parameter.
2281         (WebCore::ReadableJSStream::enqueue): Added exception throwing through ExceptionCode.
2282         (WebCore::ReadableJSStream::retrieveChunkSize): Ditto.
2283         * bindings/js/ReadableJSStream.h:
2284         * dom/ExceptionCode.h: Adding RangeError.
2285
2286 2015-07-02  Brady Eidson  <beidson@apple.com>
2287
2288         [Content Extensions] Block synchronous XMLHTTPRequest.
2289         <rdar://problem/21573006> and https://bugs.webkit.org/show_bug.cgi?id=146271
2290
2291         Reviewed by Alex Christensen.
2292
2293         Test: http/tests/contentextensions/sync-xhr-blocked.html
2294
2295         * loader/FrameLoader.cpp:
2296         (WebCore::FrameLoader::loadResourceSynchronously): If content blocked, set up an error, clear
2297           the response, and clear the response data.
2298
2299 2015-07-01  Joseph Pecoraro  <pecoraro@apple.com>
2300
2301         Web Inspector: Aggregate profile call information on the backend to drastically reduce profile sizes
2302         https://bugs.webkit.org/show_bug.cgi?id=146536
2303
2304         Reviewed by Timothy Hatcher.
2305
2306         * inspector/TimelineRecordFactory.cpp:
2307         (WebCore::buildAggregateCallInfoInspectorObject):
2308         (WebCore::buildInspectorObject):
2309         Replace the array of Call objects with a single aggregated call info object.
2310
2311 2015-07-01  Brent Fulgham  <bfulgham@apple.com>
2312
2313         [Win] REGRESSION (r185124) CACFLayer handling broken
2314         https://bugs.webkit.org/show_bug.cgi?id=146530
2315         <rdar://problem/21642241>
2316
2317         Reviewed by Tim Horton.
2318
2319         At some point in the past, the set of LayerChange flags
2320         overflowed the default MSVC enum type of 'int'. This caused
2321         Windows rendering code to not receive various update notifications.
2322
2323         Zalan's change moved the DebugIndicatorsChanged flag into that
2324         overflow set, which made it obvious that something was wrong.
2325
2326         The fix is to tell the compiler to use a compatible base type
2327         for the enum.
2328
2329         * platform/graphics/ca/GraphicsLayerCA.h: Prevent overflow.
2330
2331 2015-07-01  Alex Christensen  <achristensen@webkit.org>
2332
2333         Reduce resolution of performance.now.
2334         https://bugs.webkit.org/show_bug.cgi?id=146531
2335         rdar://problem/20116796
2336
2337         Reviewed by Simon Fraser.
2338
2339         Test: http/tests/misc/webtiming-resolution.html
2340
2341         * page/Performance.cpp:
2342         (WebCore::Performance::now):
2343         Floor the time returned by performance.now to the nearest 5 microseconds.
2344
2345 2015-07-01  Eric Carlson  <eric.carlson@apple.com>
2346
2347         [iOS] Build fix
2348
2349         Reviewed by Brent Fulgham.
2350
2351         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
2352         (-[WebAVVideoLayer enterPIPModeRedirectingVideoToLayer:]): Renamed from enterOptimizedFullScreenModeRedirectingVideoToLayer.
2353         (-[WebAVVideoLayer leavePIPMode]): Renamed from leaveOptimizedFullScreenMode.
2354         (-[WebAVVideoLayer enterOptimizedFullScreenModeRedirectingVideoToLayer:]): Deleted.
2355         (-[WebAVVideoLayer leaveOptimizedFullScreenMode]): Deleted.
2356
2357 2015-07-01  Myles C. Maxfield  <mmaxfield@apple.com>
2358
2359         [iOS] Support bold and thin italicized system fonts
2360         https://bugs.webkit.org/show_bug.cgi?id=146463
2361         <rdar://problem/20948885>
2362
2363         Reviewed by Darin Adler.
2364
2365         Add the italicized attribute to font descriptors.
2366
2367         Test: fast/text/weighted-italicized-system-font.html
2368
2369         * platform/graphics/ios/FontCacheIOS.mm:
2370         (WebCore::createCTFontWithFamilyNameAndWeight):
2371         * platform/graphics/mac/FontCacheMac.mm:
2372         (WebCore::fontWithFamilySpecialCase):
2373         (WebCore::fontWithFamily):
2374         * platform/spi/cocoa/CoreTextSPI.h:
2375
2376 2015-07-01  Alex Christensen  <achristensen@webkit.org>
2377
2378         Fix ANGLE Windows build after r186169.
2379         https://bugs.webkit.org/show_bug.cgi?id=146532
2380
2381         Reviewed by Brent Fulgham.
2382
2383         * WebCore.vcxproj/WebCore.vcxproj:
2384         * WebCore.vcxproj/WebCore.vcxproj.filters:
2385         Don't compile OpenGLShims.cpp or Extensions3DOpenGL.cpp on Windows 
2386         because Windows uses OpenGLES through ANGLE, not OpenGL.
2387         * platform/graphics/ANGLEWebKitBridge.h:
2388         Use OpenGLESShims.h on Windows instead of OpenGLShims.h.
2389         * platform/graphics/OpenGLESShims.h:
2390         Added needed definitions from OpenGL to compile successfully.
2391         * platform/graphics/win/GL/glext.h: Removed.
2392
2393 2015-07-01  Dean Jackson  <dino@apple.com>
2394
2395         Disable the experimental WebGL2 implementation
2396         https://bugs.webkit.org/show_bug.cgi?id=146526
2397         <rdar://problem/21641235>
2398
2399         Reviewed by Myles Maxfield.
2400
2401         Add (and disable) an ENABLE_WEBGL2 flag. Also protect
2402         anything that is specific to WebGL2.
2403
2404         Covered by running the WebGL 1.0.2 conformance suite
2405         and our LayoutTests.
2406
2407         * Configurations/FeatureDefines.xcconfig:
2408         * bindings/js/JSCanvasRenderingContextCustom.cpp:
2409         (WebCore::toJS):
2410         * bindings/js/JSWebGL2RenderingContextCustom.cpp:
2411         * bindings/js/JSWebGLRenderingContextBaseCustom.cpp:
2412         (WebCore::toJS):
2413         * html/HTMLCanvasElement.cpp:
2414         (WebCore::HTMLCanvasElement::is3dType):
2415         * html/canvas/WebGL2RenderingContext.cpp:
2416         * html/canvas/WebGL2RenderingContext.h:
2417         * html/canvas/WebGL2RenderingContext.idl:
2418         * html/canvas/WebGLFramebuffer.cpp:
2419         (WebCore::WebGLFramebuffer::drawBuffersIfNecessary):
2420         * html/canvas/WebGLGetInfo.cpp:
2421         * html/canvas/WebGLGetInfo.h:
2422         * html/canvas/WebGLRenderingContextBase.cpp:
2423         (WebCore::WebGLRenderingContextBase::create):
2424         * html/canvas/WebGLVertexArrayObject.cpp:
2425         * html/canvas/WebGLVertexArrayObject.h:
2426         * html/canvas/WebGLVertexArrayObject.idl:
2427
2428 2015-07-01  Chris Dumez  <cdumez@apple.com>
2429
2430         Regression(183998): Disqus comments take a very long time to load
2431         https://bugs.webkit.org/show_bug.cgi?id=146522
2432         <rdar://problem/21590601>
2433
2434         Reviewed by Simon Fraser.
2435
2436         Stop throttling requestAnimationFrame() in iframes that are not visible
2437         due to them being zero-sized or display:none. Those are usually utility
2438         iframes and throttling them is risky.
2439
2440         Se still throttle requestAnimationFrame() in iframes that would be
2441         visible in theory but are currently not noticeable because they are
2442         outside the viewport.
2443
2444         Test:
2445         - fast/animation/request-animation-frame-throttle-subframe.html
2446         - fast/animation/request-animation-frame-throttle-subframe-display-none.html
2447         - fast/animation/request-animation-frame-throttle-subframe-zero-size.html
2448
2449         * page/FrameView.cpp:
2450         (WebCore::FrameView::updateScriptedAnimationsAndTimersThrottlingState):
2451
2452 2015-06-30  Ryosuke Niwa  <rniwa@webkit.org>
2453
2454         REGRESSION (r179168): Characters overlap after resizing the font on the copy-pasted Japanese text
2455         https://bugs.webkit.org/show_bug.cgi?id=146492
2456
2457         Reviewed by Darin Adler.
2458
2459         The bug was caused by WebKit serializing the used line-height size (e.g. 18px) in the copied content
2460         instead of string "normal" and removeStyleFromRulesAndContext failing to strip it down when text with
2461         a font that influences the line height got pasted. This is because the used value of line-height
2462         property of the context and the pasted content doesn't match when the context doesn't use the same font.
2463
2464         Fixed the bug by not considering line-height as a list of editing properties we try to preserve. This is
2465         fine because we don't provide editing operations to directly manipulate line-height.
2466
2467         Test: editing/pasteboard/cjk-line-height.html
2468
2469         * editing/EditingStyle.cpp:
2470         (WebCore::editingProperties): Removed CSSPropertyLineHeight.
2471
2472 2015-06-30  Brent Fulgham  <bfulgham@apple.com>
2473
2474         REGRESSION (r184296): View keeps scrolling upward
2475         https://bugs.webkit.org/show_bug.cgi?id=146497
2476         <rdar://problem/21524942>
2477
2478         Reviewed by Darin Adler.
2479
2480         Avoid improperly triggering the ScrollController wheel event handling
2481         logic when the wheel event deltaX/deltaY are zero. On certain sites,
2482         this caused a programmatic JavaScript scroll to be triggered unexpectedly,
2483         scrolling the page back to some initial state.
2484
2485         This bug was introduced while trying to make sure scrollbars were notified
2486         when the wheel event had come to an end. Revise that change so that we still
2487         follow the right code path for non-stretchable regions. However, make sure
2488         that for zero-delta wheel events we make sure to properly handle the wheel
2489         event phase. 
2490
2491         * platform/mac/ScrollAnimatorMac.h:
2492         * platform/mac/ScrollAnimatorMac.mm:
2493         (WebCore::ScrollAnimatorMac::shouldForwardWheelEventsToParent): New helper function
2494         to reduce the complexity of the logic in handleWheelEvent.
2495         (WebCore::ScrollAnimatorMac::handleWheelEvent): When wheel events should be forwarded
2496         to the parent scroll view, if the event was handled or has no change in position
2497         trigger the 'handleWheelEventPhase' logic so that scrollbars are hidden, etc.
2498
2499 2015-06-30  Dean Jackson  <dino@apple.com>
2500
2501         Hide the inline controls when going into PiP
2502         https://bugs.webkit.org/show_bug.cgi?id=146487
2503         <rdar://problem/19881159>
2504
2505         Reviewed by Eric Carlson.
2506
2507         When the presentation mode is PiP, toggle a class
2508         on the container element so that we can completely
2509         hide the control toolbar. The placard should still
2510         remain visible.
2511
2512         * Modules/mediacontrols/mediaControlsiOS.css:
2513         (video::-webkit-media-controls-panel-container.picture-in-picture): Add
2514         a rule that hides the toolbar when PiP is active.
2515         * Modules/mediacontrols/mediaControlsiOS.js:
2516         (ControllerIOS.prototype.showControls):
2517         (ControllerIOS.prototype.handlePresentationModeChange): Toggle a
2518         class. Also fix a bug I noticed where exiting from PiP was
2519         not auto-hiding the controls until the user tapped.
2520
2521 2015-07-01  Matthew Daiter  <mdaiter@apple.com>
2522
2523         Enable MEDIA_STREAM flag
2524         https://bugs.webkit.org/show_bug.cgi?id=145947
2525         <rdar://problem/21365829>
2526
2527         Reviewed by Eric Carlson.
2528
2529         * Configurations/FeatureDefines.xcconfig: Added MEDIA_STREAM flag
2530         * Modules/mediastream/MediaStreamTrack.h:
2531         * WebCore.xcodeproj/project.pbxproj: Changed project headers to
2532         private headers
2533         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
2534         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
2535         * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
2536         * platform/mediastream/RealtimeMediaSource.h:
2537         * platform/mediastream/mac/AVAudioCaptureSource.mm:
2538         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
2539         (WebCore::refreshCaptureDeviceList): Deleted.
2540         * platform/mediastream/mac/AVMediaCaptureSource.mm:
2541         (WebCore::AVMediaCaptureSource::startProducingData):
2542         (WebCore::AVMediaCaptureSource::stopProducingData):
2543
2544 2015-07-01  Brent Fulgham  <bfulgham@apple.com>
2545
2546         REGRESSION (r185016): Intermittent crash in WebCore::TextTrackList::remove
2547         https://bugs.webkit.org/show_bug.cgi?id=146493
2548         <rdar://problem/21511122>
2549
2550         Reviewed by Eric Carlson.
2551
2552         The m_textTracks member is frequently null checked during other operations, but
2553         was not checked during track removal. This needs to be corrected.
2554
2555         * html/HTMLMediaElement.cpp:
2556         (WebCore::HTMLMediaElement::removeTextTrack): Check that m_textTracks is
2557         not null before using it during track removal.
2558
2559 2015-07-01  Antti Koivisto  <antti@apple.com>
2560
2561         PNG mask images are loaded with Accept:image/svg+xml
2562         https://bugs.webkit.org/show_bug.cgi?id=146509
2563         rdar://problem/21584740
2564
2565         Reviewed by Simon Fraser.
2566
2567         For some strange reason MaskImageOperation code loads all mask images, including non-SVG ones
2568         using CachedSVGDocument. Resulting bad accept header may cause server to reject the request.
2569
2570         This is far from ideal but as a quick fix we can override the accept header for mask images to
2571         allow any image type.
2572
2573         Test: http/tests/misc/mask-image-accept.html
2574
2575         * loader/cache/CachedResourceLoader.cpp:
2576         (WebCore::CachedResourceLoader::requestResource):
2577         * loader/cache/CachedResourceRequest.h:
2578         (WebCore::CachedResourceRequest::acceptOverride):
2579         (WebCore::CachedResourceRequest::setAcceptOverride):
2580         * loader/cache/CachedSVGDocumentReference.cpp:
2581         (WebCore::CachedSVGDocumentReference::load):
2582         * loader/cache/CachedSVGDocumentReference.h:
2583         (WebCore::CachedSVGDocumentReference::loadRequested):
2584         (WebCore::CachedSVGDocumentReference::setAcceptsAnyImageType):
2585         (WebCore::CachedSVGDocumentReference::document):
2586         * platform/graphics/MaskImageOperation.cpp:
2587         (WebCore::MaskImageOperation::ensureCachedSVGDocumentReference):
2588
2589 2015-07-01  Jer Noble  <jer.noble@apple.com>
2590
2591         [MSE] Failures on W3C media-source tests regarding MIME types
2592         https://bugs.webkit.org/show_bug.cgi?id=146499
2593
2594         Reviewed by Eric Carlson.
2595
2596         Tests: http/tests/media/media-source/SourceBuffer-abort-readyState.html
2597                http/tests/media/media-source/SourceBuffer-abort-removed.html
2598                http/tests/media/media-source/SourceBuffer-abort-updating.html
2599                http/tests/media/media-source/SourceBuffer-abort.html
2600
2601         Multiple failures in the W3C media-source test suite due to two failures in isTypeSupported MIME type handling:
2602         - MIME types without codec strings were being rejected.
2603         - MIME types with codec strings which are rejected by the system are being reported as supported.
2604
2605         For the first, stop rejecting MIME types with non-existent codec strings. For MIME types which do have non-empty
2606         codec strings, treat a "Maybe" response as unsupported.
2607
2608         * Modules/mediasource/MediaSource.cpp:
2609         (WebCore::MediaSource::isTypeSupported):
2610
2611 2015-06-30  Alex Christensen  <achristensen@webkit.org>
2612
2613         Update ANGLE to b11e2483742db884bd0af41f78f528240577356b.
2614         https://bugs.webkit.org/show_bug.cgi?id=145010
2615
2616         Reviewed by Dean Jackson.
2617
2618         * CMakeLists.txt:
2619         * platform/graphics/ANGLEWebKitBridge.cpp:
2620         (WebCore::appendSymbol):
2621         (WebCore::getStructInfo):
2622         (WebCore::getSymbolInfo):
2623         (WebCore::ANGLEWebKitBridge::cleanupCompilers):
2624         (WebCore::ANGLEWebKitBridge::compileShaderSource):
2625         (WebCore::getValidationResultValue): Deleted.
2626         * platform/graphics/ANGLEWebKitBridge.h:
2627         (WebCore::ANGLEShaderSymbol::isSampler):
2628         * platform/graphics/GraphicsContext3D.h:
2629         (WebCore::GraphicsContext3D::SymbolInfo::SymbolInfo):
2630         * platform/graphics/mac/GraphicsContext3DMac.mm:
2631         * platform/graphics/opengl/Extensions3DOpenGL.cpp:
2632         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
2633         (WebCore::GraphicsContext3D::checkVaryingsPacking):
2634         (WebCore::GraphicsContext3D::precisionsMatch):
2635         Update WebCore to reflect changes in ANGLE.
2636
2637 2015-06-30  Zalan Bujtas  <zalan@apple.com>
2638
2639         Frame flattening: Hit-testing an iframe could end up destroying the associated inline tree context.
2640         https://bugs.webkit.org/show_bug.cgi?id=146447
2641         rdar://problem/20613501
2642
2643         Reviewed by Simon Fraser.
2644
2645         This patch ensures that the render tree associated with the document on which
2646         the hit-test is initiated does not get laid out, unless it was directly mutated prior to the hittest.
2647
2648         Hit-test requirements:
2649         1. A clean the render tree before hit-testing gets propagated to the renderers.
2650         Document::updateLayout() ensures it by calling both updateStyleIfNeeded() and layout() not only on the current tree, but also
2651         on the ancestors if needed.
2652
2653         2. No render tree mutation while hit-testing the renderers.
2654
2655         When an iframe is being hit-tested, this hit-test could bubble down to the child frame's render view.
2656         In order to ensure #1, we call Document::updateLayout() on the current (subframe) document.
2657         If updateStyleIfNeeded() mutates the render tree, we mark it dirty for layout(). However frame flattening also
2658         marks the parent renderer (RenderIFrame) dirty.
2659         While calling layout() to clean the current render tree, we end up laying out the parent tree too.
2660         Laying out the parent tree could end up destroying the inline tree context from where the
2661         hittest just bubbled down. (InlineFlowBox -> RenderWidget -> RenderView).
2662
2663         This patch protects the render tree from such unintentional inline tree mutation during hittesting.
2664         After the initial layout we set a layout disallow flag on the frame view to defer subsequent layouts.
2665         This patch only changes behavior when frame flattening is enabled, but in future we may always want to enable this.
2666
2667         Test: fast/frames/flattening/hittest-iframe-while-style-changes-crash.html
2668
2669         * page/FrameView.cpp:
2670         (WebCore::FrameView::layout):
2671         (WebCore::FrameView::startLayoutAtMainFrameViewIfNeeded): Deleted. -> Assertion in no longer valid.
2672         * page/FrameView.h:
2673         * rendering/RenderView.cpp:
2674         (WebCore::FrameFlatteningLayoutDisallower::FrameFlatteningLayoutDisallower):
2675         (WebCore::FrameFlatteningLayoutDisallower::~FrameFlatteningLayoutDisallower):
2676         (WebCore::RenderView::hitTest): Protect the render tree from subsequent layouts.
2677
2678 2015-06-30  Andy VanWagoner  <thetalecrafter@gmail.com>
2679
2680         Implement ECMAScript Internationalization API
2681         https://bugs.webkit.org/show_bug.cgi?id=90906
2682
2683         Reviewed by Benjamin Poulain.
2684
2685         Test: js/intl.html
2686
2687         * Configurations/FeatureDefines.xcconfig: add ENABLE_INTL flag
2688
2689 2015-06-30  Wenson Hsieh  <whsieh@berkeley.edu>
2690
2691         scroll-snap-points do not work very well with mechanical scroll wheel events
2692         https://bugs.webkit.org/show_bug.cgi?id=142501
2693         <rdar://problem/20093511>
2694
2695         Reviewed by Brent Fulgham.
2696
2697         Stateless scroll events generated by scrolling with a mechanical mouse wheel now trigger scroll
2698         snapping after a fixed delay.
2699
2700         Test: platform/mac-wk2/tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-overflow-stateless.html
2701
2702         * platform/cocoa/ScrollController.h: Added member to track stateless scrolling.
2703         * platform/cocoa/ScrollController.mm: Added constant for delay for stateless scroll snapping.
2704         (WebCore::ScrollController::processWheelEventForScrollSnapOnAxis): Triggers timer upon stateless scroll events.
2705         (WebCore::ScrollController::horizontalScrollSnapTimerFired): Timer now handles stateless scrolling updates.
2706         (WebCore::ScrollController::verticalScrollSnapTimerFired): See above.
2707         (WebCore::ScrollController::beginScrollSnapAnimation): Handles stateless scroll snapping.
2708
2709 2015-06-30  Simon Fraser  <simon.fraser@apple.com>
2710
2711         Try to fix Gtk and EFL builds.
2712
2713         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
2714         (WebCore::GraphicsLayerTextureMapper::flushCompositingStateForThisLayerOnly):
2715         (WebCore::GraphicsLayerTextureMapper::flushCompositingState):
2716         * platform/graphics/texmap/GraphicsLayerTextureMapper.h:
2717         * platform/graphics/texmap/coordinated/CompositingCoordinator.cpp:
2718         (WebCore::CompositingCoordinator::flushPendingLayerChanges):
2719         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
2720         (WebCore::CoordinatedGraphicsLayer::flushCompositingState):
2721         (WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):
2722         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
2723
2724 2015-06-30  Simon Fraser  <simon.fraser@apple.com>
2725
2726         [iOS] Missing tiles inside position:fixed on scrolling
2727         https://bugs.webkit.org/show_bug.cgi?id=146485
2728         rdar://problem/21226861
2729
2730         Reviewed by Tim Horton.
2731
2732         Layer flushing adjusts the coverage rect for tiled layers, but does so at times
2733         when position:fixed layers are moved around by the scrolling tree. The computed
2734         coverage rect then doesn't reflect the layer's on-screen position, causing missing
2735         tiles.
2736
2737         Fix by pushing the notion of being in a "stable state" onto FrameView, and passing
2738         that state into the layer flush. When not in a stable state, flushing doesn't change
2739         the visible and coverage rects for layers that are viewport-constrained.
2740
2741         * page/FrameView.cpp:
2742         (WebCore::FrameView::reset):
2743         * page/FrameView.h: Remove some velocity-related data members that were unused.
2744         * platform/graphics/GraphicsLayer.h:
2745         (WebCore::GraphicsLayer::flushCompositingState):
2746         (WebCore::GraphicsLayer::flushCompositingStateForThisLayerOnly):
2747         * platform/graphics/ca/GraphicsLayerCA.cpp:
2748         (WebCore::GraphicsLayerCA::flushCompositingState):
2749         (WebCore::GraphicsLayerCA::flushCompositingStateForThisLayerOnly):
2750         (WebCore::GraphicsLayerCA::setVisibleAndCoverageRects): If this is a viewport-constrained
2751         layer, and the viewport is not stable, don't touch the rects.
2752         (WebCore::GraphicsLayerCA::recursiveCommitChanges):
2753         * platform/graphics/ca/GraphicsLayerCA.h:
2754         (WebCore::GraphicsLayerCA::CommitState::CommitState):
2755         * rendering/RenderLayerCompositor.cpp:
2756         (WebCore::RenderLayerCompositor::flushPendingLayerChanges):
2757
2758 2015-06-30  Simon Fraser  <simon.fraser@apple.com>
2759
2760         Rename GraphicsLayer's allowsBackingStoreDetachment to isViewportConstrained
2761         https://bugs.webkit.org/show_bug.cgi?id=146483
2762
2763         Reviewed by Tim Horton.
2764
2765         What GraphicsLayer really needs to know is whether some other thread/process
2766         is moving its platform layers around behind its back, and this is is better
2767         expressed as "isViewportConstrained" rather than "allowsBackingStoreDetachment".
2768         
2769         The sense of the flag is flipped, and boolean logic adjusted accordingly.
2770
2771         * platform/graphics/GraphicsLayer.h:
2772         (WebCore::GraphicsLayer::setIsViewportConstrained):
2773         (WebCore::GraphicsLayer::isViewportConstrained):
2774         (WebCore::GraphicsLayer::setAllowsBackingStoreDetachment): Deleted.
2775         (WebCore::GraphicsLayer::allowsBackingStoreDetachment): Deleted.
2776         * platform/graphics/ca/GraphicsLayerCA.cpp:
2777         (WebCore::GraphicsLayerCA::GraphicsLayerCA):
2778         (WebCore::GraphicsLayerCA::setVisibleAndCoverageRects):
2779         (WebCore::GraphicsLayerCA::recursiveCommitChanges):
2780         * platform/graphics/ca/GraphicsLayerCA.h:
2781         * rendering/RenderLayerBacking.cpp:
2782         (WebCore::RenderLayerBacking::setIsScrollCoordinatedWithViewportConstrainedRole):
2783
2784 2015-06-30  Dean Jackson  <dino@apple.com>
2785
2786         CABackdropFilter should set windowServerAware to false
2787         https://bugs.webkit.org/show_bug.cgi?id=146469
2788         <rdar://problem/21618614>
2789
2790         Reviewed by Simon Fraser.
2791
2792         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
2793         (PlatformCALayerCocoa::PlatformCALayerCocoa): Set windowServerAware
2794         to false on Mac (it's not available on iOS).
2795
2796 2015-06-30  Chris Dumez  <cdumez@apple.com>
2797
2798         Rolling out r175171
2799         https://bugs.webkit.org/show_bug.cgi?id=146470
2800         <rdar://problem/21349934>
2801
2802         Unreviewed, rolling out <http://trac.webkit.org/changeset/175171>. It
2803         wasn't a huge win and Brady says it caused crash at
2804         <rdar://problem/21349934>.
2805
2806         * platform/network/cf/ResourceRequest.h:
2807         * platform/network/cocoa/ResourceRequestCocoa.mm:
2808         (WebCore::ResourceRequest::doUpdatePlatformRequest):
2809         (WebCore::ResourceRequest::doUpdatePlatformHTTPBody):
2810
2811 2015-06-30  Matt Baker  <mattbaker@apple.com>
2812
2813         Web Inspector: Reduce rendering frames "Other" time by instrumenting compositing
2814         https://bugs.webkit.org/show_bug.cgi?id=146168
2815
2816         Reviewed by Brian Burg.
2817
2818         Added Inspector instrumentation for measuring CoreAnimation compositing time. We mark the start of a composite
2819         event when the LayerFlushScheduler triggers a scheduled layer flush. InspectorController now exports a function
2820         for marking the end of the composite event, which should be called during the CA transaction post-commit phase
2821         (based on platform support). Lacking platform support, the event is considered complete after CoreAnimation
2822         runloop observers have run.
2823
2824         * inspector/InspectorController.cpp:
2825         (WebCore::InspectorController::didComposite):
2826         * inspector/InspectorController.h:
2827         New export for instrumentation in WebKit2.
2828
2829         * inspector/InspectorInstrumentation.cpp:
2830         (WebCore::InspectorInstrumentation::willCompositeImpl):
2831         (WebCore::InspectorInstrumentation::didCompositeImpl):
2832         * inspector/InspectorInstrumentation.h:
2833         (WebCore::InspectorInstrumentation::willComposite):
2834         (WebCore::InspectorInstrumentation::didComposite):
2835         Plumbing for new instrumentation.
2836
2837         * inspector/InspectorTimelineAgent.cpp:
2838         (WebCore::InspectorTimelineAgent::internalStart):
2839         (WebCore::InspectorTimelineAgent::internalStop):
2840         (WebCore::InspectorTimelineAgent::willComposite):
2841         (WebCore::InspectorTimelineAgent::didComposite):
2842         (WebCore::toProtocol):
2843         * inspector/InspectorTimelineAgent.h:
2844         New Composite event type and instrumentation.
2845
2846         * page/FrameView.cpp:
2847         (WebCore::FrameView::flushCompositingStateIncludingSubframes):
2848         Hook for start of compositing.
2849
2850         * platform/spi/cocoa/QuartzCoreSPI.h:
2851         New header include and interface declaration.
2852
2853 2015-06-30  Beth Dakin  <bdakin@apple.com>
2854
2855         The bounds on InteractionInformationAtPosition should be more precise
2856         https://bugs.webkit.org/show_bug.cgi?id=146468
2857         -and corresponding-
2858         rdar://problem/20739834
2859
2860         Reviewed by Enrica Casucci and Simon Fraser.
2861
2862         Export absoluteContentQuad().
2863         * rendering/RenderBox.h:
2864
2865 2015-06-30  Zalan Bujtas  <zalan@apple.com>
2866
2867         Addressing post-review comments in r185756.
2868
2869         * html/RubyTextElement.cpp:
2870         (WebCore::RubyTextElement::createElementRenderer):
2871
2872 2015-06-30  Zalan Bujtas  <zalan@apple.com>
2873
2874         Addressing post-review comments in r185916
2875
2876         * platform/LayoutUnit.h:
2877         (WebCore::roundToDevicePixel):
2878
2879 2015-06-30  Matt Rajca  <mrajca@apple.com>
2880
2881         MediaSession: Use setSessionInternal to set the default media session in HTMLMediaElement's constructor
2882         https://bugs.webkit.org/show_bug.cgi?id=146465
2883
2884         Reviewed by Eric Carlson.
2885
2886         * html/HTMLMediaElement.cpp:
2887         (WebCore::HTMLMediaElement::HTMLMediaElement):
2888
2889 2015-06-30  Matt Rajca  <mrajca@apple.com>
2890
2891         Media Session: implement algorithm for updating a media element's session (6.1)
2892         https://bugs.webkit.org/show_bug.cgi?id=146460
2893
2894         Reviewed by Darin Adler.
2895
2896         In addition to storing a pointer to the new media session, we now:
2897
2898         - pause the media element if it is 'active' in the current media session
2899         - remove the media element from the current media session
2900         - release the current media session if there are no more active media elements
2901         - set the default media session if the new media session is null
2902         - update the 'kind' attribute to match the kind of the new media session
2903
2904         * Modules/mediasession/MediaSession.cpp:
2905         (WebCore::MediaSession::isMediaElementActive):
2906         (WebCore::MediaSession::hasActiveMediaElements):
2907         * Modules/mediasession/MediaSession.h:
2908         * html/HTMLMediaElement.cpp:
2909         (WebCore::HTMLMediaElement::setSession):
2910         (WebCore::HTMLMediaElement::setSessionInternal):
2911         * html/HTMLMediaElement.h:
2912
2913 2015-06-29  Anders Carlsson  <andersca@apple.com>
2914
2915         Get rid of unused WKSI functions
2916         https://bugs.webkit.org/show_bug.cgi?id=146443
2917
2918         Reviewed by Tim Horton.
2919
2920         * platform/graphics/cg/PathCG.cpp:
2921         (WebCore::Path::platformAddPathForRoundedRect):
2922         Just call CGPathAddRoundedRect directly.
2923
2924         * platform/ios/WebCoreSystemInterfaceIOS.mm:
2925         * platform/mac/WebCoreSystemInterface.h:
2926         * platform/mac/WebCoreSystemInterface.mm:
2927
2928 2015-06-30  Youenn Fablet  <youenn.fablet@crf.canon.fr> and Xabier Rodriguez Calvar  <calvaris@igalia.com>
2929
2930         [Streams API] Finish pulling must always be done asynchronously as it is the expected promise behavior (according to the spec)
2931         https://bugs.webkit.org/show_bug.cgi?id=146408
2932
2933         Reviewed by Darin Adler.
2934
2935         Current tests cover the case already.
2936
2937         * Modules/streams/ReadableStream.cpp:
2938         (WebCore::ReadableStream::pull): Call finishPull() in a postTask to delay it and simulate the promise
2939         resolution.
2940
2941 2015-06-30  Youenn Fablet  <youenn.fablet@crf.canon.fr> and Xabier Rodriguez Calvar  <calvaris@igalia.com>
2942
2943         [Streams API] Synced bad strategy test with reference implementation
2944         https://bugs.webkit.org/show_bug.cgi?id=146411
2945
2946         Reviewed by Darin Adler.
2947
2948         Current tests cover the case.
2949
2950         * bindings/js/ReadableJSStream.cpp:
2951         (WebCore::ReadableJSStream::retrieveChunkSize): Check for negative size then running the JavaScript function.
2952
2953 2015-06-30  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2954
2955         [Streams API] Remove ReadableStream.getReader() custom binding
2956         https://bugs.webkit.org/show_bug.cgi?id=146404
2957
2958         Reviewed by Darin Adler.
2959
2960         Covered by existing tests.
2961
2962         * Modules/streams/ReadableStream.cpp:
2963         (WebCore::ReadableStream::getReader): Updated to take an exception.
2964         * Modules/streams/ReadableStream.h:
2965         * Modules/streams/ReadableStream.idl: Updated to remove custom binding.
2966         * bindings/js/JSReadableStreamCustom.cpp:
2967         (WebCore::JSReadableStream::getReader): Deleted.
2968         * bindings/js/JSReadableStreamReaderCustom.cpp:
2969         (WebCore::constructJSReadableStreamReader): Updated to pass an exception to getReader.
2970
2971 2015-06-29  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2972
2973         [Streams API] ReadableStreamReader.closed should use DOMPromise
2974         https://bugs.webkit.org/show_bug.cgi?id=146406
2975
2976         Reviewed by Darin Adler.
2977
2978         Added storage of ClosedPromise as Optional of ReadableStream.
2979         Updated code accordingly.
2980
2981         Covered by existing tests.
2982
2983         * Modules/streams/ReadableStream.cpp:
2984         (WebCore::ReadableStream::clearCallbacks):
2985         (WebCore::ReadableStream::releaseReader):
2986         (WebCore::ReadableStream::changeStateToErrored):
2987         (WebCore::ReadableStream::closed):
2988         * Modules/streams/ReadableStream.h:
2989         * Modules/streams/ReadableStreamReader.cpp:
2990         (WebCore::ReadableStreamReader::closed):
2991         * Modules/streams/ReadableStreamReader.h:
2992         * bindings/js/JSReadableStreamReaderCustom.cpp:
2993         (WebCore::JSReadableStreamReader::closed):
2994
2995 2015-06-29  Simon Fraser  <simon.fraser@apple.com>
2996
2997         [iOS WK2] WKWebViews in Facebook app start off black
2998         https://bugs.webkit.org/show_bug.cgi?id=146445
2999         rdar://problem/21600433
3000
3001         Reviewed by Tim Horton.
3002
3003         If -isOpaque is toggled on a WKWebView, we failed to make the page tiles non-opaque
3004         for a while. After r183775, RenderLayerCompositor::rootBackgroundTransparencyChanged() was called,
3005         but only considered the computed document background color, and not the view transparency.
3006         
3007         Fix by having rootBackgroundTransparencyChanged() simply use viewHasTransparentBackground(),
3008         which checks the FrameView transparency. Now we just need to store a transparency bool rather
3009         than the old color (we only checked its alpha anyway).
3010
3011         * rendering/RenderLayerCompositor.cpp:
3012         (WebCore::RenderLayerCompositor::rootBackgroundTransparencyChanged):
3013
3014 2015-06-29  Dean Jackson  <dino@apple.com>
3015
3016         WebKit should use 80% black background for PiP indicator
3017         https://bugs.webkit.org/show_bug.cgi?id=146444
3018         <rdar://problem/21555726>
3019
3020         Reviewed by Sam Weinig.
3021
3022         Change the black background to a slightly less black background.
3023         This also involved making the placard artwork white, in order
3024         to keep it visible against the new grey.
3025
3026         * Modules/mediacontrols/mediaControlsiOS.css:
3027         (audio::-webkit-media-controls-wireless-playback-status):
3028         (audio::-webkit-media-controls-wireless-playback-status.small):
3029         (audio::-webkit-media-controls-wireless-playback-status.picture-in-picture):
3030
3031 2015-06-29  Brady Eidson  <beidson@apple.com>
3032
3033         Flag sync XHRs from the network process so they can be handled appropriately.
3034         <rdar://problem/21579162> and https://bugs.webkit.org/show_bug.cgi?id=146441
3035
3036         Reviewed by Darin Adler.
3037
3038         * platform/network/ResourceHandleClient.h:
3039         (WebCore::ResourceHandleClient::loadingSynchronousXHR): Added so clients of asynchronous
3040           loads can signal they should be treated like synchronous loads at the platform level.
3041
3042         * platform/network/cf/ResourceHandleCFNet.cpp:
3043         (WebCore::ResourceHandle::start): Adjust SchedulingBehavior based on the client.
3044
3045         * platform/network/mac/ResourceHandleMac.mm:
3046         (WebCore::ResourceHandle::start): Adjust SchedulingBehavior based on the client.
3047
3048 2015-06-29  Chris Fleizach  <cfleizach@apple.com>
3049
3050         AX: PlatformSpeechSynthesizer code doesn't catch Objective-C exceptions
3051         https://bugs.webkit.org/show_bug.cgi?id=146419
3052
3053         Reviewed by Simon Fraser.
3054
3055         Make sure ObjC exception resulting from calling into the platform cause problems in WebKit.
3056
3057         * platform/ios/PlatformSpeechSynthesizerIOS.mm:
3058         (-[WebSpeechSynthesisWrapper speakUtterance:]):
3059         (-[WebSpeechSynthesisWrapper pause]):
3060         (-[WebSpeechSynthesisWrapper resume]):
3061         (-[WebSpeechSynthesisWrapper cancel]):
3062         (-[WebSpeechSynthesisWrapper speechSynthesizer:didStartSpeechUtterance:]):
3063         (WebCore::PlatformSpeechSynthesizer::initializeVoiceList):
3064         (WebCore::PlatformSpeechSynthesizer::pause):
3065
3066 2015-06-29  Matt Rajca  <mrajca@apple.com>
3067
3068         Removing an element from a media session should also remove it from the sets of active participating elements
3069         https://bugs.webkit.org/show_bug.cgi?id=146420
3070
3071         Reviewed by Eric Carlson.
3072
3073         * Modules/mediasession/MediaSession.cpp:
3074         (WebCore::MediaSession::removeMediaElement):
3075
3076 2015-06-29  Dean Jackson  <dino@apple.com>
3077
3078         Temporarily disable PICTURE_SIZES
3079         https://bugs.webkit.org/show_bug.cgi?id=146435
3080         <rdar://problem/21087013>
3081
3082         Reviewed by Tim Horton.
3083
3084         Temporarily disable PICTURE_SIZES because it causes problems with out
3085         of date <picture> polyfills.
3086
3087         * Configurations/FeatureDefines.xcconfig:
3088
3089 2015-06-29  Tim Horton  <timothy_horton@apple.com>
3090
3091         Fix the build.
3092
3093         * editing/cocoa/HTMLConverter.mm:
3094         * platform/spi/cocoa/NSAttributedStringSPI.h:
3095
3096 2015-06-29  Tim Horton  <timothy_horton@apple.com>
3097
3098         Fix the build.
3099
3100         * platform/spi/cocoa/NSAttributedStringSPI.h:
3101
3102 2015-06-29  Tim Horton  <timothy_horton@apple.com>
3103
3104         Fix the build.
3105
3106         * platform/spi/cocoa/NSAttributedStringSPI.h:
3107
3108 2015-06-27  Ryosuke Niwa  <rniwa@webkit.org>
3109
3110         Font panel doesn't get updated when bolding text via cmd+b in Mail on OS X
3111         https://bugs.webkit.org/show_bug.cgi?id=146379
3112
3113         Reviewed by Darin Adler.
3114
3115         The bug was caused by WebKit not updating the font panel when the typing style changes.
3116         There was also a bug that WebKit never updated font attributes on OS X.
3117
3118         Fixed the bugs by always updating the font panel after applying style instead of only
3119         when the selection changes and setting the font attributes.
3120
3121         I tried really had to write a WebKit API test but I couldn't get it to work so there are
3122         no new tests :(
3123
3124         * WebCore.xcodeproj/project.pbxproj:
3125         * editing/Editor.cpp:
3126         (WebCore::Editor::applyStyle):
3127         (WebCore::Editor::shouldApplyStyle):
3128         (WebCore::Editor::applyParagraphStyle):
3129         (WebCore::Editor::applyStyleToSelection):
3130         (WebCore::Editor::applyParagraphStyleToSelection):
3131         (WebCore::Editor::selectionStartHasStyle):
3132         (WebCore::Editor::document):
3133         (WebCore::Editor::styleForSelectionStart): Deleted.
3134         * editing/Editor.h:
3135         * editing/cocoa/EditorCocoa.h: Added. Shares the declaration for NSUnderlineStyle in iOS.
3136         * editing/cocoa/EditorCocoa.mm: Added.
3137         (WebCore::Editor::styleForSelectionStart): Moved from Editor.cpp
3138         (WebCore::Editor::getTextDecorationAttributesRespectingTypingStyle): Extracted from iOS's
3139         fontAttributesForSelectionStart implementation.
3140         * editing/cocoa/HTMLConverter.mm:
3141         * editing/ios/EditorIOS.mm:
3142         (WebCore::Editor::fontAttributesForSelectionStart):
3143         * editing/mac/EditorMac.mm:
3144         (WebCore::Editor::fontAttributesForSelectionStart):
3145         * loader/EmptyClients.h:
3146         * page/EditorClient.h:
3147
3148 2015-06-29  Matt Rajca  <mrajca@apple.com>
3149
3150         MediaSession: use a HashSet for the collection of participating elements
3151         https://bugs.webkit.org/show_bug.cgi?id=146421
3152
3153         Reviewed by Eric Carlson.
3154
3155         * Modules/mediasession/MediaSession.cpp:
3156         (WebCore::MediaSession::addMediaElement):
3157         (WebCore::MediaSession::removeMediaElement):
3158         * Modules/mediasession/MediaSession.h:
3159
3160 2015-06-29  Dean Jackson  <dino@apple.com>
3161
3162         Setting to enable/disable media controls sizing on page zoom
3163         https://bugs.webkit.org/show_bug.cgi?id=146423
3164         <rdar://problem/18379634>
3165
3166         Reviewed by Eric Carlson.
3167
3168         Add a new setting "MediaControlsScaleWithPageZoom" that can disable
3169         the behaviour we currently implement on iOS, where the media controls
3170         attempt to remain at a fixed size independent of page zoom.
3171
3172         * html/HTMLMediaElement.cpp:
3173         (WebCore::HTMLMediaElement::setMediaControlsDependOnPageScaleFactor): Do not
3174         set this value to true if the new setting is disabled.
3175         * page/Settings.cpp:
3176         * page/Settings.in: Add the new setting.
3177
3178 2015-06-29  Adam Bergkvist  <adam.bergkvist@ericsson.com>
3179
3180         WebRTC: Update the MediaStream API
3181         https://bugs.webkit.org/show_bug.cgi?id=146313
3182
3183         Reviewed by Eric Carlson.
3184
3185         Update the MediaStream API (MediaStream, MediaStreamTrack and
3186         RealtimeMediaSource) to match the Media Capture and Stream
3187         specification [1]. Notable changes:
3188
3189         Updated event handling to synchronously update corresponding
3190         state/attributes as events are dispatched.
3191
3192         Removed 'new' state from MediaStreamTrack. A track is either 'live' or
3193         'ended'. As a consequence 'started' event is also removed.
3194
3195         MediaStreamTrack always has a source (disconnected source concept was
3196         removed from the spec). Therefore, more state can be kept at the source
3197         without going away.
3198
3199         Calculate MediaStream.active internally, from the track set, instead of
3200         setting it externally.
3201
3202         Updated RealtimeMediaSource Observer interface.
3203
3204         Replaced MediaStream's separate audio and video track lists with a
3205         single track set (more aligned with spec).
3206
3207         Updated MediaStream constructor to adopt instead of clone track
3208         arguments (or tracks from MediaStream argument).
3209
3210         Removed MediaStreamTrack.getSources() and corresponding test (removed
3211         from spec).
3212
3213         Test status: 3 added, 8 existing enabled (some updated) and 1 removed.
3214
3215         [1] http://w3c.github.io/mediacapture-main/archives/20150523/getusermedia.html
3216
3217         Tests: fast/mediastream/MediaStreamTrack-clone.html
3218                fast/mediastream/MediaStreamTrack-kind.html
3219                fast/mediastream/MediaStreamTrack-stop.html
3220
3221         * Modules/mediastream/MediaStream.cpp:
3222         (WebCore::MediaStream::create):
3223         (WebCore::MediaStream::MediaStream):
3224         (WebCore::MediaStream::clone):
3225         (WebCore::MediaStream::addTrack):
3226         (WebCore::MediaStream::removeTrack):
3227         (WebCore::MediaStream::getTrackById):
3228         (WebCore::MediaStream::getAudioTracks):
3229         (WebCore::MediaStream::getVideoTracks):
3230         (WebCore::MediaStream::getTracks):
3231         (WebCore::MediaStream::contextDestroyed):
3232         (WebCore::MediaStream::trackDidEnd):
3233         (WebCore::MediaStream::activeStatusChanged):
3234         (WebCore::MediaStream::didAddTrackToPrivate):
3235         (WebCore::MediaStream::didRemoveTrackFromPrivate):
3236         (WebCore::MediaStream::internalAddTrack):
3237         (WebCore::MediaStream::internalRemoveTrack):
3238         (WebCore::MediaStream::scheduleActiveStateChange):
3239         (WebCore::MediaStream::activityEventTimerFired):
3240         (WebCore::MediaStream::trackVectorForType):
3241         (WebCore::MediaStream::~MediaStream): Deleted.
3242         (WebCore::MediaStream::registry): Deleted.
3243         (WebCore::MediaStream::addObserver): Deleted.
3244         (WebCore::MediaStream::removeObserver): Deleted.
3245         * Modules/mediastream/MediaStream.h:
3246         * Modules/mediastream/MediaStream.idl:
3247         * Modules/mediastream/MediaStreamTrack.cpp:
3248         (WebCore::MediaStreamTrack::MediaStreamTrack):
3249         (WebCore::MediaStreamTrack::~MediaStreamTrack):
3250         (WebCore::MediaStreamTrack::kind):
3251         (WebCore::MediaStreamTrack::id):
3252         (WebCore::MediaStreamTrack::label):
3253         (WebCore::MediaStreamTrack::enabled):
3254         (WebCore::MediaStreamTrack::setEnabled):
3255         (WebCore::MediaStreamTrack::muted):
3256         (WebCore::MediaStreamTrack::readonly):
3257         (WebCore::MediaStreamTrack::remote):
3258         (WebCore::MediaStreamTrack::readyState):
3259         (WebCore::MediaStreamTrack::ended):
3260         (WebCore::MediaStreamTrack::clone):
3261         (WebCore::MediaStreamTrack::stopProducingData):
3262         (WebCore::MediaStreamTrack::states):
3263         (WebCore::MediaStreamTrack::getCapabilities):
3264         (WebCore::MediaStreamTrack::applyConstraints):
3265         (WebCore::MediaStreamTrack::trackEnded):
3266         (WebCore::MediaStreamTrack::trackMutedChanged):
3267         (WebCore::MediaStreamTrack::stop):
3268         (WebCore::MediaStreamTrack::getConstraints): Deleted.
3269         (WebCore::MediaStreamTrack::addObserver): Deleted.
3270         (WebCore::MediaStreamTrack::removeObserver): Deleted.
3271         (WebCore::MediaStreamTrack::configureTrackRendering): Deleted.
3272         (WebCore::MediaStreamTrack::activeDOMObjectName): Deleted.
3273         (WebCore::MediaStreamTrack::canSuspendForPageCache): Deleted.
3274         * Modules/mediastream/MediaStreamTrack.h:
3275         * Modules/mediastream/MediaStreamTrack.idl:
3276         * Modules/mediastream/RTCPeerConnection.cpp:
3277         (WebCore::RTCPeerConnection::didRemoveRemoteStream): Deleted.
3278         * Modules/mediastream/UserMediaRequest.cpp:
3279         (WebCore::UserMediaRequest::didCreateStream):
3280         * platform/mediastream/MediaStreamPrivate.cpp:
3281         (WebCore::MediaStreamPrivate::create):
3282         (WebCore::MediaStreamPrivate::MediaStreamPrivate):
3283         (WebCore::MediaStreamPrivate::tracks):
3284         (WebCore::MediaStreamPrivate::updateActiveState):
3285         (WebCore::MediaStreamPrivate::addTrack):
3286         (WebCore::MediaStreamPrivate::removeTrack):
3287         * platform/mediastream/MediaStreamPrivate.h:
3288         (WebCore::MediaStreamPrivate::active): Deleted.
3289         * platform/mediastream/MediaStreamTrackPrivate.cpp:
3290         (WebCore::MediaStreamTrackPrivate::create):
3291         (WebCore::MediaStreamTrackPrivate::MediaStreamTrackPrivate):
3292         (WebCore::MediaStreamTrackPrivate::~MediaStreamTrackPrivate):
3293         (WebCore::MediaStreamTrackPrivate::label):
3294         (WebCore::MediaStreamTrackPrivate::setEnabled):
3295         (WebCore::MediaStreamTrackPrivate::endTrack):
3296         (WebCore::MediaStreamTrackPrivate::clone):
3297         (WebCore::MediaStreamTrackPrivate::type):
3298         (WebCore::MediaStreamTrackPrivate::applyConstraints):
3299         (WebCore::MediaStreamTrackPrivate::sourceStopped):
3300         (WebCore::MediaStreamTrackPrivate::sourceMutedChanged):
3301         (WebCore::MediaStreamTrackPrivate::preventSourceFromStopping):
3302         (WebCore::MediaStreamTrackPrivate::muted): Deleted.
3303         (WebCore::MediaStreamTrackPrivate::readonly): Deleted.
3304         (WebCore::MediaStreamTrackPrivate::remote): Deleted.
3305         (WebCore::MediaStreamTrackPrivate::constraints): Deleted.
3306         (WebCore::MediaStreamTrackPrivate::states): Deleted.
3307         (WebCore::MediaStreamTrackPrivate::capabilities): Deleted.
3308         * platform/mediastream/MediaStreamTrackPrivate.h:
3309         (WebCore::MediaStreamTrackPrivate::id):
3310         (WebCore::MediaStreamTrackPrivate::ended):
3311         (WebCore::MediaStreamTrackPrivate::enabled):
3312         (WebCore::MediaStreamTrackPrivate::setClient):
3313         (WebCore::MediaStreamTrackPrivate::source): Deleted.
3314         (WebCore::MediaStreamTrackPrivate::client): Deleted.
3315         * platform/mediastream/RealtimeMediaSource.cpp:
3316         (WebCore::RealtimeMediaSource::RealtimeMediaSource):
3317         (WebCore::RealtimeMediaSource::reset):
3318         (WebCore::RealtimeMediaSource::setMuted):
3319         (WebCore::RealtimeMediaSource::readonly):
3320         (WebCore::RealtimeMediaSource::stop):
3321         (WebCore::RealtimeMediaSource::requestStop):
3322         (WebCore::RealtimeMediaSource::addObserver): Deleted.
3323         (WebCore::RealtimeMediaSource::removeObserver): Deleted.
3324         * platform/mediastream/RealtimeMediaSource.h:
3325         (WebCore::RealtimeMediaSource::stopped):
3326         (WebCore::RealtimeMediaSource::id): Deleted.
3327         (WebCore::RealtimeMediaSource::muted): Deleted.
3328         (WebCore::RealtimeMediaSource::setReadonly): Deleted.
3329         * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp:
3330         (WebCore::RealtimeMediaSourceCenterOwr::createMediaStream): Deleted.
3331         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
3332         (WebCore::MockRealtimeMediaSourceCenter::createMediaStream): Deleted.
3333
3334 2015-06-29  Benjamin Poulain  <benjamin@webkit.org>
3335
3336         Make the NFA transitions range-based
3337         https://bugs.webkit.org/show_bug.cgi?id=146338
3338
3339         Reviewed by Alex Christensen.
3340
3341         Change the NFA to use range based transition for any kind of transition.
3342         The fallback transition is also absorbed as ranges.
3343
3344         Previously, the NFA would only have single transitions and a fallback
3345         transition for all cases not covered by single transitions.
3346
3347         The problem with that design was that character ranges (e.g. [a-z]) were
3348         extended as individual transitions. Something like [^a] would cover
3349         most of the alphabet with transitions.
3350         When converting the NFA to DFA, the time is proportional to the number of states
3351         multiplied by the number of transitions. With many individual transitions,
3352         the run time was an order of magnitude higher than what we want.
3353
3354         This patch changes the NFA to only handle ranges of characters. A single transition
3355         becomes a range with the character as first and last character in the range
3356         ('a' becomes 'a' to 'a').
3357         Ranges of characters are handled direclty (e.g. [a-z] becomes a single 'a' to 'z' transition).
3358
3359         In the context of the state machines, ranges have identifies (the target of the transitions).
3360         When two ranges collide, they have to be split such that each part retain its target
3361         except the intersection that gets the union of the targets.
3362
3363         Handling the union of ranges efficiently is critical because we have to do
3364         it for every NFA node in any subset when building the DFA. The helper
3365         class that does that is MutableRange.
3366
3367         The union of ranges is done efficiently because of preconditions on our list of ranges:
3368         -The ranges must be sorted.
3369         -No range in a list can intersect any other range in the same list.
3370
3371         To merge two ranges, we can go over them in order and split them part by part.
3372         It is easy to find what goes where because they are both sorted and we can
3373         compare the characters of each to know how to move forward.
3374         The time to merge 2 range list is proportional to O(n+m) where 'n' and 'm' are
3375         the number of ranges in each list.
3376
3377         Since taking the union of two lists usually create new ranges, we have to allocate
3378         those somewhere efficiently. To do that, MutableRange support an inline capacity,
3379         which is used for the NFAToDFA Convertion.
3380
3381         ---
3382
3383         With ranges, the NFA-to-DFA conversion changes very little:
3384         -Each NFA nodes contains a list of ranges and each range has a list of targets.
3385         -The subset construction select any number of NFA nodes corresponding to
3386          a single deterministic state.
3387         -For the subset, we can use MutableRange to merge the ranges of every
3388          NFA node in the set. The resulting list has rangeis with targets corresponding
3389          to the union of all the transitions.
3390         -We go over all the ranges the same way we used to go over the transitions.
3391          Since the DFA does not support ranges, the ranges are&nbs