Use modern for-loops in WebCore/Modules - 2
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-06-08  Hunseop Jeong  <hs85.jeong@samsung.com>
2
3         Use modern for-loops in WebCore/Modules - 2
4         https://bugs.webkit.org/show_bug.cgi?id=145541
5
6         Reviewed by Darin Adler.
7
8         No new tests, no behavior changes.
9
10         * Modules/mediastream/RTCConfiguration.h:
11         (WebCore::RTCConfiguration::iceServers):
12         * Modules/mediastream/RTCDTMFSender.cpp:
13         (WebCore::RTCDTMFSender::scheduledEventTimerFired):
14         * Modules/mediastream/RTCDataChannel.cpp:
15         (WebCore::RTCDataChannel::scheduledEventTimerFired):
16         * Modules/mediastream/RTCPeerConnection.cpp:
17         (WebCore::processIceServer):
18         (WebCore::RTCPeerConnection::~RTCPeerConnection):
19         (WebCore::RTCPeerConnection::getStreamById):
20         (WebCore::RTCPeerConnection::hasLocalStreamWithTrackId):
21         (WebCore::RTCPeerConnection::stop):
22         (WebCore::RTCPeerConnection::scheduledEventTimerFired):
23         * Modules/mediastream/RTCStatsReport.cpp:
24         (WebCore::RTCStatsReport::names):
25         * Modules/navigatorcontentutils/NavigatorContentUtils.cpp:
26         (WebCore::initProtocolHandlerWhitelist):
27         * Modules/speech/SpeechSynthesis.cpp:
28         (WebCore::SpeechSynthesis::getVoices):
29         * Modules/webaudio/AudioBuffer.cpp:
30         (WebCore::AudioBuffer::memoryCost):
31         * Modules/webaudio/AudioContext.cpp:
32         (WebCore::AudioContext::createMediaStreamSource):
33         (WebCore::AudioContext::derefFinishedSourceNodes):
34         (WebCore::AudioContext::derefUnfinishedSourceNodes):
35         (WebCore::AudioContext::handleDeferredFinishDerefs):
36         (WebCore::AudioContext::handleDirtyAudioSummingJunctions):
37         (WebCore::AudioContext::handleDirtyAudioNodeOutputs):
38         (WebCore::AudioContext::updateAutomaticPullNodes):
39         (WebCore::AudioContext::processAutomaticPullNodes):
40         * Modules/webaudio/AudioNode.cpp:
41         (WebCore::AudioNode::updateChannelsForInputs):
42         (WebCore::AudioNode::checkNumberOfChannelsForInput):
43         (WebCore::AudioNode::pullInputs):
44         (WebCore::AudioNode::inputsAreSilent):
45         (WebCore::AudioNode::silenceOutputs):
46         (WebCore::AudioNode::unsilenceOutputs):
47         (WebCore::AudioNode::enableOutputsIfNecessary):
48         (WebCore::AudioNode::disableOutputsIfNecessary):
49         (WebCore::AudioNode::finishDeref):
50         * Modules/webaudio/AudioNodeInput.cpp:
51         (WebCore::AudioNodeInput::numberOfChannels):
52         (WebCore::AudioNodeInput::sumAllConnections):
53         * Modules/webaudio/AudioNodeOutput.cpp:
54         (WebCore::AudioNodeOutput::propagateChannelCount):
55         (WebCore::AudioNodeOutput::disable):
56         (WebCore::AudioNodeOutput::enable):
57         * Modules/webaudio/AudioParam.cpp:
58         (WebCore::AudioParam::calculateFinalValues):
59         * Modules/webaudio/AudioParamTimeline.cpp:
60         (WebCore::AudioParamTimeline::insertEvent):
61         * Modules/webaudio/AudioSummingJunction.cpp:
62         (WebCore::AudioSummingJunction::updateRenderingState):
63         * Modules/webaudio/MediaStreamAudioSource.cpp:
64         (WebCore::MediaStreamAudioSource::setAudioFormat):
65         (WebCore::MediaStreamAudioSource::consumeAudio):
66         * Modules/webaudio/WaveShaperProcessor.cpp:
67         (WebCore::WaveShaperProcessor::setOversample):
68         * Modules/webdatabase/DatabaseThread.cpp:
69         (WebCore::DatabaseThread::handlePausedQueue):
70         (WebCore::DatabaseThread::databaseThread):
71         * Modules/webdatabase/DatabaseTracker.cpp:
72         (WebCore::DatabaseTracker::interruptAllDatabasesForContext):
73         (WebCore::DatabaseTracker::databaseNamesForOrigin):
74         (WebCore::DatabaseTracker::getOpenDatabases):
75         (WebCore::DatabaseTracker::usageForOrigin):
76         (WebCore::DatabaseTracker::deleteAllDatabases):
77         (WebCore::DatabaseTracker::deleteOrigin):
78         (WebCore::DatabaseTracker::deleteDatabaseFile):
79         (WebCore::DatabaseTracker::removeDeletedOpenedDatabases):
80         (WebCore::DatabaseTracker::setDatabasesPaused):
81         * Modules/webdatabase/SQLTransactionCoordinator.cpp:
82         (WebCore::SQLTransactionCoordinator::shutdown):
83         * Modules/websockets/WebSocket.cpp:
84         (WebCore::WebSocket::connect):
85         * Modules/websockets/WebSocketExtensionDispatcher.cpp:
86         (WebCore::WebSocketExtensionDispatcher::addProcessor):
87         (WebCore::WebSocketExtensionDispatcher::appendAcceptedExtension):
88         (WebCore::WebSocketExtensionDispatcher::processHeaderValue):
89         * Modules/websockets/WebSocketHandshake.cpp:
90         (WebCore::WebSocketHandshake::clientHandshakeMessage):
91
92 2015-06-07  Darin Adler  <darin@apple.com>
93
94         REGRESSION (r181720): Unnecessary layout triggered any time animated GIF advances to a new frame
95         https://bugs.webkit.org/show_bug.cgi?id=145733
96
97         Reviewed by Andreas Kling.
98
99         Test: fast/images/animated-gif-no-layout.html
100
101         * rendering/RenderImage.cpp:
102         (WebCore::RenderImage::styleDidChange): Correctly pass ImageSizeChangeNone in cases
103         where we don't need to report a change in intrinsic size that happened outside the
104         repaintOrMarkForLayout function.
105         (WebCore::RenderImage::repaintOrMarkForLayout): Move work that should only be done
106         when size changed inside the if statement.
107
108         * testing/Internals.cpp:
109         (WebCore::Internals::layoutCount): Added.
110         * testing/Internals.h: Added layoutCount.
111         * testing/Internals.idl: Ditto.
112
113 2015-06-07  Michael Catanzaro  <mcatanzaro@igalia.com>
114
115         Fix strncpy use in WebCore::Text::formatForDebugger
116         https://bugs.webkit.org/show_bug.cgi?id=145608
117
118         Reviewed by Darin Adler.
119
120         r185137 replaced a call to strncpy with a call to strlcpy, which broke the build on Linux
121         since strlcpy does not exist there. r185148 reverted this to use strncpy again, but got the
122         size argument off by one, "introducing" a buffer overrun. But this code has always been
123         wrong, since it used strncpy without ensuring that the buffer is null-terminated after the
124         call to strncpy. Fix this as well.
125
126         * dom/Text.cpp:
127         (WebCore::Text::formatForDebugger):
128
129 2015-06-07  Antti Koivisto  <antti@apple.com>
130
131         CrashTracer: [USER] com.apple.WebKit.WebContent.Development at com.apple.WebCore: WebCore::FrameLoader::subresourceCachePolicy const + 11
132         https://bugs.webkit.org/show_bug.cgi?id=145736
133         rdar://problem/21246971
134
135         Reviewed by David Kilzer.
136
137         No repro, no test.
138
139         * html/HTMLLinkElement.cpp:
140         (WebCore::HTMLLinkElement::setCSSStyleSheet):
141
142             Null check frame. It may be null during frame teardown.
143
144 2015-06-06  Anders Carlsson  <andersca@apple.com>
145
146         Remove support from getting plug-in information from Carbon resources
147         https://bugs.webkit.org/show_bug.cgi?id=145730
148
149         Reviewed by Dan Bernstein.
150
151         Remove a now unused function.
152
153         * platform/mac/WebCoreNSStringExtras.h:
154         * platform/mac/WebCoreNSStringExtras.mm:
155         (stringEncodingForResource): Deleted.
156
157 2015-06-06  Commit Queue  <commit-queue@webkit.org>
158
159         Unreviewed, rolling out r185284.
160         https://bugs.webkit.org/show_bug.cgi?id=145723
161
162         it needs some discussion before landing (Requested by dino on
163         #webkit).
164
165         Reverted changeset:
166
167         "[iOS] Don't force compositing layers for no-op 3D transforms
168         on low-memory devices."
169         https://bugs.webkit.org/show_bug.cgi?id=145719
170         http://trac.webkit.org/changeset/185284
171
172 2015-06-06  Ryosuke Niwa  <rniwa@webkit.org>
173
174         Typing is slow in Gmail on iPads
175         https://bugs.webkit.org/show_bug.cgi?id=145686
176
177         Reviewed by Enrica Casucci.
178
179         The bug was caused by nextCandidate and nextVisuallyDistinctCandidate traversing through each character
180         in a text node without a renderer. Skip any node that doesn't have a renderer in both of those functions
181         and corresponding previous* functions.
182
183         It's fine to skip unrendered nodes in PositionIterator because only other clients of PositionIterator
184         are Position::upstream and Position::downstream and they don't care about un-rendered nodes either.
185
186         * dom/PositionIterator.cpp:
187         (WebCore::PositionIterator::increment):
188         (WebCore::PositionIterator::decrement):
189         * editing/htmlediting.cpp:
190         (WebCore::nextVisuallyDistinctCandidate):
191         (WebCore::previousVisuallyDistinctCandidate):
192
193 2015-06-06  Mark Lam  <mark.lam@apple.com>
194
195         Returned Exception* values need to be initialized to nullptr when no exceptions are thrown.
196         https://bugs.webkit.org/show_bug.cgi?id=145720
197
198         Reviewed by Dan Bernstein.
199
200         No new tests because this issue is already covered by the existing inspector-protocol tests.
201
202         * bindings/js/WorkerScriptController.cpp:
203         (WebCore::WorkerScriptController::evaluate):
204
205 2015-06-05  Andreas Kling  <akling@apple.com>
206
207         [iOS] Don't force compositing layers for no-op 3D transforms on low-memory devices.
208         <https://webkit.org/b/145719>
209         <rdar://problem/19973042>
210
211         Reviewed by Geoffrey Garen.
212
213         We put elements with 3D identity transforms onto compositing layers because
214         we anticipate that they will somehow animate in the future.
215
216         This can get extremely expensive, especially on low-memory devices.
217         This patch makes WebKit stop handing out compositing layers for this kinda thing:
218
219             -webkit-transform: translate3d(0,0,0)
220
221         ..on devices with 512MB or less. This dramatically improves stability on some
222         web pages.
223
224         * rendering/RenderLayerCompositor.cpp:
225         (WebCore::RenderLayerCompositor::requiresCompositingForTransform):
226
227 2015-06-05  Matt Baker  <mattbaker@apple.com>
228
229         Web Inspector: "Other" time in the framerate table is often negative
230         https://bugs.webkit.org/show_bug.cgi?id=145712
231
232         Reviewed by Timothy Hatcher.
233
234         The Inspector frontend flattens the timeline event tree it receives from the backend, which can contain nested
235         paint records. The nested records represent a single paint event, but were being interpreted as two separate
236         events for purposes of calculating total layout time. This caused the calculated "other" time to be less than
237         it should be (and in some cases negative).
238
239         * inspector/InspectorTimelineAgent.cpp:
240         (WebCore::InspectorTimelineAgent::addRecordToTimeline):
241         Paint records are no longer nested, we simply drop the child paint event.
242
243 2015-06-05  Chris Dumez  <cdumez@apple.com>
244
245         Unreviewed, speculative Windows build fix after r185273.
246
247         * platform/VNodeTracker.h:
248
249 2015-06-05  Chris Dumez  <cdumez@apple.com>
250
251         [WK2][iOS] Limit the number of vnodes used by the WebContent processes
252         https://bugs.webkit.org/show_bug.cgi?id=145672
253         <rdar://problem/21126637>
254
255         Reviewed by Antti Koivisto.
256
257         Limit the number of vnodes used by the WebContent processes to reduce
258         the chance of getting killed due to the system running out of vnodes.
259         We sometimes see the WebContent process use up to 50% of the system's
260         vnode limit on some tests on iOS, which seems excessive. Most vnodes
261         are due to CachedResources which are mmap'd from the WebKit disk cache
262         and kept alive due to caches such as the Memory Cache / PageCache.
263
264         This patch adds tracking for the number of SharedBuffer objects that are
265         backed by a CFDataRef as this should track most of the vnodes used by
266         the process. The WebContent process registers a vnode pressure handler
267         upon initialization (likely it already does for memory pressure
268         handling). This handler gets called when the process uses over 15% of
269         of system's vnode limit and the "critical" flag is set if it uses over
270         20% of the system limit. The vnode pressure handler currently calls the
271         memory pressure handler as freeing our caches (especially PageCache,
272         MemoryCache) and doing a JS GC frees up vnodes.
273
274         On iPhone 6 Plus, the system limit is at 3000, which would lead to the
275         following limits being used:
276         soft: 450 / hard: 600
277
278         However, on older hardware, the system limit can be as low as 2000,
279         which would lead to the following limits being used:
280         soft: 300 / hard: 400
281
282         vnode tracking is currently only enabled on iOS because system vnode
283         limits are usually much higher on Mac (e.g. 473695 on Mac Pro, 9984
284         on a 2011 MacBook Air) and we normally don't get killed.
285
286         * WebCore.xcodeproj/project.pbxproj:
287
288         Add new files to the XCode project.
289
290         * platform/SharedBuffer.h:
291
292         Add a VNodeTracker::Token member next to the CFDataRef member that we
293         initialize if the SharedBuffer is constructed from a CFDataRef.
294
295         * platform/VNodeTracker.cpp: Added.
296         (WebCore::VNodeTracker::singleton):
297         (WebCore::VNodeTracker::VNodeTracker):
298         (WebCore::VNodeTracker::checkPressureState):
299         (WebCore::VNodeTracker::pressureWarningTimerFired):
300         (WebCore::VNodeTracker::nextPressureWarningInterval):
301         (WebCore::VNodeTracker::platformInitialize):
302         * platform/VNodeTracker.h: Added.
303         (WebCore::VNodeTracker::setPressureHandler):
304
305         Add a new VNodeTracker singleton to keep track the number of vnodes
306         used by the process since the system does not issue warnings before
307         reaching its vnode limit. Call sites should request Tokens for
308         every vnode they use for tracking purposes. Each process can then
309         set a vnode pressure handler function that will be called when the
310         process is over the designated limits.
311
312         * platform/cf/SharedBufferCF.cpp:
313         (WebCore::SharedBuffer::SharedBuffer):
314
315         Take a VNodeToken from the VNodeTracker when constructing the
316         SharedBuffer from a CFDataRef as these usually use mmap.
317
318         * platform/cocoa/VNodeTrackerCocoa.cpp: Added.
319         (WebCore::VNodeTracker::platformInitialize):
320
321         Get the system's vnode limit and uses 15% of that value as soft
322         limit for the process and 20% of that value as hard limit.
323
324 2015-06-05  Dean Jackson  <dino@apple.com>
325
326         Lingering checkbox animations when rapidly switching between views on WK1
327         https://bugs.webkit.org/show_bug.cgi?id=145715
328         <rdar://problem/17381121>
329
330         Reviewed by Simon Fraser.
331
332         On WK1, the NSView we use for NSButtonCells is parented in the ScrollView.
333         Our checkbox and radiobutton animations cause AppKit to create a CALayer which
334         is parented into that view. As we render the animations, we see the CALayer getting
335         drawn also.
336
337         The fix was to use an unparented layer on WK1 when drawing these controls, the same
338         way WK2 does. This technique may apply to all controls, but restricting it
339         to just the buttons at the moment is less risky.
340
341         This only happens during the swap between a checked and non-checked state,
342         and we have no way to test it :(
343
344         * platform/mac/ThemeMac.h: New optional parameter to ensuredView.
345         * platform/mac/ThemeMac.mm:
346         (WebCore::paintToggleButton): If we're on Yosemite or highter, use an unparented view.
347         (WebCore::ThemeMac::ensuredView): Return either a parented or unparented view.
348
349 2015-06-05  Matt Rajca  <mrajca@apple.com>
350
351         MediaSessions should keep track of their participating media elements.
352         https://bugs.webkit.org/show_bug.cgi?id=145703
353
354         Reviewed by Eric Carlson.
355
356         * Modules/mediasession/MediaSession.cpp:
357         (WebCore::MediaSession::addMediaElement): Add the given media element to the media session.
358         (WebCore::MediaSession::removeMediaElement): Remove the given media element from the media session.
359         (WebCore::MediaSession::activeParticipatingElements): Dynamically build a vector of actively-playing media
360           elements.
361         * Modules/mediasession/MediaSession.h:
362         * html/HTMLMediaElement.cpp:
363         (WebCore::HTMLMediaElement::~HTMLMediaElement): Ensure the element is removed from its media session.
364         (WebCore::HTMLMediaElement::setSession): Update sessions' references to their media elements.
365
366 2015-06-05  Chris Dumez  <cdumez@apple.com>
367
368         Regression(r176212): Broke app switching on iCloud.com
369         https://bugs.webkit.org/show_bug.cgi?id=145708
370         <rdar://problem/21235277>
371
372         Reviewed by Simon Fraser.
373
374         Roll out r176212 and follow-up fixes for now, to fix iCloud.com.
375         We can reconsider later how to do this in a safer way.
376
377         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
378         (WebCore::JSCSSStyleDeclaration::putDelegate): Deleted.
379         (WebCore::JSCSSStyleDeclaration::getOwnPropertyNames): Deleted.
380         * dom/Element.cpp:
381         * dom/Element.h:
382         * dom/ElementRareData.cpp:
383         * dom/ElementRareData.h:
384         (WebCore::ElementRareData::ElementRareData):
385         (WebCore::ElementRareData::~ElementRareData): Deleted.
386         * dom/Node.cpp:
387         (WebCore::Node::materializeRareData):
388         * html/HTMLCanvasElement.cpp:
389         (WebCore::HTMLCanvasElement::notifyObserversCanvasChanged): Deleted.
390         * page/DOMTimer.cpp:
391         (WebCore::DOMTimerFireState::scriptMadeNonUserObservableChanges): Deleted.
392         (WebCore::DOMTimerFireState::scriptMadeUserObservableChanges): Deleted.
393         (WebCore::NestedTimersMap::instanceForContext): Deleted.
394         (WebCore::DOMTimer::install): Deleted.
395         (WebCore::DOMTimer::fired): Deleted.
396         (WebCore::DOMTimer::alignedFireTime): Deleted.
397         (WebCore::DOMTimer::activeDOMObjectName): Deleted.
398         * page/DOMTimer.h:
399         * page/FrameView.cpp:
400         (WebCore::FrameView::reset): Deleted.
401         (WebCore::FrameView::viewportContentsChanged): Deleted.
402         (WebCore::FrameView::autoSizeIfEnabled): Deleted.
403         * page/FrameView.h:
404
405 2015-06-05  Myles C. Maxfield  <mmaxfield@apple.com>
406
407         [iOS] Emoji overlap preceeding lines
408         https://bugs.webkit.org/show_bug.cgi?id=145678
409         <rdar://problem/10684914>
410
411         Reviewed by Enrica Casucci.
412
413         In WebKit, we first lay out lines, and then we lay out text inside those lines. Text is vertically centered in
414         its containing line. If the author has not specified a particular line-height, the height of a line comes from
415         the font metrics for the primary font of the line.
416
417         In iOS, we were specifically hardcoding the line height metric of Apple Color Emoji to be 0. This means that,
418         if Apple Color Emoji is the primary font for a line, and an explicit line-height was not specified, the lines
419         are laid out with 0 height. Then, when we vertically center the text inside the line, the top half of the text
420         overlaps the preceeding line.
421
422         I'm not sure exactly why were were hardcoding this value to 0, as it is surely wrong. I'm going to ask Enrica
423         to review this patch; hopefully she knows the answer.
424
425         Test: fast/text/emoji.html
426
427         * platform/graphics/cocoa/FontCocoa.mm:
428         (WebCore::Font::platformInit):
429
430 2015-06-05  Alex Christensen  <achristensen@webkit.org>
431
432         [Web Timing] Use new SPI to enable data collection.
433         https://bugs.webkit.org/show_bug.cgi?id=145650
434         rdar://problem/21203358
435
436         Reviewed by Chris Dumez.
437
438         * platform/network/cf/ResourceHandleCFNet.cpp:
439         (WebCore::ResourceHandle::createCFURLConnection):
440         Gather web timing data on iOS.
441         * platform/network/mac/ResourceHandleMac.mm:
442         (WebCore::ResourceHandle::createNSURLConnection):
443         (WebCore::ResourceHandle::setCollectsTimingData):
444         Gather web timing data on Mac.
445
446 2015-06-05  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
447
448         [Streams API] ReadableStream should store callbacks as a Deque
449         https://bugs.webkit.org/show_bug.cgi?id=145641
450
451         Reviewed by Darin Adler.
452
453         Covered by existing tests.
454
455         * Modules/streams/ReadableStream.cpp:
456         (WebCore::ReadableStream::resolveReadCallback): Use of Deque.takeFirst
457         * Modules/streams/ReadableStream.h: Using Deque in lieu of Vector for storing callbacks.
458
459 2015-06-05  Mark Lam  <mark.lam@apple.com>
460
461         finally blocks should not set the exception stack trace when re-throwing the exception.
462         https://bugs.webkit.org/show_bug.cgi?id=145525
463
464         Reviewed by Geoffrey Garen.
465
466         Update to use the new JSC::Exception object.
467
468         Test: inspector/debugger/break-on-exceptions.html
469
470         * ForwardingHeaders/runtime/Exception.h: Added.
471         * bindings/js/JSCallbackData.cpp:
472         (WebCore::JSCallbackData::invokeCallback):
473         * bindings/js/JSCustomXPathNSResolver.cpp:
474         (WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
475         * bindings/js/JSDOMBinding.cpp:
476         (WebCore::jsArray):
477         (WebCore::reportException):
478         (WebCore::reportCurrentException):
479         * bindings/js/JSDOMBinding.h:
480         * bindings/js/JSErrorHandler.cpp:
481         (WebCore::JSErrorHandler::handleEvent):
482         * bindings/js/JSEventListener.cpp:
483         (WebCore::JSEventListener::handleEvent):
484         * bindings/js/JSMainThreadExecState.cpp:
485         (WebCore::JSMainThreadExecState::didLeaveScriptContext):
486         (WebCore::functionCallHandlerFromAnyThread):
487         (WebCore::evaluateHandlerFromAnyThread):
488         * bindings/js/JSMainThreadExecState.h:
489         (WebCore::JSMainThreadExecState::currentState):
490         (WebCore::JSMainThreadExecState::call):
491         (WebCore::JSMainThreadExecState::evaluate):
492         (WebCore::JSMainThreadExecState::runTask):
493
494         * bindings/js/JSMediaDevicesCustom.cpp:
495         (WebCore::JSMediaDevices::getUserMedia):
496         - Fixed a bug where the exception was not cleared before entering the VM to
497           call JS code.
498
499         * bindings/js/JSMutationCallback.cpp:
500         (WebCore::JSMutationCallback::call):
501         * bindings/js/ReadableJSStream.cpp:
502         (WebCore::getPropertyFromObject):
503         (WebCore::callFunction):
504         (WebCore::ReadableJSStream::Source::start):
505         * bindings/js/ScheduledAction.cpp:
506         (WebCore::ScheduledAction::executeFunctionInContext):
507         * bindings/js/ScriptController.cpp:
508         (WebCore::ScriptController::evaluateInWorld):
509         * bindings/js/SerializedScriptValue.cpp:
510         (WebCore::SerializedScriptValue::create):
511         (WebCore::SerializedScriptValue::deserialize):
512         * bindings/js/WorkerScriptController.cpp:
513         (WebCore::WorkerScriptController::evaluate):
514         (WebCore::WorkerScriptController::setException):
515         (WebCore::WorkerScriptController::scheduleExecutionTermination):
516         * bindings/js/WorkerScriptController.h:
517         (WebCore::WorkerScriptController::workerGlobalScopeWrapper):
518         * bindings/js/WorkerScriptDebugServer.cpp:
519         (WebCore::WorkerScriptDebugServer::runEventLoopWhilePaused):
520         (WebCore::WorkerScriptDebugServer::reportException):
521         * bindings/js/WorkerScriptDebugServer.h:
522         * bindings/objc/WebScriptObject.mm:
523         (WebCore::createJSWrapper):
524         (WebCore::addExceptionToConsole):
525         (-[WebScriptObject callWebScriptMethod:withArguments:]):
526         (-[WebScriptObject evaluateWebScript:]):
527         - Changed to call a version of JSMainThreadExecState::evaluate() that provides
528           a stub returnedException because evaluateWebScript: doesn't need the exception.
529
530         * inspector/PageScriptDebugServer.cpp:
531         (WebCore::PageScriptDebugServer::isContentScript):
532         (WebCore::PageScriptDebugServer::reportException):
533         * inspector/PageScriptDebugServer.h:
534         * workers/WorkerGlobalScope.cpp:
535         (WebCore::WorkerGlobalScope::importScripts):
536
537 2015-06-05  Eric Carlson  <eric.carlson@apple.com>
538
539         Layout tests fullscreen/video-controls-drag.html and media/video-fullscreeen-only-controls.html
540         fail on WK1 and WK2
541         https://bugs.webkit.org/show_bug.cgi?id=145675
542
543         Reviewed by Dean Jackson.
544
545         No new tests, changes covered by existing tests.
546
547         * Modules/mediacontrols/mediaControlsApple.js:
548         (Controller.prototype.updateControls): Use shouldHaveControls() to test if controls should
549           be visible.
550         (Controller.prototype.handleWrapperMouseMove): Don't return early when in fullscreen.
551         (Controller.prototype.updateFullscreenButtons): Drive-by fix: always show the (exit) fullscreen
552           button when in fullscreen.
553           
554
555 2015-06-04  David Hyatt  <hyatt@apple.com>
556
557         Underlines too close in vertical Chinese text.
558         https://bugs.webkit.org/show_bug.cgi?id=145651
559         <rdar://problem/11105920>
560
561         Reviewed by Simon Fraser.
562
563         Added fast/text/decorations-vertical-underline.html
564
565         * style/InlineTextBoxStyle.cpp:
566         (WebCore::computeUnderlineOffset):
567         Make sure the to map text-underline-position: auto to under when a line has an ideographic baseline.
568
569 2015-06-05  Carlos Alberto Lopez Perez  <clopez@igalia.com>
570
571         [GTK] [Wayland] The MiniBrowser crashes inside Weston.
572         https://bugs.webkit.org/show_bug.cgi?id=145645
573
574         Reviewed by Žan Doberšek.
575
576         No new tests, no behavior changes.
577
578         The issue was caused because we were not properly initializing the
579         Wayland display, and we were returning a nullptr in PlatformDisplayWayland::create(),
580         therefore a crash was happening on WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp:1136
581         <http://trac.webkit.org/browser/trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp?rev=185245#L1136>
582
583         * platform/graphics/wayland/PlatformDisplayWayland.cpp:
584         (WebCore::PlatformDisplayWayland::create): When connecting to the Wayland
585         server socket we should use the default value (NULL). This allows the value
586         to be overwritten at run-time by the environment variables WAYLAND_DISPLAY or
587         WAYLAND_SOCKET that the Wayland compositor should define. Also add a couple
588         of warnings to get information about what is going wrong when we fail to
589         initialize the display instead of just crashing without giving more information.
590         * platform/graphics/wayland/PlatformDisplayWayland.h:
591         (WebCore::PlatformDisplayWayland::isInitialized): Not longer check for m_webkitgtk
592         to signal that the display is ready because the UIProcess embedded Wayland
593         subcompositer is still not implemented. Added a FIXME note about it.
594
595 2015-06-05  Dean Jackson  <dino@apple.com>
596
597         [Mac] Popup focus is cut off
598         https://bugs.webkit.org/show_bug.cgi?id=145688
599         <rdar://problem/18313375>
600
601         Reviewed by Brent Fulgham.
602
603         Yosemite increased the width of focus rings, causing
604         some ugly clipping on Yosemite. The solution was to
605         not set a clip (which was code introduced for Leopard).
606
607         Test: fast/forms/select-element-focus-ring.html
608
609         * rendering/RenderThemeMac.mm:
610         (WebCore::RenderThemeMac::paintMenuList): Don't clip on Yosemite.
611
612 2015-06-05  Manuel Rego Casasnovas  <rego@igalia.com>
613
614         [CSS Grid Layout] Support dots sequences in grid-template-areas
615         https://bugs.webkit.org/show_bug.cgi?id=145693
616
617         Reviewed by Sergio Villar Senin.
618
619         The CSS WG agreed to consider a sequence of "." characters a single null
620         cell token for grid-template-areas. That way authors can match the
621         number of dots to the width of the column.
622
623         For more information see:
624         https://lists.w3.org/Archives/Public/www-style/2015May/0175.html
625
626         Added new test cases to check the new behavior.
627
628         * css/CSSParser.cpp:
629         (WebCore::containsOnlyDots): New helper function to check that the grid
630         area name is composed by only dots.
631         (WebCore::CSSParser::parseGridTemplateAreasRow): Use the new helper
632         function to look for unnamed areas.
633
634 2015-06-04  Joonghun Park  <jh718.park@samsung.com>
635
636         Purge PassRefPtr create() factory functions in WebCore/css
637         https://bugs.webkit.org/show_bug.cgi?id=144905
638
639         Reviewed by Darin Adler.
640
641         Return Ref instead of PassRefPtr in create() factory functions in css,
642         because the factory can't return null.
643
644         No new tests, no new behaviours.
645
646         * css/BasicShapeFunctions.cpp:
647         (WebCore::valueForCenterCoordinate):
648         (WebCore::basicShapeRadiusToCSSValue):
649         (WebCore::valueForBasicShape):
650         * css/BasicShapeFunctions.h:
651         * css/CSSBasicShapes.h:
652         * css/CSSCalculationValue.cpp:
653         (WebCore::createCSS):
654         (WebCore::CSSCalcValue::create):
655         * css/CSSCalculationValue.h:
656         * css/CSSCharsetRule.h:
657         * css/CSSComputedStyleDeclaration.cpp:
658         (WebCore::valueForNinePieceImageSlice):
659         (WebCore::valueForNinePieceImageQuad):
660         (WebCore::zoomAdjustedPixelValue):
661         (WebCore::zoomAdjustedNumberValue):
662         (WebCore::zoomAdjustedPixelValueForLength):
663         (WebCore::valueForReflection):
664         (WebCore::createPositionListForLayer):
665         (WebCore::positionOffsetValue):
666         (WebCore::percentageOrZoomAdjustedValue):
667         (WebCore::autoOrZoomAdjustedValue):
668         (WebCore::getBorderRadiusCornerValues):
669         (WebCore::getBorderRadiusCornerValue):
670         (WebCore::getBorderRadiusShorthandValue):
671         (WebCore::matrixTransformValue):
672         (WebCore::computedTransform):
673         (WebCore::adjustLengthForZoom):
674         (WebCore::ComputedStyleExtractor::valueForShadow):
675         (WebCore::ComputedStyleExtractor::valueForFilter):
676         (WebCore::specifiedValueForGridTrackBreadth):
677         (WebCore::specifiedValueForGridTrackSize):
678         (WebCore::valueForGridTrackList):
679         (WebCore::scrollSnapDestination):
680         (WebCore::scrollSnapPoints):
681         (WebCore::scrollSnapCoordinates):
682         (WebCore::createAnimationTriggerValue):
683         (WebCore::getAnimationTriggerValue):
684         (WebCore::ComputedStyleExtractor::getFontSizeCSSValuePreferringKeyword):
685         (WebCore::fillSizeToCSSValue):
686         (WebCore::lineHeightFromStyle):
687         (WebCore::fontSizeFromStyle):
688         (WebCore::zoomAdjustedPaddingOrMarginPixelValue):
689         (WebCore::shapePropertyValue):
690         (WebCore::ComputedStyleExtractor::propertyValue):
691         * css/CSSComputedStyleDeclaration.h:
692         * css/CSSFontFace.h:
693         (WebCore::CSSFontFace::create):
694         * css/CSSFontFaceLoadEvent.h:
695         * css/CSSFontFaceRule.h:
696         * css/CSSGrammar.y.in:
697         * css/CSSGridLineNamesValue.cpp:
698         (WebCore::CSSGridLineNamesValue::cloneForCSSOM):
699         * css/CSSGridLineNamesValue.h:
700         (WebCore::CSSGridLineNamesValue::create):
701         * css/CSSImportRule.h:
702         * css/CSSKeyframeRule.h:
703         (WebCore::StyleKeyframe::create):
704         * css/CSSKeyframesRule.h:
705         * css/CSSMediaRule.h:
706         * css/CSSPageRule.h:
707         * css/CSSParser.cpp:
708         (WebCore::CSSParser::parseGridLineNames):
709         (WebCore::CSSParser::parseDashboardRegions):
710         (WebCore::CSSParser::parseClipShape):
711         (WebCore::CSSParser::parseBasicShape):
712         (WebCore::BorderImageSliceParseContext::commitBorderImageSlice):
713         (WebCore::BorderImageQuadParseContext::commitBorderImageQuad):
714         * css/CSSParser.h:
715         (WebCore::CSSParser::ValueWithCalculation::calculation):
716         * css/CSSPrimitiveValue.cpp:
717         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
718         (WebCore::CSSPrimitiveValue::init):
719         (WebCore::CSSPrimitiveValue::cloneForCSSOM):
720         * css/CSSPrimitiveValue.h:
721         (WebCore::CSSPrimitiveValue::create):
722         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
723         * css/CSSPropertySourceData.h:
724         (WebCore::CSSStyleSourceData::create):
725         (WebCore::CSSRuleSourceData::create):
726         (WebCore::CSSRuleSourceData::createUnknown):
727         * css/CSSRuleList.h:
728         * css/CSSSegmentedFontFace.h:
729         (WebCore::CSSSegmentedFontFace::create):
730         * css/CSSSelector.cpp:
731         (WebCore::CSSSelector::createRareData):
732         * css/CSSSelector.h:
733         (WebCore::CSSSelector::RareData::create):
734         * css/CSSStyleRule.h:
735         * css/CSSSupportsRule.h:
736         * css/CSSValuePool.h:
737         (WebCore::CSSValuePool::createValue):
738         * css/FontLoader.cpp:
739         (WebCore::LoadFontCallback::create):
740         * css/LengthRepeat.h:
741         (WebCore::LengthRepeat::create):
742         (WebCore::LengthRepeat::cloneForCSSOM):
743         * css/MediaList.h:
744         (WebCore::MediaQuerySet::create):
745         (WebCore::MediaQuerySet::createAllowingDescriptionSyntax):
746         (WebCore::MediaList::create):
747         * css/MediaQueryList.cpp:
748         (WebCore::MediaQueryList::create):
749         * css/MediaQueryList.h:
750         * css/MediaQueryMatcher.h:
751         (WebCore::MediaQueryMatcher::create):
752         * css/Pair.h:
753         (WebCore::Pair::create):
754         * css/Rect.h:
755         (WebCore::Rect::create):
756         (WebCore::Rect::cloneForCSSOM):
757         (WebCore::Quad::create):
758         (WebCore::Quad::cloneForCSSOM):
759         * css/SVGCSSComputedStyleDeclaration.cpp:
760         (WebCore::paintOrder):
761         (WebCore::ComputedStyleExtractor::svgPropertyValue):
762         * css/StyleMedia.h:
763         (WebCore::StyleMedia::create):
764         * css/StyleResolver.cpp:
765         (WebCore::StyleResolver::keyframeStylesForAnimation):
766         * css/StyleSheetList.h:
767         (WebCore::StyleSheetList::create):
768         * css/ViewportStyleResolver.h:
769         (WebCore::ViewportStyleResolver::create):
770         * css/WebKitCSSMatrix.h:
771         * css/WebKitCSSRegionRule.h:
772         * css/WebKitCSSViewportRule.h:
773         * page/animation/CSSPropertyAnimation.cpp:
774         (WebCore::blendFilter):
775         * rendering/style/RenderStyle.h:
776         (WebCore::adjustFloatForAbsoluteZoom):
777         * rendering/style/StyleInheritedData.h:
778
779 2015-06-04  Benjamin Poulain  <bpoulain@apple.com>
780
781         The last 2 merged DFAs are not minimized by DFACombiner
782
783         * contentextensions/DFACombiner.cpp:
784         (WebCore::ContentExtensions::DFACombiner::combineDFAs):
785         I introduced a bug when I made minimization conditional: the last merge
786         does not minimize if we do not reach the minimum size.
787
788 2015-06-04  Brent Fulgham  <bfulgham@apple.com>
789
790         Latching algorithm in findEnclosingOverflowScroll is broken
791         https://bugs.webkit.org/show_bug.cgi?id=145642
792         <rdar://problem/21242308>
793
794         Reviewed by Simon Fraser.
795
796         Test: platform/mac-wk2/tiled-drawing/scrolling/iframe_in_iframe.html
797
798         * page/mac/EventHandlerMac.mm:
799         (WebCore::scrollableAreaForBox): Added helper function.
800         (WebCore::findEnclosingScrollableContainer): Renamed from findEnclosingOverflowScroll.
801         Only identify something as our scroll element if it can be scrolled in either
802         axis of the gesture's motion.
803         (WebCore::scrollableAreaForContainerNode): Use new helper function.
804         (WebCore::EventHandler::platformPrepareForWheelEvents): Use new function
805         name, and pass horizontal and vertical deltas.
806         (WebCore::findEnclosingOverflowScroll): Deleted.
807
808 2015-06-04  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
809
810         REGRESSION(r185091): Crash happens on indexdb tests
811         https://bugs.webkit.org/show_bug.cgi?id=145549
812
813         Reviewed by Darin Adler.
814
815         * Modules/indexeddb/IDBDatabaseError.h:
816         (WebCore::IDBDatabaseError::create): Revert Ref usage of IDBDatabaseError::create().
817
818 2015-06-04  Simon Fraser  <simon.fraser@apple.com>
819
820         Crash in EventDispatcher::dispatchEvent entering a location on Google Maps
821         https://bugs.webkit.org/show_bug.cgi?id=145677
822         rdar://problem/20698280
823
824         Reviewed by Dean Jackson.
825
826         If a transition is running on a pseudo-element, and the host element is removed
827         from the DOM just as the transition ends, and there is a transition event listener,
828         then we'd crash with a null dereference in event dispatch code.
829         
830         AnimationController tries to clean up running animations when renderers are destroyed,
831         but omitted to remove the element from two vectors that store element references.
832         Elements are only added to these vectors briefly on animation end, before firing
833         events, but failure to remove the vector entries could result in attempting
834         to fire an event on a pseudo-element with no host element.
835         
836         Also convert EventDispatcher code to be more robust to potentially null event
837         targets, since it's not clear that eventTargetRespectingTargetRules() can always
838         manage to return a non-null node.
839         
840         Hard to make a test because this is timing sensitive.
841
842         * dom/EventDispatcher.cpp:
843         (WebCore::eventTargetRespectingTargetRules):
844         (WebCore::EventDispatcher::dispatchScopedEvent):
845         (WebCore::EventDispatcher::dispatchEvent):
846         (WebCore::EventPath::EventPath):
847         * page/animation/AnimationController.cpp:
848         (WebCore::AnimationControllerPrivate::clear):
849
850 2015-06-04  Hunseop Jeong  <hs85.jeong@samsung.com>
851
852         Replace 0 with nullptr in WebCore/Page.
853         https://bugs.webkit.org/show_bug.cgi?id=145631
854
855         Reviewed by Darin Adler.
856
857         No new tests, no behavior changes.
858
859         * page/AutoscrollController.cpp:
860         (WebCore::AutoscrollController::AutoscrollController):
861         (WebCore::AutoscrollController::stopAutoscrollTimer):
862         * page/ContentSecurityPolicy.cpp:
863         (WebCore::CSPSourceList::parseSource):
864         * page/ContentSecurityPolicy.h:
865         * page/ContextMenuController.cpp:
866         (WebCore::ContextMenuController::clearContextMenu):
867         * page/DOMSelection.cpp:
868         (WebCore::DOMSelection::clearTreeScope):
869         * page/DOMWindow.cpp:
870         (WebCore::DOMWindow::resetDOMWindowProperties):
871         (WebCore::DOMWindow::localStorage):
872         (WebCore::DOMWindow::focus):
873         * page/DOMWindow.h:
874         * page/DOMWindowExtension.cpp:
875         (WebCore::DOMWindowExtension::reconnectFrameFromPageCache):
876         (WebCore::DOMWindowExtension::willDestroyGlobalObjectInCachedFrame):
877         * page/DOMWindowProperty.cpp:
878         (WebCore::DOMWindowProperty::DOMWindowProperty):
879         (WebCore::DOMWindowProperty::~DOMWindowProperty):
880         (WebCore::DOMWindowProperty::disconnectFrameForPageCache):
881         (WebCore::DOMWindowProperty::willDestroyGlobalObjectInCachedFrame):
882         (WebCore::DOMWindowProperty::willDestroyGlobalObjectInFrame):
883         * page/DragController.cpp:
884         (WebCore::DragController::dragEnded):
885         (WebCore::DragController::performDragOperation):
886         (WebCore::DragController::tryDocumentDrag):
887         (WebCore::DragController::concludeEditDrag):
888         (WebCore::DragController::startDrag):
889         * page/EventHandler.cpp:
890         (WebCore::EventHandler::EventHandler):
891         (WebCore::EventHandler::resizeLayerDestroyed):
892         (WebCore::EventHandler::freeDataTransfer):
893         (WebCore::EventHandler::dragSourceEndedAt):
894         (WebCore::EventHandler::handleDrag):
895         * page/EventHandler.h:
896         * page/FocusController.cpp:
897         (WebCore::FocusController::advanceFocusInDocumentOrder):
898         * page/Frame.cpp:
899         (WebCore::Frame::~Frame):
900         (WebCore::Frame::searchForLabelsBeforeElement):
901         (WebCore::Frame::willDetachPage):
902         (WebCore::Frame::createView):
903         * page/Frame.h:
904         (WebCore::Frame::detachFromPage):
905         * page/FrameDestructionObserver.cpp:
906         (WebCore::FrameDestructionObserver::FrameDestructionObserver):
907         (WebCore::FrameDestructionObserver::~FrameDestructionObserver):
908         (WebCore::FrameDestructionObserver::frameDestroyed):
909         * page/FrameTree.cpp:
910         (WebCore::FrameTree::~FrameTree):
911         (WebCore::FrameTree::removeChild):
912         * page/FrameTree.h:
913         (WebCore::FrameTree::FrameTree):
914         (WebCore::FrameTree::detachFromParent):
915         * page/History.cpp:
916         (WebCore::History::History):
917         * page/Page.cpp:
918         (WebCore::Page::Page):
919         (WebCore::Page::~Page):
920         (WebCore::Page::findStringMatchingRanges):
921         * page/PageGroup.cpp:
922         * page/Performance.cpp:
923         (WebCore::Performance::Performance):
924         * page/PointerLockController.cpp:
925         (WebCore::PointerLockController::didLosePointerLock):
926         (WebCore::PointerLockController::clearElement):
927         * page/SecurityOrigin.h:
928         (WebCore::SecurityOrigin::canAccessDatabase):
929         * page/Settings.cpp:
930         (WebCore::Settings::Settings):
931         * page/SpatialNavigation.cpp:
932         (WebCore::FocusCandidate::FocusCandidate):
933         * page/SpatialNavigation.h:
934         (WebCore::FocusCandidate::FocusCandidate):
935         * page/scrolling/ScrollingTreeNode.cpp:
936         (WebCore::ScrollingTreeNode::ScrollingTreeNode):
937         * page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp:
938         (WebCore::ScrollingCoordinatorCoordinatedGraphics::willDestroyScrollableArea):
939
940 2015-06-04  Benjamin Poulain  <bpoulain@apple.com>
941
942         Combine tiny DFAs into slightly larger ones
943         https://bugs.webkit.org/show_bug.cgi?id=145572
944
945         Reviewed by Alex Christensen.
946
947         This patch changes the ContentExtensions compiler to combine tiny DFA
948         until they reach a minimum size.
949
950         The main tool introduced here is DFAMerger. It combines 2 DFAs into
951         a single DFA that represent the union of the two machines.
952         That is done by a simple subset construction on the "name" of the nodes
953         in each DFAs.
954
955         Since we only merge 2 machines, and they are both deterministic, we know that
956         we can only be in one state of each machine, or a state in one machine without
957         equivalent in the other machine.
958         We exploit that to identify the mapping between nodes. To identify a node in
959         the new machine from nodes in the original machines, we just concatenate the node
960         IDs into a single 64 bits number. If there is no node in one of the machine, we
961         use a special tag.
962
963         The current algorithm does not have any subgraph pruning, machines grow very very
964         quickly. Because of that, we only merge very small DFAs at the moment.
965
966         Test: http/tests/contentextensions/filters-with-quantifiers-combined.html
967
968         * WebCore.xcodeproj/project.pbxproj:
969         * contentextensions/ContentExtensionCompiler.cpp:
970         (WebCore::ContentExtensions::compileRuleList):
971         * contentextensions/ContentExtensionsDebugging.h:
972         * contentextensions/DFA.cpp:
973         (WebCore::ContentExtensions::DFA::graphSize):
974         (WebCore::ContentExtensions::DFA::debugPrintDot):
975         * contentextensions/DFA.h:
976         * contentextensions/DFACombiner.cpp: Added.
977         (WebCore::ContentExtensions::DFAMerger::DFAMerger):
978         (WebCore::ContentExtensions::DFAMerger::merge):
979         (WebCore::ContentExtensions::DFAMerger::signatureForIndices):
980         (WebCore::ContentExtensions::DFAMerger::extractIndexA):
981         (WebCore::ContentExtensions::DFAMerger::extractIndexB):
982         (WebCore::ContentExtensions::DFAMerger::getOrCreateCombinedNode):
983         (WebCore::ContentExtensions::DFAMerger::setHalfSignature):
984         (WebCore::ContentExtensions::DFAMerger::populateTransitions):
985         (WebCore::ContentExtensions::DFAMerger::populateFromFallbackTransitions):
986         (WebCore::ContentExtensions::DFAMerger::createTransitions):
987         (WebCore::ContentExtensions::DFAMerger::createFallbackTransitionIfNeeded):
988         (WebCore::ContentExtensions::DFACombiner::combineDFAs):
989         * contentextensions/DFACombiner.h: Copied from Source/WebCore/contentextensions/DFA.h.
990         (WebCore::ContentExtensions::DFACombiner::addDFA):
991
992 2015-06-04  Matt Rajca  <mrajca@apple.com>
993
994         Rename MediaSessionManager to PlatformMediaSessionManager for consistency with PlatformMediaSession.
995         https://bugs.webkit.org/show_bug.cgi?id=145648
996
997         Reviewed by Eric Carlson.
998
999         * WebCore.vcxproj/WebCore.vcxproj:
1000         * WebCore.vcxproj/WebCore.vcxproj.filters:
1001         * WebCore.xcodeproj/project.pbxproj:
1002         * html/HTMLMediaElement.cpp:
1003         * html/MediaElementSession.cpp:
1004         (WebCore::MediaElementSession::effectivePreloadForElement):
1005         (WebCore::MediaElementSession::requiresFullscreenForVideoPlayback):
1006         * platform/audio/PlatformMediaSession.cpp:
1007         (WebCore::PlatformMediaSession::PlatformMediaSession):
1008         (WebCore::PlatformMediaSession::~PlatformMediaSession):
1009         (WebCore::PlatformMediaSession::clientWillBeginPlayback):
1010         (WebCore::PlatformMediaSession::clientWillPausePlayback):
1011         (WebCore::PlatformMediaSession::clientDataBufferingTimerFired):
1012         (WebCore::PlatformMediaSession::updateClientDataBuffering):
1013         * platform/audio/PlatformMediaSessionManager.cpp: Renamed from Source/WebCore/platform/audio/MediaSessionManager.cpp.
1014         (WebCore::PlatformMediaSessionManager::sharedManager):
1015         (WebCore::PlatformMediaSessionManager::PlatformMediaSessionManager):
1016         (WebCore::PlatformMediaSessionManager::resetRestrictions):
1017         (WebCore::PlatformMediaSessionManager::has):
1018         (WebCore::PlatformMediaSessionManager::activeAudioSessionRequired):
1019         (WebCore::PlatformMediaSessionManager::count):
1020         (WebCore::PlatformMediaSessionManager::beginInterruption):
1021         (WebCore::PlatformMediaSessionManager::endInterruption):
1022         (WebCore::PlatformMediaSessionManager::addSession):
1023         (WebCore::PlatformMediaSessionManager::removeSession):
1024         (WebCore::PlatformMediaSessionManager::addRestriction):
1025         (WebCore::PlatformMediaSessionManager::removeRestriction):
1026         (WebCore::PlatformMediaSessionManager::restrictions):
1027         (WebCore::PlatformMediaSessionManager::sessionWillBeginPlayback):
1028         (WebCore::PlatformMediaSessionManager::sessionWillEndPlayback):
1029         (WebCore::PlatformMediaSessionManager::setCurrentSession):
1030         (WebCore::PlatformMediaSessionManager::currentSession):
1031         (WebCore::PlatformMediaSessionManager::sessionRestrictsInlineVideoPlayback):
1032         (WebCore::PlatformMediaSessionManager::sessionCanLoadMedia):
1033         (WebCore::PlatformMediaSessionManager::applicationWillEnterBackground):
1034         (WebCore::PlatformMediaSessionManager::applicationWillEnterForeground):
1035         (WebCore::PlatformMediaSessionManager::updateSessionState):
1036         (WebCore::PlatformMediaSessionManager::didReceiveRemoteControlCommand):
1037         (WebCore::PlatformMediaSessionManager::systemWillSleep):
1038         (WebCore::PlatformMediaSessionManager::systemDidWake):
1039         (WebCore::PlatformMediaSessionManager::audioOutputDeviceChanged):
1040         * platform/audio/PlatformMediaSessionManager.h: Renamed from Source/WebCore/platform/audio/MediaSessionManager.h.
1041         (WebCore::PlatformMediaSessionManager::~PlatformMediaSessionManager):
1042         (WebCore::PlatformMediaSessionManager::configureWireLessTargetMonitoring):
1043         (WebCore::PlatformMediaSessionManager::hasWirelessTargetsAvailable):
1044         (WebCore::PlatformMediaSessionManager::sessions):
1045         * platform/audio/mac/AudioDestinationMac.cpp:
1046         * platform/audio/mac/MediaSessionManagerMac.cpp:
1047         (PlatformMediaSessionManager::updateSessionState):
1048         (MediaSessionManager::updateSessionState): Deleted.
1049         * testing/Internals.cpp:
1050
1051 2015-06-04  Eric Carlson  <eric.carlson@apple.com>
1052
1053         [Mac] Don't show default controls after playing to wireless target, again
1054         https://bugs.webkit.org/show_bug.cgi?id=145620
1055         <rdar://problem/21145806>
1056
1057         Reviewed by Dean Jackson.
1058
1059         Follow up to fix two tests broken by r185207.
1060
1061         * Modules/mediacontrols/mediaControlsApple.js:
1062         (Controller.prototype.updateControls): Always show controls when the video element
1063           is the fullscreen element because custom controls aren't possible.
1064
1065 2015-06-04  Myles C. Maxfield  <mmaxfield@apple.com>
1066
1067         [Cocoa] Add ASSERT to FontPlatformData::ctFont()
1068         https://bugs.webkit.org/show_bug.cgi?id=145659
1069
1070         Reviewed by Dean Jackson.
1071
1072         The new ASSERT needs to be guarded with CORETEXT_WEB_FONTS, which is defined in FontCustomPlatformData.h,
1073         and is not accessible to FontPlatformData. Therefore, I've moved the definition into TextFlags.h, which
1074         both files include.
1075
1076         No new tests because there is no behavior change.
1077
1078         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
1079         (WebCore::FontPlatformData::ctFont): Add the ASSERT.
1080         * platform/graphics/mac/FontCustomPlatformData.h: Move the CORETEXT_WEB_FONTS preprocessor
1081         macro from here ...
1082         * platform/text/TextFlags.h: ... to here.
1083
1084 2015-06-04  Commit Queue  <commit-queue@webkit.org>
1085
1086         Unreviewed, rolling out r185208.
1087         https://bugs.webkit.org/show_bug.cgi?id=145655
1088
1089         platform/mac-wk2/tiled-drawing/scrolling/fast-scroll-iframe-
1090         latched-select.html (Requested by shallawa on #webkit).
1091
1092         Reverted changeset:
1093
1094         "Latching algorithm in findEnclosingOverflowScroll is broken"
1095         https://bugs.webkit.org/show_bug.cgi?id=145642
1096         http://trac.webkit.org/changeset/185208
1097
1098 2015-06-04  Myles C. Maxfield  <mmaxfield@apple.com>
1099
1100         [Cocoa] Remove unnecessary code from FontPlatformData::ctFont()
1101         https://bugs.webkit.org/show_bug.cgi?id=145652
1102
1103         Hoefler Text Italic no longer has initial and final swashes by default, so there
1104         is no reason to explicitly disable them.
1105
1106         Reviewed by Andreas Kling.
1107
1108         No new tests because there is no behavior change.
1109
1110         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
1111         (WebCore::FontPlatformData::ctFont):
1112         (WebCore::createFeatureSettingDictionary): Deleted.
1113         (WebCore::cascadeToLastResortAndDisableSwashesFontDescriptor): Deleted.
1114
1115 2015-06-04  Brent Fulgham  <bfulgham@apple.com>
1116
1117         Latching algorithm in findEnclosingOverflowScroll is broken
1118         https://bugs.webkit.org/show_bug.cgi?id=145642
1119         <rdar://problem/21242308>
1120
1121         Reviewed by Simon Fraser.
1122
1123         Test: platform/mac-wk2/tiled-drawing/scrolling/iframe_in_iframe.html
1124
1125         * page/mac/EventHandlerMac.mm:
1126         (WebCore::findEnclosingOverflowScrollForDominantDirection): Renamed from
1127         'findEnclosingOverflowScroll'. Only identify element as our overflow
1128         scroll element if it can be scrolled in either axis of the gesture's
1129         motion.
1130         (WebCore::scrolledToEdgeInDominantDirection): Renamed.
1131         (WebCore::EventHandler::platformPrepareForWheelEvents): Use new function
1132         name, and pass horizontal and vertical deltas.
1133         (WebCore::findEnclosingOverflowScroll): Deleted.
1134
1135 2015-06-04  Eric Carlson  <eric.carlson@apple.com>
1136
1137         [Mac] Don't show default controls after playing to wireless target, again
1138         https://bugs.webkit.org/show_bug.cgi?id=145620
1139         <rdar://problem/21145806>
1140
1141         Reviewed by Dean Jackson.
1142
1143         * Modules/mediacontrols/mediaControlsApple.js:
1144         (Controller.prototype.updateControls): Show or hide the panel as appropriate.
1145         (Controller.prototype.handleWrapperMouseMove): Early return if !video.controls.
1146         (Controller.prototype.addControls): Call updateControls instead of this.setNeedsTimelineMetricsUpdate
1147           so all needed setup is done.
1148         (Controller.prototype.resetHideControlsTimer): Only start the hide timer if playing.
1149
1150 2015-06-04  Chris Dumez  <cdumez@apple.com>
1151
1152         [WK2] Prune more resources from the MemoryCache before process suspension
1153         https://bugs.webkit.org/show_bug.cgi?id=145633
1154
1155         Reviewed by Andreas Kling.
1156
1157         Prune more resources from the MemoryCache before process suspension or
1158         on simulated memory warning by doing a synchronous JS garbage collection
1159         and sweep *before* pruning dead resources from the memory cache.
1160         Previously, we would do the garbage collection after pruning the
1161         MemoryCache which meant that a lot of resources became dead after we
1162         tried to prune them.
1163
1164         At the end a basic browsing on apple.com, we are able to remove ~17%
1165         more resources from the MemoryCache on simulated memory warning with this
1166         change.
1167
1168         Pruning as much as we can from the memory cache on critical memory
1169         pressure or before process suspension is not only useful to free up
1170         memory but also to make room in the vnode table as a lot of
1171         CachedResources are mmmap'd from the network disk cache.
1172
1173         * platform/MemoryPressureHandler.cpp:
1174         (WebCore::MemoryPressureHandler::MemoryPressureHandler):
1175         (WebCore::MemoryPressureHandler::releaseCriticalMemory):
1176
1177         - Pass 'synchronous' argument so that we know if we need to do a
1178           synchronous JS garbage collection.
1179         - Move here code from in the Cocoa handler that is doing a JS garbage
1180           collection as well as a sweep, and make this code cross-platform.
1181           This code used to be iOS specific but I see no reason we shouldn't
1182           do this on Mac.
1183
1184         (WebCore::MemoryPressureHandler::releaseMemory):
1185         * platform/MemoryPressureHandler.h:
1186
1187         Use enum class arguments for critical / synchronous. The 'synchronous'
1188         argument is new so that the call site can let us know if memory needs
1189         to be freed synchronously (e.g. in case of imminent process suspension).
1190
1191         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
1192         (WebCore::MemoryPressureHandler::platformReleaseMemory):
1193
1194         Remove iOS-specific code that was doing a JS garbage collection and
1195         sweep as this code is now in the generic memory pressure handler.
1196
1197         (WebCore::MemoryPressureHandler::install):
1198
1199         On simulated memory pressure, set 'synchronous' argument to Yes so that
1200         a synchronous GC is done by the generic memory pressure handler. This
1201         way, we no longer need to do a sync GC after calling the memory pressure
1202         handler. This avoids code duplication and makes sure the GC is done
1203         before pruning the memory cache.
1204
1205
1206 2015-06-04  Myles C. Maxfield  <mmaxfield@apple.com>
1207
1208         [Cocoa] Clean up m_isEmoji in FontPlatformData
1209         https://bugs.webkit.org/show_bug.cgi?id=145644
1210
1211         Reviewed by Andreas Kling.
1212
1213         m_isEmoji used to be a public member variable only defined on iOS. This
1214         means that, whenever it was consulted, the sites were surrounded by
1215         PLATFORM(IOS) guards. A cleaner design is to use a getter and setter,
1216         which on non-iOS platforms, always return false / do nothing. Then, the
1217         use sites can just use these functions without having ugly guards.
1218
1219         No new tests because there is no behavior change.
1220
1221         * platform/graphics/FontPlatformData.h:
1222         (WebCore::FontPlatformData::hash): Simplify isEmoji use site.
1223         (WebCore::FontPlatformData::isEmoji): Getter. Returns false on Mac.
1224         (WebCore::FontPlatformData::setIsEmoji): Setter. Does nothing on Mac.
1225         * platform/graphics/cocoa/FontCascadeCocoa.mm:
1226         (WebCore::pointAdjustedForEmoji): Simplify isEmoji use site.
1227         (WebCore::FontCascade::drawGlyphs): Ditto.
1228         * platform/graphics/cocoa/FontCocoa.mm:
1229         (WebCore::Font::platformInit): Ditto.
1230         (WebCore::canUseFastGlyphAdvanceGetter): Ditto.
1231         (WebCore::isEmoji): Deleted.
1232         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
1233         (WebCore::FontPlatformData::platformDataInit): Simplify isEmoji use
1234         site.
1235         (WebCore::FontPlatformData::platformDataAssign): Ditto.
1236         (WebCore::FontPlatformData::platformIsEqual): Ditto.
1237         (WebCore::FontPlatformData::ctFontSize): Ditto.
1238         * platform/graphics/ios/FontCacheIOS.mm:
1239         (WebCore::FontCache::getSystemFontFallbackForCharacters): Ditto.
1240         (WebCore::FontCache::createFontPlatformData): Ditto.
1241         * platform/graphics/mac/ComplexTextController.cpp:
1242         (WebCore::ComplexTextController::adjustGlyphsAndAdvances): Ditto.
1243
1244 2015-06-03  Brent Fulgham  <bfulgham@apple.com>
1245
1246         REGRESSION (r181879): Scrolling order on pages with focused iframe is broken.
1247         https://bugs.webkit.org/show_bug.cgi?id=145637
1248         <rdar://problem/20635581>
1249
1250         Reviewed by Zalan Bujtas.
1251
1252         Test: platform/mac-wk2/tiled-drawing/scrolling/iframe_in_iframe.html
1253
1254         This page revealed a bug in our RenderBox code caused by the mismatch between
1255         our scrolling units, which are all integrally snapped, with our client height
1256         and widths, which are not snapped at all. 
1257         
1258         In certain cases, the client height would have a small subpixel difference compared
1259         to the scroll height, which would cause WebKit to believe it was scrollable. When
1260         this happened, it would get stuck latched to this element and block scrolling events. 
1261
1262         * page/Frame.cpp:
1263         (WebCore::Frame::scrollOverflowLayer): Use roundToInt for clientWidth and clientHeight,
1264         rather than integer truncation.
1265         * rendering/RenderBox.cpp:
1266         (WebCore::RenderBox::canBeScrolledAndHasScrollableArea): Need to round clientWidth
1267         and clientHeight to compare with scrollWidth/scrollHeight.
1268         * rendering/RenderBox.h:
1269         (WebCore::RenderBox::hasScrollableOverflowX): Ditto.
1270         (WebCore::RenderBox::hasScrollableOverflowY): Ditto.
1271         * rendering/RenderMarquee.cpp:
1272         (WebCore::RenderMarquee::computePosition): Use roundToInt for clientWidth and
1273         clientHeight, rather than integer truncation.
1274
1275 2015-06-04  Myles C. Maxfield  <mmaxfield@apple.com>
1276
1277         [Cocoa] Clean up m_font inside FontPlatformData
1278         https://bugs.webkit.org/show_bug.cgi?id=145634
1279
1280         Reviewed by Andreas Kling.
1281
1282         FontPlatformDatas are used as keys in a HashMap. This means that they need
1283         to be able to represent a "deleted" value. Previously, this "deleted" value
1284         was represented as setting the pointer value of m_font to -1, and guarding
1285         all uses of m_font to make sure it wasn't -1 before dereferencing it.
1286
1287         This patch simplifies FontPlatformData to represent a "deleted" value using
1288         a separate boolean member variable. This class is already big enough that
1289         the increased space is negligable (the class already contains two CoreText
1290         fonts in addition to a CoreGraphics font). Because of this simplification,
1291         m_font can now be a RetainPtr, instead of being manually retained and
1292         released.
1293
1294         There is still a long way to go before FontPlatformData is acceptably
1295         clean and understandable. This patch improves one aspect of it, and more
1296         improvements will eventually follow.
1297
1298         No new tests because there is no behavior change.
1299
1300         * platform/graphics/FontCache.cpp: Remove unused variable.
1301         * platform/graphics/FontPlatformData.cpp:
1302         (WebCore::FontPlatformData::FontPlatformData): Clean up all the PLATFORM
1303         macros in favor of a single bool. Also, update to include new state.
1304         (WebCore::FontPlatformData::operator=): Update to include new state.
1305         * platform/graphics/FontPlatformData.h:
1306         (WebCore::FontPlatformData::font): Update to account for RetainPtr.
1307         (WebCore::FontPlatformData::nsFont): Ditto.
1308         (WebCore::FontPlatformData::setNSFont): Ditto.
1309         (WebCore::FontPlatformData::hash): Update to include new state.
1310         (WebCore::FontPlatformData::operator==): Ditto.
1311         (WebCore::FontPlatformData::isHashTableDeletedValue): Use new state.
1312         (WebCore::FontPlatformData::hashTableDeletedFontValue): Deleted.
1313         (WebCore::FontPlatformData::isValidCTFontRef): Deleted.
1314         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
1315         (WebCore::FontPlatformData::platformDataInit): No need for manual retain
1316         and release.
1317         (WebCore::FontPlatformData::platformDataAssign): Ditto.
1318         (WebCore::FontPlatformData::platformIsEqual): Update to account for
1319         RetanPtr.
1320         (WebCore::FontPlatformData::setFont): No need for manual retain and
1321         release.
1322         (WebCore::FontPlatformData::FontPlatformData): Deleted.
1323         (WebCore::FontPlatformData::~FontPlatformData): Deleted.
1324         * platform/graphics/win/FontPlatformDataCairoWin.cpp:
1325         (WebCore::FontPlatformData::~FontPlatformData): m_scaledFont is always
1326         valid.
1327         (WebCore::FontPlatformData::platformDataAssign): Ditto.
1328
1329 2015-06-03  Carlos Alberto Lopez Perez  <clopez@igalia.com>
1330
1331         [GTK] [Wayland] Build is broken on trunk
1332         https://bugs.webkit.org/show_bug.cgi?id=142879
1333
1334         Reviewed by Carlos Garcia Campos.
1335
1336         No new tests, no behavior changes.
1337
1338         Patch on GLContext.h picked from bug 136831 by
1339         Iago Toral <itoral@igalia.com> and Zan Dobersek <zdobersek@igalia.com>
1340
1341         * platform/graphics/GLContext.h: Include wayland-egl.h before eglplatform.h
1342         to use the Wayland platform when building for Wayland.
1343         * platform/graphics/PlatformDisplay.cpp: Fix the include of GDK
1344         headers for the different targets.
1345         * platform/graphics/wayland/WaylandSurface.cpp: Fix build after r183731.
1346         (WebCore::WaylandSurface::~WaylandSurface):
1347
1348 2015-06-04  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
1349
1350         [Streams API] Implement ReadableStreamController enqueue
1351         https://bugs.webkit.org/show_bug.cgi?id=145210
1352
1353         Reviewed by Darin Adler.
1354
1355         Added possibility to enqueue any JSValue within ReadableJSStream.
1356         They are stored in a Vector of strongified JSValue.
1357
1358         Added support for streams that contain data but are asked to close.
1359         This is done through m_closeRequested boolean and splitting actual closing of the stream from changeStateToClosed().
1360
1361         Chunk size and backpressure mechanism is not yet implemented.
1362         Neither is pulling once enqueued data is processed.
1363
1364         Covered by rebased tests.
1365
1366         * Modules/streams/ReadableStream.cpp:
1367         (WebCore::ReadableStream::changeStateToClosed): Split method with newly added close().
1368         (WebCore::ReadableStream::close): Does the actual closing of stream once stream has no more values.
1369         (WebCore::ReadableStream::read): Close the stream when stream is emptied and close is requested.
1370         (WebCore::ReadableStream::resolveReadCallback): Added to enable ReadableJSStream to resolve read callbacks immediatly at enqueue time.
1371         * Modules/streams/ReadableStream.h:
1372         (WebCore::ReadableStream::isErrored): Getter added for the custom binding code.
1373         (WebCore::ReadableStream::isCloseRequested): Ditto.
1374         * bindings/js/JSReadableStreamControllerCustom.cpp:
1375         (WebCore::JSReadableStreamController::enqueue): binding code for enqueue, taking care of raising exception if readable stream cannot enqueue.
1376         * bindings/js/ReadableJSStream.cpp:
1377         (WebCore::ReadableJSStream::hasValue):
1378         (WebCore::ReadableJSStream::read):
1379         (WebCore::ReadableJSStream::enqueue):
1380         * bindings/js/ReadableJSStream.h:
1381
1382 2015-06-04  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
1383
1384         [Streams API] ReadableJSStream does not need a ReadableStreamSource
1385         https://bugs.webkit.org/show_bug.cgi?id=145601
1386
1387         Reviewed by Darin Adler.
1388
1389         Covered by existing tests.
1390
1391         * Modules/streams/ReadableStream.cpp:
1392         (WebCore::ReadableStream::ReadableStream): Remoed m_source.
1393         * Modules/streams/ReadableStream.h: Ditto
1394         * Modules/streams/ReadableStreamSource.h: Deleted.
1395         * WebCore.vcxproj/WebCore.vcxproj: Removing Modules/streams/ReadableStreamSource.h.
1396         * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
1397         * WebCore.xcodeproj/project.pbxproj: Ditto.
1398         * bindings/js/ReadableJSStream.cpp:
1399         (WebCore::ReadableJSStream::globalObject):
1400         (WebCore::ReadableJSStream::doStart): Equivalent of ReadableJSStream::Source::start().
1401         (WebCore::ReadableJSStream::create): Updated according new constructor.
1402         (WebCore::ReadableJSStream::ReadableJSStream):
1403         (WebCore::startReadableStreamAsync): Deleted.
1404         (WebCore::ReadableJSStream::jsController): Deleted.
1405         (WebCore::ReadableJSStream::storeError): Deleted.
1406         * bindings/js/ReadableJSStream.h: Added m_source member to store the JS source as a JS object.
1407
1408 2015-06-04  Zan Dobersek  <zdobersek@igalia.com>
1409
1410         Shrink the ArabicCharShapingMode enum in SVGGlyph.cpp
1411         https://bugs.webkit.org/show_bug.cgi?id=145564
1412
1413         Reviewed by Darin Adler.
1414
1415         Shrink the ArabicCharShapingMode enum to just one byte.
1416         This drops the size of the static s_arabicCharShapingMode
1417         array of  ArabicCharShapingMode values from 888 bytes to 222.
1418
1419         * platform/graphics/SVGGlyph.cpp:
1420         (WebCore::processArabicFormDetection):
1421
1422 2015-06-03  Zalan Bujtas  <zalan@apple.com>
1423
1424         Use borderBoxRect instead of contentBoxRect for backdrop filter.
1425         https://bugs.webkit.org/show_bug.cgi?id=145606
1426
1427         Reviewed by Simon Fraser.
1428
1429         Backdrop filter should use border box rect. It also needs to take css clip into account.
1430
1431         Tests: css3/filters/backdrop/backdrop-filter-with-cliprect.html
1432                css3/filters/backdrop/backdrop-filter-with-mask.html
1433
1434         * rendering/RenderLayerBacking.cpp:
1435         (WebCore::RenderLayerBacking::updateBackdropFiltersGeometry):
1436
1437 2015-06-03  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1438
1439         MediaDevices.getUserMedia should put promises in resolve/reject state synchronously
1440         https://bugs.webkit.org/show_bug.cgi?id=145308
1441
1442         Reviewed by Darin Adler.
1443
1444         Removed the calls to callToMainThread in which were resolved and rejected promises.
1445         Cleaned up the code to remove unneeded callback copies.
1446
1447         Covered by existing tests.
1448
1449         * Modules/mediastream/UserMediaRequest.cpp:
1450         (WebCore::UserMediaRequest::create):
1451         (WebCore::UserMediaRequest::UserMediaRequest):
1452         (WebCore::UserMediaRequest::didCreateStream):
1453         (WebCore::UserMediaRequest::failedToCreateStreamWithConstraintsError):
1454         (WebCore::UserMediaRequest::failedToCreateStreamWithPermissionError):
1455         * Modules/mediastream/UserMediaRequest.h:
1456
1457 2015-06-03  Simon Fraser  <simon.fraser@apple.com>
1458
1459         REGRESSION (r184968): missing media player buttons (control bar exists, but no buttons)
1460         https://bugs.webkit.org/show_bug.cgi?id=145630
1461
1462         Reviewed by Zalan Bujtas.
1463
1464         r184968 changed the initial value of m_intersectsCoverageRect to false. However,
1465         this triggered a bug with mask layers, whose value of m_intersectsCoverageRect was never
1466         updated.
1467
1468         Fix by copying the value of m_intersectsCoverageRect from the main layer to its
1469         mask layer, just as we do for m_visibleRect and m_coverageRect.
1470
1471         Test: compositing/visible-rect/mask-layer-coverage.html
1472
1473         * platform/graphics/ca/GraphicsLayerCA.cpp:
1474         (WebCore::GraphicsLayerCA::setVisibleAndCoverageRects):
1475
1476 2015-06-03  Simon Fraser  <simon.fraser@apple.com>
1477
1478         Layer tree dumps should include mask layers
1479         https://bugs.webkit.org/show_bug.cgi?id=145629
1480
1481         Reviewed by Zalan Bujtas.
1482
1483         Dumping the layer tree omitted to dump the mask layer, so fix 
1484         GraphicsLayer::dumpProperties() to dump this layer.
1485
1486         * platform/graphics/GraphicsLayer.cpp:
1487         (WebCore::GraphicsLayer::dumpProperties):
1488
1489 2015-06-03  Greg Hughes  <ghughes@apple.com>
1490
1491         AX: Expose field sets to accessibility clients
1492         https://bugs.webkit.org/show_bug.cgi?id=145585
1493    
1494         Expose fieldsets to the accessibility API via a subrole of AXFieldset.
1495
1496         Reviewed by Chris Fleizach.
1497
1498         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1499         (-[WebAccessibilityObjectWrapper subrole]):
1500
1501 2015-06-03  Myles C. Maxfield  <mmaxfield@apple.com>
1502
1503         Remove dead code FontPlatformData::roundsGlyphAdvances()
1504         https://bugs.webkit.org/show_bug.cgi?id=145628
1505
1506         Reviewed by Simon Fraser.
1507
1508         No new tests because there is no behavior change.
1509
1510         * WebCore.order:
1511         * platform/graphics/FontPlatformData.h:
1512         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
1513         (WebCore::FontPlatformData::roundsGlyphAdvances): Deleted.
1514
1515 2015-06-03  Ryuan Choi  <ryuan.choi@navercorp.com>
1516
1517         [CoordinatedGraphics] Merge CoordinatedTile into Tile
1518         https://bugs.webkit.org/show_bug.cgi?id=145602
1519
1520         Reviewed by Darin Adler.
1521
1522         CoordinatedTile only implements Tile since Qt and WebKit1/Efl were dropped.
1523         So, there is no reason that CoordinatedTile inherits Tile interface.
1524
1525         No new tests, no behavior changes.
1526
1527         * PlatformEfl.cmake:
1528         * PlatformGTK.cmake:
1529         * WebCore.vcxproj/WebCore.vcxproj:
1530         * WebCore.vcxproj/WebCore.vcxproj.filters:
1531         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
1532         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
1533         * platform/graphics/texmap/coordinated/CoordinatedTile.cpp: Renamed to Tile.cpp
1534         * platform/graphics/texmap/coordinated/CoordinatedTile.h: Merged into Tile.h
1535         (WebCore::CoordinatedTile::coordinate): Deleted.
1536         (WebCore::CoordinatedTile::rect): Deleted.
1537         * platform/graphics/texmap/coordinated/Tile.cpp: Renamed from CoordinatedTile.cpp.
1538         * platform/graphics/texmap/coordinated/Tile.h:
1539         * platform/graphics/texmap/coordinated/TiledBackingStore.cpp:
1540         (WebCore::TiledBackingStore::createTiles):
1541
1542 2015-06-03  Matt Rajca  <mrajca@apple.com>
1543
1544         Add basic Media Session support to HTMLMediaElement.
1545         https://bugs.webkit.org/show_bug.cgi?id=145581
1546
1547         Reviewed by Eric Carlson.
1548
1549         HTMLMediaElements now have:
1550
1551         - a 'kind' attribute representing the intrinsic media category
1552         - a 'session' attribute representing the current media session, if any
1553
1554         * CMakeLists.txt: Include the new HTMLMediaElementMediaSession sources.
1555         * DerivedSources.make: Include the new IDL file.
1556         * Modules/mediasession/HTMLMediaElementMediaSession.cpp: Added.
1557         (WebCore::HTMLMediaElementMediaSession::session):
1558         * Modules/mediasession/HTMLMediaElementMediaSession.h: Added basic translation of the IDL file.
1559         (WebCore::HTMLMediaElementMediaSession::kind):
1560         (WebCore::HTMLMediaElementMediaSession::setKind):
1561         (WebCore::HTMLMediaElementMediaSession::setSession):
1562         * Modules/mediasession/HTMLMediaElementMediaSession.idl: Added from the Media Session spec.
1563         * PlatformMac.cmake: Include DOMHTMLMediaElementMediaSession.cpp.
1564         * WebCore.xcodeproj/project.pbxproj: Include the new HTMLMediaElementMediaSession sources.
1565         * html/HTMLMediaElement.h: Added accessors for 'kind' and 'session'.
1566         (WebCore::HTMLMediaElement::kind):
1567         (WebCore::HTMLMediaElement::setKind):
1568         (WebCore::HTMLMediaElement::session):
1569         (WebCore::HTMLMediaElement::setSession):
1570
1571 2015-06-03  Myles C. Maxfield  <mmaxfield@apple.com>
1572
1573         Cleanup after r185175.
1574         https://bugs.webkit.org/show_bug.cgi?id=145569
1575         <rdar://problem/20671711>
1576
1577         Unreviewed.
1578
1579         No new tests because there is no behavior change.
1580
1581         * platform/graphics/WidthIterator.h:
1582
1583 2015-06-02  Myles C. Maxfield  <mmaxfield@apple.com>
1584
1585         SoftBank Emoji are not transformed by shaping when in a run of their own
1586         https://bugs.webkit.org/show_bug.cgi?id=145569
1587         <rdar://problem/20671711>
1588
1589         Reviewed by Dean Jackson.
1590
1591         Normally, we don't perform shaping on single glyphs. However, these particular codepoints
1592         need to have shaping run on them, even if they are alone.
1593
1594         Test: fast/text/softbank-emoji.html Note that this test may fail in different locales on
1595         different platforms. This patch disables the test on iOS.
1596
1597         * Source/WebCore/platform/graphics/WidthIterator.cpp:
1598         (WebCore::applyFontTransforms): Move the length-of-1 check into shouldApplyFontTransforms()
1599         (WebCore::shouldApplyFontTransforms): Return true if we have one of these emoji characters in
1600         a run of its own
1601         (WebCore::advanceInternal): Keep track of the previous character, and use it to call
1602         shouldApplyFontTransforms. 
1603         * Source/WebCore/platform/graphics/WidthIterator.h: shouldApplyFontTransforms() needs
1604         some more information to perform its duties.
1605
1606 2015-06-03  Daniel Bates  <dabates@apple.com>
1607
1608         Caps lock indicator should not be shown in read-only or disabled field
1609         https://bugs.webkit.org/show_bug.cgi?id=145612
1610         <rdar://problem/21227454>
1611
1612         Reviewed by Darin Adler.
1613
1614         * html/TextFieldInputType.cpp:
1615         (WebCore::TextFieldInputType::disabledAttributeChanged): Update caps lock indicator state.
1616         (WebCore::TextFieldInputType::readonlyAttributeChanged): Ditto.
1617         (WebCore::TextFieldInputType::shouldDrawCapsLockIndicator): Do not draw the caps lock indicator
1618         when the field is read-only or disabled.
1619
1620 2015-06-03  Dean Jackson  <dino@apple.com>
1621
1622         Crash in GraphicsContext3D::getInternalFramebufferSize
1623         https://bugs.webkit.org/show_bug.cgi?id=145479
1624         <rdar://problem/16461048>
1625
1626         Reviewed by Eric Carlson.
1627
1628         If we are in an unitialized or lost state, don't try to access the context.
1629
1630         In order to test this, I added an Internal setting that always
1631         forces WebGL into a pending state.
1632
1633         Test: fast/canvas/webgl/useWhilePending.html
1634
1635         * html/canvas/WebGLRenderingContextBase.cpp:
1636         (WebCore::WebGLRenderingContextBase::create): Check internal settings for
1637         a forced pending state.
1638         (WebCore::WebGLRenderingContextBase::drawingBufferWidth): Guard against a pending state.
1639         (WebCore::WebGLRenderingContextBase::drawingBufferHeight): Ditto.
1640         * page/Settings.cpp: New Internal setting for forcing a pending policy.
1641         (WebCore::Settings::Settings):
1642         (WebCore::Settings::setForcePendingWebGLPolicy):
1643         * page/Settings.h:
1644         (WebCore::Settings::isForcePendingWebGLPolicy):
1645         * testing/InternalSettings.cpp:
1646         (WebCore::InternalSettings::Backup::Backup):
1647         (WebCore::InternalSettings::Backup::restoreTo):
1648         (WebCore::InternalSettings::setForcePendingWebGLPolicy):
1649         * testing/InternalSettings.h:
1650         * testing/InternalSettings.idl:
1651
1652 2015-06-03  Hunseop Jeong  <hs85.jeong@samsung.com>
1653
1654         Use modern for-loops in WebCore/page.
1655         https://bugs.webkit.org/show_bug.cgi?id=145455
1656
1657         Reviewed by Darin Adler.
1658
1659         No new tests, no behavior changes.
1660
1661         * page/Chrome.cpp:
1662         (WebCore::Chrome::notifyPopupOpeningObservers):
1663         * page/ContentSecurityPolicy.cpp:
1664         (WebCore::CSPSourceList::matches):
1665         (WebCore::CSPDirectiveList::gatherReportURIs):
1666         (WebCore::ContentSecurityPolicy::copyStateFrom):
1667         (WebCore::isAllowedByAll):
1668         (WebCore::isAllowedByAllWithState):
1669         (WebCore::isAllowedByAllWithContext):
1670         (WebCore::isAllowedByAllWithURL):
1671         (WebCore::ContentSecurityPolicy::evalDisabledErrorMessage):
1672         (WebCore::ContentSecurityPolicy::allowPluginType):
1673         (WebCore::ContentSecurityPolicy::reflectedXSSDisposition):
1674         (WebCore::ContentSecurityPolicy::gatherReportURIs):
1675         * page/ContextMenuController.cpp:
1676         (WebCore::ContextMenuController::populate):
1677         * page/DOMWindow.cpp:
1678         (WebCore::DOMWindow::dispatchAllPendingBeforeUnloadEvents):
1679         (WebCore::DOMWindow::dispatchAllPendingUnloadEvents):
1680         (WebCore::DOMWindow::willDestroyCachedFrame):
1681         (WebCore::DOMWindow::willDestroyDocumentInFrame):
1682         (WebCore::DOMWindow::willDetachDocumentFromFrame):
1683         (WebCore::DOMWindow::disconnectDOMWindowProperties):
1684         (WebCore::DOMWindow::reconnectDOMWindowProperties):
1685         (WebCore::DOMWindow::getMatchedCSSRules):
1686         * page/DeviceController.cpp:
1687         (WebCore::DeviceController::dispatchDeviceEvent):
1688         (WebCore::DeviceController::fireDeviceEvent):
1689         * page/EventHandler.cpp:
1690         (WebCore::EventHandler::updateMouseEventTargetNode):
1691         (WebCore::EventHandler::handleTouchEvent):
1692         * page/FocusController.cpp:
1693         (WebCore::FocusController::setIsVisibleAndActiveInternal):
1694         * page/Frame.cpp:
1695         (WebCore::Frame::orientationChanged):
1696         (WebCore::Frame::injectUserScriptsForWorld):
1697         * page/FrameView.cpp:
1698         (WebCore::FrameView::scrollContentsFastPath):
1699         (WebCore::FrameView::serviceScriptedAnimations):
1700         (WebCore::FrameView::trackedRepaintRectsAsText):
1701         (WebCore::FrameView::updateWidgetPositions):
1702         (WebCore::FrameView::notifyWidgets):
1703         * page/Page.cpp:
1704         (WebCore::networkStateChanged):
1705         (WebCore::Page::stringToViewMode):
1706         (WebCore::Page::updateStyleForAllPagesAfterGlobalChangeInEnvironment):
1707         (WebCore::Page::refreshPlugins):
1708         (WebCore::Page::lockAllOverlayScrollbarsToHidden):
1709         (WebCore::Page::pluginViews):
1710         (WebCore::Page::storageBlockingStateChanged):
1711         (WebCore::Page::setIsVisibleInternal):
1712         * page/PageGroup.cpp:
1713         (WebCore::PageGroup::captionPreferencesChanged):
1714         * page/PageGroupLoadDeferrer.cpp:
1715         (WebCore::PageGroupLoadDeferrer::PageGroupLoadDeferrer):
1716         (WebCore::PageGroupLoadDeferrer::~PageGroupLoadDeferrer):
1717         * page/PageSerializer.cpp:
1718         (WebCore::PageSerializer::serializeFrame):
1719         * page/Performance.cpp:
1720         (WebCore::Performance::webkitGetEntriesByType):
1721         (WebCore::Performance::webkitGetEntriesByName):
1722         * page/PerformanceResourceTiming.cpp:
1723         (WebCore::passesTimingAllowCheck):
1724         * page/PerformanceUserTiming.cpp:
1725         (WebCore::convertToEntrySequence):
1726         * page/SecurityPolicy.cpp:
1727         (WebCore::SecurityPolicy::isAccessWhiteListed):
1728         * page/UserContentURLPattern.cpp:
1729         (WebCore::UserContentURLPattern::matchesPatterns):
1730         * page/WindowFeatures.cpp:
1731         (WebCore::WindowFeatures::parseDialogFeatures):
1732         * page/animation/AnimationController.cpp:
1733         (WebCore::AnimationControllerPrivate::updateAnimations):
1734         (WebCore::AnimationControllerPrivate::fireEventsAndUpdateStyle):
1735         (WebCore::AnimationControllerPrivate::suspendAnimationsForDocument):
1736         (WebCore::AnimationControllerPrivate::resumeAnimationsForDocument):
1737         (WebCore::AnimationControllerPrivate::numberOfActiveAnimations):
1738         * page/animation/CSSPropertyAnimation.cpp:
1739         (WebCore::ShorthandPropertyWrapper::equals):
1740         (WebCore::ShorthandPropertyWrapper::blend):
1741         * page/scrolling/AsyncScrollingCoordinator.cpp:
1742         (WebCore::setStateScrollingNodeSnapOffsetsAsFloat):
1743         * page/scrolling/ScrollingCoordinator.cpp:
1744         (WebCore::ScrollingCoordinator::absoluteNonFastScrollableRegionForFrame):
1745         (WebCore::ScrollingCoordinator::hasVisibleSlowRepaintViewportConstrainedObjects):
1746
1747 2015-06-03  Daniel Bates  <dabates@apple.com>
1748
1749         AutoFill button should not be shown in read-only or disabled field
1750         https://bugs.webkit.org/show_bug.cgi?id=145579
1751         <rdar://problem/21212494>
1752
1753         Reviewed by Darin Adler.
1754
1755         Fixes an issue where the AutoFill button is shown in a read-only or disabled
1756         field. We should not show the AutoFill button in such cases.
1757
1758         Tests: fast/forms/auto-fill-button/hide-auto-fill-button-when-input-becomes-disabled.html
1759                fast/forms/auto-fill-button/hide-auto-fill-button-when-input-becomes-readonly.html
1760                fast/forms/auto-fill-button/input-auto-fill-button.html
1761                fast/forms/auto-fill-button/input-disabled-auto-fill-button.html
1762                fast/forms/auto-fill-button/input-readonly-auto-fill-button.html
1763                fast/forms/auto-fill-button/input-readonly-non-empty-auto-fill-button.html
1764
1765         * html/TextFieldInputType.cpp:
1766         (WebCore::TextFieldInputType::disabledAttributeChanged): Update AutoFill button state.
1767         (WebCore::TextFieldInputType::readonlyAttributeChanged): Ditto.
1768         (WebCore::TextFieldInputType::shouldDrawAutoFillButton): Do not draw AutoFill button
1769         when the field is disabled or read-only.
1770
1771 2015-06-03  Brent Fulgham  <bfulgham@apple.com>
1772
1773         REGRESSION: (r181879): Scrolling in select/option region in iFrame scrolls both select and iframe
1774         https://bugs.webkit.org/show_bug.cgi?id=145574
1775         <rdar://problem/20966828>
1776
1777         Reviewed by Simon Fraser.
1778
1779         Tested by platform/mac-wk2/tiled-drawing/scrolling/fast-scroll-iframe-latched-select.html
1780
1781         When the scroll gesture is started when the latched scrollable container is not at the limit of its
1782         scroll region, we are NOT supposed to propagate the scroll event to the enclosing region. However,
1783         we were doing two things wrong:
1784         (1) When we recognized we were latching, we were using the right wheel event target, but not using
1785             the latched scrollable container.
1786         (2) Likewise, we were not using latched ScrollableArea when handling wheel events.
1787
1788         Instead, we were using the current scrollable container and ScrollableArea under the mouse pointer,
1789         which could be different from the point we started latching as the content scrolled.
1790         
1791         The fix was to properly track the scrollable container and scrollable area during latching.
1792
1793         I attempted to store the latched ScrollableArea in the latchingState object, like we already do for the
1794         scrollable container, but found that this did not work properly. I think the life cycle of the
1795         ScrollableArea may not match the scrollable container, and since they are not reference counted I
1796         simply retrieve the ScrollableArea when needed.
1797
1798         * page/mac/EventHandlerMac.mm:
1799         (WebCore::scrollableAreaForContainerNode): Helper function to return the correct ScrollableArea
1800         for the two types of RenderBox elements.
1801         (WebCore::latchedToFrameOrBody): Helper predicate to identify Frame and Body elements.
1802         (WebCore::EventHandler::platformPrepareForWheelEvents): Use the correct ScrollableArea for the given
1803         ContainerNode. When latching, make sure to use the ScrollableArea that is related to the latched scrollable
1804         container, not the area currently underneath the mouse pointer.
1805
1806 2015-06-03  Brady Eidson  <beidson@apple.com>
1807
1808         REGRESSION (r183498): Certain types of frame loads in iframes with <base target="_blank"> can open urls in new window/tabs
1809         https://bugs.webkit.org/show_bug.cgi?id=145580
1810
1811         Reviewed by Mark Lam.
1812
1813         Tests: fast/loader/fragment-navigation-base-blank.html
1814                fast/loader/iframe-meta-refresh-base-blank.html
1815                fast/loader/iframe-set-location-base-blank.html
1816                fast/loader/refresh-iframe-base-blank.html
1817
1818         Before 183498, callers of FrameLoader::changeLocation() got automatically assigned a frame name of "_self".
1819         After 183498, many remained without a frame name.
1820         
1821         Later on, FrameLoader applies the <base> target as their frame name if they don't already have one. 
1822         
1823         When the <base> target is "_blank", that causes a new window/tab.
1824         
1825         Restoring "_self" to these call sites fixes this.
1826
1827         * inspector/InspectorFrontendClientLocal.cpp:
1828         (WebCore::InspectorFrontendClientLocal::openInNewTab):
1829         
1830         * inspector/InspectorPageAgent.cpp:
1831         (WebCore::InspectorPageAgent::navigate):
1832         
1833         * loader/FrameLoadRequest.h:
1834         (WebCore::FrameLoadRequest::FrameLoadRequest):
1835         
1836         * loader/NavigationScheduler.cpp:
1837         (WebCore::NavigationScheduler::scheduleLocationChange):
1838         
1839         * page/DOMWindow.cpp:
1840         (WebCore::DOMWindow::createWindow):
1841
1842 2015-06-03  Alexey Proskuryakov  <ap@apple.com>
1843
1844         More iOS build fixing.
1845
1846         * platform/spi/mac/AVFoundationSPI.h:
1847
1848 2015-06-03  Zalan Bujtas  <zalan@apple.com>
1849
1850         Subpixel rendering: Composited layer with subpixel gap does not get painted properly when its position changes.
1851         https://bugs.webkit.org/show_bug.cgi?id=145587
1852
1853         Reviewed by Simon Fraser.
1854
1855         The composited layer always snaps to an enclosing device pixel (floors) while the renderer rounds.
1856         At certain positions (for example 0.5px on a 1x display), a gap is formed between the layer(0px) and its renderer(1px).
1857         In such cases, when the the renderer moves to a position (1.1px) where the gap is closed, we need to issue repaint on the layer
1858         in order to get the renderering right.
1859
1860         Test: compositing/child-layer-with-subpixel-gap-needs-repaint-when-parent-moves.html
1861
1862         * rendering/RenderLayerBacking.cpp:
1863         (WebCore::RenderLayerBacking::updateAfterLayout):
1864         (WebCore::devicePixelFractionGapFromRendererChanged):
1865         (WebCore::RenderLayerBacking::updateGeometry):
1866         * rendering/RenderLayerBacking.h:
1867
1868 2015-06-03  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
1869
1870         [Streams API] ReadableStreamReader::closed() should be called once by binding code
1871         https://bugs.webkit.org/show_bug.cgi?id=145551
1872
1873         Reviewed by Darin Adler.
1874
1875         Covered by existing tests.
1876
1877         * bindings/js/JSReadableStreamReaderCustom.cpp:
1878         (WebCore::JSReadableStreamReader::closed): Calling ReadableStreamReader::closed only at creation of the promise.
1879
1880 2015-06-02  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1881
1882         [EFL][GTK] Fix build error since r185137
1883         https://bugs.webkit.org/show_bug.cgi?id=145596
1884
1885         Unreviewed, fix build break on EFL and GTK port.
1886
1887         * dom/Text.cpp:
1888         (WebCore::Text::formatForDebugger): Use strncpy() instead of strlcpy().
1889
1890 2015-06-02  Sergio Villar Senin  <svillar@igalia.com>
1891
1892         [CSS Grid Layout] Switch from parenthesis to brackets for grid line names
1893         https://bugs.webkit.org/show_bug.cgi?id=144996
1894
1895         Reviewed by Darin Adler.
1896
1897         Grid line names are now enclosed by brackets instead of parentheses
1898         as mentioned in the latest version of the spec. Appartently the CSS
1899         code is now more readable and avoids issues with tools like SASS.
1900
1901         * css/CSSGrammar.y.in:
1902         * css/CSSGridLineNamesValue.cpp:
1903         (WebCore::CSSGridLineNamesValue::customCSSText):
1904
1905 2015-06-02  Alexey Proskuryakov  <ap@apple.com>
1906
1907         iOS build fix
1908
1909         * platform/spi/mac/AVFoundationSPI.h:
1910
1911 2015-06-02  Commit Queue  <commit-queue@webkit.org>
1912
1913         Unreviewed, rolling out r185128 and r185132.
1914         https://bugs.webkit.org/show_bug.cgi?id=145597
1915
1916         The new test hits a bad assertion (Requested by ap on
1917         #webkit).
1918
1919         Reverted changesets:
1920
1921         "Crash in GraphicsContext3D::getInternalFramebufferSize"
1922         https://bugs.webkit.org/show_bug.cgi?id=145479
1923         http://trac.webkit.org/changeset/185128
1924
1925         "Skip webgl/useWhilePending.html on WebKit 1."
1926         http://trac.webkit.org/changeset/185132
1927
1928 2015-06-02  Ryuan Choi  <ryuan.choi@navercorp.com>
1929
1930         [CoordinatedGraphics] Refactor TiledBackingStoreClient
1931         https://bugs.webkit.org/show_bug.cgi?id=145577
1932
1933         Reviewed by Gyuyoung Kim.
1934
1935         This patch removes and simplifies unnecessary virtual methods of TiledBackingStoreClient.
1936
1937         No new tests, no behavior changes.
1938
1939         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
1940         (WebCore::CoordinatedGraphicsLayer::didUpdateTileBuffers): Renamed from tiledBackingStorePaintEnd.
1941         (WebCore::CoordinatedGraphicsLayer::tiledBackingStorePaintBegin): Deleted.
1942         (WebCore::CoordinatedGraphicsLayer::tiledBackingStorePaintEnd): Deleted.
1943         (WebCore::CoordinatedGraphicsLayer::tiledBackingStoreBackgroundColor):
1944         Deleted because tiledBackingStoreBackgroundColor() is not used anywhere.
1945         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
1946         * platform/graphics/texmap/coordinated/CoordinatedTile.cpp:
1947         (WebCore::CoordinatedTile::updateBackBuffer):
1948         Simplified not to call unnecessary methods. In addition, used modern for loop.
1949         (WebCore::CoordinatedTile::swapBackBufferToFront): Deleted.
1950         * platform/graphics/texmap/coordinated/CoordinatedTile.h:
1951         * platform/graphics/texmap/coordinated/Tile.h:
1952         * platform/graphics/texmap/coordinated/TiledBackingStore.cpp:
1953         (WebCore::TiledBackingStore::updateTileBuffers):
1954         * platform/graphics/texmap/coordinated/TiledBackingStoreClient.h:
1955
1956 2015-06-02  Doug Russell  <d_russell@apple.com>
1957
1958         AX: debugging attributes for text markers
1959         https://bugs.webkit.org/show_bug.cgi?id=145283
1960
1961         Reviewed by Chris Fleizach.
1962
1963         AXTextMarkerDebugDescription: returns the result of
1964         VisiblePosition::formatForDebugger() for the visible position that a text marker
1965         represents.
1966         AXTextMarkerNodeDebugDescription: calls Node::showNode() and
1967         Node::showNodePathForThis() for the visible position that a text marker
1968         represents.
1969         AXTextMarkerNodeTreeDebugDescription: calls Node::showTreeForThis() for the
1970         visible position that a text marker represents.
1971         AXTextMarkerRangeDebugDescription: returns the result of
1972         formatForDebugger(VisiblePositionRange) for the visible position range that a text
1973         marker range represents.
1974
1975         This is debug only tooling. Tests would be flakey and not very helpful.
1976
1977         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1978         (-[WebAccessibilityObjectWrapper debugDescriptionForTextMarker:]):
1979         (-[WebAccessibilityObjectWrapper debugDescriptionForTextMarkerRange:]):
1980         (-[WebAccessibilityObjectWrapper showNodeForTextMarker:]):
1981         (-[WebAccessibilityObjectWrapper showNodeTreeForTextMarker:]):
1982         (formatForDebugger):
1983         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
1984         * dom/Text.cpp:
1985         (WebCore::Text::formatForDebugger):
1986
1987 2015-06-02  Matt Rajca  <mrajca@apple.com>
1988
1989         MediaSessions should keep track of their current state.
1990         https://bugs.webkit.org/show_bug.cgi?id=145575
1991
1992         Reviewed by Alex Christensen.
1993
1994         * Modules/mediasession/MediaSession.h: Per the Media Session spec, the state can be 'Idle', 'Active', or
1995           'Interrupted'. Sessions are created in an 'Idle' state.
1996
1997 2015-06-02  Jon Lee  <jonlee@apple.com>
1998
1999         Build fix when building with internal SDKs
2000         https://bugs.webkit.org/show_bug.cgi?id=145576
2001         rdar://problem/21089476
2002
2003         Reviewed by Alexey Proskuryakov.
2004
2005         * platform/spi/mac/AVFoundationSPI.h: Include the right header.
2006
2007 2015-06-02  Dean Jackson  <dino@apple.com>
2008
2009         No need to guard the sizes attribute against PICTURE_SIZES in preload scanner.
2010         https://bugs.webkit.org/show_bug.cgi?id=145573
2011         <rdar://problem/21210038>
2012
2013         Reviewed by Myles Maxfield.
2014
2015         The PICTURE_SIZES feature flag doesn't need to be used to
2016         guard preloading of the sizes attribute.
2017
2018         * html/parser/HTMLPreloadScanner.cpp:
2019         (WebCore::TokenPreloadScanner::StartTagScanner::processAttributes): Deleted.
2020         (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute): Deleted.
2021
2022 2015-06-02  Anders Carlsson  <andersca@apple.com>
2023
2024         Use UUIDs for WebSQL database filenames instead of a sequential number
2025         https://bugs.webkit.org/show_bug.cgi?id=145571
2026
2027         Reviewed by Dan Bernstein.
2028
2029         This is a first step towards getting rid of the iOS specific code path where we truncate
2030         database files instead of deleting them (in order to avoid file corruption).
2031
2032         * Modules/webdatabase/DatabaseTracker.cpp:
2033         (WebCore::generateDatabaseFileName):
2034         (WebCore::DatabaseTracker::fullPathForDatabaseNoLock):
2035         * platform/sql/SQLiteFileSystem.cpp:
2036         (WebCore::SQLiteFileSystem::getFileNameForNewDatabase): Deleted.
2037         * platform/sql/SQLiteFileSystem.h:
2038
2039 2015-06-02  Dean Jackson  <dino@apple.com>
2040
2041         Crash in GraphicsContext3D::getInternalFramebufferSize
2042         https://bugs.webkit.org/show_bug.cgi?id=145479
2043         <rdar://problem/16461048>
2044
2045         Reviewed by Eric Carlson.
2046
2047         If we are in an unitialized or lost state, don't try to access the context.
2048
2049         In order to test this, I added an Internal setting that always
2050         forces WebGL into a pending state.
2051
2052         Test: fast/canvas/webgl/useWhilePending.html
2053
2054         * html/canvas/WebGLRenderingContextBase.cpp:
2055         (WebCore::WebGLRenderingContextBase::create): Check internal settings for
2056         a forced pending state.
2057         (WebCore::WebGLRenderingContextBase::drawingBufferWidth): Guard against a pending state.
2058         (WebCore::WebGLRenderingContextBase::drawingBufferHeight): Ditto.
2059         * page/Settings.cpp: New Internal setting for forcing a pending policy.
2060         (WebCore::Settings::Settings):
2061         (WebCore::Settings::setForcePendingWebGLPolicy):
2062         * page/Settings.h:
2063         (WebCore::Settings::isForcePendingWebGLPolicy):
2064         * testing/InternalSettings.cpp:
2065         (WebCore::InternalSettings::Backup::Backup):
2066         (WebCore::InternalSettings::Backup::restoreTo):
2067         (WebCore::InternalSettings::setForcePendingWebGLPolicy):
2068         * testing/InternalSettings.h:
2069         * testing/InternalSettings.idl:
2070
2071 2015-06-02  Matt Rajca  <mrajca@apple.com>
2072
2073         Added a stub implementation of MediaSession, part of the Media Session spec.
2074         https://bugs.webkit.org/show_bug.cgi?id=145530
2075
2076         Reviewed by Eric Carlson.
2077
2078         * CMakeLists.txt: Added new MediaSession sources.
2079         * DerivedSources.make:
2080         * Modules/mediasession/MediaSession.cpp: Added stub implementation.
2081         (WebCore::MediaSession::MediaSession): Per the Media Session spec, a Media Remote Controls object should only be
2082           set for 'content' sessions; it is null otherwise.
2083         (WebCore::MediaSession::~MediaSession):
2084         (WebCore::MediaSession::controls):
2085         (WebCore::MediaSession::releaseSession):
2086         * Modules/mediasession/MediaSession.h: Added basic translation of IDL file.
2087         * Modules/mediasession/MediaSession.idl: Added from the Media Session spec.
2088         * WebCore.xcodeproj/project.pbxproj: Added new MediaSession sources.
2089
2090 2015-06-02  Zalan Bujtas  <zalan@apple.com>
2091
2092         Backdrop filter is pulling in content from behind the window.
2093         https://bugs.webkit.org/show_bug.cgi?id=145561
2094         rdar://problem/20909309
2095
2096         Reviewed by Simon Fraser.
2097
2098         This patch ensures that the backdrop filter layer is positioned and sized properly.
2099
2100         The backdrop filter layer should take its size and position from its renderer and not
2101         directly from the composited layer.
2102         In certain cases the composited layer's size is expanded to cover items like box shadow or an absolute positioned descendant.
2103         In such cases, we ended up applying the backdrop filter to those areas as well.
2104
2105         Tests: css3/filters/backdrop/backdrop-filter-does-not-size-properly-absolute.html
2106                css3/filters/backdrop/backdrop-filter-does-not-size-properly-border-and-padding.html
2107
2108         * platform/graphics/GraphicsLayer.h:
2109         (WebCore::GraphicsLayer::setBackdropFiltersRect):
2110         (WebCore::GraphicsLayer::backdropFiltersRect):
2111         * platform/graphics/ca/GraphicsLayerCA.cpp:
2112         (WebCore::GraphicsLayerCA::setBackdropFiltersRect):
2113         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
2114         (WebCore::GraphicsLayerCA::updateBackdropFilters):
2115         (WebCore::GraphicsLayerCA::updateBackdropFiltersRect):
2116         (WebCore::GraphicsLayerCA::updateContentsRects):
2117         (WebCore::GraphicsLayerCA::updateGeometry): Deleted.
2118         * platform/graphics/ca/GraphicsLayerCA.h:
2119         * rendering/RenderLayerBacking.cpp:
2120         (WebCore::RenderLayerBacking::updateBackdropFiltersGeometry):
2121         (WebCore::RenderLayerBacking::updateGeometry):
2122         * rendering/RenderLayerBacking.h:
2123
2124 2015-06-02  Eric Carlson  <eric.carlson@apple.com>
2125
2126         [Mac] occasional crash in Document::playbackTargetAvailabilityDidChange
2127         https://bugs.webkit.org/show_bug.cgi?id=145559
2128
2129         Reviewed by Darin Adler.
2130
2131         No new tests, covered by existing tests.
2132
2133         * html/HTMLMediaElement.cpp:
2134         (WebCore::HTMLMediaElement::registerWithDocument): Pass document to m_mediaSession->registerWithDocument.
2135         (WebCore::HTMLMediaElement::unregisterWithDocument): Pass document to m_mediaSession->unRegisterWithDocument.
2136         (WebCore::HTMLMediaElement::documentWillSuspendForPageCache): Ditto.
2137         (WebCore::HTMLMediaElement::documentDidResumeFromPageCache): Ditto.
2138
2139         * html/MediaElementSession.cpp:
2140         (WebCore::MediaElementSession::registerWithDocument): Take a document.
2141         (WebCore::MediaElementSession::unregisterWithDocument): Ditto.
2142         * html/MediaElementSession.h:
2143
2144 2015-06-02  Chris Dumez  <cdumez@apple.com>
2145
2146         Calling FrameView::viewportContentsChanged() after style recalcs is too expensive
2147         https://bugs.webkit.org/show_bug.cgi?id=145554
2148         <rdar://problem/21189478>
2149
2150         Reviewed by Darin Adler and Simon Fraser.
2151
2152         Only call FrameView::viewportContentsChanged() after a style recalc if
2153         composited layers have been updated (and there is no pending layout).
2154
2155         We already viewportContentsChanged() after layout so we only need to
2156         call viewportContentsChanged() after a style recalc if it did not cause
2157         a layout but may have caused an element to become visible. In
2158         particular, this can happen in the case of composited animations (e.g.
2159         using -webkit-transform to move an element inside the viewport).
2160         Therefore, we now only call viewportContentsChanged() after a style
2161         recalc if it caused composited layers to be updated. This avoids a lot
2162         of unnecessary calls to viewportContentsChanged(), which is expensive.
2163
2164         No new tests, already covered by:
2165         fast/images/animated-gif-webkit-transform.html
2166
2167         * dom/Document.cpp:
2168         (WebCore::Document::recalcStyle):
2169         * page/FrameView.cpp:
2170         (WebCore::FrameView::updateCompositingLayersAfterStyleChange):
2171         * page/FrameView.h:
2172         * rendering/RenderLayerCompositor.cpp:
2173         (WebCore::RenderLayerCompositor::didRecalcStyleWithNoPendingLayout):
2174         (WebCore::RenderLayerCompositor::updateCompositingLayers):
2175         * rendering/RenderLayerCompositor.h:
2176
2177 2015-06-02  Myles C. Maxfield  <mmaxfield@apple.com>
2178
2179         Remove use of CTFontSetRenderingParameters()
2180         https://bugs.webkit.org/show_bug.cgi?id=145560
2181
2182         Reviewed by Simon Fraser.
2183
2184         Instead, always use CTFontSetRenderingStyle().
2185
2186         No new tests because there is no behavior change.
2187
2188         * platform/graphics/cocoa/FontCascadeCocoa.mm:
2189         (WebCore::RenderingStyleSaver::RenderingStyleSaver): Deleted.
2190         (WebCore::RenderingStyleSaver::~RenderingStyleSaver): Deleted.
2191
2192 2015-06-02  Anders Carlsson  <andersca@apple.com>
2193
2194         Move WKFontAntialiasingStateSaver to its own file
2195         https://bugs.webkit.org/show_bug.cgi?id=145557
2196         rdar://problem/21134776
2197
2198         Reviewed by Dan Bernstein.
2199
2200         Also rename it to FontAntialiasingStateSaver. Also, change it to use the CoreGraphicsSPI.h header for its
2201         CGFontAntialiasingStyle definition instead of using an explicit typedef.
2202
2203         * WebCore.xcodeproj/project.pbxproj:
2204         * platform/graphics/ca/mac/PlatformCALayerMac.mm:
2205         (PlatformCALayer::drawLayerContents):
2206         * platform/graphics/ios/FontAntialiasingStateSaver.h: Copied from Source/WebCore/platform/ios/wak/WKGraphics.h.
2207         (WebCore::FontAntialiasingStateSaver::FontAntialiasingStateSaver):
2208         (WebCore::FontAntialiasingStateSaver::setup):
2209         (WebCore::FontAntialiasingStateSaver::restore):
2210         * platform/ios/LegacyTileCache.mm:
2211         (WebCore::LegacyTileCache::drawWindowContent):
2212         * platform/ios/wak/WKGraphics.h:
2213         (WKFontAntialiasingStateSaver::WKFontAntialiasingStateSaver): Deleted.
2214         * platform/ios/wak/WKGraphics.mm:
2215         (WKFontAntialiasingStateSaver::setup): Deleted.
2216         (WKFontAntialiasingStateSaver::restore): Deleted.
2217
2218 2015-06-02  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
2219
2220         [Streams API] Implement ReadableStreamReader read method in closed and errored state
2221         https://bugs.webkit.org/show_bug.cgi?id=144790
2222
2223         Reviewed by Darin Adler.
2224
2225         Reader delegates read() promise handling to its stream except if reader is no longer locking the stream and stream is readable.
2226         Storing of reader read() promise callbacks as a Vector in ReadableStream.
2227         Added resolution/rejection of read() promises in case of errored/closed streams.
2228
2229         Test: streams/readable-stream-reader-read.html
2230
2231         * ForwardingHeaders/runtime/IteratorOperations.h: Added.
2232         * Modules/streams/ReadableStream.cpp:
2233         (WebCore::ReadableStream::cleanCallbacks): Clean the read requests.
2234         (WebCore::ReadableStream::changeStateToClosed): Run success callbacks with undefined for read requests.
2235         (WebCore::ReadableStream::changeStateToErrored): Run failure callbacks with the errors for read requests.
2236         (WebCore::ReadableStream::closed): Parameter name changed.
2237         (WebCore::ReadableStream::read): Added. Succeeds with empty when closed, fails with error when errored, reads a
2238         value if there is one and pushes the callbacks to the queue otherwise.
2239         * Modules/streams/ReadableStream.h:
2240         (WebCore::ReadableStream::ReadCallbacks::ReadCallbacks): Struct containing success and failure callbacks.
2241         * Modules/streams/ReadableStreamReader.cpp:
2242         (WebCore::ReadableStreamReader::closed): Parameter name changed.
2243         (WebCore::ReadableStreamReader::read): Invoke success with empty if we streams if we don't have the right reader
2244         and call the stream otherwise to read.
2245         * Modules/streams/ReadableStreamReader.h:
2246         * bindings/js/JSReadableStreamReaderCustom.cpp:
2247         (WebCore::JSReadableStreamReader::read): Create the callback lambdas and invoke read. Failure rejects the
2248         promise and success creates the result from the read value.
2249         * bindings/js/ReadableJSStream.cpp:
2250         (WebCore::ReadableJSStream::hasValue):
2251         (WebCore::ReadableJSStream::read): Not implemented yet.
2252         * bindings/js/ReadableJSStream.h:
2253
2254 2015-06-01  Myles C. Maxfield  <mmaxfield@apple.com>
2255
2256         [Cocoa] FontPlatformData's equality check should always use reference URLs
2257         https://bugs.webkit.org/show_bug.cgi?id=144168
2258
2259         Reviewed by Tim Horton.
2260
2261         <rdar://problem/18985642> is not fixed, so we need to continue using the older
2262         objectForEqualityCheck().
2263
2264         No new tests because there is no behavior change.
2265
2266         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
2267         (WebCore::FontPlatformData::objectForEqualityCheck):
2268
2269 2015-06-02  Andy Estes  <aestes@apple.com>
2270
2271         [Mac] REGRESSION (r175941): Max.app crashes when adding a sound file to a patch due to removing cursor resources from WebCore.framework
2272         https://bugs.webkit.org/show_bug.cgi?id=145555
2273
2274         Reviewed by Darin Adler.
2275
2276         Re-added the cursor resources used by Max.app and ran sort-Xcode-project-file.
2277
2278         * Resources/copyCursor.png: Added.
2279         * Resources/moveCursor.png: Added.
2280         * Resources/northEastSouthWestResizeCursor.png: Added.
2281         * Resources/northSouthResizeCursor.png: Added.
2282         * Resources/northWestSouthEastResizeCursor.png: Added.
2283         * WebCore.xcodeproj/project.pbxproj:
2284
2285 2015-06-02  Brady Eidson  <beidson@apple.com>
2286
2287         WebKit policy delegate should suggest if a navigation should be allowed to open URLs externally.
2288         rdar://problem/21025301 and https://bugs.webkit.org/show_bug.cgi?id=145280
2289
2290         Reviewed by Alex Christensen.
2291
2292         Tests: loader/navigation-policy/should-open-external-urls/main-frame-click.html
2293                loader/navigation-policy/should-open-external-urls/main-frame-navigated-programatically-by-subframe.html
2294                loader/navigation-policy/should-open-external-urls/main-frame-with-flag-progamatic.html
2295                loader/navigation-policy/should-open-external-urls/main-frame-without-flag-programatic.html
2296                loader/navigation-policy/should-open-external-urls/subframe-click-target-self.html
2297                loader/navigation-policy/should-open-external-urls/subframe-click-target-top.html
2298                loader/navigation-policy/should-open-external-urls/user-gesture-target-blank-with-flag-from-subframe.html
2299                loader/navigation-policy/should-open-external-urls/user-gesture-target-blank-with-flag.html
2300                loader/navigation-policy/should-open-external-urls/user-gesture-target-blank-without-flag-from-subframe.html
2301                loader/navigation-policy/should-open-external-urls/user-gesture-target-blank-without-flag.html
2302                loader/navigation-policy/should-open-external-urls/user-gesture-window-open-with-flag-from-subframe.html
2303                loader/navigation-policy/should-open-external-urls/user-gesture-window-open-with-flag.html
2304                loader/navigation-policy/should-open-external-urls/user-gesture-window-open-without-flag-from-subframe.html
2305                loader/navigation-policy/should-open-external-urls/user-gesture-window-open-without-flag.html
2306                loader/navigation-policy/should-open-external-urls/window-open-with-flag-from-subframe.html
2307                loader/navigation-policy/should-open-external-urls/window-open-with-flag.html
2308                loader/navigation-policy/should-open-external-urls/window-open-without-flag-from-subframe.html
2309                loader/navigation-policy/should-open-external-urls/window-open-without-flag.html
2310
2311         The "should open external URLs" flag is only for main frames.
2312         It doesn't enforce any sort of policy internal to WebKit, but rather is for notifications to the policy delegate.
2313         
2314         It is set from one of two places:
2315         1 - A main frame is navigated by any frame as the result of a user gesture.
2316         2 - WebKit2 API explicitly states the flag is true.
2317         
2318         The flag value propagates when:
2319         1 - When a main frame document is navigated to a new main frame document.
2320         2 - When a new window is opened from a page whose main frame had the flag set.
2321         3 - When a new window is opened as the result of a user gesture.
2322         
2323         The flag resets to false when:
2324         1 - A subframe navigates a main frame without a user gesture.
2325         
2326         This patch is large, but does little more than the following:
2327         1 - Adds a ShouldOpenExternalURLs flag to both FrameLoadRequest and NavigationAction.
2328         2 - Makes sure anybody who creates either of those objects sets a sensible for that flag.
2329         3 - When FrameLoader creates a new DocumentLoader, it sets its flag based on whether or not the load is in a main frame,
2330             whether or not the load is from a user gesture, and based on the initiator's value of the flag. 
2331             
2332         * dom/Document.cpp:
2333         (WebCore::Document::processHttpEquiv):
2334         (WebCore::Document::shouldOpenExternalURLsPolicyToPropagate):
2335         * dom/Document.h:
2336         
2337         * html/HTMLAnchorElement.cpp:
2338         (WebCore::HTMLAnchorElement::handleClick):
2339         
2340         * html/HTMLLinkElement.cpp:
2341         (WebCore::HTMLLinkElement::handleClick):
2342         
2343         * html/parser/XSSAuditorDelegate.cpp:
2344         (WebCore::XSSAuditorDelegate::didBlockScript):
2345         
2346         * inspector/InspectorFrontendClientLocal.cpp:
2347         (WebCore::InspectorFrontendClientLocal::openInNewTab):
2348         
2349         * inspector/InspectorPageAgent.cpp:
2350         (WebCore::InspectorPageAgent::navigate):
2351         
2352         * loader/DocumentLoader.cpp:
2353         (WebCore::DocumentLoader::setTriggeringAction):
2354         (WebCore::DocumentLoader::shouldOpenExternalURLsPolicyToPropagate):
2355         * loader/DocumentLoader.h:
2356         (WebCore::DocumentLoader::shouldOpenExternalURLsPolicy): Deleted.
2357         
2358         * loader/FrameLoadRequest.cpp:
2359         (WebCore::FrameLoadRequest::FrameLoadRequest):
2360         * loader/FrameLoadRequest.h:
2361         (WebCore::FrameLoadRequest::FrameLoadRequest):
2362         
2363         * loader/FrameLoader.cpp:
2364         (WebCore::FrameLoader::urlSelected):
2365         (WebCore::FrameLoader::receivedFirstData):
2366         (WebCore::FrameLoader::loadURLIntoChildFrame):
2367         (WebCore::FrameLoader::loadURL):
2368         (WebCore::FrameLoader::load):
2369         (WebCore::FrameLoader::loadWithNavigationAction):
2370         (WebCore::FrameLoader::reloadWithOverrideEncoding):
2371         (WebCore::FrameLoader::reload):
2372         (WebCore::FrameLoader::loadPostRequest):
2373         (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
2374         (WebCore::FrameLoader::applyShouldOpenExternalURLsPolicyToNewDocumentLoader):
2375         * loader/FrameLoader.h:
2376         
2377         * loader/NavigationAction.cpp:
2378         (WebCore::NavigationAction::NavigationAction):
2379         (WebCore::NavigationAction::copyWithShouldOpenExternalURLsPolicy):
2380         * loader/NavigationAction.h:
2381         (WebCore::NavigationAction::setShouldOpenExternalURLsPolicy): Deleted.
2382         
2383         * loader/NavigationScheduler.cpp:
2384         (WebCore::ScheduledURLNavigation::ScheduledURLNavigation):
2385         (WebCore::ScheduledRedirect::ScheduledRedirect):
2386         (WebCore::ScheduledLocationChange::ScheduledLocationChange):
2387         (WebCore::ScheduledRefresh::ScheduledRefresh):
2388         (WebCore::ScheduledFormSubmission::ScheduledFormSubmission):
2389         (WebCore::NavigationScheduler::scheduleRedirect):
2390         (WebCore::NavigationScheduler::scheduleLocationChange):
2391         (WebCore::NavigationScheduler::scheduleRefresh):
2392         * loader/NavigationScheduler.h:
2393         
2394         * loader/PolicyChecker.cpp:
2395         (WebCore::PolicyChecker::checkNavigationPolicy):
2396         
2397         * loader/SubframeLoader.cpp:
2398         (WebCore::SubframeLoader::loadOrRedirectSubframe):
2399         
2400         * loader/appcache/ApplicationCacheGroup.cpp:
2401         (WebCore::ApplicationCacheGroup::selectCache):
2402         
2403         * page/ContextMenuController.cpp:
2404         (WebCore::openNewWindow):
2405         (WebCore::ContextMenuController::contextMenuItemSelected):
2406         
2407         * page/DOMWindow.cpp:
2408         (WebCore::DOMWindow::setLocation):
2409         (WebCore::DOMWindow::createWindow):
2410         (WebCore::DOMWindow::open):
2411         
2412         * page/DragController.cpp:
2413         (WebCore::DragController::performDragOperation):
2414         
2415         * page/Location.cpp:
2416         (WebCore::Location::reload):
2417         
2418         * replay/ReplayInputDispatchMethods.cpp:
2419         (WebCore::InitialNavigation::dispatch):
2420         
2421         * svg/SVGAElement.cpp:
2422         (WebCore::SVGAElement::defaultEventHandler):
2423
2424 2015-06-02  Yusuke Suzuki  <utatane.tea@gmail.com>
2425
2426         Heap-use-after-free read of size 4 in JavaScriptCore: WTF::StringImpl::isSymbol() (StringImpl.h:496)
2427         https://bugs.webkit.org/show_bug.cgi?id=145532
2428
2429         Reviewed by Geoffrey Garen.
2430
2431         Hold the ownership of AtomicStringImpl*.
2432
2433         * bindings/scripts/CodeGeneratorJS.pm:
2434         (GenerateParametersCheck):
2435         * dom/TreeScope.cpp:
2436         (WebCore::TreeScope::getElementById):
2437
2438 2015-06-02  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2439
2440         SharedBuffer::copy should return a Ref<SharedBuffer>
2441         https://bugs.webkit.org/show_bug.cgi?id=145499
2442
2443         Reviewed by Andreas Kling.
2444
2445         Changing SharedBuffer::copy to return a Ref<> and adapting some code accordingly.
2446
2447         Covered by existing tests.
2448
2449         * loader/SubresourceLoader.cpp:
2450         (WebCore::SubresourceLoader::didReceiveResponse):
2451         * loader/appcache/ApplicationCacheResource.cpp:
2452         (WebCore::ApplicationCacheResource::deliver):
2453         * platform/SharedBuffer.cpp:
2454         (WebCore::SharedBuffer::copy):
2455         * platform/SharedBuffer.h:
2456
2457 2015-06-01  Hunseop Jeong  <hs85.jeong@samsung.com>
2458
2459         Use modern for-loops in WebCore/Modules - 1
2460         https://bugs.webkit.org/show_bug.cgi?id=145507
2461
2462         Reviewed by Darin Adler.
2463
2464         No new tests, no behavior changes.
2465
2466         * Modules/battery/BatteryController.cpp:
2467         (WebCore::BatteryController::~BatteryController):
2468         (WebCore::BatteryController::updateBatteryStatus):
2469         (WebCore::BatteryController::didChangeBatteryStatus):
2470         * Modules/encryptedmedia/CDM.cpp:
2471         (WebCore::CDMFactoryForKeySystem):
2472         * Modules/encryptedmedia/MediaKeys.cpp:
2473         (WebCore::MediaKeys::~MediaKeys):
2474         * Modules/geolocation/Geolocation.cpp:
2475         (WebCore::Geolocation::resumeTimerFired):
2476         (WebCore::Geolocation::resetAllGeolocationPermission):
2477         (WebCore::Geolocation::makeCachedPositionCallbacks):
2478         (WebCore::Geolocation::sendError):
2479         (WebCore::Geolocation::sendPosition):
2480         (WebCore::Geolocation::stopTimer):
2481         (WebCore::Geolocation::cancelRequests):
2482         (WebCore::Geolocation::extractNotifiersWithCachedPosition):
2483         (WebCore::Geolocation::copyToSet):
2484         (WebCore::Geolocation::handlePendingPermissionNotifiers):
2485         * Modules/geolocation/GeolocationController.cpp:
2486         (WebCore::GeolocationController::positionChanged):
2487         (WebCore::GeolocationController::errorOccurred):
2488         * Modules/indexeddb/IDBDatabase.cpp:
2489         (WebCore::IDBDatabase::objectStoreNames):
2490         (WebCore::IDBDatabase::transaction):
2491         (WebCore::IDBDatabase::forceClose):
2492         (WebCore::IDBDatabase::closeConnection):
2493         (WebCore::IDBDatabase::findObjectStoreId):
2494         * Modules/indexeddb/IDBDatabaseBackend.cpp:
2495         (WebCore::IDBDatabaseBackend::runIntVersionChangeTransaction):
2496         (WebCore::IDBDatabaseBackend::deleteDatabase):
2497         (WebCore::IDBDatabaseBackend::close):
2498         * Modules/indexeddb/IDBDatabaseMetadata.cpp:
2499         (WebCore::IDBDatabaseMetadata::isolatedCopy):
2500         (WebCore::IDBObjectStoreMetadata::isolatedCopy):
2501         * Modules/indexeddb/IDBKey.cpp:
2502         (WebCore::IDBKey::isValid):
2503         * Modules/indexeddb/IDBKey.h:
2504         (WebCore::IDBKey::createMultiEntryArray):
2505         (WebCore::IDBKey::createArray):
2506         * Modules/indexeddb/IDBKeyPath.cpp:
2507         (WebCore::IDBKeyPath::IDBKeyPath):
2508         (WebCore::IDBKeyPath::isValid):
2509         (WebCore::IDBKeyPath::isolatedCopy):
2510         * Modules/indexeddb/IDBObjectStore.cpp:
2511         (WebCore::IDBObjectStore::indexNames):
2512         (WebCore::IDBObjectStore::put):
2513         Rename the two 'i's to 'keyData' and 'indexKeyData'.
2514         (WebCore::IDBObjectStore::index):
2515         (WebCore::IDBObjectStore::findIndexId):
2516         * Modules/indexeddb/IDBPendingTransactionMonitor.cpp:
2517         (WebCore::IDBPendingTransactionMonitor::deactivateNewTransactions):
2518         * Modules/indexeddb/IDBRequest.cpp:
2519         (WebCore::IDBRequest::abort):
2520         * Modules/indexeddb/IDBTransaction.cpp:
2521         (WebCore::IDBTransaction::closeOpenCursors):
2522         (WebCore::IDBTransaction::onAbort):
2523         (WebCore::IDBTransaction::dispatchEvent):
2524         * Modules/indexeddb/IDBTransactionBackend.cpp:
2525         (WebCore::IDBTransactionBackend::create):
2526         (WebCore::IDBTransactionBackend::closeOpenCursors):
2527         * Modules/mediasource/MediaSource.cpp:
2528         (WebCore::MediaSource::onReadyStateChange):
2529         * Modules/mediastream/MediaConstraintsImpl.cpp:
2530         (WebCore::MediaConstraintsImpl::initialize):
2531         (WebCore::MediaConstraintsImpl::getMandatoryConstraints):
2532         (WebCore::MediaConstraintsImpl::getOptionalConstraintValue):
2533         * Modules/mediastream/MediaStream.cpp:
2534         (WebCore::MediaStream::create):
2535         (WebCore::MediaStream::cloneMediaStreamTrackVector):
2536         (WebCore::MediaStream::addTrack):
2537         (WebCore::MediaStream::removeTrack):
2538         (WebCore::MediaStream::haveTrackWithSource):
2539         (WebCore::MediaStream::getTrackById):
2540         (WebCore::MediaStream::getTracks):
2541         (WebCore::MediaStream::trackDidEnd):
2542         (WebCore::MediaStream::scheduledEventTimerFired):
2543         * Modules/mediastream/MediaStreamCapabilities.cpp:
2544         (WebCore::MediaStreamCapabilities::sourceType):
2545         (WebCore::MediaStreamCapabilities::sourceId):
2546         (WebCore::MediaStreamCapabilities::facingMode):
2547         * Modules/mediastream/MediaStreamTrack.cpp:
2548         (WebCore::MediaStreamTrack::trackDidEnd):
2549         * Modules/mediastream/MediaStreamTrackSourcesRequest.cpp:
2550         (WebCore::MediaStreamTrackSourcesRequest::didCompleteRequest):
2551
2552 2015-06-01  Myles C. Maxfield  <mmaxfield@apple.com>
2553
2554         [SVG -> OTF Converter] Remove unnecessary hacks
2555         https://bugs.webkit.org/show_bug.cgi?id=145088
2556
2557         Reviewed by Simon Fraser.
2558
2559         Not needed anymore.
2560
2561         Test: svg/text/offset-square-svg-font.html
2562
2563         * svg/SVGToOTFFontConversion.cpp:
2564         (WebCore::SVGToOTFFontConverter::appendKERNTable):
2565         (WebCore::SVGToOTFFontConverter::SVGToOTFFontConverter):
2566
2567 2015-06-01  Andreas Kling  <akling@apple.com>
2568
2569         CSS animations in filling-forwards state shouldn't force compositing.
2570         <https://webkit.org/b/145389>
2571         <rdar://problem/17923642>
2572
2573         Reviewed by Simon Fraser.
2574
2575         Stop checking if a CSS animation is filling forwards when computing
2576         compositing requirements.
2577
2578         This prevents finished animations from pinning elements in composited
2579         state, and frees up a bunch of IOSurface memory on some content.
2580
2581         * page/animation/AnimationBase.h:
2582         (WebCore::AnimationBase::isAnimatingProperty): Deleted.
2583         * rendering/RenderLayerBacking.cpp:
2584         (WebCore::RenderLayerBacking::updateGeometry):
2585         * rendering/RenderLayerCompositor.cpp:
2586         (WebCore::RenderLayerCompositor::requiresCompositingForAnimation):
2587
2588 2015-06-01  Myles C. Maxfield  <mmaxfield@apple.com>
2589
2590         Out of bounds read in WebCore::ComplexTextController::adjustGlyphsAndAdvances
2591         https://bugs.webkit.org/show_bug.cgi?id=145537
2592         <rdar://problem/20959267>
2593
2594         Reviewed by Darin Adler.
2595
2596         U16_IS_SURROGATE_LEAD(ch) assumes U16_IS_SURROGATE(ch). In this case, that isn't true.
2597
2598         Test: fast/text/crash-complex-text-surrogate.html
2599
2600         * platform/graphics/mac/ComplexTextController.cpp:
2601         (WebCore::ComplexTextController::adjustGlyphsAndAdvances):
2602
2603 2015-05-30  Zalan Bujtas  <zalan@apple.com>
2604
2605         REGRESSION (179771): zooming on facebook images covers image
2606         https://bugs.webkit.org/show_bug.cgi?id=145485
2607
2608         Reviewed by Simon Fraser.
2609
2610         Scaling an infinite rect should always produce an infinite rect.
2611         (Based on Simon Fraser's patch)
2612
2613         Test: compositing/layer-creation/zoomed-clip-intersection.html
2614
2615         * platform/graphics/LayoutRect.cpp:
2616         (WebCore::LayoutRect::scale):
2617
2618 2015-06-01  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
2619
2620         Purge PassRefPtr in WebCore/Modules - 3
2621         https://bugs.webkit.org/show_bug.cgi?id=145508
2622
2623         Reviewed by Darin Adler.
2624
2625         As a step to purge PassRefPtr, this patch removes PassRefPtr, then use Ref or RefPtr.
2626
2627         * Modules/indexeddb/IDBCursor.cpp:
2628         (WebCore::IDBCursor::create):
2629         * Modules/indexeddb/IDBCursor.h:
2630         * Modules/indexeddb/IDBCursorBackend.h:
2631         (WebCore::IDBCursorBackend::create):
2632         * Modules/indexeddb/IDBCursorBackendOperations.h:
2633         (WebCore::CursorIterationOperation::create):
2634         (WebCore::CursorAdvanceOperation::create):
2635         * Modules/indexeddb/IDBDatabase.cpp:
2636         (WebCore::IDBDatabase::create):
2637         * Modules/indexeddb/IDBDatabase.h:
2638         * Modules/indexeddb/IDBDatabaseBackend.cpp:
2639         (WebCore::IDBDatabaseBackend::create):
2640         * Modules/indexeddb/IDBDatabaseBackend.h:
2641         * Modules/indexeddb/IDBDatabaseCallbacksImpl.cpp:
2642         (WebCore::IDBDatabaseCallbacksImpl::create):
2643         * Modules/indexeddb/IDBDatabaseCallbacksImpl.h:
2644         * Modules/indexeddb/IDBDatabaseError.h:
2645         (WebCore::IDBDatabaseError::create):
2646         * Modules/indexeddb/IDBIndex.h:
2647         (WebCore::IDBIndex::create):
2648         * Modules/indexeddb/IDBKey.h:
2649         (WebCore::IDBKey::createInvalid):
2650         (WebCore::IDBKey::createNumber):
2651         (WebCore::IDBKey::createString):
2652         (WebCore::IDBKey::createDate):
2653         (WebCore::IDBKey::createArray):
2654         * Modules/indexeddb/IDBKeyRange.cpp:
2655         (WebCore::IDBKeyRange::create):
2656         * Modules/indexeddb/IDBKeyRange.h:
2657         (WebCore::IDBKeyRange::create):
2658         * Modules/indexeddb/IDBObjectStore.cpp:
2659         * Modules/indexeddb/IDBObjectStore.h:
2660         (WebCore::IDBObjectStore::create):
2661         * Modules/indexeddb/IDBOpenDBRequest.cpp:
2662         (WebCore::IDBOpenDBRequest::create):
2663         * Modules/indexeddb/IDBOpenDBRequest.h:
2664         * Modules/indexeddb/IDBRecordIdentifier.h:
2665         (WebCore::IDBRecordIdentifier::create):
2666         * Modules/indexeddb/IDBRequest.cpp:
2667         (WebCore::IDBRequest::create):
2668         (WebCore::IDBRequest::getResultCursor):
2669         * Modules/indexeddb/IDBRequest.h:
2670         * Modules/indexeddb/IDBTransaction.cpp:
2671         (WebCore::IDBTransaction::create):
2672         * Modules/indexeddb/IDBTransaction.h:
2673         * Modules/indexeddb/IDBTransactionBackend.cpp:
2674         (WebCore::IDBTransactionBackend::create):
2675         * Modules/indexeddb/IDBTransactionBackend.h:
2676         * Modules/indexeddb/IDBTransactionBackendOperations.h:
2677         (WebCore::CreateObjectStoreOperation::create):
2678         (WebCore::DeleteObjectStoreOperation::create):
2679         (WebCore::IDBDatabaseBackend::VersionChangeOperation::create):
2680         (WebCore::CreateObjectStoreAbortOperation::create):
2681         (WebCore::DeleteObjectStoreAbortOperation::create):
2682         (WebCore::IDBDatabaseBackend::VersionChangeAbortOperation::create):
2683         (WebCore::CreateIndexOperation::create):
2684         (WebCore::CreateIndexAbortOperation::create):
2685         (WebCore::DeleteIndexOperation::create):
2686         (WebCore::DeleteIndexAbortOperation::create):
2687         (WebCore::GetOperation::create):
2688         (WebCore::PutOperation::create):
2689         (WebCore::SetIndexesReadyOperation::create):
2690         (WebCore::OpenCursorOperation::create):
2691         (WebCore::CountOperation::create):
2692         (WebCore::DeleteRangeOperation::create):
2693         (WebCore::ClearObjectStoreOperation::create):
2694         * Modules/mediasource/VideoPlaybackQuality.cpp:
2695         (WebCore::VideoPlaybackQuality::create):
2696         * Modules/mediasource/VideoPlaybackQuality.h:
2697         * Modules/mediastream/MediaConstraintsImpl.cpp:
2698         (WebCore::MediaConstraintsImpl::create):
2699         * Modules/mediastream/MediaConstraintsImpl.h:
2700         * Modules/mediastream/MediaStream.cpp:
2701         (WebCore::MediaStream::create):
2702         * Modules/mediastream/MediaStream.h:
2703         * Modules/mediastream/RTCDTMFSender.cpp:
2704         (WebCore::RTCDTMFSender::create):
2705         * Modules/mediastream/RTCDTMFSender.h:
2706         * Modules/mediastream/RTCOfferAnswerOptions.cpp:
2707         (WebCore::RTCOfferAnswerOptions::create):
2708         (WebCore::RTCOfferOptions::create):
2709         * Modules/mediastream/RTCOfferAnswerOptions.h:
2710         * Modules/mediastream/RTCPeerConnection.cpp:
2711         (WebCore::RTCPeerConnection::parseConfiguration):
2712         (WebCore::RTCPeerConnection::create):
2713         * Modules/mediastream/RTCPeerConnection.h:
2714         * Modules/webaudio/AudioContext.cpp:
2715         (WebCore::AudioContext::create):
2716         * Modules/webdatabase/AbstractDatabaseServer.h:
2717         * Modules/webdatabase/DOMWindowWebDatabase.cpp:
2718         (WebCore::DOMWindowWebDatabase::openDatabase):
2719         * Modules/webdatabase/DOMWindowWebDatabase.h:
2720         * Modules/webdatabase/DatabaseManager.cpp:
2721         (WebCore::DatabaseManager::existingDatabaseContextFor):
2722         (WebCore::DatabaseManager::databaseContextFor):
2723         (WebCore::DatabaseManager::openDatabase):
2724         * Modules/webdatabase/DatabaseManager.h:
2725         * Modules/webdatabase/DatabaseServer.cpp:
2726         (WebCore::DatabaseServer::openDatabase):
2727         (WebCore::DatabaseServer::createDatabase):
2728         * Modules/webdatabase/DatabaseServer.h:
2729
2730 2015-06-01  Daniel Bates  <dabates@apple.com>
2731
2732         Notify client that we began editing when text field is focused
2733         https://bugs.webkit.org/show_bug.cgi?id=145439
2734         <rdar://problem/21142108>
2735
2736         Reviewed by Anders Carlsson.
2737
2738         Inform the editor client that we began editing when a text field is focused either
2739         by being explicitly focused (programmatically or by user interaction) or implicitly
2740         focused when the window became active.
2741
2742         Currently we only notify the editor client that we began editing a text field when
2743         when a person actually changes the value of the field. And we always notify the
2744         client that we ended editing when a text field is defocused regardless of whether
2745         we executed a began editing callback. Moreover we notify a client that we
2746         ended editing when the field is defocused (either explicitly or implicitly when the
2747         window becomes inactive). Instead we should always notify the client that we began
2748         editing when the field is focused so that this callback is symmetric with the end
2749         editing callback.
2750
2751         * html/SearchInputType.cpp:
2752         (WebCore::SearchInputType::didSetValueByUserEdit): Remove parameter for ValueChangeState,
2753         which was used to determine whether we should notify the client that we began editing, because
2754         we we will notify the client that editing began when the text field is focused as opposed to
2755         when the value of text field first changes.
2756         * html/SearchInputType.h: Ditto.
2757         * html/TextFieldInputType.cpp:
2758         (WebCore::TextFieldInputType::forwardEvent): Notify the client that we began editing when
2759         the text field is focused.
2760         (WebCore::TextFieldInputType::subtreeHasChanged): Update call site of didSetValueByUserEdit()
2761         following the removal of its parameter.
2762         (WebCore::TextFieldInputType::didSetValueByUserEdit): Ditto.
2763         * html/TextFieldInputType.h:
2764
2765 2015-06-01  Anders Carlsson  <andersca@apple.com>
2766
2767         WAKScrollView.h cannot be imported standalone
2768         https://bugs.webkit.org/show_bug.cgi?id=145529
2769
2770         Reviewed by Dan Bernstein.
2771
2772         * page/mac/WebCoreFrameView.h:
2773         Remove the __cplusplus #ifdefs since WebCoreFrameView.h is only used by Objective-C++ code.
2774         (The different non-C++ method declarations were wrong anyway!)
2775
2776         * platform/ScrollTypes.h:
2777         Remove the #ifdef __cplusplus surrounding the code, add header includes to make the file self-contained,
2778         and reformat the enum definitions.
2779
2780 2015-06-01  Alex Christensen  <achristensen@webkit.org>
2781
2782         [Content Extensions] resource-type and load-type should be independent.
2783         https://bugs.webkit.org/show_bug.cgi?id=145528
2784         rdar://problem/21190765
2785
2786         Reviewed by Benjamin Poulain.
2787
2788         Covered by existing tests and a new API test.
2789         
2790         Right now we use the same uint16_t to store all the load-type and resource-type flags,
2791         then we just do a bitwise and to check both at the same time. This results in a trigger
2792         with load-type and resource-type firing if either condition is met, not both conditions.
2793         A trigger with both resource-type and load-type conditions should only fire if both conditions are met.
2794
2795         * contentextensions/DFABytecodeInterpreter.cpp:
2796         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpretTestFlagsAndAppendAction):
2797         Check and correctly handle rules with both resource-type and load-type flags.
2798         * loader/ResourceLoadInfo.h:
2799         Add masks to separate flags from resource-type and load-type.
2800
2801 2015-06-01  Alex Christensen  <achristensen@webkit.org>
2802
2803         [Content Extensions] Reduce DFA memory usage.
2804         https://bugs.webkit.org/show_bug.cgi?id=145526
2805
2806         Reviewed by Benjamin Poulain.
2807
2808         * contentextensions/DFA.cpp:
2809         (WebCore::ContentExtensions::DFA::memoryUsed):
2810         (WebCore::ContentExtensions::DFANode::transitions):
2811         (WebCore::ContentExtensions::DFANode::fallbackTransitionDestination):
2812         (WebCore::ContentExtensions::DFANode::changeFallbackTransition):
2813         (WebCore::ContentExtensions::DFANode::addFallbackTransition):
2814         (WebCore::ContentExtensions::DFANode::containsTransition):
2815         (WebCore::ContentExtensions::DFANode::kill):
2816         * contentextensions/DFA.h:
2817         * contentextensions/DFAMinimizer.cpp:
2818         (WebCore::ContentExtensions::DFAMinimizer::minimize):
2819         * contentextensions/NFAToDFA.cpp:
2820         (WebCore::ContentExtensions::NFAToDFA::convert):
2821         Use separate Vectors for the transition characters and destinations to avoid wasting memory to padding a std::pair.
2822
2823 2015-06-01  Matt Rajca  <mrajca@apple.com>
2824
2825         Implemented the `eventTargetInterface` and `scriptExecutionContext` methods required by EventTarget, as well as
2826         some required infrastructure.
2827         https://bugs.webkit.org/show_bug.cgi?id=145523
2828
2829         Reviewed by Eric Carlson.
2830
2831         * Modules/mediasession/MediaRemoteControls.cpp:
2832         (WebCore::MediaRemoteControls::MediaRemoteControls): Initialize all instance variables.
2833         * Modules/mediasession/MediaRemoteControls.h: MediaRemoteControl's constructor now takes a script execution
2834           context, which we provide to EventTarget. The required eventTargetInterface method has also been implemented.
2835         (WebCore::MediaRemoteControls::create):
2836         * Modules/mediasession/MediaRemoteControls.idl: Indicate MediaRemoteControls now takes a constructor that is
2837           passed in a script execution context. To prevent build errors, event handlers have been removed until they are
2838           implemented.
2839         * WebCore.xcodeproj/project.pbxproj: We should be building the derived JSMediaRemoteControls class with WebCore.
2840         * dom/EventTargetFactory.in: Ensure a MediaRemoteControlsEventTargetInterfaceType is generated.
2841
2842 2015-06-01  Benjamin Poulain  <bpoulain@apple.com>
2843
2844         [CSS JIT] Fail to compile when we are out of executable memory
2845         https://bugs.webkit.org/show_bug.cgi?id=145483
2846         rdar://problem/21166612
2847
2848         Reviewed by Andreas Kling.
2849
2850         We should use a soft failure when the Linker fails to allocate
2851         executable memory for the CSS JIT. We will just fallback to slow
2852         code when that happen, better slow CSS than crashing.
2853
2854         Credit to Chris for finding this problem.
2855
2856         * cssjit/SelectorCompiler.cpp:
2857         (WebCore::SelectorCompiler::SelectorCodeGenerator::compile):
2858
2859 2015-06-01  Chris Dumez  <cdumez@apple.com>
2860
2861         ASSERT(revalidatingResource.inCache()) in MemoryCache when reloading tumblr.com
2862         https://bugs.webkit.org/show_bug.cgi?id=145518
2863         <rdar://problem/21168573>
2864
2865         Reviewed by Darin Adler.
2866
2867         There was an assertion in MemoryCache::revalidationSucceeded() making
2868         sure that the resource that was revalidated is still in the memory
2869         cache. However, nothing prevents this resource from being pruned while
2870         it is being revalidated. We do make sure that the resource in question
2871         cannot be destroyed though (see CachedResource::canDelete()).
2872
2873         This patch gets rid of this assertion as it is incorrect. Also, the
2874         fact that the resource is no longer in the memory cache is not an
2875         issue. We are merely going to call MemoryCache::remove() to remove
2876         it from the memory cache before re-adding it and updating its
2877         HTTP response. The call to MemoryCache::remove() will simply be a
2878         no-op in this case and we will not have any problem adding the
2879         resource back to the memory cache because the resource is kept alive.
2880
2881         Test: http/tests/cache/memory-cache-pruning-during-revalidation.html
2882
2883         * loader/cache/MemoryCache.cpp:
2884         (WebCore::MemoryCache::revalidationSucceeded): Deleted.
2885
2886 2015-06-01  Matt Rajca  <mrajca@apple.com>
2887
2888         Add stub implementation of MediaRemoteControls, part of the Media Session spec.
2889         https://bugs.webkit.org/show_bug.cgi?id=145462
2890
2891         Reviewed by Eric Carlson.
2892
2893         * CMakeLists.txt: Added IDL file as well as the corresponding implementation file.
2894         * DerivedSources.make: Included the new IDL file.
2895         * Modules/mediasession/MediaRemoteControls.cpp: Added an empty implementation file.
2896         (MediaRemoteControls::~MediaRemoteControls):
2897         * Modules/mediasession/MediaRemoteControls.h: Added a stubbed header file with accessors for the four attributes declared in the IDL file.
2898         (WebCore::MediaRemoteControls::previousTrackEnabled):
2899         (WebCore::MediaRemoteControls::setPreviousTrackEnabled):
2900         (WebCore::MediaRemoteControls::nextTrackEnabled):
2901         (WebCore::MediaRemoteControls::setNextTrackEnabled):
2902         (WebCore::MediaRemoteControls::seekForwardEnabled):
2903         (WebCore::MediaRemoteControls::setSeekForwardEnabled):
2904         (WebCore::MediaRemoteControls::seekBackwardEnabled):
2905         (WebCore::MediaRemoteControls::setSeekBackwardEnabled):
2906         * Modules/mediasession/MediaRemoteControls.idl: Added from the Media Session spec.
2907         * WebCore.xcodeproj/project.pbxproj: Included the new IDL file and MediaRemoteControls.cpp/.h sources.
2908
2909 2015-06-01  Sergio Villar Senin  <svillar@igalia.com>
2910
2911         [CSS Grid Layout] Simplify the interface of GridResolvedPosition
2912         https://bugs.webkit.org/show_bug.cgi?id=139077
2913
2914         Reviewed by Darin Adler.
2915
2916         The interface of GridResolvedPosition is full of static methods
2917         that are used only internally, we should not expose them.
2918
2919         Apart from that resolveGridPositionsFromStyle() do always return
2920         a valid GridSpan from now on meaning that the caller has to ensure
2921         that the resolution does not require running the auto-placement
2922         algorithm. A new class called GridUnresolvedSpan was added for
2923         that purpose.
2924
2925         No new tests as this is a refactoring.
2926
2927         * rendering/RenderGrid.cpp:
2928         (WebCore::RenderGrid::placeItemsOnGrid):
2929         (WebCore::RenderGrid::populateExplicitGridAndOrderIterator):
2930         (WebCore::RenderGrid::placeSpecifiedMajorAxisItemsOnGrid):
2931         (WebCore::RenderGrid::placeAutoMajorAxisItemOnGrid):
2932         * rendering/style/GridPosition.h:
2933         * rendering/style/GridResolvedPosition.cpp:
2934         (WebCore::gridLinesForSide):
2935         (WebCore::implicitNamedGridLineForSide):
2936         (WebCore::isNonExistentNamedLineOrArea):
2937         (WebCore::GridUnresolvedSpan::requiresAutoPlacement):
2938         (WebCore::GridUnresolvedSpan::adjustGridPositionsFromStyle):
2939         (WebCore::adjustGridPositionForRowEndColumnEndSide):
2940         (WebCore::adjustGridPositionForSide):
2941         (WebCore::resolveNamedGridLinePositionFromStyle):
2942         (WebCore::firstNamedGridLineBeforePosition):
2943         (WebCore::resolveRowStartColumnStartNamedGridLinePositionAgainstOppositePosition):
2944         (WebCore::resolveRowEndColumnEndNamedGridLinePositionAgainstOppositePosition):
2945         (WebCore::resolveNamedGridLinePositionAgainstOppositePosition):
2946         (WebCore::resolveGridPositionAgainstOppositePosition):
2947         (WebCore::GridResolvedPosition::resolveGridPositionsFromAutoPlacementPosition):
2948         (WebCore::resolveGridPositionFromStyle):
2949         (WebCore::GridResolvedPosition::GridResolvedPosition):
2950         (WebCore::GridResolvedPosition::unresolvedSpanFromStyle):
2951         (WebCore::GridResolvedPosition::resolveGridPositionsFromStyle):
2952         (WebCore::GridResolvedPosition::adjustGridPositionsFromStyle): Deleted.
2953         (WebCore::GridResolvedPosition::resolveNamedGridLinePositionFromStyle): Deleted.
2954         (WebCore::GridResolvedPosition::resolveGridPositionFromStyle): Deleted.
2955         (WebCore::GridResolvedPosition::resolveGridPositionAgainstOppositePosition): Deleted.
2956         (WebCore::GridResolvedPosition::resolveNamedGridLinePositionAgainstOppositePosition): Deleted.
2957         (WebCore::GridResolvedPosition::resolveRowStartColumnStartNamedGridLinePositionAgainstOppositePosition): Deleted.
2958         (WebCore::GridResolvedPosition::resolveRowEndColumnEndNamedGridLinePositionAgainstOppositePosition): Deleted.
2959         * rendering/style/GridResolvedPosition.h:
2960         (WebCore::GridUnresolvedSpan::GridUnresolvedSpan): New class.
2961         (WebCore::GridUnresolvedSpan::initialPosition):
2962         (WebCore::GridUnresolvedSpan::finalPosition):
2963         (WebCore::GridUnresolvedSpan::initialPositionSide):
2964         (WebCore::GridUnresolvedSpan::finalPositionSide):
2965         (WebCore::GridResolvedPosition::adjustGridPositionForRowEndColumnEndSide): Deleted.
2966         (WebCore::GridResolvedPosition::adjustGridPositionForSide): Deleted.
2967         (WebCore::GridResolvedPosition::GridResolvedPosition): Deleted.
2968
2969 2015-06-01  Csaba Osztrogonác  <ossy@webkit.org>
2970
2971         Fix the !ENABLE(VIDEO_TRACK) build after r184799
2972         https://bugs.webkit.org/show_bug.cgi?id=145510
2973
2974         Reviewed by Eric Carlson.
2975
2976         * testing/Internals.cpp:
2977         (WebCore::Internals::userPreferredAudioCharacteristics):
2978         (WebCore::Internals::setUserPreferredAudioCharacteristic):
2979
2980 2015-06-01  Csaba Osztrogonác  <ossy@webkit.org>
2981
2982         Fix logical-not-parentheses warning in CachedScript.cpp
2983         https://bugs.webkit.org/show_bug.cgi?id=145254
2984
2985         Reviewed by Sam Weinig.
2986
2987         * loader/cache/CachedScript.cpp:
2988         (WebCore::CachedScript::mimeTypeAllowedByNosniff): "!X==Y" should be "X!=Y" here.
2989
2990 2015-05-31  Dan Bernstein  <mitz@apple.com>
2991
2992         Remove Panther support
2993         https://bugs.webkit.org/show_bug.cgi?id=145506
2994
2995         Reviewed by Sam Weinig.
2996
2997         * platform/ios/wak/WAKAppKitStubs.h: Don't check for pre-Tiger SDKs.
2998
2999 2015-05-31  Carlos Alberto Lopez Perez  <clopez@igalia.com>
3000
3001         Remove unused variable kZoomTicks.
3002         https://bugs.webkit.org/show_bug.cgi?id=145504
3003
3004         Reviewed by Sam Weinig.
3005
3006         No new tests, no behavior changes.
3007
3008         * platform/ScrollAnimatorNone.cpp:
3009
3010 2015-05-31  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3011
3012         Async XMLHttpRequest should get access to AppCache resources stored as flat files
3013         https://bugs.webkit.org/show_bug.cgi?id=138506
3014
3015         Reviewed by Darin Adler.
3016
3017         This patch reads flat file data when DocumentLoader substituteResource delivery timer is fired.
3018         Refactoring to remove ApplicationCacheHost/DocumentLoader friend link.
3019         Added ResourceLoader::deliverResponseAndData helper function, taking a SharedBuffer as input to remove an unneeded copy for flat files (no change for other files). 
3020
3021         Test: http/tests/appcache/simple-video-async.html
3022
3023         * loader/DocumentLoader.cpp:
3024         (WebCore::DocumentLoader::substituteResourceDeliveryTimerFired):
3025         (WebCore::DocumentLoader::scheduleArchiveLoad):
3026         (WebCore::DocumentLoader::scheduleSubstituteResourceLoad): Helper function to remove ApplicationCacheHost friend link.
3027         * loader/DocumentLoader.h:
3028         * loader/ResourceLoader.cpp:
3029         (WebCore::ResourceLoader::deliverResponseAndData): Helper function, code mostly moved from DocumentLoader::substituteResourceDeliveryTimerFired.
3030         * loader/ResourceLoader.h:
3031         * loader/SubstituteResource.h:
3032         (WebCore::SubstituteResource::deliver): Introduced to be overriden by ApplicationCacheResource to take care of flat file case.
3033         * loader/appcache/ApplicationCacheHost.cpp:
3034         (WebCore::ApplicationCacheHost::maybeLoadResource):
3035         (WebCore::ApplicationCacheHost::scheduleLoadFallbackResourceFromApplicationCache):
3036         * loader/appcache/ApplicationCacheResource.cpp:
3037         (WebCore::ApplicationCacheResource::deliver): Use SharedBuffer::createWithContentsOfFile to load data stored in flat file.
3038         * loader/appcache/ApplicationCacheResource.h:
3039
3040 2015-05-31  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
3041
3042         [Streams API] Implement ReadableStreamController constructor
3043         https://bugs.webkit.org/show_bug.cgi?id=143752
3044
3045         Reviewed by Darin Adler.
3046
3047         Covered by rebased test and expectation.
3048
3049         * Modules/streams/ReadableStreamController.idl: Adding CustomConstructor.
3050         * bindings/js/JSReadableStreamControllerCustom.cpp:
3051         (WebCore::constructJSReadableStreamController): Throws an exception whenever called.
3052
3053 2015-05-30  Brady Eidson  <beidson@apple.com>
3054
3055         Make FrameLoader methods that take PassRefPtr<Event> take raw pointers instead.
3056         https://bugs.webkit.org/show_bug.cgi?id=145495
3057
3058         Reviewed by Alexey Proskuryakov.
3059
3060         No new tests (No change in behavior).
3061
3062         In most cases ownership of the Event is not actually being transferred, and these functions are all rarely called anyways.
3063         
3064         * html/HTMLLinkElement.cpp:
3065         (WebCore::HTMLLinkElement::handleClick):
3066         
3067         * loader/FrameLoader.cpp:
3068         (WebCore::FrameLoader::urlSelected):
3069         (WebCore::FrameLoader::loadFrameRequest):
3070         (WebCore::FrameLoader::loadURL):
3071         (WebCore::FrameLoader::loadPostRequest):
3072         * loader/FrameLoader.h:
3073
3074 2015-05-30  Andreas Kling  <akling@apple.com>
3075
3076         [iOS] Tiling coverage sometimes inflated by outdated scale factor.
3077         <https://webkit.org/b/145494>
3078         <rdar://problem/20989389>
3079
3080         Reviewed by Benjamin Poulain.
3081
3082         Have GraphicsLayerCA plumb the current contents scale through to TileController::adjustCoverageRect()
3083         instead of TileController getting it from TileGrid.
3084
3085         This avoids a situation where adjustCoverageRect() could cause temporarily oversized tiling coverage
3086         if called while TileGrid's content scale is outdated, and we're neither zooming or pinching, following
3087         a pinch zoom that increased the scale factor.
3088
3089         Specifically, if all the velocity data is zero, we pad the coverage rect by a horizontal and vertical
3090         margin computed like so:
3091
3092             margin = defaultTileSize / tileGrid.scale
3093
3094         If the actual scale is 5, but the TileGrid's outdated scale is e.g 0.8, you'll get a much larger
3095         margin than you really wanted. Then the whole thing gets scaled up by 5x later on, and we explode
3096         in a fiery feast of IOSurface allocations.
3097
3098         * platform/graphics/TiledBacking.h:
3099         * platform/graphics/ca/GraphicsLayerCA.cpp:
3100         (WebCore::GraphicsLayerCA::adjustCoverageRect):
3101         * platform/graphics/ca/TileController.cpp:
3102         (WebCore::TileController::computeTileCoverageRect):
3103         * platform/graphics/ca/TileController.h:
3104
3105 2015-05-30  Brady Eidson  <beidson@apple.com>
3106
3107         Fix Windows tests broken by r185007.
3108         https://bugs.webkit.org/show_bug.cgi?id=145472
3109
3110         Unreviewed. Discussed with Alexey Proskuryakov.
3111
3112         No new tests (Fixing the four broken ones should suffice).
3113
3114         The bug was that evaluating arguments in a method/constructor call has no guaranteed sequencing.
3115         
3116         Clang seems to always do LTR, allowing the PassRefPtr to be evaluated as a bool in the call to
3117         navigationType() before it is "consumed" by the PassRefPtr argument.
3118         
3119         In Visual Studio the PassRefPtr consumption happened before the bool evaluation, meaning `false`
3120         was always passed in to navigationType(), breaking the four tests.
3121         
3122         The fix? Using PassRefPtr here was silly in the first place.
3123         No ownership is being transferred.
3124         Raw pointers it is.
3125         
3126         * loader/FrameLoader.cpp:
3127         (WebCore::FrameLoader::loadURL):
3128         (WebCore::FrameLoader::loadPostRequest):
3129         * loader/NavigationAction.cpp:
3130
3131         (WebCore::NavigationAction::NavigationAction):
3132         * loader/NavigationAction.h: Nobody is actually transferring ownership of these Events.
3133           Raw pointers will work just fine, thanks.
3134
3135 2015-05-29  Joseph Pecoraro  <pecoraro@apple.com>
3136
3137         Unreviewed bindings test rebaseline after r185023.
3138
3139         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
3140         (WebCore::isObservable): Deleted.
3141         (WebCore::JSTestGenerateIsReachableOwner::isReachableFromOpaqueRoots): Deleted.
3142
3143 2015-05-29  Andreas Kling  <akling@apple.com>
3144
3145         [iOS] Reduce tiling coverage when doing a pure pinch zoom with no panning.
3146         <https://webkit.org/b/145481>
3147         <rdar://problem/20989389>
3148
3149         Reviewed by Benjamin Poulain.
3150
3151         When we're zooming in with a pinch gesture but not panning the page
3152         at the same time, make the coverage rect be the visible rect.
3153
3154         This reduces memory pressure during zooming, especially on slower
3155         devices that struggle to keep up with the current viewport.
3156
3157         * platform/graphics/ca/TileController.cpp:
3158         (WebCore::TileController::computeTileCoverageRect):
3159
3160 2015-05-29  Keith Miller  <keith_miller@apple.com>
3161
3162         WeakMap reference w/ DOM element as key does not survive long enough.
3163         https://bugs.webkit.org/show_bug.cgi?id=137651
3164
3165         Reviewed by Geoffrey Garen.
3166
3167         Remove isObservable functions as an "unobservable wrappers"
3168         optimization is invalid with WeakMaps. Performance testing
3169         will be done after the code is commited. If major
3170         performance issues occur the patch will be rolled out.
3171
3172         Test: js/dom/weakmap-gc-unobservable-dom-nodes.html
3173
3174         * bindings/js/JSNodeCustom.cpp:
3175         (WebCore::isReachableFromDOM):
3176         (WebCore::JSNodeOwner::isReachableFromOpaqueRoots):
3177         (WebCore::JSNode::insertBefore):
3178         (WebCore::isObservable): Deleted.
3179         * bindings/scripts/CodeGeneratorJS.pm:
3180         (GenerateImplementation):
3181
3182 2015-05-29  Anders Carlsson  <andersca@apple.com>
3183
3184         Get rid of WAKViewPrivate.h
3185         https://bugs.webkit.org/show_bug.cgi?id=145482
3186         rdar://problem/21162149
3187
3188         Reviewed by Dan Bernstein.
3189
3190         Merge WAKViewPrivate.h into WAKViewInternal.h and move the NSView sizing enum
3191         to WAKView.h since that was the only thing WebKit used (indirectly) from WAKViewPrivate.h.
3192
3193         * WebCore.xcodeproj/project.pbxproj:
3194         * platform/WAKViewInternal.h:
3195         (WAKViewForWKViewRef):
3196         * platform/ios/ScrollViewIOS.mm:
3197         * platform/ios/wak/WAKResponder.m:
3198         * platform/ios/wak/WAKView.h:
3199         * platform/ios/wak/WAKView.mm:
3200         * platform/ios/wak/WAKViewPrivate.h: Removed.
3201         (WAKViewForWKViewRef): Deleted.
3202         * platform/ios/wak/WAKWindow.mm:
3203         * platform/ios/wak/WKView.h:
3204         * platform/ios/wak/WKView.mm:
3205
3206 2015-05-29  Daniel Bates  <dabates@apple.com>
3207
3208         Clean up logic for updating caps lock indicator state
3209         https://bugs.webkit.org/show_bug.cgi?id=145329
3210
3211         Reviewed by Sam Weinig.
3212
3213         Remove logic to explicitly update the state of the caps lock indicator, which was used
3214         when the caps logic indicator was implemented as part of RenderTextControl. Currently,
3215         the caps logic indicator is implemented as part of a shadow DOM and we have existing
3216         logic to forward DOM focus and blur events to it so that it may update its state.
3217
3218         No change in behavior.
3219
3220         * editing/FrameSelection.cpp:
3221         (WebCore::FrameSelection::focusedOrActiveStateChanged): Deleted.
3222         * editing/FrameSelection.h:
3223         * page/EventHandler.cpp:
3224         (WebCore::EventHandler::keyEvent): Inline the code from EventHandler::capsLockStateMayHaveChanged()
3225         into this function because it is the only caller of EventHandler::capsLockStateMayHaveChanged() after
3226         we removed the call site in FrameSelection::focusedOrActiveStateChanged().
3227         (WebCore::EventHandler::capsLockStateMayHaveChanged): Deleted.
3228         * page/EventHandler.h:
3229
3230 2015-05-29  Zalan Bujtas  <zalan@apple.com>
3231
3232         Text disappears shortly after page load on Nexus 7 site.
3233         https://bugs.webkit.org/show_bug.cgi?id=145467
3234         rdar://problem/18327239
3235
3236         Reviewed by Simon Fraser.
3237
3238         This patch ensures that overlap testing for composited layers works properly when the sibling
3239         layer gets composited through its child.
3240
3241         When a layer gets composited through its child content, the recursive overlap testing should build up the
3242         overlapmap stack so that sibling content is intersected both against the child and its parent bounds.
3243
3244         Tests: compositing/sibling-layer-does-not-get-composited-overflow-hidden-case.html
3245                compositing/sibling-layer-does-not-get-composited-transform-case.html
3246
3247         * rendering/RenderLayerCompositor.cpp:
3248         (WebCore::RenderLayerCompositor::addToOverlapMapRecursive):
3249         (WebCore::RenderLayerCompositor::OverlapMap::contains): Deleted.
3250
3251 2015-05-29  Brady Eidson  <beidson@apple.com>
3252
3253         Review feedback followup for r185003.
3254         https://bugs.webkit.org/show_bug.cgi?id=145463
3255
3256         Reviewed by Darin Adler.
3257
3258         * platform/sql/SQLiteDatabase.cpp:
3259         (WebCore::SQLiteDatabase::overrideUnauthorizedFunctions): `static const` one thing, c++-style cast another.
3260
3261 2015-05-29  Chris Dumez  <cdumez@apple.com>
3262
3263         WebContent crash in WebCore::Page::sessionID() const + 0 (Page.cpp:1660)
3264         https://bugs.webkit.org/show_bug.cgi?id=145422
3265         <rdar://problem/20613631>
3266
3267         Reviewed by Brady Eidson.
3268
3269         We sometimes crash when destroying a PageCache CachedFrame because its
3270         DocumentLoader is still loading. This should never happen as we are not
3271         supposed to let pages are still have pending loads into the PageCache.
3272
3273         However, we were using DocumentLoader::isLoadingInAPISense() as check
3274         in PageCache::canCachePageContainingThisFrame() which is not exactly
3275         what we want. isLoadingInAPISense() no longer considers subresource
3276         loads once the frame as loaded. This means if the JS triggers a new
3277         load in a subframe after it has been loaded, then isLoadingInAPISense()
3278         will return false, despite the pending load.
3279
3280         This patch replaces the isLoadingInAPISense() check with isLoading()
3281         as this will consider all pending loads, even after the frame is
3282         loaded.
3283
3284         In most cases, using isLoadingInAPISense() was not an issue because
3285         we call DocumentLoader::stopLoading() in all subframes before starting
3286         a provisional load. However, nothing seems to prevent JS from
3287         triggering a new load after that and before the new load gets committed
3288         (which is when we save the page into PageCache).
3289
3290         No new test as we don't have a reliable reproduction case and the
3291         issue is timing related.
3292
3293         * history/PageCache.cpp:
3294         (WebCore::logCanCacheFrameDecision):
3295         (WebCore::PageCache::canCachePageContainingThisFrame):
3296         * page/DiagnosticLoggingKeys.cpp:
3297         (WebCore::DiagnosticLoggingKeys::isLoading):
3298         (WebCore::DiagnosticLoggingKeys::loadingAPISenseKey): Deleted.
3299         * page/DiagnosticLoggingKeys.h:
3300
3301 2015-05-29  Chris Dumez  <cdumez@apple.com>
3302
3303         Consider throttling DOM timers in iframes outside the viewport
3304         https://bugs.webkit.org/show_bug.cgi?id=145465
3305         <rdar://problem/20768957>
3306
3307         Reviewed by Darin Adler.
3308
3309         Throttle DOM timers in iframes that are outside the viewport to decrease
3310         CPU usage, improve performance and reduce power use.
3311
3312         The approach is similar to what we already did for requestAnimationFrame
3313         in r183998.
3314
3315         We already has support for throttling DOM timers at:
3316         - Page level: for backgound pages
3317         - DOM timer level: for timers changing the style of an element outside
3318           the viewport or drawing on a canvas outside the viewport.
3319
3320         This patch adds support for throttling DOM timers at Document level so
3321         we can throttle all timers inside a specific iframe / Document. It relies
3322         on the same timerAlignmentInterval that is used for throttling at Page
3323         level with tweaks so that different Documents inside the same Page can
3324         have a different timerAlignmentInterval.
3325
3326         Test: fast/dom/timer-throttling-subframe.html
3327
3328         * dom/Document.cpp:
3329         (WebCore::Document::setTimerThrottlingEnabled):
3330         (WebCore::Document::timerAlignmentInterval):
3331         * dom/Document.h:
3332         (WebCore::Document::isTimerThrottlingEnabled):
3333         * page/DOMTimer.cpp:
3334         (WebCore::DOMTimer::alignedFireTime):
3335         The previous code was not throttling the timer if its fireTime was in
3336         the past. This was causing some aggressive timers on mashable.com to
3337         not be throttled so I got rid of this behavior. I don't see any reason
3338         why we would not throttle a timer simply because it is supposed to have
3339         fired already.
3340
3341         * page/FrameView.cpp:
3342         (WebCore::FrameView::viewportContentsChanged):
3343         (WebCore::FrameView::updateScriptedAnimationsAndTimersThrottlingState):
3344         * page/FrameView.h:
3345
3346         * testing/Internals.cpp:
3347         (WebCore::Internals::areTimersThrottled):
3348         * testing/Internals.h:
3349         * testing/Internals.idl:
3350         Add API to facilitate layout testing of this functionality.
3351
3352 2015-05-29  Brady Eidson  <beidson@apple.com>
3353
3354         NavigationAction constructor cleanup.
3355         https://bugs.webkit.org/show_bug.cgi?id=145472
3356
3357         Reviewed by Alex Christensen.
3358
3359         No new tests (Refactor, no change in behavior).
3360
3361         * loader/NavigationAction.cpp:
3362         (WebCore::NavigationAction::NavigationAction): Delegate many of the various constructors
3363           to a single full-featured constructor.
3364         * loader/NavigationAction.h:
3365
3366 2015-05-29  Matt Rajca  <mrajca@apple.com>
3367
3368         Rename MediaSession and MediaSessionClient to PlatformMediaSession and PlatformMediaSessionClient so we can use MediaSession for the formal implementation of the Media Session spec.
3369         https://bugs.webkit.org/show_bug.cgi?id=145447
3370
3371         Reviewed by Eric Carlson.
3372
3373         * Modules/webaudio/AudioContext.cpp:
3374         (WebCore::AudioContext::AudioContext):
3375         (WebCore::AudioContext::suspendPlayback):
3376         * Modules/webaudio/AudioContext.h:
3377         * WebCore.vcxproj/WebCore.vcxproj:
3378         * WebCore.vcxproj/WebCore.vcxproj.filters:
3379         * WebCore.xcodeproj/project.pbxproj:
3380         * html/HTMLAudioElement.h:
3381         * html/HTMLMediaElement.cpp:
3382         (WebCore::HTMLMediaElement::pausedForUserInteraction):
3383         (WebCore::HTMLMediaElement::mediaType):
3384         (WebCore::HTMLMediaElement::presentationType):
3385         (WebCore::HTMLMediaElement::displayType):
3386         (WebCore::HTMLMediaElement::didReceiveRemoteControlCommand):
3387         * html/HTMLMediaElement.h:
3388         * html/HTMLMediaSession.cpp:
3389         (WebCore::HTMLMediaSession::HTMLMediaSession):
3390         (WebCore::HTMLMediaSession::requiresFullscreenForVideoPlayback):
3391         * html/HTMLMediaSession.h:
3392         * html/HTMLVideoElement.h:
3393         * platform/RemoteCommandListener.h:
3394         * platform/audio/MediaSessionManager.cpp:
3395         (WebCore::MediaSessionManager::resetRestrictions):
3396         (WebCore::MediaSessionManager::has):
3397         (WebCore::MediaSessionManager::activeAudioSessionRequired):
3398         (WebCore::MediaSessionManager::count):
3399         (WebCore::MediaSessionManager::beginInterruption):
3400         (WebCore::MediaSessionManager::endInterruption):
3401         (WebCore::MediaSessionManager::addSession):
3402         (WebCore::MediaSessionManager::removeSession):
3403         (WebCore::MediaSessionManager::addRestriction):
3404         (WebCore::MediaSessionManager::removeRestriction):
3405         (WebCore::MediaSessionManager::restrictions):
3406         (WebCore::MediaSessionManager::sessionWillBeginPlayback):
3407         (WebCore::MediaSessionManager::sessionWillEndPlayback):
3408         (WebCore::MediaSessionManager::setCurrentSession):
3409         (WebCore::MediaSessionManager::currentSession):
3410         (WebCore::MediaSessionManager::sessionRestrictsInlineVideoPlayback):
3411         (WebCore::MediaSessionManager::sessionCanLoadMedia):
3412         (WebCore::MediaSessionManager::applicationWillEnterBackground):
3413         (WebCore::MediaSessionManager::applicationWillEnterForeground):
3414         (WebCore::MediaSessionManager::didReceiveRemoteControlCommand):
3415         (WebCore::MediaSessionManager::systemWillSleep):
3416         (WebCore::MediaSessionManager::systemDidWake):
3417         * platform/audio/MediaSessionManager.h:
3418         (WebCore::MediaSessionManager::sessions):
3419         * platform/audio/PlatformMediaSession.cpp: Renamed from Source/WebCore/platform/audio/MediaSession.cpp.
3420         (WebCore::stateName):
3421         (WebCore::PlatformMediaSession::create):