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