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