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