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