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