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