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