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