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