-[WKWebView evaluateJavaScript] provides a misleading error when the return cannot...
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-06-12  Alexey Proskuryakov  <ap@apple.com>
2
3         -[WKWebView evaluateJavaScript] provides a misleading error when the return cannot be serialized
4         https://bugs.webkit.org/show_bug.cgi?id=145900
5
6         Reviewed by Sam Weinig.
7
8         * English.lproj/Localizable.strings:
9
10 2015-06-15  Carlos Garcia Campos  <cgarcia@igalia.com>
11
12         [SOUP] Custom URI schemes don't work for requests containing a fragment identifier
13         https://bugs.webkit.org/show_bug.cgi?id=145969
14
15         Reviewed by Sergio Villar Senin.
16
17         For URIs like foo:bar#baz, what the custom protocol manager
18         receives in the UI process is foo:bar, so the user can't handle fragments.
19
20         * platform/network/soup/ResourceRequestSoup.cpp:
21         (WebCore::ResourceRequest::updateSoupRequest): If the SoupRequest
22         is a WebKitSoupRequestGeneric, call
23         webkitSoupRequestGenericSetRequest with the ResourceRequest.
24         * platform/network/soup/WebKitSoupRequestGeneric.cpp:
25         (webkitSoupRequestGenericSetRequest):
26         (webkitSoupRequestGenericGetRequest):
27         * platform/network/soup/WebKitSoupRequestGeneric.h:
28
29 2015-06-15  Carlos Garcia Campos  <cgarcia@igalia.com>
30
31         [SOUP] Move WebKitSoupRequestGeneric to platform layer
32         https://bugs.webkit.org/show_bug.cgi?id=145968
33
34         Reviewed by Sergio Villar Senin.
35
36         * PlatformEfl.cmake:
37         * PlatformGTK.cmake:
38         * platform/network/soup/WebKitSoupRequestGeneric.cpp: Renamed from Source/WebKit2/WebProcess/soup/WebKitSoupRequestGeneric.cpp.
39         (webkitSoupRequestGenericFinalize):
40         (webkit_soup_request_generic_init):
41         (webkitSoupRequestGenericSendAsync):
42         (webkitSoupRequestGenericSendFinish):
43         (webkitSoupRequestGenericGetContentLength):
44         (webkitSoupRequestGenericGetContentType):
45         (webkit_soup_request_generic_class_init):
46         (webkitSoupRequestGenericSetContentLength):
47         (webkitSoupRequestGenericSetContentType):
48         * platform/network/soup/WebKitSoupRequestGeneric.h: Renamed from Source/WebKit2/WebProcess/soup/WebKitSoupRequestGeneric.h.
49         * platform/network/soup/WebKitSoupRequestGenericClient.h: Renamed from Source/WebKit2/WebProcess/soup/WebKitSoupRequestGenericClient.h.
50
51 2015-06-13  Chris Dumez  <cdumez@apple.com>
52
53         [WK2] API::Navigation objects are leaked on history navigation to HistoryItems in PageCache
54         https://bugs.webkit.org/show_bug.cgi?id=145948
55
56         Reviewed by Darin Adler.
57
58         API::Navigation objects were leaked on history navigation to
59         HistoryItems in PageCache. In such case, we would create 2 Navigation
60         objects instead of 1 and the first one would be leaked. The reason
61         we create the second one is because we fail to pass along the
62         navigationID from the UIProcess to the WebProcess and then back to the
63         UIProcess. On the IPC back to the UIProcess, the navigationID ends up
64         being 0 so the UIProcess creates a new Navigation object, thinking that
65         the load was triggered by the WebContent process.
66
67         We now pass along the navigationID, even if the HistoryItem is in the
68         PageCache and we end up reusing the cached DocumentLoader, instead of
69         creating a new one. A new updateCachedDocumentLoader() delegate is
70         added to the FrameLoaderClient, similarly to the pre-existing
71         createDocumentLoader() but for the case where the DocumentLoader gets
72         reused.
73
74         * loader/EmptyClients.h:
75         * loader/FrameLoader.cpp:
76         (WebCore::FrameLoader::loadDifferentDocumentItem):
77         * loader/FrameLoaderClient.h:
78
79 2015-06-13  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
80
81         [Streams API] ReadableJSStream should handle promises returned by JS source start callback
82         https://bugs.webkit.org/show_bug.cgi?id=145792
83
84         Reviewed by Darin Adler.
85
86         Covered by rebased tests.
87
88         When calling start callback, the returned value is checked.
89         If it is not a promise, we do as if it is a resolved promise.
90         If it is a promise, we call its then() method with two resolve/reject JS functions.
91
92         * Modules/streams/ReadableStream.cpp:
93         * bindings/js/ReadableJSStream.cpp:
94         (WebCore::ReadableJSStream::invoke): Returns a JSPromise* if any is returned by the JS source callback.
95         (WebCore::thenPromise): Utility method to call the promise.
96         (WebCore::createStartResultFulfilledFunction): The promise resolve callback.
97         (WebCore::ReadableJSStream::doStart): Calls thenPromise if a JSPromise* is returned by invoke.
98         (WebCore::ReadableJSStream::ReadableJSStream):
99         * bindings/js/ReadableJSStream.h:
100
101 2015-06-13  Andres Gonzalez  <agonzalez334@nc.rr.com>
102
103         AX: WebKit exposes all Ruby Text as Unknown (Japanese EPUB accessibility blocker)
104         https://bugs.webkit.org/show_bug.cgi?id=141303
105
106         Reviewed by Chris Fleizach.
107
108         Test: accessibility/ruby-hierarchy-roles.html
109
110         * accessibility/AccessibilityObject.h:
111         * accessibility/AccessibilityRenderObject.cpp:
112         (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
113         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
114         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
115         (createAccessibilityRoleMap):
116         (-[WebAccessibilityObjectWrapper subrole]):
117
118 2015-06-12  Chris Fleizach  <cfleizach@apple.com>
119
120         AX: iOS: after updating control, VoiceOver speaks aria-expanded states reversed (says "collapsed" when "expanded")
121         https://bugs.webkit.org/show_bug.cgi?id=145943
122
123         Reviewed by Darin Adler.
124
125         iOS Accessibility platform needs to be notified of when aria expanded changes.
126
127         * accessibility/ios/AXObjectCacheIOS.mm:
128         (WebCore::AXObjectCache::postPlatformNotification):
129         * accessibility/ios/WebAccessibilityObjectWrapperIOS.h:
130         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
131         (-[WebAccessibilityObjectWrapper postValueChangedNotification]):
132         (-[WebAccessibilityObjectWrapper postExpandedChangedNotification]):
133         (-[WebAccessibilityObjectWrapper postScrollStatusChangeNotification]):
134
135 2015-06-12  Chris Fleizach  <cfleizach@apple.com>
136
137         AX:ARIA Toggle buttons aren't properly conveyed on iOS using VoiceOver
138         https://bugs.webkit.org/show_bug.cgi?id=145949
139
140         Reviewed by Darin Adler.
141
142         Expose pressed state information to the iOS platform AX API.
143
144         Test: Updated inspector-protocol/dom/getAccessibilityPropertiesForNode.html 
145               There was a FIXME for this issue in that test: https://bugs.webkit.org/show_bug.cgi?id=129830
146
147         * accessibility/AccessibilityNodeObject.cpp:
148         (WebCore::AccessibilityNodeObject::isPressed):
149         * accessibility/AccessibilityObject.cpp:
150         (WebCore::AccessibilityObject::classList):
151         (WebCore::AccessibilityObject::supportsARIAPressed):
152         (WebCore::AccessibilityObject::supportsARIAExpanded):
153         * accessibility/AccessibilityObject.h:
154         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
155         (-[WebAccessibilityObjectWrapper accessibilityARIALiveRegionIsAtomic]):
156         (-[WebAccessibilityObjectWrapper accessibilitySupportsARIAPressed]):
157         (-[WebAccessibilityObjectWrapper accessibilityIsPressed]):
158         (-[WebAccessibilityObjectWrapper accessibilitySupportsARIAExpanded]):
159
160 2015-06-12  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
161
162         Purge PassRefPtr in JavaScriptCore - 2
163         https://bugs.webkit.org/show_bug.cgi?id=145834
164
165         Reviewed by Darin Adler.
166
167         Fix call sites depends on changing of JSC.
168
169         * html/canvas/WebGL2RenderingContext.cpp:
170         (WebCore::WebGL2RenderingContext::getParameter):
171         * html/canvas/WebGLRenderingContext.cpp:
172         (WebCore::WebGLRenderingContext::getParameter):
173         * html/canvas/WebGLRenderingContextBase.cpp:
174         (WebCore::WebGLRenderingContextBase::getUniform):
175         (WebCore::WebGLRenderingContextBase::getVertexAttrib):
176         (WebCore::WebGLRenderingContextBase::getWebGLFloatArrayParameter):
177         (WebCore::WebGLRenderingContextBase::getWebGLIntArrayParameter):
178
179 2015-06-12  Zalan Bujtas  <zalan@apple.com>
180
181         Be more defensive at renderer type checking when initializing flow segments.
182         https://bugs.webkit.org/show_bug.cgi?id=145942
183
184         Reviewed by Simon Fraser.
185
186         FlowContents::initializeSegments should ignore unsupported renderers so that when we miss
187         a simple line layout path invalidation, we don't downcast the unsupported renderer to RenderText.
188
189         I have not reproduced this issue (but related to rdar://problem/21312452)
190
191         * rendering/SimpleLineLayoutFlowContents.cpp:
192         (WebCore::SimpleLineLayout::initializeSegments):
193
194 2015-06-12  Anders Carlsson  <andersca@apple.com>
195
196         deleteEmptyDirectory should delete .DS_Store files on OS X
197         https://bugs.webkit.org/show_bug.cgi?id=145944
198
199         Reviewed by Dan Bernstein.
200
201         deleteEmptyDirectory is often used when clearing website data, so we should
202         take extra care to delete empty directories so the user won't think that clearing
203         website data didn't do anything because it would leave directories with .DS_Store 
204         files behind.
205
206         * platform/mac/FileSystemMac.mm:
207         (WebCore::deleteEmptyDirectory):
208         * platform/posix/FileSystemPOSIX.cpp:
209
210 2015-06-12  Manuel Rego Casasnovas  <rego@igalia.com>
211
212         [CSS Grid Layout] Fix grid-template-areas parsing to avoid spaces
213         https://bugs.webkit.org/show_bug.cgi?id=145860
214
215         Reviewed by Sergio Villar Senin.
216
217         The spec doesn't require to have spaces between unnamed and named areas
218         in grid-template-areas syntax. But spaces are currently required in our
219         code.
220
221         This was confirmed in the CSS WG mailing list:
222         https://lists.w3.org/Archives/Public/www-style/2015May/0239.html
223
224         This patch updates grid-template-areas parsing to allow the possibility
225         of removing spaces between unnamed and named areas.
226
227         Added new cases to fast/css-grid-layout/grid-template-areas-get-set.html.
228
229         * css/CSSParser.cpp:
230         (WebCore::parseGridTemplateAreasColumnNames): New helper method to
231         determine the column names split by white spaces or dots.
232         (WebCore::CSSParser::parseGridTemplateAreasRow): Use the new helper
233         method to get the column names.
234         (WebCore::containsOnlyDots): Deleted. Not needed anymore as
235         parseGridTemplateAreasColumnNames() is using a single dot for unnamed
236         grid areas (despite of being defined with 1 or more dots).
237
238 2015-06-12  Eric Carlson  <eric.carlson@apple.com>
239
240         [Mac] AirPlay menu button doesn't always show on page load
241         https://bugs.webkit.org/show_bug.cgi?id=145936
242
243         Reviewed by Brent Fulgham.
244
245         * Modules/mediasession/WebMediaSessionManager.cpp:
246         (WebCore::mediaProducerStateString): New, return a string representing MediaStateFlags.
247         (WebCore::WebMediaSessionManager::clientStateDidChange): Log the states as strings.
248         (WebCore::WebMediaSessionManager::toString): New, return a string representing ConfigurationTasks.
249         (WebCore::WebMediaSessionManager::scheduleDelayedTask): Add logging.
250         (WebCore::WebMediaSessionManager::taskTimerFired): Add logging.
251         * Modules/mediasession/WebMediaSessionManager.h:
252
253         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h: Override wirelessVideoPlaybackDisabled
254           so it is possible to activate route monitoring for a movie loaded with this engine.
255         * platform/graphics/mac/MediaPlayerPrivateQTKit.h: Ditto.
256
257 2015-06-12  Zan Dobersek  <zdobersek@igalia.com>
258
259         Add the remaining missing override specifiers under Source/WebCore/
260         https://bugs.webkit.org/show_bug.cgi?id=145907
261
262         Reviewed by Darin Adler.
263
264         Fix the remaining compiler warnings about missing override specifiers
265         for overriding method declarations in classes under Source/WebCore/.
266
267         Where the addition had to be performed on all virtual methods of the
268         class, the virtual specifier was removed so now only the override
269         specifier is in use.
270
271         * Modules/indexeddb/IDBOpenDBRequest.h:
272         * Modules/indexeddb/IDBRequest.h:
273         * Modules/webdatabase/DatabaseServer.h:
274         * bindings/js/ReadableJSStream.h:
275         * editing/InsertTextCommand.h:
276         * mathml/MathMLInlineContainerElement.h:
277         * platform/audio/EqualPowerPanner.h:
278         (WebCore::EqualPowerPanner::reset):
279         * platform/graphics/MediaPlayer.cpp:
280         (WebCore::NullMediaPlayerPrivate::load):
281         (WebCore::NullMediaPlayerPrivate::cancelLoad):
282         (WebCore::NullMediaPlayerPrivate::prepareToPlay):
283         (WebCore::NullMediaPlayerPrivate::play):
284         (WebCore::NullMediaPlayerPrivate::pause):
285         (WebCore::NullMediaPlayerPrivate::platformMedia):
286         (WebCore::NullMediaPlayerPrivate::platformLayer):
287         (WebCore::NullMediaPlayerPrivate::naturalSize):
288         (WebCore::NullMediaPlayerPrivate::hasVideo):
289         (WebCore::NullMediaPlayerPrivate::hasAudio):
290         (WebCore::NullMediaPlayerPrivate::setVisible):
291         (WebCore::NullMediaPlayerPrivate::durationDouble):
292         (WebCore::NullMediaPlayerPrivate::currentTimeDouble):
293         (WebCore::NullMediaPlayerPrivate::seekDouble):
294         (WebCore::NullMediaPlayerPrivate::seeking):
295         (WebCore::NullMediaPlayerPrivate::setRateDouble):
296         (WebCore::NullMediaPlayerPrivate::setPreservesPitch):
297         (WebCore::NullMediaPlayerPrivate::paused):
298         (WebCore::NullMediaPlayerPrivate::setVolumeDouble):
299         (WebCore::NullMediaPlayerPrivate::supportsMuting):
300         (WebCore::NullMediaPlayerPrivate::setMuted):
301         (WebCore::NullMediaPlayerPrivate::hasClosedCaptions):
302         (WebCore::NullMediaPlayerPrivate::setClosedCaptionsVisible):
303         (WebCore::NullMediaPlayerPrivate::networkState):
304         (WebCore::NullMediaPlayerPrivate::readyState):
305         (WebCore::NullMediaPlayerPrivate::maxTimeSeekableDouble):
306         (WebCore::NullMediaPlayerPrivate::minTimeSeekable):
307         (WebCore::NullMediaPlayerPrivate::buffered):
308         (WebCore::NullMediaPlayerPrivate::totalBytes):
309         (WebCore::NullMediaPlayerPrivate::didLoadingProgress):
310         (WebCore::NullMediaPlayerPrivate::setSize):
311         (WebCore::NullMediaPlayerPrivate::canLoadPoster):
312         (WebCore::NullMediaPlayerPrivate::setPoster):
313         (WebCore::NullMediaPlayerPrivate::hasSingleSecurityOrigin):
314         * platform/graphics/filters/DistantLightSource.h:
315         * platform/graphics/filters/FEComposite.h:
316         * platform/graphics/filters/FEDisplacementMap.h:
317         (WebCore::FEDisplacementMap::determineAbsolutePaintRect):
318         * platform/graphics/filters/FEFlood.h:
319         (WebCore::FEFlood::determineAbsolutePaintRect):
320         * platform/graphics/filters/PointLightSource.h:
321         * platform/graphics/filters/SpotLightSource.h:
322         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
323         (WebCore::MediaPlayerPrivateGStreamer::hasVideo):
324         (WebCore::MediaPlayerPrivateGStreamer::hasAudio):
325         (WebCore::MediaPlayerPrivateGStreamer::audioSourceProvider):
326         (WebCore::MediaPlayerPrivateGStreamer::engineDescription):
327         (WebCore::MediaPlayerPrivateGStreamer::isLiveStream):
328         (WebCore::MediaPlayerPrivateGStreamer::totalVideoFrames):
329         (WebCore::MediaPlayerPrivateGStreamer::droppedVideoFrames):
330         (WebCore::MediaPlayerPrivateGStreamer::corruptedVideoFrames):
331         (WebCore::MediaPlayerPrivateGStreamer::totalFrameDelay):
332         * platform/graphics/texmap/BitmapTextureGL.h:
333         (WebCore::BitmapTextureGL::isBackedByOpenGL):
334         * platform/graphics/transforms/Matrix3DTransformOperation.h:
335         * platform/graphics/transforms/MatrixTransformOperation.h:
336         * platform/graphics/transforms/PerspectiveTransformOperation.h:
337         * platform/graphics/transforms/RotateTransformOperation.h:
338         * platform/graphics/transforms/ScaleTransformOperation.h:
339         * platform/graphics/transforms/SkewTransformOperation.h:
340         * platform/image-decoders/png/PNGImageDecoder.h:
341         (WebCore::PNGImageDecoder::filenameExtension):
342         * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.h:
343         * platform/mock/MockRealtimeMediaSourceCenter.h:
344
345 2015-06-12  Commit Queue  <commit-queue@webkit.org>
346
347         Unreviewed, rolling out r185512.
348         https://bugs.webkit.org/show_bug.cgi?id=145932
349
350         Many asserts on layout tests and on API tests (Requested by
351         ap_ on #webkit).
352
353         Reverted changeset:
354
355         "Use modern for-loops in WebCore/rendering - 1"
356         https://bugs.webkit.org/show_bug.cgi?id=145831
357         http://trac.webkit.org/changeset/185512
358
359 2015-06-12  Simon Fraser  <simon.fraser@apple.com>
360
361         OpenGLESSPI.h doesn't need to include UIKit.h
362         https://bugs.webkit.org/show_bug.cgi?id=145931
363
364         Reviewed by Darin Adler.
365
366         No need to suck in all of UIKit from OpenGLESSPI.h.
367
368         * platform/spi/ios/OpenGLESSPI.h:
369
370 2015-06-12  Matt Rajca  <mrajca@apple.com>
371
372         Add barebones implementation of media session invocation algorithm.
373         https://bugs.webkit.org/show_bug.cgi?id=145847
374
375         Reviewed by Darin Adler.
376
377         * Modules/mediasession/MediaSession.cpp:
378         (WebCore::MediaSession::invoke): Move the media session to an active state.
379         * Modules/mediasession/MediaSession.h:
380         * html/HTMLMediaElement.cpp:
381         (WebCore::HTMLMediaElement::playInternal): Call the media session invocation algorithm as described in the
382           Media Session spec.
383
384 2015-06-12  Hunseop Jeong  <hs85.jeong@samsung.com>
385
386         Use modern for-loops in WebCore/rendering - 1
387         https://bugs.webkit.org/show_bug.cgi?id=145831
388
389         Reviewed by Darin Adler.
390
391         No new tests because there is no behavior change.
392
393         * rendering/AutoTableLayout.cpp:
394         (WebCore::AutoTableLayout::computeIntrinsicLogicalWidths):
395         (WebCore::AutoTableLayout::calcEffectiveLogicalWidth):
396         * rendering/FilterEffectRenderer.cpp:
397         (WebCore::FilterEffectRenderer::build):
398         (WebCore::FilterEffectRenderer::clearIntermediateResults):
399         * rendering/FilterEffectRenderer.h:
400         * rendering/FloatingObjects.cpp:
401         (WebCore::FloatingObjects::clearLineBoxTreePointers):
402         (WebCore::FloatingObjects::moveAllToFloatInfoMap):
403         (WebCore::FloatingObjects::computePlacedFloatsTree):
404         * rendering/FlowThreadController.cpp:
405         (WebCore::FlowThreadController::collectFixedPositionedLayers):
406         * rendering/HitTestResult.cpp:
407         (WebCore::HitTestResult::append):
408         * rendering/ImageQualityController.cpp:
409         (WebCore::ImageQualityController::highQualityRepaintTimerFired):
410         * rendering/InlineTextBox.cpp:
411         (WebCore::InlineTextBox::paint):
412         * rendering/RenderBlock.cpp:
413         (WebCore::removeBlockFromDescendantAndContainerMaps):
414         (WebCore::RenderBlock::addOverflowFromPositionedObjects):
415         (WebCore::RenderBlock::dirtyForLayoutFromPercentageHeightDescendants):
416         (WebCore::RenderBlock::simplifiedNormalFlowLayout):
417         (WebCore::RenderBlock::layoutPositionedObjects):
418         (WebCore::RenderBlock::markPositionedObjectsForLayout):
419         (WebCore::RenderBlock::paintContinuationOutlines):
420         (WebCore::clipOutPositionedObjects):
421         (WebCore::RenderBlock::removeFromTrackedRendererMaps):
422         (WebCore::RenderBlock::removePositionedObjects):
423         (WebCore::RenderBlock::checkPositionedObjectsNeedLayout):
424         * rendering/RenderBlockFlow.cpp:
425         (WebCore::RenderBlockFlow::rebuildFloatingObjectSetFromIntrudingFloats):
426         (WebCore::RenderBlockFlow::styleDidChange):
427         (WebCore::RenderBlockFlow::moveFloatsTo):
428         (WebCore::RenderBlockFlow::addOverflowFromFloats):
429         (WebCore::RenderBlockFlow::repaintOverhangingFloats):
430         (WebCore::RenderBlockFlow::paintFloats):
431         (WebCore::RenderBlockFlow::clipOutFloatingObjects):
432         (WebCore::RenderBlockFlow::lowestFloatLogicalBottom):
433         (WebCore::RenderBlockFlow::lowestInitialLetterLogicalBottom):
434         (WebCore::RenderBlockFlow::addOverhangingFloats):
435         (WebCore::RenderBlockFlow::addIntrudingFloats):
436         (WebCore::RenderBlockFlow::markSiblingsWithFloatsForLayout):
437         (WebCore::RenderBlockFlow::adjustForBorderFit):
438         * rendering/RenderBlockLineLayout.cpp:
439         (WebCore::setLogicalWidthForTextRun):
440         (WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
441         (WebCore::RenderBlockFlow::linkToEndLineIfNeeded):
442         (WebCore::RenderBlockFlow::repaintDirtyFloats):
443         (WebCore::RenderBlockFlow::layoutLineBoxes):
444         (WebCore::RenderBlockFlow::checkFloatsInCleanLine):
445         (WebCore::RenderBlockFlow::determineStartPosition):
446         (WebCore::RenderBlockFlow::checkPaginationAndFloatsAtEndLine):
447         * rendering/RenderCounter.cpp:
448         (WebCore::RenderCounter::destroyCounterNodes):
449         (WebCore::updateCounters):
450         (WebCore::RenderCounter::rendererStyleChanged):
451         * rendering/RenderFlexibleBox.cpp:
452         (WebCore::RenderFlexibleBox::autoMarginOffsetInMainAxis):
453         (WebCore::RenderFlexibleBox::freezeViolations):
454         (WebCore::RenderFlexibleBox::resolveFlexibleLengths):
455         (WebCore::RenderFlexibleBox::numberOfInFlowPositionedChildren):
456         (WebCore::RenderFlexibleBox::layoutColumnReverse):
457         (WebCore::RenderFlexibleBox::alignFlexLines):
458         (WebCore::RenderFlexibleBox::alignChildren):
459         (WebCore::RenderFlexibleBox::flipForWrapReverse):
460         * rendering/RenderFlowThread.cpp:
461         (WebCore::RenderFlowThread::updateAllLayerToRegionMappings):
462         * rendering/RenderInline.cpp:
463         (WebCore::RenderInline::addAnnotatedRegions):
464         * rendering/RenderLayer.cpp:
465         (WebCore::RenderLayer::updateDescendantsAreContiguousInStackingOrder):
466         (WebCore::RenderLayer::updateDescendantDependentFlags):
467         * rendering/RenderLayerBacking.cpp:
468         (WebCore::descendantLayerPaintsIntoAncestor):
469         (WebCore::RenderLayerBacking::startAnimation):
470         * rendering/RenderLineBoxList.cpp:
471         (WebCore::RenderLineBoxList::paint):
472         * rendering/RenderListBox.cpp:
473         (WebCore::RenderListBox::updateFromElement):
474         * rendering/RenderMenuList.cpp:
475         (WebCore::selectedOptionCount):
476         (RenderMenuList::updateOptionsWidth):
477         * rendering/RenderMultiColumnSet.cpp:
478         (WebCore::RenderMultiColumnSet::distributeImplicitBreaks):
479
480 2015-06-12  Csaba Osztrogonác  <ossy@webkit.org>
481
482         Fix unused private field warning in ResourceHandleSoup.cpp
483         https://bugs.webkit.org/show_bug.cgi?id=145910
484
485         Reviewed by Darin Adler.
486
487         * platform/network/soup/ResourceHandleSoup.cpp:
488
489 2015-06-12  Joseph Pecoraro  <pecoraro@apple.com>
490
491         Web Inspector: CRASH trying to inspect text that was removed/replaced
492         https://bugs.webkit.org/show_bug.cgi?id=145898
493
494         Reviewed by Darin Adler.
495
496         * inspector/InspectorDOMAgent.cpp:
497         (WebCore::InspectorDOMAgent::inspect):
498         (WebCore::InspectorDOMAgent::focusNode):
499         Ensure we only cause focusNode with a node to focus. If the original
500         node that was provided is no longer in the document, then we won't
501         actually find a node to inspect.
502
503 2015-06-12  KwangHyuk Kim  <hyuki.kim@samsung.com>
504
505         [EFL] canvas/philip/tests/toDataURL.jpeg.foo tests have been failed since r185417.
506         https://bugs.webkit.org/show_bug.cgi?id=145878
507
508         Reviewed by Gyuyoung Kim.
509
510         Fix input buffer alignment issue.
511
512         No new tests, canvas/philip/tests/toDataURL.jpeg.foo can be used.
513
514         * platform/graphics/efl/ImageBufferEfl.cpp:
515         (WebCore::encodeImagePNG):
516         (WebCore::encodeImageJPEG):
517         (WebCore::ImageBuffer::toDataURL):
518
519 2015-06-12  Zan Dobersek  <zdobersek@igalia.com>
520
521         Add missing override specifiers under Source/WebCore/svg/
522         https://bugs.webkit.org/show_bug.cgi?id=145841
523
524         Reviewed by Darin Adler.
525
526         Add missing override specifiers to virtual method overrides for classes
527         under Source/WebCore/svg/, suppressing a bunch of warnings when compiling
528         with Clang 3.6.
529
530         Add the BEGIN_DECLARE_ANIMATED_PROPERTIES_BASE() macro that doesn't
531         override the localAttributeToPropertyMap() method declaration, and
532         have the BEGIN_DECLARE_ANIMATED_PROPERTIES() macro add the override
533         specifier. The new macro is used in SVGElement.
534
535         Change the DECLARE_ANIMATED_PROPERTY() to accept the optional override
536         specifier as the fifth parameter. Current DECLARE_ANIMATED_*() macros
537         are modified to just pass an empty argument, not adding any specifier.
538         DECLARE_ANIMATED_BOOLEAN_OVERRIDE() and DECLARE_ANIMATED_STRING_OVERRIDE()
539         macros are added to override the methods for the externalResourcesRequired
540         and href animated properties, where required.
541
542         * svg/SVGAElement.h:
543         * svg/SVGAltGlyphElement.h:
544         * svg/SVGAnimatedAngle.h:
545         * svg/SVGAnimatedBoolean.h:
546         * svg/SVGAnimatedEnumeration.h:
547         * svg/SVGAnimatedInteger.h:
548         * svg/SVGAnimatedLength.h:
549         * svg/SVGAnimatedNumber.h:
550         * svg/SVGAnimatedPreserveAspectRatio.h:
551         * svg/SVGAnimatedRect.h:
552         * svg/SVGAnimatedString.h:
553         * svg/SVGAnimationElement.h:
554         * svg/SVGCircleElement.h:
555         * svg/SVGClipPathElement.h:
556         * svg/SVGCursorElement.h:
557         * svg/SVGDefsElement.h:
558         * svg/SVGElement.h:
559         * svg/SVGEllipseElement.h:
560         * svg/SVGFEImageElement.h:
561         * svg/SVGFilterElement.h:
562         * svg/SVGFontElement.h:
563         * svg/SVGForeignObjectElement.h:
564         * svg/SVGGElement.h:
565         * svg/SVGGlyphRefElement.h:
566         * svg/SVGGradientElement.h:
567         * svg/SVGImageElement.h:
568         * svg/SVGLineElement.h:
569         * svg/SVGMPathElement.h:
570         * svg/SVGMarkerElement.h:
571         * svg/SVGMaskElement.h:
572         * svg/SVGPathElement.h:
573         * svg/SVGPatternElement.h:
574         * svg/SVGPolyElement.h:
575         * svg/SVGRectElement.h:
576         * svg/SVGSVGElement.h:
577         * svg/SVGScriptElement.h:
578         * svg/SVGSwitchElement.h:
579         * svg/SVGSymbolElement.h:
580         * svg/SVGTRefElement.h:
581         * svg/SVGTextContentElement.h:
582         * svg/SVGTextPathElement.h:
583         * svg/SVGURIReference.h: Add the hrefBaseValue() pure virtual method
584         so it can be overridden by any class that also overrides the
585         corresponding setHrefBaseValue() method.
586         * svg/SVGUseElement.h:
587         * svg/SVGViewElement.h:
588         * svg/properties/SVGAnimatedPropertyMacros.h:
589         * svg/properties/SVGMatrixTearOff.h:
590         (WebCore::SVGMatrixTearOff::commitChange):
591
592 2015-06-12  Zan Dobersek  <zdobersek@igalia.com>
593
594         [GLib] Move files under Source/WTF/wtf/gobject to Source/WTF/wtf/glib
595         https://bugs.webkit.org/show_bug.cgi?id=145799
596
597         Reviewed by Carlos Garcia Campos.
598
599         Update header inclusions for headers that have been moved
600         to Source/WTF/wtf/glib/.
601
602         * accessibility/atk/AXObjectCacheAtk.cpp:
603         * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
604         * bindings/gobject/DOMObjectCache.cpp:
605         * bindings/gobject/GObjectEventListener.h:
606         * bindings/gobject/GObjectNodeFilterCondition.h:
607         * bindings/gobject/GObjectXPathNSResolver.h:
608         * bindings/gobject/WebKitDOMEventTarget.cpp:
609         * platform/Pasteboard.h:
610         * platform/audio/gstreamer/AudioDestinationGStreamer.cpp:
611         * platform/audio/gstreamer/AudioFileReaderGStreamer.cpp:
612         * platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp:
613         * platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:
614         * platform/audio/gtk/AudioBusGtk.cpp:
615         * platform/geoclue/GeolocationProviderGeoclue.h:
616         * platform/geoclue/GeolocationProviderGeoclue2.cpp:
617         * platform/glib/BatteryProviderUPower.cpp:
618         * platform/glib/BatteryProviderUPower.h:
619         * platform/graphics/gstreamer/GRefPtrGStreamer.h:
620         * platform/graphics/gstreamer/GStreamerUtilities.cpp:
621         * platform/graphics/gstreamer/GUniquePtrGStreamer.h:
622         * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.h:
623         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
624         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
625         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
626         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
627         * platform/graphics/gstreamer/MediaSourceGStreamer.cpp:
628         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
629         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h:
630         * platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
631         * platform/graphics/gstreamer/WebKitMediaSourceGStreamer.cpp:
632         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
633         * platform/graphics/gtk/ImageBufferGtk.cpp:
634         * platform/graphics/gtk/ImageGtk.cpp:
635         * platform/gtk/ContextMenuGtk.cpp:
636         * platform/gtk/ContextMenuItemGtk.cpp:
637         * platform/gtk/DataObjectGtk.cpp:
638         * platform/gtk/DataObjectGtk.h:
639         * platform/gtk/FileSystemGtk.cpp:
640         * platform/gtk/GRefPtrGtk.h:
641         * platform/gtk/GUniquePtrGtk.h:
642         * platform/gtk/GamepadsGtk.cpp:
643         * platform/gtk/GtkUtilities.cpp:
644         * platform/gtk/LanguageGtk.cpp:
645         * platform/gtk/LocalizedStringsGtk.cpp:
646         * platform/gtk/PasteboardHelper.cpp:
647         * platform/gtk/ScrollbarThemeGtk.cpp:
648         * platform/gtk/SharedBufferGtk.cpp:
649         * platform/gtk/SharedTimerGtk.cpp:
650         * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp:
651         * platform/network/ResourceHandleInternal.h:
652         * platform/network/gtk/CredentialBackingStore.cpp:
653         * platform/network/soup/CertificateInfo.h:
654         * platform/network/soup/CookieJarSoup.cpp:
655         * platform/network/soup/DNSSoup.cpp:
656         * platform/network/soup/GRefPtrSoup.h:
657         * platform/network/soup/GUniquePtrSoup.h:
658         * platform/network/soup/ResourceError.h:
659         * platform/network/soup/ResourceErrorSoup.cpp:
660         * platform/network/soup/ResourceHandleSoup.cpp:
661         * platform/network/soup/ResourceResponse.h:
662         * platform/network/soup/SocketStreamHandle.h:
663         * platform/network/soup/SocketStreamHandleSoup.cpp:
664         * platform/network/soup/SoupNetworkSession.h:
665         * platform/text/gtk/HyphenationLibHyphen.cpp:
666         * rendering/RenderThemeGtk.cpp:
667
668 2015-06-12  Yoav Weiss  <yoav@yoav.ws>
669
670         Fix the build when the PICTURE_SIZES flag is off
671         https://bugs.webkit.org/show_bug.cgi?id=145926
672
673         Reviewed by Csaba Osztrogonác.
674
675         No new tests since there's no functionality change.
676
677         * html/parser/HTMLPreloadScanner.cpp: Remove the guard around the definition of m_sizesAttribute.
678
679 2015-06-12  Commit Queue  <commit-queue@webkit.org>
680
681         Unreviewed, rolling out r185492.
682         https://bugs.webkit.org/show_bug.cgi?id=145927
683
684         Causes crashes on debug (Requested by rego on #webkit).
685
686         Reverted changeset:
687
688         "[CSS Grid Layout] Fix grid-template-areas parsing to avoid
689         spaces"
690         https://bugs.webkit.org/show_bug.cgi?id=145860
691         http://trac.webkit.org/changeset/185492
692
693 2015-06-12  Youenn Fablet  <youenn.fablet@crf.canon.fr>
694
695         Bindings generator should generate code for Promise-based APIs
696         https://bugs.webkit.org/show_bug.cgi?id=145833
697
698         Reviewed by Darin Adler.
699
700         Covered by existing tests.
701
702         * Modules/webaudio/AudioContext.idl: Removing custom binding for resume, suspend and close.
703         * bindings/js/JSAudioContextCustom.cpp: Ditto.
704         * bindings/scripts/CodeGeneratorJS.pm:
705         (GenerateHeader): Refactoring to use IsReturningPromise.
706         (GenerateImplementation): Disabling include for return type if it is a promise.
707         (GenerateParametersCheck): Adding DeferredWrapper() as argument to the DOM method if JS method returns a promise.
708         (GenerateImplementationFunctionCall): Added support for promise-returning API.
709         (IsReturningPromise): Checking whether function is returning a promise.
710         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
711         (webkit_dom_test_obj_test_promise_function):
712         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
713         * bindings/scripts/test/JS/JSTestObj.cpp:
714         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunction):
715         * bindings/scripts/test/ObjC/DOMTestObj.h:
716         * bindings/scripts/test/ObjC/DOMTestObj.mm:
717         (-[DOMTestObj testPromiseFunction]):
718         * bindings/scripts/test/TestObj.idl: Adding promise returning function.
719
720
721 2015-06-12  Manuel Rego Casasnovas  <rego@igalia.com>
722
723         [CSS Grid Layout] Fix grid-template-areas parsing to avoid spaces
724         https://bugs.webkit.org/show_bug.cgi?id=145860
725
726         Reviewed by Sergio Villar Senin.
727
728         The spec doesn't require to have spaces between unnamed and named areas
729         in grid-template-areas syntax. But spaces are currently required in our
730         code.
731
732         This was confirmed in the CSS WG mailing list:
733         https://lists.w3.org/Archives/Public/www-style/2015May/0239.html
734
735         This patch updates grid-template-areas parsing to allow the possibility
736         of removing spaces between unnamed and named areas.
737
738         Added new cases to fast/css-grid-layout/grid-template-areas-get-set.html.
739
740         * css/CSSParser.cpp:
741         (WebCore::parseGridTemplateAreasColumnNames): New helper method to
742         determine the column names split by white spaces or dots.
743         (WebCore::CSSParser::parseGridTemplateAreasRow): Use the new helper
744         method to get the column names.
745         (WebCore::containsOnlyDots): Deleted. Not needed anymore as
746         parseGridTemplateAreasColumnNames() is using a single dot for unnamed
747         grid areas (despite of being defined with 1 or more dots).
748
749 2015-06-11  Mark Lam  <mark.lam@apple.com>
750
751         WebCore::reportException() needs to be able to accept a raw thrown value in addition to Exception objects.
752         https://bugs.webkit.org/show_bug.cgi?id=145872
753
754         Reviewed by Michael Saboff.
755
756         API test added: WebKit1.ReportExceptionTest.
757
758         * bindings/js/JSDOMBinding.cpp:
759         (WebCore::reportException):
760         - Added a version of reportException() that takes a JSValue instead of an Exception
761           object.  This version will ensure that we have an Exception object before calling
762           into the original reportException() as follows:
763
764           1. If the JSValue is already an Exception object, we're good to go.
765
766           2. Else, if VM::lastException() is available, use that as the exception.
767              This is how the old code use to behave (in terms of where it gets the exception
768              stack trace).  The assumption is that reportException() will be called in
769              a timely manner before the exception stack trace has been purged.
770
771           3. Else, create an Exception object with no stack trace.  This is the fall back
772              in case the client did not call reportException() in a timely manner.
773
774         - Also clear the last exception after we've reported it.  This is how the old code
775           before r185259 behave (in terms of the lifecycle of the last exception stack
776           trace).  We're restoring that behavior here.
777
778         * bindings/js/JSDOMBinding.h:
779
780 2015-06-11  Zalan Bujtas  <zalan@apple.com>
781
782         Do not crash when the descendant frame tree is destroyed during layout.
783         https://bugs.webkit.org/show_bug.cgi?id=144540
784         rdar://problem/20793184
785
786         Reviewed by Andreas Kling.
787
788         Widget::setFrameRect(), through WebHTMLView layout, could trigger a style recalc, which in turn
789         could initiate an onBeforeLoad callback.
790         If javascript happens to destroy the current iframe in the onBeforeLoad callback, we lose the descendant
791         render tree, including the child FrameView (the iframe element's view). However the RenderIFrame
792         object stays protected until after the layout is done. (see protectRenderWidgetUntilLayoutIsDone())
793
794         Climbing back on the callstack, we need to make sure that
795         1. the root widget of the descendant render tree (FrameView) stays valid as long as it is needed.
796         2. RenderFrameBase::layoutWithFlattening() can handle the case when the associated widget (child FrameView) is set to nullptr.
797         (see RenderWidget::willBeDestroyed() -> setWidget(nullptr))
798
799         (and later, when layout is finished this (RenderIFrame) object gets destroyed too.)
800
801         Covered by fast/frames/flattening/crash-remove-iframe-during-object-beforeload.html.
802
803         * page/FrameView.cpp:
804         (WebCore::FrameView::setFrameRect):
805         (WebCore::FrameView::updateEmbeddedObject):
806         (WebCore::FrameView::updateWidgetPositions):
807         * platform/ScrollView.cpp:
808         (WebCore::ScrollView::setFrameRect):
809         * platform/mac/WidgetMac.mm:
810         (WebCore::Widget::setFrameRect):
811         * rendering/RenderFrameBase.cpp:
812         (WebCore::RenderFrameBase::layoutWithFlattening):
813         (WebCore::RenderFrameBase::childRenderView):
814         (WebCore::RenderFrameBase::peformLayoutWithFlattening):
815         * rendering/RenderFrameBase.h:
816         * rendering/RenderWidget.cpp:
817         (WebCore::RenderWidget::updateWidgetPosition):
818         * rendering/RenderWidget.h:
819
820 2015-06-11  Commit Queue  <commit-queue@webkit.org>
821
822         Unreviewed, rolling out r185470.
823         https://bugs.webkit.org/show_bug.cgi?id=145902
824
825         Caused ASan violations (Requested by ap on #webkit).
826
827         Reverted changeset:
828
829         "Add an appearance keyword for wireless playback / airplay
830         icon"
831         https://bugs.webkit.org/show_bug.cgi?id=145892
832         http://trac.webkit.org/changeset/185470
833
834 2015-06-11  Brady Eidson  <beidson@apple.com>
835
836         IndexedDB onupgradeneeded event has incorrect value for oldVersion.
837         <rdar://problem/18309792> and https://bugs.webkit.org/show_bug.cgi?id=136888
838
839         Reviewed by Sam Weinig.
840
841         Test: storage/indexeddb/version-change-event-basic.html
842
843         "NoIntVersion" is an internal bookkeeping concept that we never should've been passing to Javascript.
844         
845         This cleans up things by:
846         - Adjusting an old version of "NoIntVersion" to "0" before making the version change callback.
847         - Removing the VersionNullness parameter from almost everywhere.
848         - Removing the nullability of the newVersion parameter from the IDL.
849
850         * Modules/indexeddb/IDBDatabase.cpp:
851         (WebCore::IDBDatabase::onVersionChange):
852         * Modules/indexeddb/IDBDatabase.h:
853         
854         * Modules/indexeddb/IDBDatabaseBackend.cpp:
855         (WebCore::IDBDatabaseBackend::runIntVersionChangeTransaction):
856         (WebCore::IDBDatabaseBackend::deleteDatabase):
857         
858         * Modules/indexeddb/IDBDatabaseCallbacks.h:
859         * Modules/indexeddb/IDBDatabaseCallbacksImpl.cpp:
860         (WebCore::IDBDatabaseCallbacksImpl::onVersionChange):
861         * Modules/indexeddb/IDBDatabaseCallbacksImpl.h:
862         
863         * Modules/indexeddb/IDBOpenDBRequest.cpp:
864         (WebCore::IDBOpenDBRequest::onBlocked):
865         (WebCore::IDBOpenDBRequest::onUpgradeNeeded):
866         
867         * Modules/indexeddb/IDBTransactionBackendOperations.cpp:
868         (WebCore::IDBDatabaseBackend::VersionChangeOperation::perform):
869         
870         * Modules/indexeddb/IDBVersionChangeEvent.cpp:
871         (WebCore::IDBVersionChangeEvent::IDBVersionChangeEvent):
872         * Modules/indexeddb/IDBVersionChangeEvent.h:
873         (WebCore::IDBVersionChangeEvent::create):
874         (WebCore::IDBVersionChangeEvent::newVersion):
875         * Modules/indexeddb/IDBVersionChangeEvent.idl:
876
877 2015-06-11  Matt Rajca  <mrajca@apple.com>
878
879         Media Session: Add plumbing for media control event delivery.
880         https://bugs.webkit.org/show_bug.cgi?id=145859
881
882         Reviewed by Anders Carlsson.
883
884         * Modules/mediasession/MediaEventTypes.h: Added.
885         * WebCore.xcodeproj/project.pbxproj:
886         * page/Page.cpp:
887         (WebCore::Page::handleMediaEvent): Toggle media playback upon receiving the PlayPause event as described in the spec.
888         * page/Page.h:
889
890 2015-06-11  Jon Lee  <jonlee@apple.com>
891
892         Update media controls JS and CSS to use picture-in-picture
893         https://bugs.webkit.org/show_bug.cgi?id=145827
894         <rdar://problem/21311576>
895
896         Reviewed by Dean Jackson.
897
898         * English.lproj/mediaControlsLocalizedStrings.js: Update localized strings.
899         Add a string for the placeholder text, and for the aria-label of the
900         placard.
901
902         * Modules/mediacontrols/MediaControlsHost.idl: Remove uncalled functions.
903         * Modules/mediacontrols/MediaControlsHost.h: Also remove optimizedFullscreenSupported(),
904         which was never used.
905         * Modules/mediacontrols/MediaControlsHost.cpp: Remove uncalled functions and media part IDs.
906         (WebCore::MediaControlsHost::enterFullscreenOptimized): Deleted.
907         (WebCore::MediaControlsHost::mediaUIImageData): Deleted.
908
909         * Modules/mediacontrols/mediaControlsApple.css:
910         (audio::-webkit-media-controls-picture-in-picture-button): Update pseudo-element name.
911         (audio::-webkit-media-controls-optimized-fullscreen-button): Deleted.
912         * Modules/mediacontrols/mediaControlsApple.js: Update global variable name, and classes.
913         (Controller.prototype.createControls): Update button name. Add aria-label to the placeholder.
914         (Controller.prototype.updateFullscreenButtons):
915         (Controller.prototype.updateLayoutForDisplayedWidth):
916         (Controller.prototype.handlePictureInPictureButtonClicked): Update handler names.
917         (Controller.prototype.handleOptimizedFullscreenButtonClicked): Deleted.
918
919         * Modules/mediacontrols/mediaControlsiOS.css: Rename pseudo-element.
920         (audio::-webkit-media-controls-picture-in-picture-button): Add mask images.
921         (audio::-webkit-media-controls-picture-in-picture-button:active):
922         (video::-webkit-media-controls-picture-in-picture-button):
923         (video::-webkit-media-controls-picture-in-picture-button.return-from-picture-in-picture):
924         (audio::-webkit-media-controls-wireless-playback-status.picture-in-picture):
925         (audio::-webkit-media-controls-wireless-playback-text-top.picture-in-picture):
926         (audio::-webkit-media-controls-wireless-playback-text-bottom.picture-in-picture):
927         (audio::-webkit-media-controls-optimized-fullscreen-button): Deleted.
928         (audio::-webkit-media-controls-optimized-fullscreen-button:active): Deleted.
929         (video::-webkit-media-controls-optimized-fullscreen-button): Deleted.
930         (audio::-webkit-media-controls-wireless-playback-status.optimized): Deleted. The placard
931         pseudo-element should be updated from wireless-playback-status to just playback-status
932         since it serves both for pip and AirPlay.
933         (audio::-webkit-media-controls-wireless-playback-text-top.optimized): Deleted.
934         (audio::-webkit-media-controls-wireless-playback-text-bottom.optimized): Deleted.
935         * Modules/mediacontrols/mediaControlsiOS.js:
936         (ControllerIOS.prototype.createControls): Update button names.
937         (ControllerIOS.prototype.configureInlineControls):
938         (ControllerIOS.prototype.handlePictureInPictureButtonClicked): Update handler name.
939         (ControllerIOS.prototype.handlePictureInPictureTouchStart):
940         (ControllerIOS.prototype.handlePictureInPictureTouchEnd):
941         (ControllerIOS.prototype.handlePictureInPictureTouchCancel):
942         (ControllerIOS.prototype.handlePresentationModeChange): Remove changes to the inline bg
943         image style, and rely on the CSS to fill those in. Use localized strings for the placard.
944         Move the aria-label to createControls().
945         (ControllerIOS.prototype.handleOptimizedFullscreenButtonClicked): Deleted.
946         (ControllerIOS.prototype.handleOptimizedFullscreenTouchStart): Deleted.
947         (ControllerIOS.prototype.handleOptimizedFullscreenTouchEnd): Deleted.
948         (ControllerIOS.prototype.handleOptimizedFullscreenTouchCancel): Deleted.
949
950         * html/HTMLMediaElement.cpp: Remove enterFullscreenOptimized since it is never called.
951         (WebCore::HTMLMediaElement::enterFullscreenOptimized): Deleted.
952         * html/HTMLMediaElement.h:
953         * platform/ios/WebCoreSystemInterfaceIOS.h: Remove wkGetMediaUIImageData.
954         * platform/ios/WebCoreSystemInterfaceIOS.mm:
955         * rendering/RenderThemeIOS.mm:
956         (WebCore::RenderThemeIOS::mediaControlsStyleSheet): Remove calls to wkGetMediaUIImageData.
957
958 2015-06-11  Dean Jackson  <dino@apple.com>
959
960         Add an appearance keyword for wireless playback / airplay icon
961         https://bugs.webkit.org/show_bug.cgi?id=145892
962         <rdar://problem/21344872>
963
964         Reviewed by Simon Fraser.
965
966         Add a new "-webkit-appearance" value named "-apple-airplay"
967         which will be used to render an icon. This change simply
968         adds support for the value, and puts in hooks for drawing.
969
970         At the moment this is only going to be used by Airplay, so
971         the public-facing name is "-apple-airplay". However, the
972         implementation in Theme has a more generic name, in case
973         we hook it up for other ports later.
974
975         Test: fast/css/appearance-airplay.html
976
977         * css/CSSParser.cpp:
978         (WebCore::cssValueKeywordID): This new keyword should not get
979         translated into having a -webkit prefix.
980         * css/CSSPrimitiveValueMappings.h:
981         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): New mapping from
982         the Theme to the CSS value.
983         * css/CSSValueKeywords.in: Add "-apple-airplay".
984         * platform/ThemeTypes.h: New ControlPart.
985         * rendering/RenderTheme.cpp: Stub implementation of the rendering and
986         style update for the new appearance.
987         (WebCore::RenderTheme::adjustStyle):
988         (WebCore::RenderTheme::paint):
989         (WebCore::RenderTheme::adjustWirelessPlaybackIconStyle):
990         (WebCore::RenderTheme::paintWirelessPlaybackIcon):
991         * rendering/RenderTheme.h:
992         * rendering/RenderThemeMac.h:
993         * rendering/RenderThemeMac.mm:
994         (WebCore::RenderThemeMac::adjustWirelessPlaybackIconStyle):
995         (WebCore::RenderThemeMac::paintWirelessPlaybackIcon):
996
997 2015-06-11  Commit Queue  <commit-queue@webkit.org>
998
999         Unreviewed, rolling out r185464.
1000         https://bugs.webkit.org/show_bug.cgi?id=145894
1001
1002         "This patch is breaking binding tests" (Requested by youenn on
1003         #webkit).
1004
1005         Reverted changeset:
1006
1007         "Bindings generator should generate code for Promise-based
1008         APIs"
1009         https://bugs.webkit.org/show_bug.cgi?id=145833
1010         http://trac.webkit.org/changeset/185464
1011
1012 2015-06-11  Commit Queue  <commit-queue@webkit.org>
1013
1014         Unreviewed, rolling out r185465.
1015         https://bugs.webkit.org/show_bug.cgi?id=145893
1016
1017         "This patch is breaking 32bit mac build" (Requested by youenn
1018         on #webkit).
1019
1020         Reverted changeset:
1021
1022         "[Streams API] ReadableJSStream should handle promises
1023         returned by JS source start callback"
1024         https://bugs.webkit.org/show_bug.cgi?id=145792
1025         http://trac.webkit.org/changeset/185465
1026
1027 2015-06-11  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
1028
1029         [Streams API] ReadableJSStream should handle promises returned by JS source start callback
1030         https://bugs.webkit.org/show_bug.cgi?id=145792
1031
1032         Reviewed by Darin Adler.
1033
1034         Covered by rebased tests.
1035
1036         When calling start callback, the returned value is checked.
1037         If it is not a promise, we do as if it is a resolved promise.
1038         If it is a promise, we call its then() method with two resolve/reject JS functions.
1039
1040         * Modules/streams/ReadableStream.cpp:
1041         * bindings/js/ReadableJSStream.cpp:
1042         (WebCore::ReadableJSStream::invoke): Returns a JSPromise* if any is returned by the JS source callback.
1043         (WebCore::thenPromise): Utility method to call the promise.
1044         (WebCore::createStartResultFulfilledFunction): The promise resolve callback.
1045         (WebCore::ReadableJSStream::doStart): Calls thenPromise if a JSPromise* is returned by invoke.
1046         (WebCore::ReadableJSStream::ReadableJSStream):
1047         * bindings/js/ReadableJSStream.h:
1048
1049 2015-06-11  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1050
1051         Bindings generator should generate code for Promise-based APIs
1052         https://bugs.webkit.org/show_bug.cgi?id=145833
1053
1054         Reviewed by Darin Adler.
1055
1056         Covered by existing tests.
1057
1058         * Modules/webaudio/AudioContext.idl: Removing custom binding for resume, suspend and close.
1059         * bindings/js/JSAudioContextCustom.cpp: Ditto.
1060         * bindings/scripts/CodeGeneratorJS.pm:
1061         (GenerateHeader): Refactoring to use IsReturningPromise.
1062         (GenerateImplementation): Disabling include for return type if it is a promise.
1063         (GenerateParametersCheck): Adding DeferredWrapper() as argument to the DOM method if JS method returns a promise.
1064         (GenerateImplementationFunctionCall): Added support for promise-returning API.
1065         (IsReturningPromise): Checking whether function is returning a promise.
1066         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
1067         (webkit_dom_test_obj_test_promise_function):
1068         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
1069         * bindings/scripts/test/JS/JSTestObj.cpp:
1070         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunction):
1071         * bindings/scripts/test/ObjC/DOMTestObj.h:
1072         * bindings/scripts/test/ObjC/DOMTestObj.mm:
1073         (-[DOMTestObj testPromiseFunction]):
1074         * bindings/scripts/test/TestObj.idl: Adding promise returning function.
1075
1076
1077 2015-06-08  Simon Fraser  <simon.fraser@apple.com>
1078
1079         Missing content in UIWebView snapshots sometimes
1080         https://bugs.webkit.org/show_bug.cgi?id=145779
1081         rdar://problem/20744708
1082
1083         Reviewed by Darin Adler.
1084         
1085         When expanding collapsed parts of quoted text on iOS, sometimes the "concertina"
1086         images would be blank. This happened because we'd fail to create tiles for regions
1087         outside the LegacyTileCache's visibleRect.
1088         
1089         Fix by giving LegacyTileCache an optional override visibleRect, which is set
1090         and cleared during -renderInContext: using the context clip rect.
1091
1092         * platform/ios/LegacyTileCache.h:
1093         * platform/ios/LegacyTileCache.mm:
1094         (WebCore::LegacyTileCache::visibleRectInLayer):
1095         (WebCore::LegacyTileCache::setOverrideVisibleRect):
1096         * platform/ios/LegacyTileLayer.mm:
1097         (-[LegacyTileHostLayer renderInContext:]):
1098
1099 2015-06-11  Daniel Bates  <dabates@apple.com>
1100
1101         Simplify event handling logic for search cancel button
1102         https://bugs.webkit.org/show_bug.cgi?id=145780
1103
1104         Reviewed by Darin Adler.
1105
1106         Following the patch for <https://bugs.webkit.org/show_bug.cgi?id=145774> we can take advantage
1107         of the DOM click event to simplify the event handling logic for the search cancel button.
1108         It is sufficient to listen for mousedown and click events instead of listening for mousedown
1109         and mouseup events, capturing all events during drag, and using the hover state of the button
1110         on mouse release together with a instance variable set on mouse press to determine whether
1111         the cancel button was clicked.
1112
1113         As a side effect of removing the requirement that the search cancel button be hovered (a
1114         workaround to ensure that the mouse was pressed and released on the button in absence of
1115         listening for an explicit DOM click event) we can remove the accessibility-specific class,
1116         AccessibilitySearchFieldCancelButton, that was primarily used to fake the hover state of
1117         the button so that the accessibility machinery could simulate a click on it. Instead we
1118         can add use the default accessibility machinery for clicking on an element.
1119
1120         No new tests since no functionality was changed.
1121
1122         * CMakeLists.txt: Remove reference to file AccessibilitySearchFieldButtons.cpp.
1123         * WebCore.vcxproj/WebCore.vcxproj: Remove reference to files AccessibilitySearchFieldButtons.{cpp, h}.
1124         * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
1125         * WebCore.xcodeproj/project.pbxproj: Ditto.
1126         * accessibility/AXObjectCache.cpp:
1127         (WebCore::createFromRenderer): Remove special-purpose logic that instantiated
1128         AccessibilitySearchFieldCancelButton for the search cancel button. Instead we can make
1129         use of the existing accessibility machinery to handle this button.
1130         * accessibility/AccessibilityAllInOne.cpp: Remove #include of AccessibilitySearchFieldButtons.cpp
1131         since the file is no longer needed.
1132         * accessibility/AccessibilitySearchFieldButtons.cpp: Removed.
1133         * accessibility/AccessibilitySearchFieldButtons.h: Removed.
1134         * dom/Element.h:
1135         (WebCore::Element::isSearchFieldCancelButtonElement): Deleted.
1136         * html/shadow/TextControlInnerElements.cpp:
1137         (WebCore::SearchFieldCancelButtonElement::SearchFieldCancelButtonElement): Set the ARIA role
1138         and label attributes so that the accessibility system identifies the search cancel button as
1139         a button and shows a description for the button, respectively.
1140         (WebCore::SearchFieldCancelButtonElement::defaultEventHandler): Simplify the event handling logic
1141         such that we clear the field when we receive a DOM click event (i.e. the mouse was pressed
1142         and released on the button). Remove unused variable, oldValue. Substitute emptyString() for the
1143         empty string literal in the call to HTMLInputElement::setValueForUser() to avoid an implicit
1144         conversion to String. Also remove out-of-date comment that repeated what the code does.
1145         (WebCore::SearchFieldCancelButtonElement::willDetachRenderers): Deleted. We no longer need to use
1146         custom style resolve callbacks to reset the state of the EventHandler since we no longer need to
1147         have the EventHandler dispatch all mouse events to us on mouse press.
1148         * html/shadow/TextControlInnerElements.h:
1149
1150 2015-06-11  Commit Queue  <commit-queue@webkit.org>
1151
1152         Unreviewed, rolling out r185453.
1153         https://bugs.webkit.org/show_bug.cgi?id=145881
1154
1155         it broke the 32-bit build (Requested by clopez on #webkit).
1156
1157         Reverted changeset:
1158
1159         "[GTK] [Wayland] Should be possible to build with support for
1160         both X11 and Wayland."
1161         https://bugs.webkit.org/show_bug.cgi?id=145701
1162         http://trac.webkit.org/changeset/185453
1163
1164 2015-06-11  Carlos Alberto Lopez Perez  <clopez@igalia.com>
1165
1166         [GTK] [Wayland] Should be possible to build with support for both X11 and Wayland.
1167         https://bugs.webkit.org/show_bug.cgi?id=145701
1168
1169         Reviewed by Žan Doberšek.
1170
1171         No new tests, no behavior changes.
1172
1173         When building both targets, we have to include the wayland-egl
1174         headers in order to build the Wayland target. This causes that
1175         EGLNativePixmapType and EGLNativeWindowType get defined as
1176         different types than when building only the X11 target.
1177
1178         By type casting them to the ones that are expected, we are able
1179         to build both targets at the same time.
1180
1181         I have done tests (building each target alone as also both targets
1182         at the same time), and everything seems to works as expected.
1183
1184         Once built for both targets, if you try to launch the MiniBrowser
1185         from inside a Wayland compositor (Weston on top of X for example),
1186         it will trigger the X11 target if the DISPLAY environment variable
1187         is set and the environment variable GDK_BACKEND is not set to wayland,
1188         otherwise it will trigger the Wayland target.
1189
1190         * platform/graphics/GLContext.cpp:
1191         (WebCore::GLContext::createContextForWindow): Add type cast.
1192         * platform/graphics/egl/GLContextEGL.cpp: Add missing include when
1193         building both targets that is required for defining DefaultRootWindow().
1194         (WebCore::GLContextEGL::createPixmapContext): Add type cast.
1195
1196 2015-06-11  Hunseop Jeong  <hs85.jeong@samsung.com>
1197
1198         [EFL] Fix the debug build after r185417.
1199         https://bugs.webkit.org/show_bug.cgi?id=145876 
1200
1201         Reviewed by Gyuyoung Kim.
1202
1203         * platform/graphics/efl/ImageBufferEfl.cpp: added the missing "MIMETypeRegistry.h".
1204
1205 2015-06-11  Myles C. Maxfield  <mmaxfield@apple.com>
1206
1207         [iOS] Tahoma isn't installed on iOS, so there is no need to blacklist it
1208         https://bugs.webkit.org/show_bug.cgi?id=145865
1209
1210         Reviewed by Dan Bernstein.
1211
1212         No new tests because I can't copy Tahoma into our open source repository.
1213
1214         * platform/graphics/cocoa/FontCocoa.mm:
1215         (WebCore::fontFamilyShouldNotBeUsedForArabic):
1216
1217 2015-06-10  Commit Queue  <commit-queue@webkit.org>
1218
1219         Unreviewed, rolling out r185442.
1220         https://bugs.webkit.org/show_bug.cgi?id=145871
1221
1222         seems to have broken WTF.StringOperators test (Requested by
1223         alexchristensen on #webkit).
1224
1225         Reverted changeset:
1226
1227         "[Content Extensions] Limit number of rules."
1228         https://bugs.webkit.org/show_bug.cgi?id=145663
1229         http://trac.webkit.org/changeset/185442
1230
1231 2015-06-10  Jon Lee  <jonlee@apple.com>
1232
1233         Update presentation mode JS API to using 'picture-in-picture'
1234         https://bugs.webkit.org/show_bug.cgi?id=145826
1235         rdar://problem/2131153
1236
1237         Reviewed by Anders Carlsson.
1238
1239         Update presentation modes to use 'picture-in-picture' in lieu of 'optimized'.
1240
1241         * html/HTMLVideoElement.idl: Update to "picture-in-picture".
1242         * html/HTMLVideoElement.cpp:
1243         (WebCore::presentationModePictureInPicture): Rename static function returning string.
1244         (WebCore::presentationModeOptimized): Deleted.
1245         (WebCore::HTMLVideoElement::webkitSupportsPresentationMode): Use the new static function name.
1246         (WebCore::HTMLVideoElement::webkitSetPresentationMode): Ditto.
1247         (WebCore::HTMLVideoElement::webkitPresentationMode): Ditto.
1248
1249         * Modules/mediacontrols/mediaControlsiOS.js: Update to 'picture-in-picture'.
1250         (ControllerIOS.prototype.configureInlineControls): 
1251         (ControllerIOS.prototype.isFullScreen):
1252         (ControllerIOS.prototype.handleOptimizedFullscreenButtonClicked):
1253         (ControllerIOS.prototype.handlePresentationModeChange):
1254         (ControllerIOS.prototype.controlsAlwaysVisible):
1255
1256 2015-06-10  Boris Smus  <boris@smus.com>
1257
1258         [Mobile Safari, WKWebView] increase DeviceOrientationEvent events emission frequency
1259         https://bugs.webkit.org/show_bug.cgi?id=145814
1260
1261         Reviewed by Benjamin Poulain.
1262
1263         Increased the sampling rate of DeviceOrientationEvent from 20 Hz to 60
1264         Hz to make good head tracking possible.
1265
1266         * platform/ios/WebCoreMotionManager.h:
1267
1268 2015-06-10  Alex Christensen  <achristensen@webkit.org>
1269
1270         [Content Extensions] Limit number of rules.
1271         https://bugs.webkit.org/show_bug.cgi?id=145663
1272         rdar://problem/21242407
1273
1274         Reviewed by Benjamin Poulain.
1275
1276         Added an API test to make sure that parsing fails when there are too many rules.
1277
1278         * contentextensions/ContentExtensionError.cpp:
1279         (WebCore::ContentExtensions::contentExtensionErrorCategory):
1280         * contentextensions/ContentExtensionError.h:
1281         * contentextensions/ContentExtensionParser.cpp:
1282         (WebCore::ContentExtensions::loadEncodedRules):
1283         Fail to parse a content extension with more than 50000 rules.
1284
1285 2015-06-10  Said Abou-Hallawa  <sabouhallawa@apple.com>
1286
1287         REGRESSION (r184895): Vertical border elements ([-webkit]-border-image set to 'repeat') that used to render perfectly are now rendering incorrectly.
1288         https://bugs.webkit.org/show_bug.cgi?id=145801
1289
1290         Reviewed by Simon Fraser.
1291
1292         When using the tiling to draw the sides of an image-border, the image slice
1293         is repeated only in one direction. For top and bottom sides, the slice is
1294         repeated horizontally and for left and right sides, it's repeated vertically.
1295         The tile might be scaled in the other direction of the tiling if the border
1296         extent and the slice extent are different in this direction.
1297         
1298         The bug happens because we were scaling the tile in the tiling direction.
1299
1300         Test: fast/borders/border-image-repeat-stretch.html
1301
1302         * rendering/style/NinePieceImage.cpp:
1303         (WebCore::NinePieceImage::scaleSlicesIfNeeded): Fix the type and the name
1304         of deviceScaleFactor.
1305         
1306         (WebCore::NinePieceImage::computeIntrinsicSideTileScale): Fix the scaling
1307         direction of the border image side tiling.
1308         
1309         * rendering/style/NinePieceImage.h:
1310
1311 2015-06-10  Chris Dumez  <cdumez@apple.com>
1312
1313         ASSERT_WITH_SECURITY_IMPLICATION in WebCore::DocumentOrderedMap::getElementById
1314         https://bugs.webkit.org/show_bug.cgi?id=145857
1315         <rdar://problem/16798440>
1316
1317         Reviewed by Darin Adler.
1318
1319         Make sure Node::insertedInto() gets called on the inserted node and its
1320         descendants after its insertion into the tree but *before*
1321         ContainerNode::childrenChanged() is called on the parent node. This is
1322         needed so that the descendants know they've been inserted into the tree
1323         (and their InDocumentFlag flag gets set) before the parent node does
1324         anything with them in childrenChanged().
1325
1326         In the case of <rdar://problem/16798440>, executing HTMLScriptElement's
1327         childrenChanged() after appending a child to a script element was causing
1328         the script to be executed. The script would call getElementBy() which
1329         would traverse the DOM tree and find a matching Element in the newly
1330         inserted subtree. However, the matching Element's InDocumentFlag flag was
1331         not set yet because the element's insertedInto() method has not been called
1332         yet at this point. This would cause us to hit an assertion as
1333         DocumentOrderedMap::getElementById() is only supposed to return elements
1334         that are in a Document.
1335
1336         This patch is based on Blink r178976 by <esprehn@chromium.org>:
1337         https://src.chromium.org/viewvc/blink?view=rev&revision=178976
1338
1339         Tests: fast/dom/script-getElementById-during-insertion.html
1340                fast/dom/script-remove-child-id-map.html
1341
1342         * dom/ContainerNode.cpp:
1343         (WebCore::ContainerNode::notifyChildInserted):
1344         (WebCore::ContainerNode::notifyChildRemoved):
1345         (WebCore::ContainerNode::removeChildren):
1346         (WebCore::ContainerNode::parserInsertBefore): Deleted.
1347         (WebCore::ContainerNode::removeChild): Deleted.
1348         (WebCore::ContainerNode::parserRemoveChild): Deleted.
1349         (WebCore::ContainerNode::parserAppendChild): Deleted.
1350         (WebCore::ContainerNode::childrenChanged): Deleted.
1351         (WebCore::ContainerNode::setAttributeEventListener): Deleted.
1352         (WebCore::ContainerNode::querySelector): Deleted.
1353         * dom/ContainerNodeAlgorithms.cpp:
1354         (WebCore::ChildNodeInsertionNotifier::notifyDescendantInsertedIntoDocument):
1355         (WebCore::ChildNodeInsertionNotifier::notifyDescendantInsertedIntoTree):
1356         * dom/ContainerNodeAlgorithms.h:
1357         (WebCore::ChildNodeInsertionNotifier::notifyNodeInsertedIntoDocument):
1358         (WebCore::ChildNodeInsertionNotifier::notifyNodeInsertedIntoTree):
1359         (WebCore::ChildNodeInsertionNotifier::notify):
1360         (WebCore::ChildNodeRemovalNotifier::notifyNodeRemovedFromDocument): Deleted.
1361         * dom/Element.cpp:
1362         (WebCore::Element::addShadowRoot):
1363
1364 2015-06-10  Alex Christensen  <achristensen@webkit.org>
1365
1366         [Web Timing] Fix flaky test.
1367         https://bugs.webkit.org/show_bug.cgi?id=145846
1368
1369         Reviewed by Alexey Proskuryakov.
1370
1371         The timing data is gathered in ResourceHandle::getConnectionTimingData as 
1372         millisecond deltas from the fetch start time, not the navigation start time.
1373         The difference between navigation and fetch start time is usually so small that 
1374         it only caused one flaky test, but this should fix that flakiness. This patch 
1375         corrects how the millisecond deltas are used.
1376
1377         * page/PerformanceTiming.cpp:
1378         (WebCore::PerformanceTiming::domainLookupStart):
1379         (WebCore::PerformanceTiming::domainLookupEnd):
1380         (WebCore::PerformanceTiming::connectStart):
1381         (WebCore::PerformanceTiming::connectEnd):
1382         (WebCore::PerformanceTiming::secureConnectionStart):
1383         (WebCore::PerformanceTiming::requestStart):
1384         (WebCore::PerformanceTiming::responseStart):
1385         (WebCore::PerformanceTiming::responseEnd):
1386         (WebCore::PerformanceTiming::documentLoadTiming):
1387         (WebCore::PerformanceTiming::resourceLoadTimeRelativeToFetchStart):
1388         (WebCore::PerformanceTiming::monotonicTimeToIntegerMilliseconds):
1389         (WebCore::PerformanceTiming::resourceLoadTimeRelativeToAbsolute): Deleted.
1390         * page/PerformanceTiming.h:
1391
1392 2015-06-10  Beth Dakin  <bdakin@apple.com>
1393
1394         Overriding the overlay scrollbar style on WKView doesn't take effect immediately
1395         https://bugs.webkit.org/show_bug.cgi?id=145855
1396         -and corresponding-
1397         rdar://problem/20948706
1398
1399         Reviewed by Simon Fraser.
1400
1401         Since we opt into layer-per-part scrollbars in order to move the knob on the 
1402         secondary thread, AppKit is creating its own layers for the knob and track. To 
1403         invalidate them, we need to call into the ScrollbarPainter’s setNeedsDisplay.
1404
1405         New virtual function on ScrollAnimator to call into ScrollbarPainter’s 
1406         setNeedsDispay.
1407         * platform/ScrollAnimator.h:
1408
1409         Call the new function when setting the overlay style.
1410         * platform/ScrollableArea.cpp:
1411         (WebCore::ScrollableArea::setScrollbarOverlayStyle):
1412
1413         Add setNeedsDisplay to the list of ScrollbarPainter methods.
1414         * platform/mac/NSScrollerImpDetails.h:
1415
1416         Implement invalidateScrollbarPartLayers.
1417         * platform/mac/ScrollAnimatorMac.h:
1418         * platform/mac/ScrollAnimatorMac.mm:
1419         (WebCore::ScrollAnimatorMac::invalidateScrollbarPartLayers):
1420
1421 2015-06-10  Matt Rajca  <mrajca@apple.com>
1422
1423         MediaRemoteControls should be marked JSGenerateToJSObject.
1424         https://bugs.webkit.org/show_bug.cgi?id=145849
1425
1426         Reviewed by Eric Carlson.
1427
1428         Since MediaRemoteControls has a parent interface, we need to add the JSGenerateToJSObject attribute so the
1429         toJS(...) function gets generated. This is required for event handling to work.
1430
1431         * Modules/mediasession/MediaRemoteControls.idl:
1432
1433 2015-06-10  Dean Jackson  <dino@apple.com>
1434
1435         User can not scroll on page when dragging inside video
1436         https://bugs.webkit.org/show_bug.cgi?id=145848
1437         <rdar://problem/20997158>
1438
1439         Reviewed by Brent Fulgham.
1440
1441         Revert the change made in http://trac.webkit.org/changeset/183797
1442         which breaks panning on pages if the touch starts inside the video.
1443
1444         * Modules/mediacontrols/mediaControlsiOS.js:
1445         (ControllerIOS.prototype.handleWrapperTouchStart): Do not return true, which stops
1446         the handleEvent call in the superclass from preventing the default action.
1447
1448 2015-06-10  Matt Rajca  <mrajca@apple.com>
1449
1450         Explicitly keep track of active HTMLMediaElements in MediaSessions.
1451         https://bugs.webkit.org/show_bug.cgi?id=145829
1452
1453         Reviewed by Eric Carlson.
1454
1455         * Modules/mediasession/MediaSession.cpp: Add support for keeping track of active media elements.
1456         (WebCore::MediaSession::addActiveMediaElement):
1457         * Modules/mediasession/MediaSession.h:
1458         * html/HTMLMediaElement.cpp:
1459         (WebCore::HTMLMediaElement::playInternal): If the paused attribute is true and the readyState attribute has the
1460           value HAVE_FUTURE_DATA or HAVE_ENOUGH_DATA, the media element becomes an active participating element of the
1461           media session.
1462
1463 2015-06-10  Chris Dumez  <cdumez@apple.com>
1464
1465         Drop unused argument for Node::didNotifySubtreeInsertions()
1466         https://bugs.webkit.org/show_bug.cgi?id=145845
1467
1468         Reviewed by Andreas Kling.
1469
1470         * dom/ContainerNodeAlgorithms.h:
1471         (WebCore::ChildNodeInsertionNotifier::notify):
1472         * dom/Node.h:
1473         (WebCore::Node::didNotifySubtreeInsertions):
1474         * html/HTMLFrameElementBase.cpp:
1475         (WebCore::HTMLFrameElementBase::didNotifySubtreeInsertions):
1476         * html/HTMLFrameElementBase.h:
1477         * svg/SVGFEImageElement.cpp:
1478         (WebCore::SVGFEImageElement::didNotifySubtreeInsertions):
1479         * svg/SVGFEImageElement.h:
1480         * svg/SVGMPathElement.cpp:
1481         (WebCore::SVGMPathElement::didNotifySubtreeInsertions):
1482         * svg/SVGMPathElement.h:
1483         * svg/SVGTRefElement.cpp:
1484         (WebCore::SVGTRefElement::didNotifySubtreeInsertions):
1485         * svg/SVGTRefElement.h:
1486         * svg/SVGTextPathElement.cpp:
1487         (WebCore::SVGTextPathElement::didNotifySubtreeInsertions):
1488         * svg/SVGTextPathElement.h:
1489         * svg/animation/SVGSMILElement.cpp:
1490         (WebCore::SVGSMILElement::didNotifySubtreeInsertions):
1491         * svg/animation/SVGSMILElement.h:
1492
1493 2015-06-10  KwangHyuk Kim  <hyuki.kim@samsung.com>
1494
1495         [EFL] Jpeg image export implementation for Canvas.
1496         https://bugs.webkit.org/show_bug.cgi?id=145457
1497
1498         Reviewed by Gyuyoung Kim.
1499
1500         Add implementation of jpeg image export on Webkit EFL by using JPEGImageEncoder.
1501
1502         No new tests, fast/canvas/toDataURL-supportedTypes.html can be reused.
1503
1504         * PlatformEfl.cmake:
1505         * platform/MIMETypeRegistry.cpp:
1506         (WebCore::initializeSupportedImageMIMETypesForEncoding):
1507         * platform/graphics/cairo/ImageBufferCairo.cpp:
1508         * platform/graphics/efl/ImageBufferEfl.cpp: Added.
1509         (WebCore::writeFunction):
1510         (WebCore::encodeImage):
1511         (WebCore::ImageBuffer::toDataURL):
1512         * platform/image-encoders/JPEGImageEncoder.cpp:
1513         (WebCore::compressRGBABigEndianToJPEG):
1514
1515 2015-06-10  Carlos Garcia Campos  <cgarcia@igalia.com>
1516
1517         [GTK] Move KeyBindingTranslator from platform to WebKit2 layer
1518         https://bugs.webkit.org/show_bug.cgi?id=145840
1519
1520         Reviewed by Martin Robinson.
1521
1522         It's currently used only by WebKit2 in the UI process and it's
1523         another file built twice because of the GTK2 plugin process.
1524
1525         * PlatformGTK.cmake:
1526
1527 2015-06-10  Carlos Garcia Campos  <cgarcia@igalia.com>
1528
1529         [GTK] Get rid of GetEditorCommandsForKeyEvent sync message
1530         https://bugs.webkit.org/show_bug.cgi?id=145598
1531
1532         Reviewed by Žan Doberšek.
1533
1534         * platform/PlatformKeyboardEvent.h:
1535         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
1536         (WebCore::PlatformKeyboardEvent::commands):
1537         * platform/gtk/KeyBindingTranslator.cpp: Use a single list of
1538         custom key bindings. We don't need to distinguish between key down and
1539         key press commands, since the web editor client already does that
1540         when executing the commands.
1541         (WebCore::KeyBindingTranslator::commandsForKeyEvent): This is
1542         getEditorCommandsForKeyEvent() renamed as commandsForKeyEvent(),
1543         since it now returns the list of commands to simplify the
1544         code. Also simplify the custom key bindings handling, by using the
1545         global list instead of moving it to a HashMap.
1546         (WebCore::KeyBindingTranslator::getEditorCommandsForKeyEvent): Deleted.
1547         * platform/gtk/KeyBindingTranslator.h:
1548
1549 2015-06-10  Per Arne Vollan  <peavo@outlook.com>
1550
1551         [WinCairo] Crash on exit when terminating egl
1552         https://bugs.webkit.org/show_bug.cgi?id=145832
1553
1554         Reviewed by Carlos Garcia Campos.
1555
1556         Avoid terminating egl on exit for WinCairo.
1557
1558         * platform/graphics/PlatformDisplay.cpp:
1559         (WebCore::PlatformDisplay::~PlatformDisplay):
1560
1561 2015-06-10  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1562
1563         Refactor AudioContext implementation to enable automatic binding generation of promise-based methods
1564         https://bugs.webkit.org/show_bug.cgi?id=145223
1565
1566         Reviewed by Darin Adler.
1567
1568         Introducing DOMPromise as a typed wrapper above DeferredWrapper.
1569         This DOMPromise allows constraining Promise resolution/rejection to a single resolution type and rejection type. 
1570         This might be useful for typed callback usage of promise based APIs, like getUserMedia() or ReadableStreamReader.read().
1571
1572         Applying DOMPromise to AudioContext close, suspend and resume.
1573         Changed binding code to represent what could be automatically generated by binding generator.
1574         Fixing unneeded copies of std::function callbacks.
1575
1576         Disabling DOMPromise copy constructors to lower chances that resolution/rejection is done twice on the same object.
1577
1578         Covered by existing tests.
1579
1580         * Modules/webaudio/AudioContext.cpp:
1581         (WebCore::AudioContext::addReaction):
1582         (WebCore::AudioContext::setState):
1583         (WebCore::AudioContext::suspend):
1584         (WebCore::AudioContext::resume):
1585         (WebCore::AudioContext::close):
1586         * Modules/webaudio/AudioContext.h:
1587         * bindings/js/JSAudioContextCustom.cpp:
1588         (WebCore::JSAudioContext::suspend):
1589         (WebCore::JSAudioContext::resume):
1590         (WebCore::JSAudioContext::close):
1591         * bindings/js/JSDOMPromise.cpp:
1592         (WebCore::DeferredWrapper::callFunction):
1593         * bindings/js/JSDOMPromise.h:
1594         (WebCore::DeferredWrapper::resolve):
1595         (WebCore::DeferredWrapper::reject):
1596         (WebCore::DOMPromise::DOMPromise):
1597         (WebCore::DOMPromise::resolve):
1598         (WebCore::DOMPromise::reject):
1599
1600 2015-06-10  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
1601
1602         [Streams API] Implement pulling of a source by a ReadableStream
1603         https://bugs.webkit.org/show_bug.cgi?id=145262
1604
1605         Reviewed by Darin Adler
1606
1607         Introduced abstract ReadableStream::doPull() which is overriden in ReadableJSStream.
1608         Added support to call the "pull" JS callback in ReadableJSStream::doPull().
1609         Added calls to pull as requested by the spec (when resolving a read callback, at start time...).
1610
1611         Fixed issue in ReadableStreamReader::read() (use of successCallback(JSValue()) in lieu of endCallback())
1612
1613         Covered by rebased tests.
1614
1615         * Modules/streams/ReadableStream.cpp:
1616         (WebCore::ReadableStream::start): calling pull() once start.
1617         (WebCore::ReadableStream::pull): calling doPull() if readableStream states requires to.
1618         (WebCore::ReadableStream::read): calling pull() after resolving a read callback.
1619         * Modules/streams/ReadableStream.h:
1620         * Modules/streams/ReadableStreamReader.cpp:
1621         (WebCore::ReadableStreamReader::read): fixed JSValue() bug.
1622         * bindings/js/ReadableJSStream.cpp:
1623         (WebCore::ReadableJSStream::doPull): calling of JS callback.
1624         (WebCore::ReadableJSStream::storeException): catches exception and store them.
1625         (WebCore::ReadableJSStream::storeError): refactoring for checkForException.
1626         (WebCore::ReadableJSStream::enqueue):
1627         * bindings/js/ReadableJSStream.h:
1628
1629 2015-06-09  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1630
1631         DeferredWrapper should clear its JS strong references once its promise is resolved/rejected
1632         https://bugs.webkit.org/show_bug.cgi?id=145753
1633
1634         Reviewed by Darin Adler.
1635
1636         Clear strong references at the end of DeferredWrapper::resolve and DeferredWrapper::reject.
1637         Added assertions to check that resolve or reject is called only once.
1638
1639         Removed DeferredWrapper constructor that creates internally its promise.
1640         Reason is DeferredWrapper can be resolved synchronously and promise
1641         will be lost when returning it at the end of the binding promise function.
1642         Updated all custom bindings accordingly.
1643
1644         Covered by existing tests.
1645
1646         * bindings/js/JSAudioContextCustom.cpp:
1647         (WebCore::JSAudioContext::suspend): Updated DeferredWrapper constructor to properly return the promise.
1648         (WebCore::JSAudioContext::resume): Ditto.
1649         (WebCore::JSAudioContext::close): Ditto.
1650         * bindings/js/JSDOMPromise.cpp:
1651         (WebCore::DeferredWrapper::resolve): Cleared strong references after promise resolution.
1652         (WebCore::DeferredWrapper::reject): Cleared strong references after promise rejection.
1653         * bindings/js/JSDOMPromise.h:
1654         (WebCore::DeferredWrapper::resolve): Added ASSERT to check promise is not yet rejected/resolved.
1655         (WebCore::DeferredWrapper::reject): Ditto.
1656         (WebCore::DeferredWrapper::reject<ExceptionCode>): Ditto.
1657         (WebCore::DeferredWrapper::resolve<String>): Ditto.
1658         (WebCore::DeferredWrapper::resolve<bool>): Ditto.
1659         (WebCore::DeferredWrapper::resolve<JSC::JSValue>): Ditto.
1660         (WebCore::char>>):
1661         (WebCore::DeferredWrapper::reject<String>): Ditto.
1662         * bindings/js/JSMediaDevicesCustom.cpp:
1663         (WebCore::JSMediaDevices::getUserMedia): Updated DeferredWrapper constructor to properly return the promise.
1664         * bindings/js/JSReadableStreamReaderCustom.cpp:
1665         (WebCore::JSReadableStreamReader::read): Ditto.
1666         (WebCore::JSReadableStreamReader::closed): Ditto.
1667         * bindings/js/JSSubtleCryptoCustom.cpp:
1668         (WebCore::JSSubtleCrypto::encrypt): Ditto.
1669         (WebCore::JSSubtleCrypto::decrypt): Ditto.
1670         (WebCore::JSSubtleCrypto::sign): Ditto.
1671         (WebCore::JSSubtleCrypto::verify): Ditto.
1672         (WebCore::JSSubtleCrypto::digest): Ditto.
1673         (WebCore::JSSubtleCrypto::generateKey): Ditto.
1674         (WebCore::JSSubtleCrypto::importKey): Ditto.
1675         (WebCore::JSSubtleCrypto::exportKey): Ditto.
1676         (WebCore::JSSubtleCrypto::wrapKey): Ditto.
1677         (WebCore::JSSubtleCrypto::unwrapKey): Ditto.
1678
1679 2015-06-09  Zalan Bujtas  <zalan@apple.com>
1680
1681         Protect FrameView from being destroyed in Document::recalcStyle()
1682         https://bugs.webkit.org/show_bug.cgi?id=143033
1683         rdar://problem/20326871
1684
1685         Reviewed by Andreas Kling.
1686
1687         This patch ensures that FrameView stays valid in Document::recalcStyle().
1688         It follows the defensive pattern we use to deal with the refcounted FrameView (see EventDispatcher::dispatchEvent)
1689
1690         When the iframe destroys itself in the onBeforeLoad callback (as the result of
1691         PostResolutionCallbackDisabler -> HTMLObjectElement::updateWidget -> guardedDispatchBeforeLoadEvent),
1692         we detach the frame and release the FrameView. However Document::recalcStyle() expects
1693         the FrameView to stay valid.
1694
1695         Covered by fast/frames/flattening/crash-remove-iframe-during-object-beforeload.html.
1696
1697         * dom/Document.cpp:
1698         (WebCore::Document::recalcStyle):
1699
1700 2015-06-09  Daegyu Lee  <daegyu.lee@navercorp.com>
1701
1702         3D-transformed video does not display on platforms without accelerated video rendering
1703         https://bugs.webkit.org/show_bug.cgi?id=144782
1704
1705         Reviewed by Simon Fraser.
1706
1707         Video element does not get GraphicsLayer when MediaPlayerPrivate::supportsAcceleratedRendering() returns false
1708         which means not using accelerated video decoding.
1709         Although the video element gets GraphicsLayer by changing the CSS style of video element by javascript,
1710         there is no way to set GraphicsLayer::setDrawsContent(true) for updating the video content.
1711         As a result, after changing the CSS style, the video content does not show.
1712         To avoid missing setDrawsContent(true), add conditions(!supportsAcceleratedRendering() && m_requiresOwnBackingStore).
1713
1714         Test: media/video-transformed-by-javascript.html
1715               media/video-transformed-by-javascript-expected.html
1716
1717         * rendering/RenderLayerBacking.cpp:
1718         (WebCore::RenderLayerBacking::containsPaintedContent):
1719
1720 2015-06-09  Ryosuke Niwa  <rniwa@webkit.org>
1721
1722         REGRESSION(r180867): Tabbing to login field on iCloud.com doesn't have highlight for text
1723         https://bugs.webkit.org/show_bug.cgi?id=145830
1724
1725         Reviewed by Darin Adler.
1726
1727         The bug was caused by setSelection not updating RenderView when there is a style recalc scheduled
1728         that doesn't trigger a layout. Fixed the bug by explicitly updating the selection in
1729         Document::recalcStyle in that case.
1730
1731         Test: editing/selection/update-selection-by-style-change.html
1732
1733         * dom/Document.cpp:
1734         (WebCore::Document::recalcStyle):
1735         * editing/FrameSelection.cpp:
1736         (WebCore::FrameSelection::updateAppearanceAfterLayout): Renamed from didLayout.
1737         * editing/FrameSelection.h:
1738         * page/FrameView.cpp:
1739         (WebCore::FrameView::performPostLayoutTasks):
1740
1741 2015-06-09  Dean Jackson  <dino@apple.com>
1742
1743         MediaControls: Reenable resize of controls on pinch zoom
1744         https://bugs.webkit.org/show_bug.cgi?id=145824
1745         <rdar://problem/21212778>
1746
1747         Reviewed by Darin Adler.
1748
1749         Reinstate the code that updated the scaling of the
1750         controls in response to changes in page scale.
1751         This time around we have to change both the controls
1752         panel, and its blurry background.
1753
1754         * Modules/mediacontrols/mediaControlsApple.js:
1755         (Controller.prototype.set pageScaleFactor): Deleted a comment.
1756         * Modules/mediacontrols/mediaControlsiOS.css:
1757         (video::-webkit-media-controls-panel-background): Set the background to pin
1758         to the bottom of its view.
1759         * Modules/mediacontrols/mediaControlsiOS.js:
1760         (ControllerIOS.prototype.get pageScaleFactor): Basic getter, copied from mediaControlsApple.
1761         (ControllerIOS.prototype.set pageScaleFactor): The setter that reacts to the page scale
1762         and applies an inverse scaling on the control panel using a transform, and adjusts the
1763         height on the background similarly.
1764
1765 2015-06-09  Andreas Kling  <akling@apple.com>
1766
1767         GraphicsContext state stack wasting lots of memory when empty.
1768         <https://webkit.org/b/145817>
1769
1770         Reviewed by Geoffrey Garen.
1771
1772         Give the GraphicsContextState stack an inline capacity of 1, and make sure
1773         to free any heap-allocated backing store when the stack goes empty.
1774
1775         The 1 is because HTMLCanvasElement keeps one "save" on the underlying
1776         GraphicsContext at all times, and this prevents those canvases from always
1777         sitting on an empty stack with 16 capacity.
1778
1779         This saves ~520 kB on cnet.com video pages.
1780
1781         * platform/graphics/GraphicsContext.cpp:
1782         (WebCore::GraphicsContext::restore):
1783         * platform/graphics/GraphicsContext.h:
1784
1785 2015-06-09  Said Abou-Hallawa  <sabouhallawa@apple.com>
1786
1787         SVG Fragment is not rendered if it is the css background image of an HTML element
1788         https://bugs.webkit.org/show_bug.cgi?id=91790
1789
1790         Reviewed by Darin Adler.
1791
1792         To show an SVG fragment, the SVGImage has to scrollToFragment() using
1793         the resource url. The changes http://trac.webkit.org/changeset/164804
1794         and http://trac.webkit.org/changeset/164983 set the url of SVGImage to
1795         to be used later in SVGImage::draw(). The problem is the SVGImage url
1796         is only set when it is the src of an <img> tag. We did not do the same
1797         thing when the SVGImage is the css background image of an HTML element.
1798         
1799         The fix is to set the url of the SVGImage always when it's created by 
1800         the CachedImage. The CachedImage must have a valid url when the SVGImage
1801         is created.
1802
1803         Test: svg/css/svg-resource-fragment-identifier-background.html
1804
1805         * loader/cache/CachedImage.cpp:
1806         (WebCore::CachedImage::load):
1807         (WebCore::CachedImage::checkShouldPaintBrokenImage):
1808         Replace the calls resourceRequest().url() and m_resourceRequest.url() by
1809         calling url() since they are all the same.
1810         
1811         (WebCore::CachedImage::createImage): Pass the resource url to SVGImage
1812         and change ImageObserver& by ImageObserver*, since null is not legal.
1813         
1814         * svg/graphics/SVGImage.cpp:
1815         (WebCore::SVGImage::SVGImage):
1816         * svg/graphics/SVGImage.h: Add a url parameter to SVGImage constructor.
1817         
1818         * svg/graphics/SVGImageCache.cpp:
1819         (WebCore::SVGImageCache::findImageForRenderer): Add a new helper function.
1820         
1821         (WebCore::SVGImageCache::imageSizeForRenderer):
1822         (WebCore::SVGImageCache::imageForRenderer): Code clean up.
1823         
1824         * svg/graphics/SVGImageCache.h: Make imageForRenderer() const.
1825
1826         * svg/graphics/SVGImageForContainer.cpp: Remove unneeded header file.
1827
1828 2015-06-09  Matt Rajca  <mrajca@apple.com>
1829
1830         Add support for toggling playback in MediaSessions and MediaSessionManagers.
1831         https://bugs.webkit.org/show_bug.cgi?id=145822
1832
1833         Reviewed by Eric Carlson.
1834
1835         * Modules/mediasession/MediaSession.cpp: Toggle playback of all active media elements.
1836         (WebCore::MediaSession::togglePlayback):
1837         * Modules/mediasession/MediaSession.h:
1838         * Modules/mediasession/MediaSessionManager.cpp: Toggle playback of all media sessions as described in the
1839           Media Session spec.
1840         (WebCore::MediaSessionManager::togglePlayback):
1841         * Modules/mediasession/MediaSessionManager.h:
1842
1843 2015-06-09  Darin Adler  <darin@apple.com>
1844
1845         Takes two delete key presses to delete pasted emoji up-pointing index finger with skin tone
1846         https://bugs.webkit.org/show_bug.cgi?id=145823
1847
1848         Reviewed by Anders Carlsson.
1849
1850         Tests: editing/deleting/delete-emoji.html
1851
1852         * rendering/RenderText.cpp:
1853         (WebCore::isHangulLVT): Use constants instead of macros. Also changed to take a UChar since
1854         the Hangul processing can work on UTF-16 code unit at a time and doesn't have to handle
1855         surrogate pairs.
1856         (WebCore::isMark): Use U_GC_M_MASK instead of writing the algorithm out another way.
1857         (WebCore::isInArmenianToLimbuRange): Added.
1858         (WebCore::RenderText::previousOffsetForBackwardDeletion): Refactored for clarity and to use
1859         the U16_PREV macro instead of doing what it does in a sloppier way. Added code to allow a
1860         variation selector before an emoji modifier to fix the bug. Changed Hangul logic to work a
1861         code unit at a time, since it can, to use an enum class, and to use constants rather than
1862         all capital macros. Also changed the "dumb" case to use a more appropriate ICU macro.
1863
1864 2015-06-09  Said Abou-Hallawa  <sabouhallawa@apple.com>
1865
1866         feComposite filter does not clip the paint rect to its effect rect when the operator is 'in' or 'atop'
1867         https://bugs.webkit.org/show_bug.cgi?id=137856
1868
1869         Reviewed by Darin Adler.
1870
1871         There was bug in calculating the absolutePaintRect of the feComposite filter
1872         when the operator is equal to 'in' or 'atop'. The absolutePaintRect was set
1873         to the absolutePaintRect of the background FilterEffect which is correct.
1874         What was missing is clipping this rectangle to the maxEffectRect of the
1875         filter which we do for other operators.
1876
1877         Tests: svg/filters/feComposite-background-rect-control-operators.svg
1878
1879         * platform/graphics/IntRect.h:
1880         (WebCore::operator-=):
1881         (WebCore::operator-): Add new operators to IntRect.
1882
1883         * platform/graphics/filters/FEComposite.cpp:
1884         (WebCore::FEComposite::determineAbsolutePaintRect): Make sure the filter
1885         absolutePaintRect is clipped to maxEffectRect for all operators.
1886         
1887         (WebCore::FEComposite::platformApplySoftware): Code clean-up.
1888         
1889         * platform/graphics/filters/FilterEffect.cpp:
1890         (WebCore::FilterEffect::determineAbsolutePaintRect): Move the clipping
1891         part to a separate function.
1892         
1893         (WebCore::FilterEffect::clipAbsolutePaintRect): Clip the absolutePaintRect
1894         to the maxEffectRect of the filter.
1895         
1896         * platform/graphics/filters/FilterEffect.h:
1897
1898 2015-06-09  Matt Rajca  <mrajca@apple.com>
1899
1900         Implement MediaSessionManager to keep track of all MediaSessions.
1901         https://bugs.webkit.org/show_bug.cgi?id=145806
1902
1903         Reviewed by Eric Carlson.
1904
1905         * Modules/mediasession/MediaSession.cpp:
1906         (WebCore::MediaSession::MediaSession): Add ourselves to the MediaSessionManager upon construction.
1907         (WebCore::MediaSession::~MediaSession): Remove ourselves from the MediaSessionManager before destruction.
1908         * Modules/mediasession/MediaSessionManager.cpp: Added to keep track of all living MediaSessions.
1909         (WebCore::MediaSessionManager::singleton):
1910         (WebCore::MediaSessionManager::addMediaSession):
1911         (WebCore::MediaSessionManager::removeMediaSession):
1912         * Modules/mediasession/MediaSessionManager.h: Added.
1913         * WebCore.xcodeproj/project.pbxproj: Added new MediaSessionManager sources.
1914
1915 2015-06-09  Ryuan Choi  <ryuan.choi@navercorp.com>
1916
1917         [CoordinatedGraphics] Remove RefCounted from Tile
1918         https://bugs.webkit.org/show_bug.cgi?id=145788
1919
1920         Reviewed by Darin Adler.
1921
1922         Since r185140, Tile does not need to be RefCounted.
1923
1924         No new tests, no behavior changes.
1925
1926         * platform/graphics/texmap/coordinated/Tile.cpp:
1927         (WebCore::Tile::create): Deleted.
1928         * platform/graphics/texmap/coordinated/Tile.h:
1929         * platform/graphics/texmap/coordinated/TiledBackingStore.cpp:
1930         (WebCore::TiledBackingStore::invalidate):
1931         (WebCore::TiledBackingStore::updateTileBuffers): Simplifies not to use unnecessary Vector.
1932         (WebCore::TiledBackingStore::coverageRatio):
1933         (WebCore::TiledBackingStore::createTiles):
1934         (WebCore::TiledBackingStore::resizeEdgeTiles):
1935         (WebCore::TiledBackingStore::setKeepRect):
1936         (WebCore::TiledBackingStore::tileAt): Deleted one line wrapper.
1937         (WebCore::TiledBackingStore::setTile): Ditto.
1938         (WebCore::TiledBackingStore::removeTile): Ditto.
1939         * platform/graphics/texmap/coordinated/TiledBackingStore.h:
1940
1941 2015-06-09  Chris Dumez  <cdumez@apple.com>
1942
1943         Allow one sync GC per gcTimer interval on critical memory pressure warning
1944         https://bugs.webkit.org/show_bug.cgi?id=145773
1945
1946         Reviewed by Geoffrey Garen.
1947
1948         * bindings/js/GCController.cpp:
1949         (WebCore::GCController::garbageCollectNowIfNotDoneRecently):
1950
1951         Add new GCController::garbageCollectNowIfNotDoneRecently() API that
1952         allows one synchronous GC per full GC timer interval. If called more
1953         than once per interval, it becomes equivalent to garbageCollectSoon()
1954         and merely accelerates the next collection.
1955
1956         * bindings/js/GCController.h:
1957         * platform/MemoryPressureHandler.cpp:
1958         (WebCore::MemoryPressureHandler::releaseCriticalMemory):
1959
1960         Call the new GCController::garbageCollectNowIfNotDoneRecently() on
1961         critical memory pressure instead of garbageCollectionSoon() to try
1962         as do a synchronous GC if one wasn't already done recently.
1963         Also drop call to fullSweep() as GCController::garbageCollectNow*()
1964         already do a sweep after the collection.
1965
1966 2015-06-09  Darin Adler  <darin@apple.com>
1967
1968         Follow-up fix for:
1969         JavaScript bindings are unnecessarily checking for impossible empty JSValue arguments
1970         https://bugs.webkit.org/show_bug.cgi?id=145811
1971
1972         There was one unusual case in the bindings generator that was depending on this.
1973
1974         * bindings/js/JSDOMBinding.h:
1975         (WebCore::argumentOrNull): Deleted.
1976         * bindings/scripts/CodeGeneratorJS.pm:
1977         (GenerateParametersCheck): Stop using argumentOrNull.
1978         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp: Updated.
1979         * bindings/scripts/test/JS/JSTestObj.cpp: Updated.
1980
1981 2015-06-09  Darin Adler  <darin@apple.com>
1982
1983         JavaScript bindings are unnecessarily checking for impossible empty JSValue arguments
1984         https://bugs.webkit.org/show_bug.cgi?id=145811
1985
1986         Reviewed by Antti Koivisto.
1987
1988         At some point, someone who didn't understand JSValue very well added checks for
1989         isEmpty (and the function isEmpty itself) in JavaScript bindings. But the engine
1990         never would pass an empty JSValue to a binding; that's used only inside the
1991         engine itself. I think this was done by some Google V8 experts a while back, so
1992         it's not entirely surprising they didn't understand this. But we don't want to
1993         keep all that unneeded code.
1994
1995         * bindings/js/JSAudioTrackCustom.cpp:
1996         (WebCore::JSAudioTrack::setKind): Removed the isEmpty clause here. I presume this
1997         was copied and pasted from script-generated bindings. While I was at it, I used a
1998         slightly more efficient code path that avoids doing a ref/deref on the string by
1999         using auto&. That's trickier to do correctly for functions with more than one
2000         argument, so I didn't do it in the bindings generator yet.
2001         (WebCore::JSAudioTrack::setLanguage): Ditto.
2002         * bindings/js/JSTextTrackCustom.cpp:
2003         (WebCore::JSTextTrack::setKind): Ditto.
2004         (WebCore::JSTextTrack::setLanguage): Ditto.
2005         * bindings/js/JSVideoTrackCustom.cpp:
2006         (WebCore::JSVideoTrack::setKind): Ditto.
2007         (WebCore::JSVideoTrack::setLanguage): Ditto.
2008
2009         * bindings/scripts/CodeGeneratorJS.pm:
2010         (GenerateImplementation): Use "=" syntax instead of constructor style syntax for
2011         the argument processing. I think this is more readable.
2012         (GenerateParametersCheck): For the enum code path, did the more efficient auto&
2013         idiom to avoid ref/deref on a string. For the toExistingAtomicString path,
2014         restructured so we don't have to check the flag indicating that something is atomic.
2015         Later we could also avoid the ref/deref; added a FIXME about that.
2016         (GetNativeType): Use String, not const String, for local variables. Sure, the
2017         string is const, but so is every other local variable type we use! No need to be
2018         wordy about it.
2019         (JSValueToNative): Removed the uneeded calls to isEmpty. Since the call sites no
2020         longer use construction syntax, used initializer syntax style for a couple classes
2021         that are constructed with multiple arguments.
2022
2023         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp: Updated.
2024         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp: Ditto.
2025         * bindings/scripts/test/JS/JSTestEventTarget.cpp: Ditto.
2026         * bindings/scripts/test/JS/JSTestInterface.cpp: Ditto.
2027         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp: Ditto.
2028         * bindings/scripts/test/JS/JSTestNondeterministic.cpp: Ditto.
2029         * bindings/scripts/test/JS/JSTestObj.cpp: Ditto.
2030         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp: Ditto.
2031         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp: Ditto.
2032         * bindings/scripts/test/JS/JSTestTypedefs.cpp: Ditto.
2033
2034 2015-06-09  Csaba Osztrogonác  <ossy@webkit.org>
2035
2036         Fix unused private field warning in GraphicsLayerUpdater.h
2037         https://bugs.webkit.org/show_bug.cgi?id=145757
2038
2039         Reviewed by Darin Adler.
2040
2041         * platform/graphics/GraphicsLayerUpdater.cpp:
2042         (WebCore::GraphicsLayerUpdater::GraphicsLayerUpdater):
2043         * platform/graphics/GraphicsLayerUpdater.h:
2044
2045 2015-06-09  Yusuke Suzuki  <utatane.tea@gmail.com>
2046
2047         Crash when passing Symbol to NPAPI plugin objects
2048         https://bugs.webkit.org/show_bug.cgi?id=145798
2049
2050         Reviewed by Darin Adler.
2051
2052         Test: plugins/npruntime/script-object-with-symbols.html
2053
2054         For C bridge APIs, we add guards for symbols.
2055         This is the same to the existing guards in Objective-C APIs.
2056
2057         * bridge/c/c_class.cpp:
2058         (JSC::Bindings::CClass::methodNamed):
2059         (JSC::Bindings::CClass::fieldNamed):
2060         * bridge/objc/objc_class.mm:
2061         (JSC::Bindings::ObjcClass::methodNamed):
2062         (JSC::Bindings::ObjcClass::fieldNamed):
2063         (JSC::Bindings::ObjcClass::fallbackObject):
2064
2065 2015-06-09  Csaba Osztrogonác  <ossy@webkit.org>
2066
2067         [cmake] Fix the style issues in cmake project files
2068         https://bugs.webkit.org/show_bug.cgi?id=145755
2069
2070         Reviewed by Darin Adler.
2071
2072         * CMakeLists.txt:
2073         * PlatformEfl.cmake:
2074         * PlatformGTK.cmake:
2075         * PlatformMac.cmake:
2076         * PlatformWin.cmake:
2077         * PlatformWinCairo.cmake:
2078
2079 2015-06-09  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
2080
2081         [Streams API] ReadableJSStream should handle JS source getters that throw
2082         https://bugs.webkit.org/show_bug.cgi?id=145600
2083
2084         Reviewed by Darin Adler.
2085
2086         Checking whether there is an exception when trying to access to a source method.
2087         If so, rethrowing it in case of "start".
2088
2089         Refactoring of code to prepare pulling, cancelling and additional parameter handling in ReadableStream construtor.
2090
2091         Fixed the case of ReadableStream constructor called with an undefined parameter.
2092
2093         Covered by rebased test expectation.
2094
2095         * bindings/js/JSReadableStreamCustom.cpp:
2096         (WebCore::constructJSReadableStream): Refactoring to group all parameter check and exception handling in ReadableJSStream::create.
2097         * bindings/js/ReadableJSStream.cpp:
2098         (WebCore::getPropertyFromObject):
2099         (WebCore::callFunction):
2100         (WebCore::ReadableJSStream::invoke): Added method to be used also for pulling and cancelling.
2101         (WebCore::ReadableJSStream::doStart):
2102         (WebCore::ReadableJSStream::create):
2103         * bindings/js/ReadableJSStream.h:
2104
2105 2015-06-08  Dan Bernstein  <mitz@apple.com>
2106
2107         Made MicroTask.h a project header.
2108
2109         Rubber-stamped by Anders Carlsson.
2110
2111         * WebCore.xcodeproj/project.pbxproj: Demoted MicroTask.h from Public to Project. WebCore
2112         doesn’t have public headers, and this header isn’t used by WebKit.
2113
2114 2015-06-08  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
2115
2116         Purge PassRefPtr in JavaScriptCore
2117         https://bugs.webkit.org/show_bug.cgi?id=145750
2118
2119         Reviewed by Darin Adler.
2120
2121         As a step to purge PassRefPtr, this patch replaces PassRefPtr with Ref or RefPtr.
2122
2123         No new tests, no behavior changes.
2124
2125         * bindings/js/JSDOMWindowBase.cpp:
2126         (WebCore::JSDOMWindowBase::commonVM):
2127
2128 2015-06-08  Zalan Bujtas  <zalan@apple.com>
2129
2130         Subpixel rendering: Clip-path does not work properly on subpixel positions.
2131         https://bugs.webkit.org/show_bug.cgi?id=145749
2132         rdar://problem/20824305
2133
2134         Reviewed by Simon Fraser.
2135
2136         This patch ensures that clip-path is device pixel snapped both for composited and
2137         non-composited content.
2138
2139         Tests: compositing/masks/compositing-clip-path-on-subpixel-position.html
2140                fast/masking/clip-path-on-subpixel-position.html
2141
2142         * rendering/RenderLayer.cpp:
2143         (WebCore::RenderLayer::setupClipPath):
2144         * rendering/RenderLayerBacking.cpp:
2145         (WebCore::RenderLayerBacking::updateMaskingLayerGeometry):
2146
2147 2015-06-08  Chris Dumez  <cdumez@apple.com>
2148
2149         Access GCController instance via GCController::singleton() instead of a free function
2150         https://bugs.webkit.org/show_bug.cgi?id=145776
2151
2152         Reviewed by Darin Adler.
2153
2154         Access GCController instance via GCController::singleton() instead of a
2155         free function as per coding style and for consistency with other
2156         singleton classes in the codebase.
2157
2158         * bindings/js/GCController.cpp:
2159         (WebCore::GCController::singleton):
2160         (WebCore::gcController): Deleted.
2161         * bindings/js/GCController.h:
2162         * bindings/js/JSDOMWindowShell.cpp:
2163         (WebCore::JSDOMWindowShell::setWindow):
2164         * bindings/js/ScriptCachedFrameData.cpp:
2165         (WebCore::ScriptCachedFrameData::clear):
2166         * bindings/js/ScriptController.cpp:
2167         (WebCore::collectGarbageAfterWindowShellDestruction):
2168         * platform/MemoryPressureHandler.cpp:
2169         (WebCore::MemoryPressureHandler::releaseCriticalMemory):
2170
2171 2015-06-08  Daniel Bates  <dabates@apple.com>
2172
2173         Mouse release on AutoFill button activates it; should only activate on click
2174         https://bugs.webkit.org/show_bug.cgi?id=145774
2175         <rdar://problem/21069245>
2176
2177         Reviewed by Ryosuke Niwa.
2178
2179         Fixes an issue where a click event was dispatched to a shadow tree node regardless of whether
2180         both the mouse press and mouse release were targeted at it. In particular, releasing the mouse
2181         on the AutoFill button activates it regardless of whether the mouse was pressed on it.
2182
2183         Currently we always dispatch a click event to a node n where the mouse was released when n is
2184         in a shadow tree regardless of whether the mouse was pressed on n. Instead we should only
2185         dispatch a click event to n if the mouse was pressed and released on n. If n is a shadow tree
2186         descendant, the mouse was released on n, and n never received a mouse press then we should
2187         dispatch the click event at the shadow host element of n to preserve the illusion to web
2188         developers that the shadow host element is a single element.
2189
2190         Test: fast/forms/auto-fill-button/mouse-down-input-mouse-release-auto-fill-button.html
2191
2192         * page/EventHandler.cpp:
2193         (WebCore::targetNodeForClickEvent): Added; returns the target node for the DOM click event.
2194         (WebCore::EventHandler::handleMouseReleaseEvent): Modified to use dispatch the DOM click event
2195         at the node returned by targetNodeForClickEvent().
2196         (WebCore::mouseIsReleasedOnPressedElement): Deleted.
2197
2198 2015-06-08  Chris Dumez  <cdumez@apple.com>
2199
2200         WebContent crash in WebCore::Page::sessionID() const + 0 (Page.cpp:1660)
2201         https://bugs.webkit.org/show_bug.cgi?id=145748
2202         <rdar://problem/21226577>
2203
2204         Reviewed by Brady Eidson.
2205
2206         We would sometimes crash when pruning the PageCache because it was
2207         possible for frames to still be loading while in the PageCache and
2208         we would try to stop the load when the CachedFrame is destroyed. This
2209         code path was not supposed to be exercised as we were not supposed to
2210         have pages still loading inside the PageCache.
2211
2212         r185017 made sure we don't insert into the PageCache pages that are
2213         still loading. However, nothing was preventing content from starting
2214         new loads in their 'pagehide' event handlers, *after* the decision
2215         to put the page in the PageCache was made.
2216
2217         This patch prevents content from starting loads from a 'pagehide'
2218         event handler so that we can no longer have content that is loading
2219         inside the PageCache. 'ping' image loads still go through though as
2220         these are specially handled and use PingLoaders.
2221
2222         Tests: http/tests/navigation/image-load-in-pagehide-handler.html
2223                http/tests/navigation/subframe-pagehide-handler-starts-load.html
2224                http/tests/navigation/subframe-pagehide-handler-starts-load2.html
2225
2226         * loader/FrameLoader.cpp:
2227         (WebCore::FrameLoader::FrameLoader):
2228         (WebCore::FrameLoader::stopLoading):
2229         (WebCore::FrameLoader::loadURL):
2230         (WebCore::FrameLoader::loadWithDocumentLoader):
2231         (WebCore::FrameLoader::stopAllLoaders):
2232         (WebCore::FrameLoader::handleBeforeUnloadEvent):
2233         * loader/FrameLoader.h:
2234         (WebCore::FrameLoader::pageDismissalEventBeingDispatched):
2235         (WebCore::FrameLoader::PageDismissalEventType::PageDismissalEventType):
2236         (WebCore::FrameLoader::PageDismissalEventType::operator Page::DismissalType):
2237
2238         Add wrapper class for m_pageDismissalEventBeingDispatched member type.
2239         The wrapper takes care of updating the m_dismissalEventBeingDispatched
2240         member on the Page every time the member on FrameLoader is updated. We
2241         now cache this information on the Page so that clients can cheaply
2242         query if a dismissal event is being dispatched in any of the Page's
2243         frame, without having to traverse the frame tree.
2244
2245         * loader/ImageLoader.cpp:
2246         (WebCore::pageIsBeingDismissed):
2247
2248         * loader/cache/CachedResource.cpp:
2249         (WebCore::CachedResource::load):
2250
2251         Abort the load early if we are currently dispatching a 'pagehide'
2252         event. We don't allow new loads at such point because we've already
2253         made the decision to add the Page to the PageCache.
2254
2255         * loader/cache/CachedResourceLoader.cpp:
2256         (WebCore::CachedResourceLoader::requestImage):
2257
2258         * page/Chrome.cpp:
2259         (WebCore::Chrome::runModal): Deleted.
2260         (WebCore::Chrome::setToolbarsVisible): Deleted.
2261         (WebCore::Chrome::toolbarsVisible): Deleted.
2262         (WebCore::Chrome::runJavaScriptConfirm): Deleted.
2263         (WebCore::Chrome::runJavaScriptPrompt): Deleted.
2264         (WebCore::Chrome::shouldInterruptJavaScript): Deleted.
2265         * page/Chrome.h:
2266         * page/ChromeClient.h:
2267         * page/DOMWindow.cpp:
2268         (WebCore::DOMWindow::canShowModalDialogNow):
2269
2270         Drop ChromeClient::shouldRunModalDialogDuringPageDismissal() and code
2271         using it as it is unused and I did not think it was worth updating
2272         this code.
2273
2274         * page/Page.h:
2275         (WebCore::Page::dismissalEventBeingDispatched):
2276         (WebCore::Page::setDismissalEventBeingDispatched):
2277
2278         Add a m_dismissalEventBeingDispatched member to the Page so that we can
2279         easily query if a dismissal event is being dispatched in any of the
2280         frames, without having to traverse the frame tree. I suspect more call
2281         sites of FrameLoader::pageDismissalEventBeingDispatched() may actually
2282         want this but I did not make such change in this patch. It is important
2283         to check all the frames and not simply the current one because a frame's
2284         pagehide event handler may trigger a load in another frame.
2285
2286 2015-06-08  Hunseop Jeong  <hs85.jeong@samsung.com>
2287
2288         Replaced 0 with nullptr in WebCore/Modules.
2289         https://bugs.webkit.org/show_bug.cgi?id=145758
2290
2291         Reviewed by Darin Adler.
2292
2293         No new tests, no behavior changes.
2294
2295         * Modules/battery/BatteryManager.cpp:
2296         (WebCore::BatteryManager::BatteryManager):
2297         * Modules/encryptedmedia/CDM.cpp:
2298         (WebCore::CDM::CDM):
2299         * Modules/encryptedmedia/MediaKeys.cpp:
2300         (WebCore::MediaKeys::MediaKeys):
2301         (WebCore::MediaKeys::~MediaKeys):
2302         * Modules/indexeddb/IDBCursor.h:
2303         (WebCore::IDBCursor::continueFunction):
2304         * Modules/indexeddb/IDBCursorBackendOperations.cpp:
2305         (WebCore::CursorAdvanceOperation::perform):
2306         (WebCore::CursorIterationOperation::perform):
2307         * Modules/indexeddb/IDBDatabase.cpp:
2308         (WebCore::IDBDatabase::transactionFinished):
2309         * Modules/indexeddb/IDBDatabaseCallbacksImpl.cpp:
2310         (WebCore::IDBDatabaseCallbacksImpl::IDBDatabaseCallbacksImpl):
2311         * Modules/indexeddb/IDBEventDispatcher.cpp:
2312         (WebCore::IDBEventDispatcher::dispatch):
2313         * Modules/indexeddb/IDBIndex.h:
2314         (WebCore::IDBIndex::openCursor):
2315         (WebCore::IDBIndex::count):
2316         (WebCore::IDBIndex::openKeyCursor):
2317         * Modules/indexeddb/IDBObjectStore.cpp:
2318         (WebCore::IDBObjectStore::add):
2319         (WebCore::IDBObjectStore::put):
2320         (WebCore::IDBObjectStore::index):
2321         (WebCore::IDBObjectStore::openCursor):
2322         * Modules/indexeddb/IDBObjectStore.h:
2323         (WebCore::IDBObjectStore::count):
2324         * Modules/indexeddb/IDBOpenDBRequest.cpp:
2325         (WebCore::IDBOpenDBRequest::onUpgradeNeeded):
2326         (WebCore::IDBOpenDBRequest::onSuccess):
2327         * Modules/indexeddb/IDBRequest.cpp:
2328         (WebCore::IDBRequest::IDBRequest):
2329         * Modules/indexeddb/IDBTransaction.cpp:
2330         (WebCore::IDBTransaction::OpenCursorNotifier::cursorFinished):
2331         * Modules/indexeddb/IDBTransactionBackend.cpp:
2332         (WebCore::IDBTransactionBackend::commit):
2333         * Modules/indexeddb/IDBTransactionBackendOperations.cpp:
2334         (WebCore::OpenCursorOperation::perform):
2335         * Modules/indieui/UIRequestEvent.cpp:
2336         (WebCore::UIRequestEventInit::UIRequestEventInit):
2337         (WebCore::UIRequestEvent::UIRequestEvent):
2338         * Modules/mediasource/MediaSource.cpp:
2339         (WebCore::MediaSource::MediaSource):
2340         (WebCore::MediaSource::setReadyState):
2341         (WebCore::MediaSource::removeSourceBuffer):
2342         * Modules/mediasource/SourceBuffer.cpp:
2343         (WebCore::SourceBuffer::~SourceBuffer):
2344         (WebCore::SourceBuffer::removedFromMediaSource):
2345         * Modules/mediastream/MediaStream.cpp:
2346         (WebCore::MediaStream::~MediaStream):
2347         * Modules/mediastream/MediaStreamEvent.cpp:
2348         (WebCore::MediaStreamEventInit::MediaStreamEventInit):
2349         * Modules/mediastream/MediaStreamTrackEvent.cpp:
2350         (WebCore::MediaStreamTrackEventInit::MediaStreamTrackEventInit):
2351         * Modules/mediastream/RTCDataChannel.cpp:
2352         (WebCore::RTCDataChannel::stop):
2353         * Modules/mediastream/UserMediaRequest.cpp:
2354         (WebCore::UserMediaRequest::contextDestroyed):
2355         * Modules/notifications/Notification.cpp:
2356         (WebCore::Notification::Notification):
2357         * Modules/notifications/Notification.h:
2358         * Modules/speech/SpeechSynthesis.cpp:
2359         (WebCore::SpeechSynthesis::SpeechSynthesis):
2360         (WebCore::SpeechSynthesis::setPlatformSynthesizer):
2361         (WebCore::SpeechSynthesis::cancel):
2362         (WebCore::SpeechSynthesis::handleSpeakingCompleted):
2363         * Modules/speech/SpeechSynthesisUtterance.cpp:
2364         (WebCore::SpeechSynthesisUtterance::~SpeechSynthesisUtterance):
2365         * Modules/webaudio/AudioBufferSourceNode.cpp:
2366         (WebCore::AudioBufferSourceNode::AudioBufferSourceNode):
2367         (WebCore::AudioBufferSourceNode::clearPannerNode):
2368         * Modules/webaudio/AudioContext.cpp:
2369         (WebCore::AudioContext::createMediaStreamSource):
2370         * Modules/webaudio/MediaElementAudioSourceNode.cpp:
2371         (WebCore::MediaElementAudioSourceNode::~MediaElementAudioSourceNode):
2372         * Modules/webaudio/OscillatorNode.cpp:
2373         (WebCore::OscillatorNode::setType):
2374         (WebCore::OscillatorNode::process):
2375         * Modules/webdatabase/DatabaseManager.cpp:
2376         (WebCore::DatabaseManager::DatabaseManager):
2377         * Modules/webdatabase/DatabaseThread.cpp:
2378         (WebCore::DatabaseThread::DatabaseThread):
2379         (WebCore::DatabaseThread::databaseThread):
2380         * Modules/webdatabase/DatabaseThread.h:
2381         * Modules/webdatabase/DatabaseTracker.cpp:
2382         (WebCore::DatabaseTracker::DatabaseTracker):
2383         * Modules/webdatabase/SQLCallbackWrapper.h:
2384         (WebCore::SQLCallbackWrapper::clear):
2385         (WebCore::SQLCallbackWrapper::unwrap):
2386         * Modules/webdatabase/SQLStatementBackend.cpp:
2387         (WebCore::SQLStatementBackend::clearFailureDueToQuota):
2388         * Modules/webdatabase/SQLTransaction.cpp:
2389         (WebCore::SQLTransaction::deliverTransactionErrorCallback):
2390         * Modules/webdatabase/SQLTransactionBackend.cpp:
2391         (WebCore::SQLTransactionBackend::doCleanup):
2392         (WebCore::SQLTransactionBackend::getNextStatement):
2393         * Modules/webdatabase/SQLTransactionCoordinator.cpp:
2394         (WebCore::SQLTransactionCoordinator::releaseLock):
2395         * Modules/websockets/ThreadableWebSocketChannelClientWrapper.cpp:
2396         (WebCore::ThreadableWebSocketChannelClientWrapper::ThreadableWebSocketChannelClientWrapper):
2397         (WebCore::ThreadableWebSocketChannelClientWrapper::clearPeer):
2398         (WebCore::ThreadableWebSocketChannelClientWrapper::clearClient):
2399         * Modules/websockets/WebSocket.cpp:
2400         (WebCore::WebSocket::stop):
2401         * Modules/websockets/WebSocketChannel.cpp:
2402         (WebCore::WebSocketChannel::disconnect):
2403         (WebCore::WebSocketChannel::didCloseSocketStream):
2404         * Modules/websockets/WebSocketFrame.h:
2405         * Modules/websockets/WebSocketHandshake.cpp:
2406         (WebCore::WebSocketHandshake::clearScriptExecutionContext):
2407         (WebCore::WebSocketHandshake::readStatusLine):
2408         * Modules/websockets/WorkerThreadableWebSocketChannel.cpp:
2409         (WebCore::WorkerThreadableWebSocketChannel::Peer::disconnect):
2410         (WebCore::WorkerThreadableWebSocketChannel::Peer::didClose):
2411         (WebCore::WorkerThreadableWebSocketChannel::Bridge::Bridge):
2412
2413 2015-06-08  Chris Fleizach  <cfleizach@apple.com>
2414
2415         AX: improve list heuristics (presentational use versus actual lists)
2416        ​https://bugs.webkit.org/show_bug.cgi?id=134187
2417
2418         Unreviewed. Rolling this change out temporarily.
2419
2420         * accessibility/AccessibilityList.cpp:
2421         (WebCore::AccessibilityList::isDescriptionList):
2422         (WebCore::AccessibilityList::determineAccessibilityRole):
2423         (WebCore::AccessibilityList::childHasPseudoVisibleListItemMarkers): Deleted.
2424         * accessibility/AccessibilityList.h:
2425
2426 2015-06-08  Eric Carlson  <eric.carlson@apple.com>
2427
2428         [Mac] Enable AVFoundation by default when QTKit is disabled by default
2429         https://bugs.webkit.org/show_bug.cgi?id=145760
2430
2431         Reviewed by Alexey Proskuryakov.
2432
2433         No new tests, this change makes existing tests pass.
2434
2435         Settings::gAVFoundationEnabled defaults to true.
2436
2437         * page/Settings.cpp:
2438         (WebCore::invalidateAfterGenericFamilyChange):
2439
2440 2015-06-08  Ryosuke Niwa  <rniwa@webkit.org>
2441
2442         Explicitly dismiss correction panel when user types a new character
2443         https://bugs.webkit.org/show_bug.cgi?id=145732
2444         <rdar://problem/19596892>
2445
2446         Reviewed by Darin Adler.
2447
2448         Explicitly dismiss the correction panel when the user types a new character.
2449         This patch shouldn't change any behavior we're currently relying on AppKit to do the same.
2450
2451         Manually ran tests in ManualTests/autocorrection.
2452
2453         * editing/AlternativeTextController.cpp:
2454         (WebCore::AlternativeTextController::respondToAppliedEditing):
2455
2456 2015-06-08  Javier Fernandez  <jfernandez@igalia.com>
2457
2458         [CSS Grid Layout] Setting height on a grid item doesn't have any effect
2459         https://bugs.webkit.org/show_bug.cgi?id=145604
2460
2461         Reviewed by Sergio Villar Senin.
2462
2463         Box Alignment spec states that stretch is only possible when height is
2464         'auto' and no 'auto' margins are used.
2465
2466         It might be the case that style changes so that stretching is not allowed,
2467         hence we need to detect it and clear the override height the stretching
2468         algorithm previously set. The new layout triggered by the style change
2469         will then set grid item's height according to the new style rules.
2470
2471         Test: fast/css-grid-layout/grid-item-should-not-be-stretched-when-height-or-margin-change.html
2472
2473         * rendering/RenderGrid.cpp:
2474         (WebCore::RenderGrid::applyStretchAlignmentToChildIfNeeded):
2475
2476 2015-06-08  Brady Eidson  <beidson@apple.com>
2477
2478         Completely remove all IDB properties/constructors when it is disabled at runtime.
2479         rdar://problem/18429374 and https://bugs.webkit.org/show_bug.cgi?id=137034
2480
2481         Reviewed by Geoffrey Garen.
2482
2483         Test: storage/indexeddb/properties-disabled-at-runtime.html
2484
2485         - Make constructors all runtime enabled.
2486         - Remove autogeneration of the window.(webkit)indexedDB accessors.
2487         - Add manual overrides for the (webkit)indexedDB accessors at runtime.
2488         
2489         * Modules/indexeddb/DOMWindowIndexedDatabase.idl:
2490         * Modules/indexeddb/IDBAny.idl:
2491         * Modules/indexeddb/IDBCursor.idl:
2492         * Modules/indexeddb/IDBCursorWithValue.idl:
2493         * Modules/indexeddb/IDBDatabase.idl:
2494         * Modules/indexeddb/IDBFactory.idl:
2495         * Modules/indexeddb/IDBIndex.idl:
2496         * Modules/indexeddb/IDBKeyRange.idl:
2497         * Modules/indexeddb/IDBObjectStore.idl:
2498         * Modules/indexeddb/IDBOpenDBRequest.idl:
2499         * Modules/indexeddb/IDBRequest.idl:
2500         * Modules/indexeddb/IDBTransaction.idl:
2501         * Modules/indexeddb/IDBVersionChangeEvent.idl:
2502         * page/DOMWindow.idl:
2503
2504         * bindings/js/JSDOMWindowCustom.cpp:
2505         (WebCore::jsDOMWindowIndexedDB):
2506         (WebCore::JSDOMWindow::getOwnPropertySlot):
2507
2508 2015-06-08  Michael Catanzaro  <mcatanzaro@igalia.com>
2509
2510         [SOUP] Performs DNS prefetch when a proxy is configured (information leak)
2511         https://bugs.webkit.org/show_bug.cgi?id=145542
2512
2513         Reviewed by Alexey Proskuryakov.
2514
2515         No new tests, because it's hard to test whether a DNS request has been sent. We could do
2516         this by adding new API to modify the GProxyResolver and GResolver used by the SoupSession in
2517         the network process, but even if such API were desirable, it would be a big job. Tests
2518         should not be allowed to dictate our public API.
2519
2520         * platform/network/DNSResolveQueue.cpp:
2521         (WebCore::DNSResolveQueue::add): Do not check whether the system is using a proxy, since
2522         this can't be determined for all ports here.
2523         (WebCore::DNSResolveQueue::timerFired): Do not check whether the system is using a proxy,
2524         since this can't be determined for all ports here.
2525         (WebCore::DNSResolveQueue::DNSResolveQueue): Remove member variables and member functions
2526         that are only needed by the CF backend. Rename platformResolve to
2527         platformMaybeResolveHost.
2528         (WebCore::DNSResolveQueue::isUsingProxy): Moved to DNSCFNet.cpp.
2529         * platform/network/DNSResolveQueue.h: Remove member variables that are only needed by the
2530         CF backend.
2531         * platform/network/cf/DNSCFNet.cpp:
2532         (WebCore::proxyIsEnabledInSystemPreferences): Renamed from
2533         platformProxyIsEnabledInSystemPreferences.
2534         (WebCore::isUsingProxy): Moved from DNSResolveQueue.cpp. The member variables removed from
2535         DNSResolveQueue are not static here. This is safe since it's a singleton.
2536         (WebCore::DNSResolveQueue::platformMaybeResolveHost): Renamed from platformResolve.
2537         Bail early from here if a proxy is configured.
2538         (WebCore::DNSResolveQueue::platformProxyIsEnabledInSystemPreferences): Renamed to
2539         proxyIsEnabledInSystemPreferences.
2540         (WebCore::DNSResolveQueue::platformResolve): Renamed to platformMaybeResolveHost.
2541         * platform/network/soup/DNSSoup.cpp:
2542         (WebCore::gotProxySettingsCallback): Added. Call soup_session_prefetch_dns from here only
2543         if a proxy would not be used to resolve the host.
2544         (WebCore::DNSResolveQueue::platformMaybeResolveHost): Renamed from platformResolve.
2545         Look up proxy settings using g_proxy_resolver_lookup_async rather than calling
2546         soup_session_prefetch_dns directly.
2547         (WebCore::DNSResolveQueue::platformProxyIsEnabledInSystemPreferences): Deleted.
2548         (WebCore::DNSResolveQueue::platformResolve): Renamed to platformMaybeResolveHost.
2549
2550 2015-06-08  Hunseop Jeong  <hs85.jeong@samsung.com>
2551
2552         Use modern for-loops in WebCore/Modules - 2
2553         https://bugs.webkit.org/show_bug.cgi?id=145541
2554
2555         Reviewed by Darin Adler.
2556
2557         No new tests, no behavior changes.
2558
2559         * Modules/mediastream/RTCConfiguration.h:
2560         (WebCore::RTCConfiguration::iceServers):
2561         * Modules/mediastream/RTCDTMFSender.cpp:
2562         (WebCore::RTCDTMFSender::scheduledEventTimerFired):
2563         * Modules/mediastream/RTCDataChannel.cpp:
2564         (WebCore::RTCDataChannel::scheduledEventTimerFired):
2565         * Modules/mediastream/RTCPeerConnection.cpp:
2566         (WebCore::processIceServer):
2567         (WebCore::RTCPeerConnection::~RTCPeerConnection):
2568         (WebCore::RTCPeerConnection::getStreamById):
2569         (WebCore::RTCPeerConnection::hasLocalStreamWithTrackId):
2570         (WebCore::RTCPeerConnection::stop):
2571         (WebCore::RTCPeerConnection::scheduledEventTimerFired):
2572         * Modules/mediastream/RTCStatsReport.cpp:
2573         (WebCore::RTCStatsReport::names):
2574         * Modules/navigatorcontentutils/NavigatorContentUtils.cpp:
2575         (WebCore::initProtocolHandlerWhitelist):
2576         * Modules/speech/SpeechSynthesis.cpp:
2577         (WebCore::SpeechSynthesis::getVoices):
2578         * Modules/webaudio/AudioBuffer.cpp:
2579         (WebCore::AudioBuffer::memoryCost):
2580         * Modules/webaudio/AudioContext.cpp:
2581         (WebCore::AudioContext::createMediaStreamSource):
2582         (WebCore::AudioContext::derefFinishedSourceNodes):
2583         (WebCore::AudioContext::derefUnfinishedSourceNodes):
2584         (WebCore::AudioContext::handleDeferredFinishDerefs):
2585         (WebCore::AudioContext::handleDirtyAudioSummingJunctions):
2586         (WebCore::AudioContext::handleDirtyAudioNodeOutputs):
2587         (WebCore::AudioContext::updateAutomaticPullNodes):
2588         (WebCore::AudioContext::processAutomaticPullNodes):
2589         * Modules/webaudio/AudioNode.cpp:
2590         (WebCore::AudioNode::updateChannelsForInputs):
2591         (WebCore::AudioNode::checkNumberOfChannelsForInput):
2592         (WebCore::AudioNode::pullInputs):
2593         (WebCore::AudioNode::inputsAreSilent):
2594         (WebCore::AudioNode::silenceOutputs):
2595         (WebCore::AudioNode::unsilenceOutputs):
2596         (WebCore::AudioNode::enableOutputsIfNecessary):
2597         (WebCore::AudioNode::disableOutputsIfNecessary):
2598         (WebCore::AudioNode::finishDeref):
2599         * Modules/webaudio/AudioNodeInput.cpp:
2600         (WebCore::AudioNodeInput::numberOfChannels):
2601         (WebCore::AudioNodeInput::sumAllConnections):
2602         * Modules/webaudio/AudioNodeOutput.cpp:
2603         (WebCore::AudioNodeOutput::propagateChannelCount):
2604         (WebCore::AudioNodeOutput::disable):
2605         (WebCore::AudioNodeOutput::enable):
2606         * Modules/webaudio/AudioParam.cpp:
2607         (WebCore::AudioParam::calculateFinalValues):
2608         * Modules/webaudio/AudioParamTimeline.cpp:
2609         (WebCore::AudioParamTimeline::insertEvent):
2610         * Modules/webaudio/AudioSummingJunction.cpp:
2611         (WebCore::AudioSummingJunction::updateRenderingState):
2612         * Modules/webaudio/MediaStreamAudioSource.cpp:
2613         (WebCore::MediaStreamAudioSource::setAudioFormat):
2614         (WebCore::MediaStreamAudioSource::consumeAudio):
2615         * Modules/webaudio/WaveShaperProcessor.cpp:
2616         (WebCore::WaveShaperProcessor::setOversample):
2617         * Modules/webdatabase/DatabaseThread.cpp:
2618         (WebCore::DatabaseThread::handlePausedQueue):
2619         (WebCore::DatabaseThread::databaseThread):
2620         * Modules/webdatabase/DatabaseTracker.cpp:
2621         (WebCore::DatabaseTracker::interruptAllDatabasesForContext):
2622         (WebCore::DatabaseTracker::databaseNamesForOrigin):
2623         (WebCore::DatabaseTracker::getOpenDatabases):
2624         (WebCore::DatabaseTracker::usageForOrigin):
2625         (WebCore::DatabaseTracker::deleteAllDatabases):
2626         (WebCore::DatabaseTracker::deleteOrigin):
2627         (WebCore::DatabaseTracker::deleteDatabaseFile):
2628         (WebCore::DatabaseTracker::removeDeletedOpenedDatabases):
2629         (WebCore::DatabaseTracker::setDatabasesPaused):
2630         * Modules/webdatabase/SQLTransactionCoordinator.cpp:
2631         (WebCore::SQLTransactionCoordinator::shutdown):
2632         * Modules/websockets/WebSocket.cpp:
2633         (WebCore::WebSocket::connect):
2634         * Modules/websockets/WebSocketExtensionDispatcher.cpp:
2635         (WebCore::WebSocketExtensionDispatcher::addProcessor):
2636         (WebCore::WebSocketExtensionDispatcher::appendAcceptedExtension):
2637         (WebCore::WebSocketExtensionDispatcher::processHeaderValue):
2638         * Modules/websockets/WebSocketHandshake.cpp:
2639         (WebCore::WebSocketHandshake::clientHandshakeMessage):
2640
2641 2015-06-07  Darin Adler  <darin@apple.com>
2642
2643         REGRESSION (r181720): Unnecessary layout triggered any time animated GIF advances to a new frame
2644         https://bugs.webkit.org/show_bug.cgi?id=145733
2645
2646         Reviewed by Andreas Kling.
2647
2648         Test: fast/images/animated-gif-no-layout.html
2649
2650         * rendering/RenderImage.cpp:
2651         (WebCore::RenderImage::styleDidChange): Correctly pass ImageSizeChangeNone in cases
2652         where we don't need to report a change in intrinsic size that happened outside the
2653         repaintOrMarkForLayout function.
2654         (WebCore::RenderImage::repaintOrMarkForLayout): Move work that should only be done
2655         when size changed inside the if statement.
2656
2657         * testing/Internals.cpp:
2658         (WebCore::Internals::layoutCount): Added.
2659         * testing/Internals.h: Added layoutCount.
2660         * testing/Internals.idl: Ditto.
2661
2662 2015-06-07  Michael Catanzaro  <mcatanzaro@igalia.com>
2663
2664         Fix strncpy use in WebCore::Text::formatForDebugger
2665         https://bugs.webkit.org/show_bug.cgi?id=145608
2666
2667         Reviewed by Darin Adler.
2668
2669         r185137 replaced a call to strncpy with a call to strlcpy, which broke the build on Linux
2670         since strlcpy does not exist there. r185148 reverted this to use strncpy again, but got the
2671         size argument off by one, "introducing" a buffer overrun. But this code has always been
2672         wrong, since it used strncpy without ensuring that the buffer is null-terminated after the
2673         call to strncpy. Fix this as well.
2674
2675         * dom/Text.cpp:
2676         (WebCore::Text::formatForDebugger):
2677
2678 2015-06-07  Antti Koivisto  <antti@apple.com>
2679
2680         CrashTracer: [USER] com.apple.WebKit.WebContent.Development at com.apple.WebCore: WebCore::FrameLoader::subresourceCachePolicy const + 11
2681         https://bugs.webkit.org/show_bug.cgi?id=145736
2682         rdar://problem/21246971
2683
2684         Reviewed by David Kilzer.
2685
2686         No repro, no test.
2687
2688         * html/HTMLLinkElement.cpp:
2689         (WebCore::HTMLLinkElement::setCSSStyleSheet):
2690
2691             Null check frame. It may be null during frame teardown.
2692
2693 2015-06-06  Anders Carlsson  <andersca@apple.com>
2694
2695         Remove support from getting plug-in information from Carbon resources
2696         https://bugs.webkit.org/show_bug.cgi?id=145730
2697
2698         Reviewed by Dan Bernstein.
2699
2700         Remove a now unused function.
2701
2702         * platform/mac/WebCoreNSStringExtras.h:
2703         * platform/mac/WebCoreNSStringExtras.mm:
2704         (stringEncodingForResource): Deleted.
2705
2706 2015-06-06  Commit Queue  <commit-queue@webkit.org>
2707
2708         Unreviewed, rolling out r185284.
2709         https://bugs.webkit.org/show_bug.cgi?id=145723
2710
2711         it needs some discussion before landing (Requested by dino on
2712         #webkit).
2713
2714         Reverted changeset:
2715
2716         "[iOS] Don't force compositing layers for no-op 3D transforms
2717         on low-memory devices."
2718         https://bugs.webkit.org/show_bug.cgi?id=145719
2719         http://trac.webkit.org/changeset/185284
2720
2721 2015-06-06  Ryosuke Niwa  <rniwa@webkit.org>
2722
2723         Typing is slow in Gmail on iPads
2724         https://bugs.webkit.org/show_bug.cgi?id=145686
2725
2726         Reviewed by Enrica Casucci.
2727
2728         The bug was caused by nextCandidate and nextVisuallyDistinctCandidate traversing through each character
2729         in a text node without a renderer. Skip any node that doesn't have a renderer in both of those functions
2730         and corresponding previous* functions.
2731
2732         It's fine to skip unrendered nodes in PositionIterator because only other clients of PositionIterator
2733         are Position::upstream and Position::downstream and they don't care about un-rendered nodes either.
2734
2735         * dom/PositionIterator.cpp:
2736         (WebCore::PositionIterator::increment):
2737         (WebCore::PositionIterator::decrement):
2738         * editing/htmlediting.cpp:
2739         (WebCore::nextVisuallyDistinctCandidate):
2740         (WebCore::previousVisuallyDistinctCandidate):
2741
2742 2015-06-06  Mark Lam  <mark.lam@apple.com>
2743
2744         Returned Exception* values need to be initialized to nullptr when no exceptions are thrown.
2745         https://bugs.webkit.org/show_bug.cgi?id=145720
2746
2747         Reviewed by Dan Bernstein.
2748
2749         No new tests because this issue is already covered by the existing inspector-protocol tests.
2750
2751         * bindings/js/WorkerScriptController.cpp:
2752         (WebCore::WorkerScriptController::evaluate):
2753
2754 2015-06-05  Andreas Kling  <akling@apple.com>
2755
2756         [iOS] Don't force compositing layers for no-op 3D transforms on low-memory devices.
2757         <https://webkit.org/b/145719>
2758         <rdar://problem/19973042>
2759
2760         Reviewed by Geoffrey Garen.
2761
2762         We put elements with 3D identity transforms onto compositing layers because
2763         we anticipate that they will somehow animate in the future.
2764
2765         This can get extremely expensive, especially on low-memory devices.
2766         This patch makes WebKit stop handing out compositing layers for this kinda thing:
2767
2768             -webkit-transform: translate3d(0,0,0)
2769
2770         ..on devices with 512MB or less. This dramatically improves stability on some
2771         web pages.
2772
2773         * rendering/RenderLayerCompositor.cpp:
2774         (WebCore::RenderLayerCompositor::requiresCompositingForTransform):
2775
2776 2015-06-05  Matt Baker  <mattbaker@apple.com>
2777
2778         Web Inspector: "Other" time in the framerate table is often negative
2779         https://bugs.webkit.org/show_bug.cgi?id=145712
2780
2781         Reviewed by Timothy Hatcher.
2782
2783         The Inspector frontend flattens the timeline event tree it receives from the backend, which can contain nested
2784         paint records. The nested records represent a single paint event, but were being interpreted as two separate
2785         events for purposes of calculating total layout time. This caused the calculated "other" time to be less than
2786         it should be (and in some cases negative).
2787
2788         * inspector/InspectorTimelineAgent.cpp:
2789         (WebCore::InspectorTimelineAgent::addRecordToTimeline):
2790         Paint records are no longer nested, we simply drop the child paint event.
2791
2792 2015-06-05  Chris Dumez  <cdumez@apple.com>
2793
2794         Unreviewed, speculative Windows build fix after r185273.
2795
2796         * platform/VNodeTracker.h:
2797
2798 2015-06-05  Chris Dumez  <cdumez@apple.com>
2799
2800         [WK2][iOS] Limit the number of vnodes used by the WebContent processes
2801         https://bugs.webkit.org/show_bug.cgi?id=145672
2802         <rdar://problem/21126637>
2803
2804         Reviewed by Antti Koivisto.
2805
2806         Limit the number of vnodes used by the WebContent processes to reduce
2807         the chance of getting killed due to the system running out of vnodes.
2808         We sometimes see the WebContent process use up to 50% of the system's
2809         vnode limit on some tests on iOS, which seems excessive. Most vnodes
2810         are due to CachedResources which are mmap'd from the WebKit disk cache
2811         and kept alive due to caches such as the Memory Cache / PageCache.
2812
2813         This patch adds tracking for the number of SharedBuffer objects that are
2814         backed by a CFDataRef as this should track most of the vnodes used by
2815         the process. The WebContent process registers a vnode pressure handler
2816         upon initialization (likely it already does for memory pressure
2817         handling). This handler gets called when the process uses over 15% of
2818         of system's vnode limit and the "critical" flag is set if it uses over
2819         20% of the system limit. The vnode pressure handler currently calls the
2820         memory pressure handler as freeing our caches (especially PageCache,
2821         MemoryCache) and doing a JS GC frees up vnodes.
2822
2823         On iPhone 6 Plus, the system limit is at 3000, which would lead to the
2824         following limits being used:
2825         soft: 450 / hard: 600
2826
2827         However, on older hardware, the system limit can be as low as 2000,
2828         which would lead to the following limits being used:
2829         soft: 300 / hard: 400
2830
2831         vnode tracking is currently only enabled on iOS because system vnode
2832         limits are usually much higher on Mac (e.g. 473695 on Mac Pro, 9984
2833         on a 2011 MacBook Air) and we normally don't get killed.
2834
2835         * WebCore.xcodeproj/project.pbxproj:
2836
2837         Add new files to the XCode project.
2838
2839         * platform/SharedBuffer.h:
2840
2841         Add a VNodeTracker::Token member next to the CFDataRef member that we
2842         initialize if the SharedBuffer is constructed from a CFDataRef.
2843
2844         * platform/VNodeTracker.cpp: Added.
2845         (WebCore::VNodeTracker::singleton):
2846         (WebCore::VNodeTracker::VNodeTracker):
2847         (WebCore::VNodeTracker::checkPressureState):
2848         (WebCore::VNodeTracker::pressureWarningTimerFired):
2849         (WebCore::VNodeTracker::nextPressureWarningInterval):
2850         (WebCore::VNodeTracker::platformInitialize):
2851         * platform/VNodeTracker.h: Added.
2852         (WebCore::VNodeTracker::setPressureHandler):
2853
2854         Add a new VNodeTracker singleton to keep track the number of vnodes
2855         used by the process since the system does not issue warnings before
2856         reaching its vnode limit. Call sites should request Tokens for
2857         every vnode they use for tracking purposes. Each process can then
2858         set a vnode pressure handler function that will be called when the
2859         process is over the designated limits.
2860
2861         * platform/cf/SharedBufferCF.cpp:
2862         (WebCore::SharedBuffer::SharedBuffer):
2863
2864         Take a VNodeToken from the VNodeTracker when constructing the
2865         SharedBuffer from a CFDataRef as these usually use mmap.
2866
2867         * platform/cocoa/VNodeTrackerCocoa.cpp: Added.
2868         (WebCore::VNodeTracker::platformInitialize):
2869
2870         Get the system's vnode limit and uses 15% of that value as soft
2871         limit for the process and 20% of that value as hard limit.
2872
2873 2015-06-05  Dean Jackson  <dino@apple.com>
2874
2875         Lingering checkbox animations when rapidly switching between views on WK1
2876         https://bugs.webkit.org/show_bug.cgi?id=145715
2877         <rdar://problem/17381121>
2878
2879         Reviewed by Simon Fraser.
2880
2881         On WK1, the NSView we use for NSButtonCells is parented in the ScrollView.
2882         Our checkbox and radiobutton animations cause AppKit to create a CALayer which
2883         is parented into that view. As we render the animations, we see the CALayer getting
2884         drawn also.
2885
2886         The fix was to use an unparented layer on WK1 when drawing these controls, the same
2887         way WK2 does. This technique may apply to all controls, but restricting it
2888         to just the buttons at the moment is less risky.
2889
2890         This only happens during the swap between a checked and non-checked state,
2891         and we have no way to test it :(
2892
2893         * platform/mac/ThemeMac.h: New optional parameter to ensuredView.
2894         * platform/mac/ThemeMac.mm:
2895         (WebCore::paintToggleButton): If we're on Yosemite or highter, use an unparented view.
2896         (WebCore::ThemeMac::ensuredView): Return either a parented or unparented view.
2897
2898 2015-06-05  Matt Rajca  <mrajca@apple.com>
2899
2900         MediaSessions should keep track of their participating media elements.
2901         https://bugs.webkit.org/show_bug.cgi?id=145703
2902
2903         Reviewed by Eric Carlson.
2904
2905         * Modules/mediasession/MediaSession.cpp:
2906         (WebCore::MediaSession::addMediaElement): Add the given media element to the media session.
2907         (WebCore::MediaSession::removeMediaElement): Remove the given media element from the media session.
2908         (WebCore::MediaSession::activeParticipatingElements): Dynamically build a vector of actively-playing media
2909           elements.
2910         * Modules/mediasession/MediaSession.h:
2911         * html/HTMLMediaElement.cpp:
2912         (WebCore::HTMLMediaElement::~HTMLMediaElement): Ensure the element is removed from its media session.
2913         (WebCore::HTMLMediaElement::setSession): Update sessions' references to their media elements.
2914
2915 2015-06-05  Chris Dumez  <cdumez@apple.com>
2916
2917         Regression(r176212): Broke app switching on iCloud.com
2918         https://bugs.webkit.org/show_bug.cgi?id=145708
2919         <rdar://problem/21235277>
2920
2921         Reviewed by Simon Fraser.
2922
2923         Roll out r176212 and follow-up fixes for now, to fix iCloud.com.
2924         We can reconsider later how to do this in a safer way.
2925
2926         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
2927         (WebCore::JSCSSStyleDeclaration::putDelegate): Deleted.
2928         (WebCore::JSCSSStyleDeclaration::getOwnPropertyNames): Deleted.
2929         * dom/Element.cpp:
2930         * dom/Element.h:
2931         * dom/ElementRareData.cpp:
2932         * dom/ElementRareData.h:
2933         (WebCore::ElementRareData::ElementRareData):
2934         (WebCore::ElementRareData::~ElementRareData): Deleted.
2935         * dom/Node.cpp:
2936         (WebCore::Node::materializeRareData):
2937         * html/HTMLCanvasElement.cpp:
2938         (WebCore::HTMLCanvasElement::notifyObserversCanvasChanged): Deleted.
2939         * page/DOMTimer.cpp:
2940         (WebCore::DOMTimerFireState::scriptMadeNonUserObservableChanges): Deleted.
2941         (WebCore::DOMTimerFireState::scriptMadeUserObservableChanges): Deleted.
2942         (WebCore::NestedTimersMap::instanceForContext): Deleted.
2943         (WebCore::DOMTimer::install): Deleted.
2944         (WebCore::DOMTimer::fired): Deleted.
2945         (WebCore::DOMTimer::alignedFireTime): Deleted.
2946         (WebCore::DOMTimer::activeDOMObjectName): Deleted.
2947         * page/DOMTimer.h:
2948         * page/FrameView.cpp:
2949         (WebCore::FrameView::reset): Deleted.
2950         (WebCore::FrameView::viewportContentsChanged): Deleted.
2951         (WebCore::FrameView::autoSizeIfEnabled): Deleted.
2952         * page/FrameView.h:
2953
2954 2015-06-05  Myles C. Maxfield  <mmaxfield@apple.com>
2955
2956         [iOS] Emoji overlap preceeding lines
2957         https://bugs.webkit.org/show_bug.cgi?id=145678
2958         <rdar://problem/10684914>
2959
2960         Reviewed by Enrica Casucci.
2961
2962         In WebKit, we first lay out lines, and then we lay out text inside those lines. Text is vertically centered in
2963         its containing line. If the author has not specified a particular line-height, the height of a line comes from
2964         the font metrics for the primary font of the line.
2965
2966         In iOS, we were specifically hardcoding the line height metric of Apple Color Emoji to be 0. This means that,
2967         if Apple Color Emoji is the primary font for a line, and an explicit line-height was not specified, the lines
2968         are laid out with 0 height. Then, when we vertically center the text inside the line, the top half of the text
2969         overlaps the preceeding line.
2970
2971         I'm not sure exactly why were were hardcoding this value to 0, as it is surely wrong. I'm going to ask Enrica
2972         to review this patch; hopefully she knows the answer.
2973
2974         Test: fast/text/emoji.html
2975
2976         * platform/graphics/cocoa/FontCocoa.mm:
2977         (WebCore::Font::platformInit):
2978
2979 2015-06-05  Alex Christensen  <achristensen@webkit.org>
2980
2981         [Web Timing] Use new SPI to enable data collection.
2982         https://bugs.webkit.org/show_bug.cgi?id=145650
2983         rdar://problem/21203358
2984
2985         Reviewed by Chris Dumez.
2986
2987         * platform/network/cf/ResourceHandleCFNet.cpp:
2988         (WebCore::ResourceHandle::createCFURLConnection):
2989         Gather web timing data on iOS.
2990         * platform/network/mac/ResourceHandleMac.mm:
2991         (WebCore::ResourceHandle::createNSURLConnection):
2992         (WebCore::ResourceHandle::setCollectsTimingData):
2993         Gather web timing data on Mac.
2994
2995 2015-06-05  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
2996
2997         [Streams API] ReadableStream should store callbacks as a Deque
2998         https://bugs.webkit.org/show_bug.cgi?id=145641
2999
3000         Reviewed by Darin Adler.
3001
3002         Covered by existing tests.
3003
3004         * Modules/streams/ReadableStream.cpp:
3005         (WebCore::ReadableStream::resolveReadCallback): Use of Deque.takeFirst
3006         * Modules/streams/ReadableStream.h: Using Deque in lieu of Vector for storing callbacks.
3007
3008 2015-06-05  Mark Lam  <mark.lam@apple.com>
3009
3010         finally blocks should not set the exception stack trace when re-throwing the exception.
3011         https://bugs.webkit.org/show_bug.cgi?id=145525
3012
3013         Reviewed by Geoffrey Garen.
3014
3015         Update to use the new JSC::Exception object.
3016
3017         Test: inspector/debugger/break-on-exceptions.html
3018
3019         * ForwardingHeaders/runtime/Exception.h: Added.
3020         * bindings/js/JSCallbackData.cpp:
3021         (WebCore::JSCallbackData::invokeCallback):
3022         * bindings/js/JSCustomXPathNSResolver.cpp:
3023         (WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
3024         * bindings/js/JSDOMBinding.cpp:
3025         (WebCore::jsArray):
3026         (WebCore::reportException):
3027         (WebCore::reportCurrentException):
3028         * bindings/js/JSDOMBinding.h:
3029         * bindings/js/JSErrorHandler.cpp:
3030         (WebCore::JSErrorHandler::handleEvent):
3031         * bindings/js/JSEventListener.cpp:
3032         (WebCore::JSEventListener::handleEvent):
3033         * bindings/js/JSMainThreadExecState.cpp:
3034         (WebCore::JSMainThreadExecState::didLeaveScriptContext):
3035         (WebCore::functionCallHandlerFromAnyThread):
3036         (WebCore::evaluateHandlerFromAnyThread):
3037         * bindings/js/JSMainThreadExecState.h:
3038         (WebCore::JSMainThreadExecState::currentState):
3039         (WebCore::JSMainThreadExecState::call):
3040         (WebCore::JSMainThreadExecState::evaluate):
3041         (WebCore::JSMainThreadExecState::runTask):
3042
3043         * bindings/js/JSMediaDevicesCustom.cpp:
3044         (WebCore::JSMediaDevices::getUserMedia):
3045         - Fixed a bug where the exception was not cleared before entering the VM to
3046           call JS code.
3047
3048         * bindings/js/JSMutationCallback.cpp:
3049         (WebCore::JSMutationCallback::call):
3050         * bindings/js/ReadableJSStream.cpp:
3051         (WebCore::getPropertyFromObject):
3052         (WebCore::callFunction):
3053         (WebCore::ReadableJSStream::Source::start):
3054         * bindings/js/ScheduledAction.cpp:
3055         (WebCore::ScheduledAction::executeFunctionInContext):
3056         * bindings/js/ScriptController.cpp:
3057         (WebCore::ScriptController::evaluateInWorld):
3058         * bindings/js/SerializedScriptValue.cpp:
3059         (WebCore::SerializedScriptValue::create):
3060         (WebCore::SerializedScriptValue::deserialize):
3061         * bindings/js/WorkerScriptController.cpp:
3062         (WebCore::WorkerScriptController::evaluate):
3063         (WebCore::WorkerScriptController::setException):
3064         (WebCore::WorkerScriptController::scheduleExecutionTermination):
3065         * bindings/js/WorkerScriptController.h:
3066         (WebCore::WorkerScriptController::workerGlobalScopeWrapper):
3067         * bindings/js/WorkerScriptDebugServer.cpp:
3068         (WebCore::WorkerScriptDebugServer::runEventLoopWhilePaused):
3069         (WebCore::WorkerScriptDebugServer::reportException):
3070         * bindings/js/WorkerScriptDebugServer.h:
3071         * bindings/objc/WebScriptObject.mm:
3072         (WebCore::createJSWrapper):
3073         (WebCore::addExceptionToConsole):
3074         (-[WebScriptObject callWebScriptMethod:withArguments:]):
3075         (-[WebScriptObject evaluateWebScript:]):
3076         - Changed to call a version of JSMainThreadExecState::evaluate() that provides
3077           a stub returnedException because evaluateWebScript: doesn't need the exception.
3078
3079         * inspector/PageScriptDebugServer.cpp:
3080         (WebCore::PageScriptDebugServer::isContentScript):
3081         (WebCore::PageScriptDebugServer::reportException):
3082         * inspector/PageScriptDebugServer.h:
3083         * workers/WorkerGlobalScope.cpp:
3084         (WebCore::WorkerGlobalScope::importScripts):
3085
3086 2015-06-05  Eric Carlson  <eric.carlson@apple.com>
3087
3088         Layout tests fullscreen/video-controls-drag.html and media/video-fullscreeen-only-controls.html
3089         fail on WK1 and WK2
3090         https://bugs.webkit.org/show_bug.cgi?id=145675
3091
3092         Reviewed by Dean Jackson.
3093
3094         No new tests, changes covered by existing tests.
3095
3096         * Modules/mediacontrols/mediaControlsApple.js:
3097         (Controller.prototype.updateControls): Use shouldHaveControls() to test if controls should
3098           be visible.
3099         (Controller.prototype.handleWrapperMouseMove): Don't return early when in fullscreen.
3100         (Controller.prototype.updateFullscreenButtons): Drive-by fix: always show the (exit) fullscreen
3101           button when in fullscreen.
3102           
3103
3104 2015-06-04  David Hyatt  <hyatt@apple.com>
3105
3106         Underlines too close in vertical Chinese text.
3107         https://bugs.webkit.org/show_bug.cgi?id=145651
3108         <rdar://problem/11105920>
3109
3110         Reviewed by Simon Fraser.
3111
3112         Added fast/text/decorations-vertical-underline.html
3113
3114         * style/InlineTextBoxStyle.cpp:
3115         (WebCore::computeUnderlineOffset):
3116         Make sure the to map text-underline-position: auto to under when a line has an ideographic baseline.
3117
3118 2015-06-05  Carlos Alberto Lopez Perez  <clopez@igalia.com>
3119
3120         [GTK] [Wayland] The MiniBrowser crashes inside Weston.
3121         https://bugs.webkit.org/show_bug.cgi?id=145645
3122
3123         Reviewed by Žan Doberšek.
3124
3125         No new tests, no behavior changes.
3126
3127         The issue was caused because we were not properly initializing the
3128         Wayland display, and we were returning a nullptr in PlatformDisplayWayland::create(),
3129         therefore a crash was happening on WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp:1136
3130         <http://trac.webkit.org/browser/trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp?rev=185245#L1136>
3131
3132         * platform/graphics/wayland/PlatformDisplayWayland.cpp:
3133         (WebCore::PlatformDisplayWayland::create): When connecting to the Wayland
3134         server socket we should use the default value (NULL). This allows the value
3135         to be overwritten at run-time by the environment variables WAYLAND_DISPLAY or
3136         WAYLAND_SOCKET that the Wayland compositor should define. Also add a couple
3137         of warnings to get information about what is going wrong when we fail to
3138         initialize the display instead of just crashing without giving more information.
3139         * platform/graphics/wayland/PlatformDisplayWayland.h:
3140         (WebCore::PlatformDisplayWayland::isInitialized): Not longer check for m_webkitgtk
3141         to signal that the display is ready because the UIProcess embedded Wayland
3142         subcompositer is still not implemented. Added a FIXME note about it.
3143
3144 2015-06-05  Dean Jackson  <dino@apple.com>
3145
3146         [Mac] Popup focus is cut off
3147         https://bugs.webkit.org/show_bug.cgi?id=145688
3148         <rdar://problem/18313375>
3149
3150         Reviewed by Brent Fulgham.
3151
3152         Yosemite increased the width of focus rings, causing
3153         some ugly clipping on Yosemite. The solution was to
3154         not set a clip (which was code introduced for Leopard).
3155
3156         Test: fast/forms/select-element-focus-ring.html
3157
3158         * rendering/RenderThemeMac.mm:
3159         (WebCore::RenderThemeMac::paintMenuList): Don't clip on Yosemite.
3160
3161 2015-06-05  Manuel Rego Casasnovas  <rego@igalia.com>
3162
3163         [CSS Grid Layout] Support dots sequences in grid-template-areas
3164         https://bugs.webkit.org/show_bug.cgi?id=145693
3165
3166         Reviewed by Sergio Villar Senin.
3167
3168         The CSS WG agreed to consider a sequence of "." characters a single null
3169         cell token for grid-template-areas. That way authors can match the
3170         number of dots to the width of the column.
3171
3172         For more information see:
3173         https://lists.w3.org/Archives/Public/www-style/2015May/0175.html
3174
3175         Added new test cases to check the new behavior.
3176
3177         * css/CSSParser.cpp:
3178         (WebCore::containsOnlyDots): New helper function to check that the grid
3179         area name is composed by only dots.
3180         (WebCore::CSSParser::parseGridTemplateAreasRow): Use the new helper
3181         function to look for unnamed areas.
3182
3183 2015-06-04  Joonghun Park  <jh718.park@samsung.com>
3184
3185         Purge PassRefPtr create() factory functions in WebCore/css
3186         https://bugs.webkit.org/show_bug.cgi?id=144905
3187
3188         Reviewed by Darin Adler.
3189
3190         Return Ref instead of PassRefPtr in create() factory functions in css,
3191         because the factory can't return null.
3192
3193         No new tests, no new behaviours.
3194
3195         * css/BasicShapeFunctions.cpp:
3196         (WebCore::valueForCenterCoordinate):
3197         (WebCore::basicShapeRadiusToCSSValue):
3198         (WebCore::valueForBasicShape):
3199         * css/BasicShapeFunctions.h:
3200         * css/CSSBasicShapes.h:
3201         * css/CSSCalculationValue.cpp:
3202         (WebCore::createCSS):
3203         (WebCore::CSSCalcValue::create):
3204         * css/CSSCalculationValue.h:
3205         * css/CSSCharsetRule.h:
3206         * css/CSSComputedStyleDeclaration.cpp:
3207         (WebCore::valueForNinePieceImageSlice):
3208         (WebCore::valueForNinePieceImageQuad):
3209         (WebCore::zoomAdjustedPixelValue):
3210         (WebCore::zoomAdjustedNumberValue):
3211         (WebCore::zoomAdjustedPixelValueForLength):
3212         (WebCore::valueForReflection):
3213         (WebCore::createPositionListForLayer):
3214         (WebCore::positionOffsetValue):
3215         (WebCore::percentageOrZoomAdjustedValue):
3216         (WebCore::autoOrZoomAdjustedValue):
3217         (WebCore::getBorderRadiusCornerValues):
3218         (WebCore::getBorderRadiusCornerValue):
3219         (WebCore::getBorderRadiusShorthandValue):
3220         (WebCore::matrixTransformValue):
3221         (WebCore::computedTransform):
3222         (WebCore::adjustLengthForZoom):
3223         (WebCore::ComputedStyleExtractor::valueForShadow):
3224         (WebCore::ComputedStyleExtractor::valueForFilter):
3225         (WebCore::specifiedValueForGridTrackBreadth):
3226         (WebCore::specifiedValueForGridTrackSize):
3227         (WebCore::valueForGridTrackList):
3228         (WebCore::scrollSnapDestination):
3229         (WebCore::scrollSnapPoints):
3230         (WebCore::scrollSnapCoordinates):
3231         (WebCore::createAnimationTriggerValue):
3232         (WebCore::getAnimationTriggerValue):
3233         (WebCore::ComputedStyleExtractor::getFontSizeCSSValuePreferringKeyword):
3234         (WebCore::fillSizeToCSSValue):
3235         (WebCore::lineHeightFromStyle):
3236         (WebCore::fontSizeFromStyle):
3237         (WebCore::zoomAdjustedPaddingOrMarginPixelValue):
3238         (WebCore::shapePropertyValue):
3239         (WebCore::ComputedStyleExtractor::propertyValue):
3240         * css/CSSComputedStyleDeclaration.h:
3241         * css/CSSFontFace.h:
3242         (WebCore::CSSFontFace::create):
3243         * css/CSSFontFaceLoadEvent.h:
3244         * css/CSSFontFaceRule.h:
3245         * css/CSSGrammar.y.in:
3246         * css/CSSGridLineNamesValue.cpp:
3247         (WebCore::CSSGridLineNamesValue::cloneForCSSOM):
3248         * css/CSSGridLineNamesValue.h:
3249         (WebCore::CSSGridLineNamesValue::create):
3250         * css/CSSImportRule.h:
3251         * css/CSSKeyframeRule.h:
3252         (WebCore::StyleKeyframe::create):
3253         * css/CSSKeyframesRule.h:
3254         * css/CSSMediaRule.h:
3255         * css/CSSPageRule.h:
3256         * css/CSSParser.cpp:
3257         (WebCore::CSSParser::parseGridLineNames):
3258         (WebCore::CSSParser::parseDashboardRegions):
3259         (WebCore::CSSParser::parseClipShape):
3260         (WebCore::CSSParser::parseBasicShape):
3261         (WebCore::BorderImageSliceParseContext::commitBorderImageSlice):
3262         (WebCore::BorderImageQuadParseContext::commitBorderImageQuad):
3263         * css/CSSParser.h:
3264         (WebCore::CSSParser::ValueWithCalculation::calculation):
3265         * css/CSSPrimitiveValue.cpp:
3266         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
3267         (WebCore::CSSPrimitiveValue::init):
3268         (WebCore::CSSPrimitiveValue::cloneForCSSOM):
3269         * css/CSSPrimitiveValue.h:
3270         (WebCore::CSSPrimitiveValue::create):
3271         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
3272         * css/CSSPropertySourceData.h:
3273         (WebCore::CSSStyleSourceData::create):
3274         (WebCore::CSSRuleSourceData::create):
3275         (WebCore::CSSRuleSourceData::createUnknown):
3276         * css/CSSRuleList.h:
3277         * css/CSSSegmentedFontFace.h:
3278         (WebCore::CSSSegmentedFontFace::create):
3279         * css/CSSSelector.cpp:
3280         (WebCore::CSSSelector::createRareData):
3281         * css/CSSSelector.h:
3282         (WebCore::CSSSelector::RareData::create):
3283         * css/CSSStyleRule.h:
3284         * css/CSSSupportsRule.h:
3285         * css/CSSValuePool.h:
3286         (WebCore::CSSValuePool::createValue):
3287         * css/FontLoader.cpp:
3288         (WebCore::LoadFontCallback::create):
3289         * css/LengthRepeat.h:
3290         (WebCore::LengthRepeat::create):
3291         (WebCore::LengthRepeat::cloneForCSSOM):
3292         * css/MediaList.h:
3293         (WebCore::MediaQuerySet::create):
3294         (WebCore::MediaQuerySet::createAllowingDescriptionSyntax):
3295         (WebCore::MediaList::create):
3296         * css/MediaQueryList.cpp:
3297         (WebCore::MediaQueryList::create):
3298         * css/MediaQueryList.h:
3299         * css/MediaQueryMatcher.h:
3300         (WebCore::MediaQueryMatcher::create):
3301         * css/Pair.h:
3302         (WebCore::Pair::create):
3303         * css/Rect.h:
3304         (WebCore::Rect::create):
3305         (WebCore::Rect::cloneForCSSOM):
3306         (WebCore::Quad::create):
3307         (WebCore::Quad::cloneForCSSOM):
3308         * css/SVGCSSComputedStyleDeclaration.cpp:
3309         (WebCore::paintOrder):
3310         (WebCore::ComputedStyleExtractor::svgPropertyValue):
3311         * css/StyleMedia.h:
3312         (WebCore::StyleMedia::create):
3313         * css/StyleResolver.cpp:
3314         (WebCore::StyleResolver::keyframeStylesForAnimation):
3315         * css/StyleSheetList.h:
3316         (WebCore::StyleSheetList::create):
3317         * css/ViewportStyleResolver.h:
3318         (WebCore::ViewportStyleResolver::create):
3319         * css/WebKitCSSMatrix.h:
3320         * css/WebKitCSSRegionRule.h:
3321         * css/WebKitCSSViewportRule.h:
3322         * page/animation/CSSPropertyAnimation.cpp:
3323         (WebCore::blendFilter):
3324         * rendering/style/RenderStyle.h:
3325         (WebCore::adjustFloatForAbsoluteZoom):
3326         * rendering/style/StyleInheritedData.h:
3327
3328 2015-06-04  Benjamin Poulain  <bpoulain@apple.com>
3329
3330         The last 2 merged DFAs are not minimized by DFACombiner
3331
3332         * contentextensions/DFACombiner.cpp:
3333         (WebCore::ContentExtensions::DFACombiner::combineDFAs):
3334         I introduced a bug when I made minimization conditional: the last merge
3335         does not minimize if we do not reach the minimum size.
3336
3337 2015-06-04  Brent Fulgham  <bfulgham@apple.com>
3338
3339         Latching algorithm in findEnclosingOverflowScroll is broken
3340         https://bugs.webkit.org/show_bug.cgi?id=145642
3341         <rdar://problem/21242308>
3342
3343         Reviewed by Simon Fraser.
3344
3345         Test: platform/mac-wk2/tiled-drawing/scrolling/iframe_in_iframe.html
3346
3347         * page/mac/EventHandlerMac.mm:
3348         (WebCore::scrollableAreaForBox): Added helper function.
3349         (WebCore::findEnclosingScrollableContainer): Renamed from findEnclosingOverflowScroll.
3350         Only identify something as our scroll element if it can be scrolled in either
3351         axis of the gesture's motion.
3352         (WebCore::scrollableAreaForContainerNode): Use new helper function.
3353         (WebCore::EventHandler::platformPrepareForWheelEvents): Use new function
3354         name, and pass horizontal and vertical deltas.
3355         (WebCore::findEnclosingOverflowScroll): Deleted.
3356
3357 2015-06-04  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
3358
3359         REGRESSION(r185091): Crash happens on indexdb tests
3360         https://bugs.webkit.org/show_bug.cgi?id=145549
3361
3362         Reviewed by Darin Adler.
3363
3364         * Modules/indexeddb/IDBDatabaseError.h:
3365         (WebCore::IDBDatabaseError::create): Revert Ref usage of IDBDatabaseError::create().
3366
3367 2015-06-04  Simon Fraser  <simon.fraser@apple.com>
3368
3369         Crash in EventDispatcher::dispatchEvent entering a location on Google Maps
3370         https://bugs.webkit.org/show_bug.cgi?id=145677
3371         rdar://problem/20698280
3372
3373         Reviewed by Dean Jackson.
3374
3375         If a transition is running on a pseudo-element, and the host element is removed
3376         from the DOM just as the transition ends, and there is a transition event listener,
3377         then we'd crash with a null dereference in event dispatch code.
3378         
3379         AnimationController tries to clean up running animations when renderers are destroyed,
3380         but omitted to remove the element from two vectors that store element references.
3381         Elements are only added to these vectors briefly on animation end, before firing
3382         events, but failure to remove the vector entries could result in attempting
3383         to fire an event on a pseudo-element with no host element.
3384         
3385         Also convert EventDispatcher code to be more robust to potentially null event
3386         targets, since it's not clear that eventTargetRespectingTargetRules() can always
3387         manage to return a non-null node.
3388         
3389         Hard to make a test because this is timing sensitive.
3390
3391         * dom/EventDispatcher.cpp:
3392         (WebCore::eventTargetRespectingTargetRules):
3393         (WebCore::EventDispatcher::dispatchScopedEvent):
3394         (WebCore::EventDispatcher::dispatchEvent):
3395         (WebCore::EventPath::EventPath):
3396         * page/animation/AnimationController.cpp:
3397         (WebCore::AnimationControllerPrivate::clear):
3398
3399 2015-06-04  Hunseop Jeong  <hs85.jeong@samsung.com>
3400
3401         Replace 0 with nullptr in WebCore/Page.
3402         https://bugs.webkit.org/show_bug.cgi?id=145631
3403
3404         Reviewed by Darin Adler.
3405
3406         No new tests, no behavior changes.
3407
3408         * page/AutoscrollController.cpp:
3409         (WebCore::AutoscrollController::AutoscrollController):
3410         (WebCore::AutoscrollController::stopAutoscrollTimer):
3411         * page/ContentSecurityPolicy.cpp:
3412         (WebCore::CSPSourceList::parseSource):
3413         * page/ContentSecurityPolicy.h:
3414         * page/ContextMenuController.cpp:
3415         (WebCore::ContextMenuController: