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