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