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