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