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