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