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