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