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