429e4b8a2e58d13315391e7ec3f6da28dd566d94
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-05-28  Ryosuke Niwa  <rniwa@webkit.org>
2
3         Autocorrection makes it hard to type "doesn't" and to type @ in email addresses
4         https://bugs.webkit.org/show_bug.cgi?id=158177
5         <rdar://problem/20490862>
6         <rdar://problem/24707954>
7
8         Reviewed by Darin Adler.
9
10         When the user had typed "doesn'", some unified spellchecker may try to autocorrect it to "doesn't" or "does"
11         but we should ignore this for a moment until the next character is typed by the user. The code to deal with
12         this situation which checks the existence of an "ambiguous boundary character" was not robust when the
13         replacement text was longer than the corrected text.
14
15         Fixed this bug by fixing the logic to detect this case. Also added '@' as an ambiguous boundary character
16         since autocorrecting letters that appear right before '@' would not be useful in many cases.
17
18         Tests: ManualTests/autocorrection/autocorrection-at-mark.html
19                ManualTests/autocorrection/autocorrection-contraction-2.html
20
21         * editing/AlternativeTextController.cpp:
22         (WebCore::AlternativeTextController::timerFired): Fixed a bug that we can show an empty reversion panel.
23         * editing/Editor.cpp:
24         (WebCore::Editor::markAndReplaceFor): When the user had typed "doesn'" and our autocorrection result is
25         "doesn't", resultEndLocation (the end of "doesn't") is larger than selectionOffset (the end of "doesn'").
26         When the correction is "does", resultEndLocation (the end of "does") is one less than selectionOffset.
27         Updated the condition to deal with both of these conditions as well as cases where the correction result
28         contains more than one letter after '.
29         * editing/htmlediting.cpp:
30         (WebCore::isAmbiguousBoundaryCharacter): Moved from the header file since this is not a hot function and
31         doesn't need to be inlined everywhere. Added '@' as an ambiguous boundary character.
32         * editing/htmlediting.h:
33         (WebCore::isAmbiguousBoundaryCharacter): Moved to the cpp file.
34
35 2016-05-28  Konstantin Tokarev  <annulen@yandex.ru>
36
37         FileSystem: use OS(WINDOWS) instead of PLATFORM(WIN).
38         https://bugs.webkit.org/show_bug.cgi?id=158168
39
40         Reviewed by Darin Adler.
41
42         No new tests needed.
43
44         * platform/FileSystem.cpp:
45         (WebCore::lastComponentOfPathIgnoringTrailingSlash):
46         (WebCore::MappedFileData::~MappedFileData):
47         (WebCore::MappedFileData::MappedFileData):
48         * platform/FileSystem.h: Removed unused PlatformFilePathSeparator
49         constant.
50
51 2016-05-28  Konstantin Tokarev  <annulen@yandex.ru>
52
53         Use COMPILER(MSVC) instead of PLATFORM(WIN) for MSVC-specific workaround
54         https://bugs.webkit.org/show_bug.cgi?id=158169
55
56         Reviewed by Darin Adler.
57
58         No new tests needed.
59
60         * platform/PlatformMouseEvent.h:
61         * platform/win/PlatformMouseEventWin.cpp: Moved operators'
62         implementations to PlatformMouseEvent.h
63
64 2016-05-27  Chris Dumez  <cdumez@apple.com>
65
66         callOnMainThread() should not copy captured lambda variables
67         https://bugs.webkit.org/show_bug.cgi?id=158166
68
69         Reviewed by Brady Eidson.
70
71         callOnMainThread() should not copy captured lambda variables. This 
72         function is usually called cross-thread with a lambda and copying
73         the lambda (and its captured variables) can lead to thread-safety
74         issues.
75
76         This patch updates callOnMainThread() to take a NoncopyableFunction&&
77         in parameter instead of a std::function. The call sites of
78         callOnMainThread() have also been updated to use C++14's lambda
79         capture with initializer.
80
81         * Modules/indexeddb/IDBTransaction.cpp:
82         (WebCore::IDBTransaction::putOrAddOnServer):
83         * Modules/mediastream/MediaDevicesRequest.cpp:
84         (WebCore::MediaDevicesRequest::didCompletePermissionCheck):
85         (WebCore::MediaDevicesRequest::didCompleteTrackSourceInfoRequest):
86         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
87         (WebCore::MediaEndpointPeerConnection::runTask):
88         * Modules/mediastream/MediaEndpointPeerConnection.h:
89         * Modules/mediastream/UserMediaRequest.cpp:
90         (WebCore::UserMediaRequest::constraintsValidated):
91         (WebCore::UserMediaRequest::userMediaAccessGranted):
92         * Modules/webaudio/AudioContext.cpp:
93         (WebCore::AudioContext::scheduleNodeDeletion):
94         (WebCore::AudioContext::isPlayingAudioDidChange):
95         * dom/Document.cpp:
96         (WebCore::Document::postTask):
97         (WebCore::Document::pendingTasksTimerFired): Deleted.
98         * dom/ScriptElement.cpp:
99         (WebCore::ScriptElement::requestScript):
100         * fileapi/AsyncFileStream.cpp:
101         (WebCore::callOnFileThread):
102         (WebCore::AsyncFileStream::~AsyncFileStream):
103         (WebCore::AsyncFileStream::perform):
104         * fileapi/AsyncFileStream.h:
105         * fileapi/ThreadableBlobRegistry.cpp:
106         (WebCore::ThreadableBlobRegistry::registerFileBlobURL):
107         (WebCore::ThreadableBlobRegistry::registerBlobURL):
108         (WebCore::ThreadableBlobRegistry::registerBlobURLForSlice):
109         (WebCore::ThreadableBlobRegistry::blobSize):
110         (WebCore::ThreadableBlobRegistry::unregisterBlobURL):
111         (WebCore::ThreadableBlobRegistry::registerBlobURLOptionallyFileBacked): Deleted.
112         * loader/icon/IconDatabase.cpp:
113         (WebCore::IconDatabase::dispatchDidImportIconURLForPageURLOnMainThread):
114         (WebCore::IconDatabase::dispatchDidImportIconDataForPageURLOnMainThread):
115         * page/ResourceUsageThread.cpp:
116         (WebCore::ResourceUsageThread::notifyObservers):
117         (WebCore::ResourceUsageThread::threadBody):
118         * page/ResourceUsageThread.h:
119         * page/scrolling/ScrollingThread.cpp:
120         (WebCore::ScrollingThread::dispatch):
121         (WebCore::ScrollingThread::dispatchBarrier):
122         (WebCore::ScrollingThread::dispatchFunctionsFromScrollingThread):
123         * page/scrolling/ScrollingThread.h:
124         * page/scrolling/ios/ScrollingTreeIOS.cpp:
125         (WebCore::ScrollingTreeIOS::invalidate):
126         (WebCore::ScrollingTreeIOS::scrollingTreeNodeDidScroll):
127         (WebCore::ScrollingTreeIOS::currentSnapPointIndicesDidChange):
128         (WebCore::ScrollingTreeIOS::createScrollingTreeNode): Deleted.
129         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
130         (WebCore::ScrollingTreeFrameScrollingNodeMac::releaseReferencesToScrollerImpsOnTheMainThread):
131         * platform/MemoryPressureHandler.cpp:
132         (WebCore::MemoryPressureHandler::releaseMemory):
133         * platform/audio/ios/MediaSessionManagerIOS.mm:
134         (-[WebMediaSessionHelper dealloc]):
135         (-[WebMediaSessionHelper startMonitoringAirPlayRoutes]):
136         (-[WebMediaSessionHelper stopMonitoringAirPlayRoutes]):
137         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
138         (WebCore::AudioSourceProviderAVFObjC::prepare):
139         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
140         (WebCore::MediaPlayerPrivateAVFoundation::scheduleMainThreadNotification):
141         (WebCore::MediaPlayerPrivateAVFoundation::dispatchNotification):
142         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
143         (-[WebCDMSessionAVFoundationObjCListener observeValueForKeyPath:ofObject:change:context:]):
144         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
145         (-[WebAVOutputDeviceMenuControllerHelper observeValueForKeyPath:ofObject:change:context:]):
146         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
147         (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoLayer):
148         (-[WebCoreAVFMovieObserver legibleOutput:didOutputAttributedStrings:nativeSampleBuffers:forItemTime:]):
149         (-[WebCoreAVFMovieObserver outputSequenceWasFlushed:]):
150         (-[WebCoreAVFLoaderDelegate resourceLoader:shouldWaitForLoadingOfRequestedResource:]):
151         (-[WebCoreAVFLoaderDelegate resourceLoader:shouldWaitForResponseToAuthenticationChallenge:]):
152         (-[WebCoreAVFLoaderDelegate resourceLoader:didCancelLoadingRequest:]):
153         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
154         (WebCore::CMTimebaseEffectiveRateChangedCallback):
155         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::play):
156         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::pause):
157         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
158         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
159         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::scheduleDeferredTask):
160         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
161         (-[WebAVStreamDataParserListener streamDataParser:didParseStreamDataAsAsset:]):
162         (-[WebAVStreamDataParserListener streamDataParser:didParseStreamDataAsAsset:withDiscontinuity:]):
163         (-[WebAVStreamDataParserListener streamDataParser:didFailToParseStreamDataWithError:]):
164         (-[WebAVStreamDataParserListener streamDataParser:didProvideMediaData:forTrackID:mediaType:flags:]):
165         (-[WebAVStreamDataParserListener streamDataParser:didReachEndOfTrackWithTrackID:mediaType:]):
166         (-[WebAVStreamDataParserListener streamDataParser:didProvideContentKeyRequestInitializationData:forTrackID:]):
167         (-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]):
168         (-[WebAVSampleBufferErrorListener layerFailedToDecode:]):
169         * platform/graphics/cg/GraphicsContextCG.cpp:
170         (WebCore::patternReleaseCallback):
171         * platform/graphics/cg/PatternCG.cpp:
172         (WebCore::patternReleaseCallback):
173         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
174         (WebCore::MediaPlayerPrivateMediaFoundation::endCreatedMediaSource):
175         (WebCore::MediaPlayerPrivateMediaFoundation::endGetEvent):
176         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::processInputNotify):
177         * platform/mediastream/MediaStreamPrivate.cpp:
178         (WebCore::MediaStreamPrivate::scheduleDeferredTask):
179         * platform/mediastream/MediaStreamPrivate.h:
180         * platform/mediastream/mac/AVMediaCaptureSource.h:
181         * platform/mediastream/mac/AVMediaCaptureSource.mm:
182         (WebCore::AVMediaCaptureSource::scheduleDeferredTask):
183         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
184         (WebCore::RealtimeMediaSourceCenterMac::getMediaStreamTrackSources):
185         * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm:
186         (WebCore::WebAudioSourceProviderAVFObjC::prepare):
187         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
188         (WebCore::MockRealtimeMediaSourceCenter::getMediaStreamTrackSources):
189         * platform/network/BlobResourceHandle.cpp:
190         (WebCore::BlobResourceHandle::start):
191         (WebCore::BlobResourceHandle::notifyFinish):
192         * platform/network/DataURLDecoder.cpp:
193         (WebCore::DataURLDecoder::decode):
194         * platform/network/DataURLDecoder.h:
195         * platform/network/cocoa/WebCoreNSURLSession.mm:
196         (-[WebCoreNSURLSession dealloc]):
197         (-[WebCoreNSURLSessionDataTask cancel]):
198         (-[WebCoreNSURLSessionDataTask suspend]):
199         (-[WebCoreNSURLSessionDataTask resume]):
200         * platform/network/curl/CurlDownload.cpp:
201         (WebCore::CurlDownload::didReceiveHeader):
202         (WebCore::CurlDownload::didReceiveData): Deleted.
203
204 2016-05-27  Tim Horton  <timothy_horton@apple.com>
205
206         REGRESSION (r190574): Swipe snapshots are always black on iPhone 5
207         https://bugs.webkit.org/show_bug.cgi?id=158171
208         <rdar://problem/24639709>
209
210         Reviewed by Beth Dakin.
211
212         * platform/graphics/cocoa/IOSurface.mm:
213         (optionsForBiplanarSurface):
214         (optionsFor32BitSurface):
215         (IOSurface::IOSurface):
216         (IOSurface::format):
217         We are supposed to be using bi-planar 422f, not yuvf. They're the same
218         size, but different formats, and 422f is supported in more places.
219
220         Clean up the IOSurface constructor so we don't have a switch inside an if
221         with random ASSERT_NOT_REACHED, making helper functions to build the
222         options dictionary for arbitrary-size biplanar and 32-bit single-planar
223         surfaces.
224
225         I don't know how to write a test because IOSurface is not supported
226         in the simulator.
227
228 2016-05-27  Zalan Bujtas  <zalan@apple.com>
229
230         EventHandler finds incorrect scrollable container.
231         https://bugs.webkit.org/show_bug.cgi?id=158132
232         <rdar://problem/26423126>
233
234         Reviewed by Brent Fulgham.
235
236         Fix the logic that checks whether we are at the beginning or at the end of the container (horizontally).
237         While scrolling to the right, deltaX has negative values. So in case of deltaX < 0, we need to check if
238         the container is not scrolled all the way to the right.
239
240         Test: fast/scrolling/scroll-container-horizontally.html
241
242         * page/mac/EventHandlerMac.mm:
243         (WebCore::findEnclosingScrollableContainer):
244
245 2016-05-27  Jeremy Jones  <jeremyj@apple.com>
246
247         Decrease flicker when changing video presentation mode.
248         https://bugs.webkit.org/show_bug.cgi?id=158148
249         rdar://problem/24476949
250
251         Reviewed by Jer Noble.
252
253         No new tests because there is no behavior change. This change is about the timing of
254         moving AVPlayerLayers between layers to prevent flicker.
255
256         1) Moving an AVPlayerLayer between CAContexts can flicker. So always keep two
257         AVPlayerLayers around and add and remove them from the inline and fullscreen contexts.
258         2) Wait to show the inline placeholder until the fullscreen video layer has been installed.
259         3) Wait to remove the fullscreen video layer until the placeholder has been removed.
260
261         * Modules/mediacontrols/MediaControlsHost.cpp:
262         (WebCore::MediaControlsHost::isVideoLayerInline): Expose isVideoLayerInline to the shadow DOM.
263         (WebCore::MediaControlsHost::setPreparedForInline): Expose setPreparedForInline to the shadow DOM.
264         * Modules/mediacontrols/MediaControlsHost.h: Add setPreparedForInline and isVideoLayerInline
265         * Modules/mediacontrols/MediaControlsHost.idl: Add setPreparedForInline and isVideoLayerInline
266         * Modules/mediacontrols/mediaControlsApple.js:
267         (Controller.prototype.showInlinePlaybackPlaceholderWhenSafe): Wait to show placeholder when entering fullscreen.
268         (Controller.prototype.handlePresentationModeChange): Wait to show placeholder, and notify when placeholder is removed.
269         * html/HTMLMediaElement.cpp:
270         (WebCore::HTMLMediaElement::setPreparedForInline):
271         (WebCore::HTMLMediaElement::waitForPreparedForInlineThen): Used to delay fullscreen cleanup until placeholder is removed.
272         (WebCore::HTMLMediaElement::setVideoFullscreenLayer): Add a callback so we can wait until this completes before continuing.
273         * html/HTMLMediaElement.h:
274         (WebCore::HTMLMediaElement::isVideoLayerInline):
275         (WebCore::HTMLMediaElement::waitForPreparedForInlineThen):
276         (WebCore::HTMLMediaElement::setVideoFullscreenLayer): Add completionHandler.
277         * platform/cocoa/WebVideoFullscreenModelVideoElement.h:
278         (WebCore::WebVideoFullscreenModelVideoElement::setVideoFullscreenLayer): Add completionHandler.
279         (WebCore::WebVideoFullscreenModelVideoElement::waitForPreparedForInlineThen): Added.
280         * platform/cocoa/WebVideoFullscreenModelVideoElement.mm:
281         (WebVideoFullscreenModelVideoElement::setVideoFullscreenLayer): Add completionHandler.
282         (WebVideoFullscreenModelVideoElement::waitForPreparedForInlineThen):
283         * platform/graphics/MediaPlayer.cpp:
284         (WebCore::MediaPlayer::setVideoFullscreenLayer): Add completionHandler.
285         * platform/graphics/MediaPlayer.h:
286         (WebCore::MediaPlayer::setVideoFullscreenLayer): Add completionHandler.
287         * platform/graphics/MediaPlayerPrivate.h:
288         (WebCore::MediaPlayerPrivateInterface::setVideoFullscreenLayer): Add completionHandler.
289         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
290         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
291         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer): Create two video layers.
292         (WebCore::MediaPlayerPrivateAVFoundationObjC::destroyVideoLayer): Allow two video layers.
293         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenLayer): Add completionHandler.
294         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateVideoLayerGravity): Allow two video layers.
295         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
296         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
297         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::addDisplayLayer): Allow two video layers.
298         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVideoFullscreenLayer): Add completionHandler.
299         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
300         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
301         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::createPreviewLayers): Allow two video layers.
302         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setVideoFullscreenLayer): Add completionHandler.
303         * platform/graphics/avfoundation/objc/VideoFullscreenLayerManager.h:
304         * platform/graphics/avfoundation/objc/VideoFullscreenLayerManager.mm:
305         (WebCore::VideoFullscreenLayerManager::setVideoLayers): Allow two video layers.
306         (WebCore::VideoFullscreenLayerManager::setVideoFullscreenLayer): Add completionHandler.
307         (WebCore::VideoFullscreenLayerManager::setVideoFullscreenFrame): Allow two video layers.
308         (WebCore::VideoFullscreenLayerManager::didDestroyVideoLayer): Allow two video layers.
309         (WebCore::VideoFullscreenLayerManager::setVideoLayer): Deleted.
310         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
311         (WebVideoFullscreenControllerContext::didSetupFullscreen): Use completionHandler. 
312         (WebVideoFullscreenControllerContext::didExitFullscreen): Use completionHandler.
313
314 2016-05-26  Ryosuke Niwa  <rniwa@webkit.org>
315
316         Crash in TreeScope::focusedElement
317         https://bugs.webkit.org/show_bug.cgi?id=158108
318
319         Reviewed by Enrica Casucci.
320
321         The bug was caused by a flawed sequence of steps we took to remove an element. When an element is removed,
322         willRemoveChild and willRemoveChildren fire blur events on removed focused element and its ancestors and
323         unload event on any removed iframes. However, it was possible to focus an element on which we had fired blur
324         during an unload event, leaving m_focusedElement point to an element that's not in the document anymore.
325
326         Changing the order doesn't help because that would make it possible to insert the removed iframes back into
327         the document inside a event listener of the blur event, which was specifically fixed by r127534 four years ago.
328
329         Instead, fix the bug by not firing blur and change events on removed nodes. New behavior matches Firefox and HTML5
330         specification: https://html.spec.whatwg.org/multipage/interaction.html#focus-fixup-rule-one
331
332         Test: fast/shadow-dom/shadow-root-active-element-crash.html
333
334         * dom/ContainerNode.cpp:
335         (WebCore::willRemoveChild): Made this function static local since it didn't need to have access to any private
336         member variables. Call Document::nodeWillBeRemoved after disconnecting iframes since unload event handler could
337         allocate new Ranges just like mutation events.
338         (WebCore::willRemoveChildren): Ditto.
339         (WebCore::ContainerNode::removeChild): Removed the calls to removeFullScreenElementOfSubtree and
340         removeFocusedNodeOfSubtree as they're now called in Document::nodeWillBeRemoved.
341         (WebCore::ContainerNode::removeChildren): Ditto.
342         * dom/ContainerNode.h:
343         * dom/Document.cpp:
344         (WebCore::Document::removeFocusedNodeOfSubtree): Don't dispatch blur and change events when a node is removed.
345         (WebCore::Document::setFocusedElement): Added FocusRemovalEventsMode as the third argument. Avoid dispatching blur
346         and change events when FocusRemovalEventsMode::Dispatch is set.
347         (WebCore::Document::nodeChildrenWillBeRemoved): Added calls to removeFullScreenElementOfSubtree and
348         removeFocusedNodeOfSubtree. Also assert that no events are fired within this function. If we ever fire an event here,
349         "unloaded" iframes can be inserted back into a document before ContainerNode::removeChild actually removes them.
350         (WebCore::Document::nodeWillBeRemoved): Ditto.
351         * dom/Document.h:
352         * dom/TreeScope.cpp:
353         (WebCore::TreeScope::focusedElement): Added a release assertion to make sure the focused element is in the document
354         of the tree scope, and added an explicit type check just in case.
355
356 2016-05-27  Brent Fulgham  <bfulgham@apple.com>
357
358         CSP: Fire 'load' events even when blocking loads via 'frame-src'.
359         https://bugs.webkit.org/show_bug.cgi?id=153150
360         <rdar://problem/24383162>
361
362         Reviewed by Daniel Bates.
363
364         Always fire a load event, even when the load is blocked by CSP rules, so that
365         attackers cannot gain knowledge about the URL in the frame by blocking the
366         load and waiting long enough to be sure that a 'load' event would have
367         fired if the load wasn't blocked.
368
369         Inspired by Blink patch:
370         <https://src.chromium.org/viewvc/blink?view=rev&revision=165743>
371
372         Tests: http/tests/security/contentSecurityPolicy/frame-src-cross-origin-load.html
373
374         * loader/PolicyChecker.cpp:
375         (WebCore::PolicyChecker::checkNavigationPolicy):
376
377 2016-05-27  Andreas Kling  <akling@apple.com>
378
379         Document abandons its EventTargetData.
380         <https://webkit.org/b/158158>
381
382         Reviewed by Darin Adler.
383
384         Node::willBeDeletedFrom() is called when destroying all Node types *except* Document.
385         If a Document had an associated EventTargetData, it would not get cleaned up.
386
387         This patch moves the EventTargetData cleanup to ~Node() where it's guaranteed to run.
388
389         * dom/Node.cpp:
390         (WebCore::Node::~Node):
391         (WebCore::Node::willBeDeletedFrom):
392
393 2016-05-27  Ryan Haddad  <ryanhaddad@apple.com>
394
395         Attempt to fix the iOS build.
396
397         Unreviewed build fix.
398
399         * platform/graphics/cocoa/TextTrackRepresentationCocoa.mm:
400         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
401         (-[WebAVPlayerLayer layoutSublayers]):
402
403 2016-05-27  Brady Eidson  <beidson@apple.com>
404
405         Modern IDB: After closing a Netflix video, trying to watch it again fails.
406         <rdar://problem/25092473> and https://bugs.webkit.org/show_bug.cgi?id=158160
407
408         Reviewed by Alex Christensen.
409
410         New APITest: IndexedDB.WebProcessKillIDBCleanup
411
412         * Modules/indexeddb/IDBTransaction.cpp:
413         (WebCore::IDBTransaction::stop):
414         
415         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
416         (WebCore::IDBServer::UniqueIDBDatabase::connectionClosedFromClient): All active transactions need to be aborted
417           (without callback, since there's no connection to callback to).
418         (WebCore::IDBServer::UniqueIDBDatabase::takeNextRunnableTransaction):
419
420 2016-05-27  Adam Bergkvist  <adam.bergkvist@ericsson.com>
421
422         WebRTC: Update RTCPeerConnection overloaded legacy operations to return a Promise
423         https://bugs.webkit.org/show_bug.cgi?id=158114
424
425         Reviewed by Eric Carlson.
426
427         Update overloaded operations so that the legacy callback versions also return a promise
428         and never throw [1].
429
430         [1] https://w3c.github.io/webrtc-pc/archives/20160513/webrtc.html#legacy-interface-extensions
431
432         Updated existing tests.
433         - fast/mediastream/RTCPeerConnection-overloaded-operations-params.html
434         - fast/mediastream/RTCPeerConnection-overloaded-operations.html
435
436         * Modules/mediastream/RTCPeerConnection.idl:
437         Updated legacy signatures (just for documentation purposes)
438         * Modules/mediastream/RTCPeerConnection.js:
439         Implements the promise overload and the legacy callbacks overload (using the promise version)
440         as specified in [1] (above).
441         (createOffer):
442         (createAnswer):
443         (setLocalDescription):
444         (setRemoteDescription):
445         (addIceCandidate):
446         (getStats):
447         * Modules/mediastream/RTCPeerConnectionInternals.js:
448         Added helper functions objectAndCallbacksOverload and callbacksAndDictionaryOverload that
449         process an argument list and determine which overloaded version to use.
450         (callbacksAndDictionaryOverload):
451         (setLocalOrRemoteDescription): Deleted.
452         (extractCallbackArg): Deleted.
453
454 2016-05-27  Antoine Quint  <graouts@apple.com>
455
456         Video play glyph not visible if initially invisible when contained in a "-webkit-overflow-scrolling: touch" container
457         https://bugs.webkit.org/show_bug.cgi?id=158146
458         <rdar://problem/25816307>
459
460         Reviewed by Dean Jackson.
461
462         We now force the <video> controls play glyph into being composited due to webkit.org/b/158147. In most scenarios,
463         this element gets composited anyway, this is just to ensure that this happens in all cases until we get the
464         general fix for webkit.org/b/158147.
465
466         Test: platform/ios-simulator/media/video-play-glyph-composited-outside-overflow-scrolling-touch-container.html
467
468         * Modules/mediacontrols/mediaControlsiOS.css:
469         (video::-webkit-media-controls-start-playback-button .webkit-media-controls-start-playback-glyph):
470
471 2016-05-26  Yoav Weiss  <yoav@yoav.ws>
472
473         Preload single download tests.
474         https://bugs.webkit.org/show_bug.cgi?id=157988
475
476         Reviewed by Alex Christensen.
477
478         ResourceTiming entries for some subresource weren't registered as resource->response().isHTTP() was false, since
479         resource->response().url() was empty. I switched the check to use resource->resourceRequest().url() directly instead.
480
481         Test: http/tests/preload/single_download_preload_runner.html
482
483         * loader/ResourceTimingInformation.cpp:
484         (WebCore::ResourceTimingInformation::addResourceTiming):
485
486 2016-05-26  Nan Wang  <n_wang@apple.com>
487
488         AX: Wrong CharacterOffset from VisiblePosition with composed characters
489         https://bugs.webkit.org/show_bug.cgi?id=158138
490
491         Reviewed by Chris Fleizach.
492
493         The conversion logic is not correct when the text node contains composed characters. 
494         We should use VisiblePosition's offset directly for text nodes so we won't mess things up.
495
496         Test: accessibility/mac/character-offset-visible-position-conversion-with-emoji.html
497
498         * accessibility/AXObjectCache.cpp:
499         (WebCore::AXObjectCache::visiblePositionFromCharacterOffset):
500         (WebCore::AXObjectCache::characterOffsetFromVisiblePosition):
501
502 2016-05-26  Darin Adler  <darin@apple.com>
503
504         Media queries and platform screen modernization and streamlining
505         https://bugs.webkit.org/show_bug.cgi?id=158067
506
507         Reviewed by Alex Christensen.
508
509         * bindings/objc/DOM.mm:
510         (-[DOMHTMLLinkElement _mediaQueryMatches]): Use references, use fastGetAttribute,
511         pass a document instead of a frame to the media query evaluator and a reference instead
512         of a pointer.
513
514         * css/CSSGrammar.y.in: Use "expression" instead of "exp" for media query expressions.
515         Update vectors and arguments to move media query expressions instead of using unique_ptr.
516
517         * css/CSSImportRule.h: Use pragma once. Removed unneeded forward declarations.
518         Made more overrides private and marked them final.
519
520         * css/CSSParser.cpp:
521         (WebCore::CSSParser::SourceSize::SourceSize): Added missing WTFMove to avoid reference
522         count churn. Changed type of expression to no longer use unique_ptr.
523         (WebCore::CSSParser::sourceSize): Ditto.
524
525         * css/CSSParser.h: Changed SourceSize::expression to no longer use unique_ptr.
526         Also changed SourceSize::length to be Ref instead of RefPtr.
527
528         * css/DocumentRuleSets.cpp:
529         (WebCore::DocumentRuleSets::appendAuthorStyleSheets): Updated for changes to
530         MediaQueryEvaluator.
531
532         * css/MediaFeatureNames.cpp:
533         (WebCore::MediaFeatureNames::init): Streamlined a bit. Removed "MediaFeature" suffix from
534         names of media feature strings.
535
536         * css/MediaFeatureNames.h: Use pragma once. Changed media feature name globals
537         to use normal WebKit naming style instead of all lowercase with underscores.
538         Sorted alphabetically. Removed "MediaFeature" suffix from names of media feature strings.
539
540         * css/MediaList.cpp:
541         (WebCore::MediaQuerySet::MediaQuerySet): Simplified copy constructor since the queries
542         vector can now be copied normally.
543         (WebCore::parseMediaDescriptor): Normalized types and changed to use isASCIIAlphanumeric.
544         The old code was not handling '0' the way the comment said it did.
545         (WebCore::MediaQuerySet::internalParse): Added. Helper function to cut down on redundant
546         code in functions below.
547         (WebCore::MediaQuerySet::parse): Use stripLeadingAndTrailingHTMLSpaces instead of
548         stripWhiteSpace. Streamlined logic using helper function. Updated to use a vector of
549         queries instead of a vector of unique_ptr.
550         (WebCore::MediaQuerySet::add): Use internalParse.
551         (WebCore::MediaQuerySet::remove): Ditto.
552         (WebCore::MediaQuerySet::addMediaQuery): Changed argument type to not be unique_ptr.
553         (WebCore::MediaQuerySet::mediaText): Use modern for loop.
554         (WebCore::MediaList::MediaList): Initialize pointers to null in the class definition
555         rather than in these constructors.
556         (WebCore::MediaList::setMediaText): Removed unhelpful local variable.
557         (WebCore::MediaList::item): Updated since queries no longer use unique_ptr.
558         (WebCore::addResolutionWarningMessageToConsole): Changed argument types to references
559         instead of pointers with assertions.
560         (WebCore::reportMediaQueryWarningIfNeeded): Updated to modernize.
561
562         * css/MediaList.h: Use pragma once. Removed unneeded includes and forward declarations.
563         Changed vector to contain media queries instead of unique_ptr. Use nullptr instead of 0.
564         Initialize pointers to null here.
565
566         * css/MediaQuery.cpp: Deleted now-unneeded copy constructor and destructor. Both are
567         correctly generated without us writing them explicitly.
568         (WebCore::MediaQuery::serialize): Rewrote to streamline.
569         (WebCore::MediaQuery::MediaQuery): Updates since expressions are no longer unique_ptr.
570         (WebCore::MediaQuery::cssText): Changed return type to reference.
571
572         * css/MediaQuery.h: Use pragma once. Added include since this now includes media query
573         expressions, not just unique_ptr. Deleted the unneeded copy function.
574
575         * css/MediaQueryEvaluator.cpp:
576         (WebCore::isViewportDependent): Moved this here. It used to be a member function of
577         MediaQueryExp, but this file has a lot more functions about specific features and how
578         they are evaluated, so it really belongs here.
579         (WebCore::MediaQueryEvaluator::MediaQueryEvaluator): Changed constructor to take a
580         document instead of a frame. Initialize the fallback result in the class definition.
581         (WebCore::MediaQueryEvaluator::evaluate): Changed the argument type to a reference.
582         (WebCore::compareValue): Made both of the arguments separate template types. This
583         helps us compare an integer to a double without lots of type casts.
584         (WebCore::compareAspectRatioValue): Changed to use early return style and got rid of
585         the casts to int so we will do the work in double instead.
586         (WebCore::doubleValue): Replaced the old numberValue function with this. Since values
587         are stored as doubles, it's much better to use double rather than float.
588         (WebCore::zeroEvaluate): Added. Helpful for the many functions that just need to
589         evaluate as 0.
590         (WebCore::oneEvaluate): Ditto.
591         (WebCore::colorEvaluate): Renamed this and all the functions below. Simplified the logic
592         to use the new doubleValue function.
593         (WebCore::colorIndexEvaluate): Use zeroEvaluate.
594         (WebCore::colorGamutEvaluate): No longer use page just to get from the frame to the
595         main frame.
596         (WebCore::monochromeEvaluate): Simplify logic using zeroEvaluate.
597         (WebCore::invertedColorsEvaluate): Use auto for the keyword; easier to read.
598         (WebCore::orientationEvaluate): Use early return style.
599         (WebCore::aspectRatioEvaluate): Ditto.
600         (WebCore::deviceAspectRatioEvaluate): Simplified logic and removed type casts.
601         (WebCore::evaluateResolution): Added a couple null checks.
602         (WebCore::devicePixelRatioEvaluate): Renamed. Added missing type check.
603         (WebCore::resolutionEvaluate): Ditto.
604         (WebCore::gridEvaluate): Use zeroEvaluate.
605         (WebCore::computeLength): Added a null check.
606         (WebCore::deviceHeightEvaluate): Use early return.
607         (WebCore::deviceWidthEvaluate): Ditto.
608         (WebCore::heightEvaluate): Ditto.
609         (WebCore::widthEvaluate): Ditto.
610         (WebCore::minColorEvaluate): Updated name only.
611         (WebCore::maxColorEvaluate): Ditto.
612         (WebCore::minColorIndexEvaluate): Ditto.
613         (WebCore::maxColorIndexEvaluate): Ditto.
614         (WebCore::minMonochromeEvaluate): Ditto.
615         (WebCore::maxMonochromeEvaluate): Ditto.
616         (WebCore::minAspectRatioEvaluate): Ditto.
617         (WebCore::maxAspectRatioEvaluate): Ditto.
618         (WebCore::minDeviceAspectRatioEvaluate): Ditto.
619         (WebCore::maxDeviceAspectRatioEvaluate): Ditto.
620         (WebCore::minDevicePixelRatioEvaluate): Ditto.
621         (WebCore::maxDevicePixelRatioEvaluate): Ditto.
622         (WebCore::minHeightEvaluate): Ditto.
623         (WebCore::maxHeightEvaluate): Ditto.
624         (WebCore::minWidthEvaluate): Ditto.
625         (WebCore::maxWidthEvaluate): Ditto.
626         (WebCore::minDeviceHeightEvaluate): Ditto.
627         (WebCore::maxDeviceHeightEvaluate): Ditto.
628         (WebCore::minDeviceWidthEvaluate): Ditto.
629         (WebCore::maxDeviceWidthEvaluate): Ditto.
630         (WebCore::minResolutionEvaluate): Ditto.
631         (WebCore::maxResolutionEvaluate): Ditto.
632         (WebCore::animationEvaluate): Use oneEvaluate.
633         (WebCore::transitionEvaluate): Ditto.
634         (WebCore::transform2dEvaluate): Ditto.
635         (WebCore::transform3dEvaluate): Simplify using zeroEvaluate and oneEvaluate.
636         (WebCore::viewModeEvaluate): Simplified logic with fewer local variables and the name "keyword".
637         (WebCore::videoPlayableInlineEvaluate): Use reference.
638         (WebCore::hoverEvaluate): Simplify using keyword.
639         (WebCore::anyHoverEvaluate): Just updated name.
640         (WebCore::pointerEvaluate): Simplify using keyword.
641         (WebCore::anyPointerEvaluate): Just updated name.
642         (WebCore::add): Added. Helper for building up the media query function map.
643         (WebCore::MediaQueryEvaluator::evaluate): Moved code to build the function map in here in
644         a lambda, rather than having it in a separate global function.
645
646         * css/MediaQueryEvaluator.h: Use pragma once. Removed uneeded includes. Simplified comments and
647         modernized their style.
648
649         * css/MediaQueryExp.cpp:
650         (WebCore::isFeatureValidWithIdentifier): Renamed to make it clearer what this does. Updated
651         to take a reference and use te new feature names.
652         (WebCore::isFeatureValidWithNonNegativeLengthOrNumber): Ditto.
653         (WebCore::isFeatureValidWithDensity): Ditto.
654         (WebCore::isFeatureValidWithNonNegativeInteger): Ditto.
655         (WebCore::isFeatureValidWithNonNegativeNumber): Ditto.
656         (WebCore::isFeatureValidWithZeroOrOne): Ditto.
657         (WebCore::isAspectRatioFeature): Ditto.
658         (WebCore::isFeatureValidWithoutValue): Ditto.
659         (WebCore::isFeatureValidWithNumberWithUnit): Added. Helper that calls multiple functions above.
660         (WebCore::isFeatureValidWithNumber): Ditto.
661         (WebCore::isSlash): Added. Helper to make aspect ratio code below easier to read.
662         (WebCore::isPositiveIntegerValue): Ditto.
663         (WebCore::MediaQueryExpression::MediaQueryExpression): Rearranged code to be much less wordy and
664         to not use current/next.
665
666         * css/MediaQueryExp.h: Use pragma once. Renamed class to MediaQueryExpression. Removed
667         the isViewportDependent function, now part of MediaQueryEvaluator. Removed unneeded includes.
668
669         * css/MediaQueryList.cpp:
670         (WebCore::MediaQueryList::MediaQueryList): Marked this inline. Use a reference and a Ref&&
671         instead of PassRefPtr.
672         (WebCore::MediaQueryList::create): Updated argument types.
673         (WebCore::MediaQueryList::addListener): Updated argument type and use releaseNonNull.
674         (WebCore::MediaQueryList::removeListener): Updated argument types.
675         (WebCore::MediaQueryList::evaluate): Ditto.
676         (WebCore::MediaQueryList::matches): More of the same.
677
678         * css/MediaQueryList.h: Use pragma once. Changed types to use references, RefPtr&& and Ref&&.
679
680         * css/MediaQueryMatcher.cpp:
681         (WebCore::MediaQueryMatcher::MediaQueryMatcher): Take a reference.
682         (WebCore::MediaQueryMatcher::documentDestroyed): Use nullptr.
683         (WebCore::MediaQueryMatcher::documentElementUserAgentStyle): Use auto.
684         (WebCore::MediaQueryMatcher::evaluate): Take a reference. Updated for changes to MediaQueryEvaluator.
685         (WebCore::MediaQueryMatcher::matchMedia): Updated for above changes.
686         (WebCore::MediaQueryMatcher::addListener): Use Ref&& and reference for arguments. Simplify code.
687         (WebCore::MediaQueryMatcher::removeListener): Ditto.
688         (WebCore::MediaQueryMatcher::styleResolverChanged): Moved the logic for evaluating each query here.
689         Updated for changes to MediaQueryEvaluator.
690
691         * css/MediaQueryMatcher.h: Use pragma once. Changed create to take a reference. Tightened argument
692         types for addListener and removeListener. Made the private Listener a simple struct rather than a
693         class. Initialized m_evaluationRound.
694
695         * css/RuleSet.cpp:
696         (WebCore::RuleSet::addChildRules): Updated for changes to MediaQueryEvaluator.
697         (WebCore::RuleSet::addRulesFromSheet): Ditto.
698
699         * css/SourceSizeList.cpp:
700         (WebCore::match): Updated to use MediaQueryEvaluator in a simpler way.
701         (WebCore::defaultLength): Use a reference and simpler syntax.
702         (WebCore::computeLength): Ditto.
703         (WebCore::parseSizesAttribute): Changed arguments to take a Document instead of both a
704         RenderView and a Frame.
705
706         * css/SourceSizeList.h: Use #pragma once. Change parseSizesAttribute to take a Document.
707
708         * css/StyleMedia.cpp:
709         (WebCore::StyleMedia::matchMedium): Update for changes to MediaQueryEvaluator.
710
711         * css/StyleResolver.cpp:
712         (WebCore::StyleResolver::StyleResolver): Use a MediaQueryEvaluator instead of a unique_ptr
713         to one.
714         (WebCore::StyleResolver::appendAuthorStyleSheets): Ditto.
715         (WebCore::StyleResolver::styleForElement): Ditto.
716         (WebCore::StyleResolver::pseudoStyleForElement): Ditto.
717         (WebCore::StyleResolver::pseudoStyleRulesForElement): Ditto.
718         (WebCore::StyleResolver::addViewportDependentMediaQueryResult): Use references instead of
719         ponters, and use a vector of MediaQueryResult instead of unique_ptr.
720         (WebCore::StyleResolver::hasMediaQueriesAffectedByViewportChange): Use a modern for loop.
721
722         * css/StyleResolver.h: Use a MediaQueryEvaluator instead of a unique_ptr to one.
723         Use a vector of MediaQueryResult instead of a vector of unique_ptr.
724
725         * dom/Document.cpp:
726         (WebCore::Document::mediaQueryMatcher): Pass a reference instead of a pointer.
727
728         * dom/InlineStyleSheetOwner.cpp:
729         (WebCore::InlineStyleSheetOwner::createSheet): Updated for changes to MediaQueryEvaluator.
730
731         * editing/TextIterator.cpp:
732         (WebCore::SimplifiedBackwardsTextIterator::advance): Removed a stray space (unrelated to
733         the rest of the patch).
734
735         * html/HTMLImageElement.cpp:
736         (WebCore::HTMLImageElement::bestFitSourceFromPictureElement): Updated for changes to the
737         MediaQueryEvaluator class. Also use auto a bit more and eliminated a double hash table
738         lookup in code that used hasAttribute followed by fastGetAttribute.
739         (WebCore::HTMLImageElement::selectImageSource): Updated for changes to parseSizesAttribute.
740
741         * html/HTMLLinkElement.cpp:
742         (WebCore::HTMLLinkElement::process): Updated for changes to MediaQueryEvaluator.
743         (WebCore::HTMLLinkElement::setCSSStyleSheet): Use auto.
744
745         * html/HTMLMediaElement.cpp:
746         (WebCore::HTMLMediaElement::selectNextSourceChild): Updated for changes to MediaQueryEvaluator.
747
748         * html/HTMLPictureElement.cpp:
749         (WebCore::HTMLPictureElement::viewportChangeAffectedPicture): Updated for changes to
750         MediaQueryEvaluator.
751
752         * html/HTMLPictureElement.h: Use #pragma once. Changed viewport dependent media query results
753         vector to be a vector of results, not of unique_ptr.
754
755         * html/parser/HTMLPreloadScanner.cpp:
756         (WebCore::TokenPreloadScanner::StartTagScanner::processAttributes): Updated for changes to
757         parseSizesAttribute.
758         (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute): Updated for changes to
759         MediaQueryEvaluator.
760
761         * html/parser/HTMLResourcePreloader.cpp:
762         (WebCore::mediaAttributeMatches): Updated for changes to MediaQueryEvaluator.
763         (WebCore::HTMLResourcePreloader::preload): Ditto.
764
765         * page/DOMWindow.cpp: Removed unneeded include of PlatformScreen.h.
766
767         * page/mac/EventHandlerMac.mm:
768         (WebCore::EventHandler::effectiveMousePositionForSelectionAutoscroll): Simplified code and
769         updated for changes to PlatformScreenMac functions.
770
771         * platform/PlatformScreen.h: Use #pragma once. Use using instad of typedef. Put the typedef
772         for PlatformDisplayID inside the WebCore namespace. Removed the typedef for ColorProfile.
773         Renamed the functions that find a screen to just "screen".
774
775         * platform/graphics/DisplayRefreshMonitorClient.cpp:
776         (WebCore::DisplayRefreshMonitorClient::DisplayRefreshMonitorClient): Moved initialization
777         of booleans to the class definition.
778
779         * platform/graphics/DisplayRefreshMonitorClient.h: Use pragma once. Removed unneeded
780         forward declarations. Changed display ID data member to be an Optional instead of a boolean
781         paired with another data member.
782
783         * platform/graphics/GraphicsLayerUpdater.h: Use pragma once. Removed unneeded include of
784         PlatformScreen.h.
785
786         * platform/image-decoders/ImageDecoder.h: Use pragma once. Moved ColorProfile here from
787         PlatformScreen.h, since it's not used there. and is used here.
788
789         * platform/mac/PlatformEventFactoryMac.h: Use parma once. Changed reutrn type of the
790         globalPoint function to NSPoint. Tweaked comments and formatting a bit.
791
792         * platform/mac/PlatformEventFactoryMac.mm:
793         (WebCore::globalPoint): Changed return type to NSPoint and so removed the explicit
794         conversion to IntPoint.
795         (WebCore::globalPointForEvent): Changed return type to NSPoint.
796         (WebCore::PlatformMouseEventBuilder::PlatformMouseEventBuilder): Moved conversion to
797         IntPoint in here. Also got rid of special indenting style and just indented normally.
798         (WebCore::PlatformWheelEventBuilder::PlatformWheelEventBuilder): Ditto.
799         (WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder): Ditto.
800
801         * platform/mac/PlatformScreenMac.mm:
802         (WebCore::displayID): Renamed from displayIDFromScreen and displayFromWidget since this
803         is C++ and we have overloading to determine the types of arguments. Added a null check
804         of the how dinwo pointer.
805         (WebCore::firstScreen): Added. Helper used below.
806         (WebCore::window): Added. Helper used below.
807         (WebCore::screen): Renamed from screenForWidget and screenFromWindow and removed the
808         unneeded window argument from the widget version.
809         (WebCore::screenDepth): Simplified, using new helpers.
810         (WebCore::screenDepthPerComponent): Ditto.
811         (WebCore::screenIsMonochrome): Tweaked comment.
812         (WebCore::screenHasInvertedColors): Ditto.
813         (WebCore::screenRect): Simplified using new elpers.
814         (WebCore::screenAvailableRect): Ditto.
815         (WebCore::screenSupportsExtendedColor): Streamlined using fewer local variables and
816         using auto for types of the results of adoptCF.
817         (WebCore::toUserSpace): Updated for function name changes.
818         (WebCore::toDeviceSpace): Ditto.
819
820 2016-05-26  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
821
822         Purge PassRefPtr in Modules/battery
823         https://bugs.webkit.org/show_bug.cgi?id=157062
824
825         Reviewed by Darin Adler.
826
827         Use RefPtr<>& to reduce uses of PassRefPtr in WebKit.
828
829         * Modules/battery/BatteryClient.h:
830         * Modules/battery/BatteryController.cpp:
831         (WebCore::BatteryController::BatteryController):
832         (WebCore::BatteryController::~BatteryController):
833         (WebCore::BatteryController::addListener):
834         (WebCore::BatteryController::removeListener):
835         (WebCore::BatteryController::updateBatteryStatus):
836         (WebCore::BatteryController::didChangeBatteryStatus):
837         (WebCore::provideBatteryTo):
838         * Modules/battery/BatteryController.h:
839         * Modules/battery/BatteryManager.cpp:
840         (WebCore::BatteryManager::didChangeBatteryStatus):
841         (WebCore::BatteryManager::updateBatteryStatus):
842         * Modules/battery/BatteryManager.h:
843         * Modules/battery/BatteryStatus.h:
844         * testing/Internals.cpp:
845         (WebCore::Internals::setBatteryStatus):
846
847 2016-05-25  Ada Chan  <adachan@apple.com>
848
849         Add WebKitAdditions extension point in HTMLMediaElement.
850         https://bugs.webkit.org/show_bug.cgi?id=158097
851
852         Reviewed by Eric Carlson.
853
854         * html/HTMLMediaElement.cpp:
855         (WebCore::HTMLMediaElement::shouldOverrideBackgroundLoadingRestriction):
856         We need to load data in the background if playing to wireless playback target.
857         (WebCore::HTMLMediaElement::fullscreenModeChanged):
858         Moved from header file.
859         * html/HTMLMediaElement.h:
860
861         * platform/audio/PlatformMediaSession.cpp:
862         (WebCore::PlatformMediaSession::clientWillPausePlayback):
863         The code to start m_clientDataBufferingTimer is also in visibilityChanged().
864         Moved that code to PlatformMediaSession::scheduleClientDataBufferingCheck() and call
865         that method here.
866         (WebCore::PlatformMediaSession::visibilityChanged):
867         Call PlatformMediaSession::scheduleClientDataBufferingCheck().
868         (WebCore::PlatformMediaSession::scheduleClientDataBufferingCheck):
869         Start m_clientDataBufferingTimer if it's not already active.
870         (WebCore::PlatformMediaSession::shouldOverrideBackgroundLoadingRestriction):
871         Call the client.
872
873         * platform/audio/PlatformMediaSession.h:
874         (WebCore::PlatformMediaSessionClient::shouldOverrideBackgroundLoadingRestriction):
875
876         * platform/audio/PlatformMediaSessionManager.cpp:
877         (WebCore::PlatformMediaSessionManager::sessionCanLoadMedia):
878         Call the new PlatformMediaSession::shouldOverrideBackgroundLoadingRestriction().
879
880 2016-05-26  Jer Noble  <jer.noble@apple.com>
881
882         Use std::atomic<> rather than OSAtomicIncrement in CARingBuffer.cpp
883         https://bugs.webkit.org/show_bug.cgi?id=158129
884
885         Reviewed by Eric Carlson.
886
887         std::atomic is a more portable atomic primitive than OSAtomicIncrement.
888
889         * platform/audio/mac/CARingBuffer.cpp:
890         (WebCore::CARingBuffer::setCurrentFrameBounds):
891         (WebCore::CARingBuffer::getCurrentFrameBounds):
892         (WebCore::CARingBuffer::currentStartFrame):
893         (WebCore::CARingBuffer::currentEndFrame):
894         * platform/audio/mac/CARingBuffer.h:
895
896 2016-05-26  Ryan Haddad  <ryanhaddad@apple.com>
897
898         Rebaseline bindings tests after r201428
899
900         Unreviewed test gardening.
901
902         * bindings/scripts/test/JS/JSTestObj.cpp:
903         (WebCore::setJSTestObjReplaceableAttribute):
904
905 2016-05-25  Geoffrey Garen  <ggaren@apple.com>
906
907         replaceable own properties seem to ignore replacement after property caching
908         https://bugs.webkit.org/show_bug.cgi?id=158091
909
910         Reviewed by Darin Adler.
911
912         * bindings/scripts/CodeGeneratorJS.pm:
913         (GenerateImplementation): Use our new replacement helper if we're replacing
914         an own static property with an own direct property. Because we advertise
915         that our own static properties are cacheable, we need to do a structure
916         transition to indicate when they change. (Only own properties need this 
917         special treatment because JSC considers it normal to shadow a prototype
918         property with an own property.)
919
920 2016-05-26  Said Abou-Hallawa  <sabouhallawa@apple,com>
921
922         BitmapImage::checkForSolidColor() cleanup
923         https://bugs.webkit.org/show_bug.cgi?id=157750
924
925         Reviewed by Darin Adler.
926
927         Have a single implementation for BitmapImage::checkForSolidColor(). Create
928         a new function named NativeImage::solidColor() and call it from the former
929         one. The goal is to have the platform files contain only the platform dependent
930         code rather than repeating the platform independent code multiple times.
931
932         * platform/graphics/BitmapImage.cpp:
933         (WebCore::BitmapImage::destroyMetadataAndNotify): Invalidate m_solidColor.
934         (WebCore::BitmapImage::singlePixelSolidColor): Combine mayFillWithSolidColor(),
935         checkForSolidColor() and solidColor() in one function to guarantee the validity
936         of the returned value. Before, if solidColor() is called without calling
937         mayFillWithSolidColor() or checkForSolidColor(), the returned value would be
938         incorrect.
939         
940         (WebCore::BitmapImage::dump): Use the m_solidColor Optional and Color states.
941         (WebCore::BitmapImage::mayFillWithSolidColor): Deleted.
942         (WebCore::BitmapImage::solidColor): Deleted.
943         
944         * platform/graphics/BitmapImage.h: Delete m_checkedForSolidColor and
945         m_isSolidColor and change m_solidColor to be Optional<Color>.
946         
947         * platform/graphics/Image.cpp:
948         (WebCore::Image::drawTiled): Use singlePixelSolidColor() and check the returned
949         value to know whether the singe pixel solid color optimization applies or not.
950         
951         * platform/graphics/Image.h:
952         (WebCore::Image::singlePixelSolidColor):
953         (WebCore::Image::mayFillWithSolidColor): Deleted.
954         (WebCore::Image::solidColor): Deleted.
955         Replace mayFillWithSolidColor() and solidColor() with a single function named
956         singlePixelSolidColor(). isValid() of the returned Color can be used to tell
957         whether the singe pixel solid color optimization applies or not.
958         
959         * platform/graphics/cairo/BitmapImageCairo.cpp:
960         (WebCore::NativeImage::singlePixelSolidColor):
961         (WebCore::BitmapImage::draw):
962         (WebCore::BitmapImage::checkForSolidColor): Deleted.
963         Delete the platform dependent BitmapImage::checkForSolidColor() and add
964         the new platform dependent function NativeImage::singlePixelSolidColor() and
965         use to know whether the singe pixel solid color optimization applies or not.
966         
967         * platform/graphics/cg/BitmapImageCG.cpp:
968         (WebCore::NativeImage::singlePixelSolidColor):
969         (WebCore::BitmapImage::draw):
970         (WebCore::BitmapImage::checkForSolidColor): Deleted.
971         Ditto.
972
973 2016-05-26  Pranjal Jumde  <pjumde@apple.com>
974
975         Sites served over insecure connections should not be allowed to use geolocation.
976         https://bugs.webkit.org/show_bug.cgi?id=157423
977         <rdar://problem/23751632>
978
979         Reviewed by Brent Fulgham.
980
981         Tests: http/tests/security/insecure-geolocation.html
982                http/tests/security/mixedcontent-geolocation-block-insecure-content.html
983                http/tests/security/mixedcontent-geolocation.html
984
985         * Modules/geolocation/Geolocation.cpp:
986         (WebCore::logError):
987         Logs an error to the console if geolocation is blocked.
988         (WebCore::Geolocation::startRequest):
989         Access to Geolocation will be blocked if site is not secure. An error will be logged when access to Geolocation is blocked.
990         (WebCore::Geolocation::shouldBlockGeolocationRequests)
991         Returns true if the access to geolocation should be blocked.
992         * Modules/geolocation/Geolocation.h:
993         * dom/SecurityContext.h:
994         (WebCore::SecurityContext::foundMixedContent):
995         Returns true if insecure content was accessed over secure connection.
996         (WebCore::SecurityContext::setFoundMixedContent):
997         Sets m_foundMixedContent to true if insecure content is accessed over secure connection.
998         (WebCore::SecurityContext::geolocationAccessed):
999         Returns true if geolocation was accessed
1000         (WebCore::SecurityContext::setGeolocationAccessed):
1001         Sets m_geolocationAccessed to true if geolocation was accessed.
1002         * loader/MixedContentChecker.cpp:
1003         (WebCore::MixedContentChecker::canDisplayInsecureContent):
1004         Insecure content will be blocked if geolocation was accessed by the page. Updates document to keep track of mixed content.
1005         (WebCore::MixedContentChecker::canRunInsecureContent):
1006         Insecure content will be blocked if geolocation was accessed by the page. Updates document to keep track of mixed content.
1007
1008 2016-05-26  Brady Eidson  <beidson@apple.com>
1009
1010         Implement internals.observeGC to get called back when a Javascript object is GC'ed.
1011         https://bugs.webkit.org/show_bug.cgi?id=158093
1012
1013         Reviewed by Geoffrey Garen.
1014
1015         Test: js/test-observegc.html
1016
1017         * CMakeLists.txt:
1018         * DerivedSources.make:
1019         * WebCore.xcodeproj/project.pbxproj:
1020
1021         * testing/GCObservation.cpp: Added.
1022         (WebCore::GCObservation::GCObservation):
1023         * testing/GCObservation.h: Added.
1024         * testing/GCObservation.idl: Added.
1025
1026         * testing/Internals.cpp:
1027         (WebCore::Internals::observeGC):
1028         * testing/Internals.h:
1029         * testing/Internals.idl:
1030
1031 2016-05-26  Myles C. Maxfield  <mmaxfield@apple.com>
1032
1033         [Font Loading] Allow empty strings in FontFace constructor
1034         https://bugs.webkit.org/show_bug.cgi?id=158112
1035
1036         Reviewed by Darin Adler.
1037
1038         Other browsers accept empty strings and parse them as if they are omitted.
1039         We should do the same. However, this is only true for the constructor. Setting
1040         an attribute to an empty string should still throw an exception.
1041
1042         Test: fast/text/font-face-empty-string.html
1043
1044         * css/FontFace.cpp:
1045         (WebCore::FontFace::create):
1046         (WebCore::FontFace::setFamily):
1047         (WebCore::FontFace::setStyle):
1048         (WebCore::FontFace::setWeight):
1049         (WebCore::FontFace::setUnicodeRange):
1050         (WebCore::FontFace::setVariant):
1051         (WebCore::FontFace::setFeatureSettings):
1052
1053 2016-05-26  Adam Bergkvist  <adam.bergkvist@ericsson.com>
1054
1055         WebRTC: RTCSessionDescription: Make attributes readonly (and remove custom binding)
1056         https://bugs.webkit.org/show_bug.cgi?id=157858
1057
1058         Reviewed by Eric Carlson.
1059
1060         Align RTCSessionDescription type with WebRTC 1.0 specification [1].
1061         - Make constructor dictionary member mandatory
1062         - Align constructor dictionary argument (RTCSessionDescriptionInit) with [1]
1063         - Use RTCSdpType enum for the type attribute
1064         - Remove custom binding
1065
1066         [1] https://w3c.github.io/webrtc-pc/archives/20160513/webrtc.html
1067
1068         Updated existing test.
1069
1070         * CMakeLists.txt:
1071         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
1072         (WebCore::MediaEndpointPeerConnection::createOfferTask):
1073         * Modules/mediastream/RTCSessionDescription.cpp:
1074         (WebCore::parseTypeString):
1075         (WebCore::RTCSessionDescription::create):
1076         (WebCore::RTCSessionDescription::RTCSessionDescription):
1077         (WebCore::verifyType): Deleted.
1078         (WebCore::RTCSessionDescription::setType): Deleted.
1079         * Modules/mediastream/RTCSessionDescription.h:
1080         (WebCore::RTCSessionDescription::type):
1081         * Modules/mediastream/RTCSessionDescription.idl:
1082         * WebCore.xcodeproj/project.pbxproj:
1083         * bindings/js/JSRTCSessionDescriptionCustom.cpp: Removed.
1084         (WebCore::constructJSRTCSessionDescription): Deleted.
1085
1086 2016-05-26  Alejandro G. Castro  <alex@igalia.com>
1087
1088         NativeToJSValue is harcoding the $thisValue in some strings
1089         https://bugs.webkit.org/show_bug.cgi?id=158113
1090
1091         Reviewed by Darin Adler.
1092
1093         Replaced the string with the variable value.
1094
1095         Updated the tests results in the bindings.
1096
1097         * bindings/scripts/CodeGeneratorJS.pm:
1098         (NativeToJSValue): Replaced the hardcoded string with the variable
1099         value.
1100         * bindings/scripts/test/JS/JSTestCallback.cpp:
1101         (WebCore::JSTestCallback::callbackWithSerializedScriptValueParam):
1102         * bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
1103         (WebCore::JSTestCallbackFunction::callbackWithSerializedScriptValueParam):
1104
1105 2016-05-26  Frederic Wang  <fwang@igalia.com>
1106
1107         Small improvements to RenderBox/LayoutUnit casting in MathML
1108         https://bugs.webkit.org/show_bug.cgi?id=157943
1109
1110         Reviewed by Darin Adler.
1111
1112         This is a small follow-up of the RenderMathMLRow/RenderMathMLUnderOver/RenderMathMLFraction
1113         refactoring. Since these MathML renderers can only contain other MathML renderers, we can
1114         just considerer RenderBox children and avoid unnecessary casts. Similarly, when the two
1115         arguments of std::max are LayoutUnit's, we do not need to specialize to std::max<LayoutUnit>.
1116
1117         No new tests, behavior is not changed.
1118
1119         * rendering/mathml/RenderMathMLFraction.cpp:
1120         (WebCore::RenderMathMLFraction::layoutBlock): Do not to specialize to std::max<LayoutUnit>.
1121         * rendering/mathml/RenderMathMLRow.cpp:
1122         (WebCore::RenderMathMLRow::updateOperatorProperties): Browse the list of RenderBox children
1123         and use auto*.
1124         (WebCore::RenderMathMLRow::computeLineVerticalStretch): Do not to specialize to std::max<LayoutUnit>.
1125         * rendering/mathml/RenderMathMLUnderOver.cpp:
1126         (WebCore::RenderMathMLUnderOver::unembellishedOperator): Get the RenderBox child and use auto*.
1127         (WebCore::RenderMathMLUnderOver::computeOperatorsHorizontalStretch): Browse the list of
1128         RenderBox children, use auto* and remove unnecessary casts. Do not to specialize to
1129         std::max<LayoutUnit>.
1130
1131 2016-05-26  Chris Fleizach  <cfleizach@apple.com>
1132
1133         AX: crash at AccessibilityRenderObject::remoteSVGRootElement const
1134         https://bugs.webkit.org/show_bug.cgi?id=158098
1135
1136         Reviewed by Joanmarie Diggs.
1137
1138         What looks like happens here is that when a document is torn down and we try to detach, we end up creating an accessibility element during detachment phase.
1139         So instead of just clearing the callback pointer on an existing AXObject, we make a new object and access properties of an object being deallocated.
1140
1141         I tried very hard to make a test but it looks like this can really only be triggered during document tear down which also tears down the AXObjectCache. I didn't
1142         have luck reproducing because of that.
1143
1144         * accessibility/AccessibilityRenderObject.cpp:
1145         (WebCore::AccessibilityRenderObject::remoteSVGElementHitTest):
1146         (WebCore::AccessibilityRenderObject::isSVGImage):
1147         (WebCore::AccessibilityRenderObject::detachRemoteSVGRoot):
1148         (WebCore::AccessibilityRenderObject::remoteSVGRootElement):
1149         (WebCore::AccessibilityRenderObject::addRemoteSVGChildren):
1150         * accessibility/AccessibilityRenderObject.h:
1151
1152 2016-05-25  Antti Koivisto  <antti@apple.com>
1153
1154         Invalidate style for newly added nodes in Node::insertedInto
1155         https://bugs.webkit.org/show_bug.cgi?id=158088
1156
1157         Reviewed by Darin Adler.
1158
1159         * dom/ContainerNode.cpp:
1160         (WebCore::ContainerNode::parserInsertBefore):
1161         (WebCore::ContainerNode::replaceChild):
1162         (WebCore::ContainerNode::parserAppendChild):
1163         (WebCore::ContainerNode::childrenChanged):
1164         (WebCore::ContainerNode::updateTreeAfterInsertion):
1165         * dom/Node.cpp:
1166         (WebCore::Node::insertedInto):
1167
1168         Consolidate setNeedsStyleRecalc(ReconstructRenderTree) here.
1169
1170         This also now happens earliest possible time, right after inserting the node and can avoid
1171         some unneeded style invalidation work in subclass insertion handlers.
1172
1173 2016-05-25  Yoav Weiss  <yoav@yoav.ws>
1174
1175         Fix ResourceTiming multiple entries per resource and test initiator
1176         https://bugs.webkit.org/show_bug.cgi?id=158094
1177
1178         Reviewed by Alex Christensen.
1179
1180         Make sure that CachedResource that was needed by two different elements only adds one entry, with the right (first) initiatorType.
1181
1182         Tests: http/tests/performance/performance-resource-timing-initiator-css.html
1183                http/tests/performance/performance-resource-timing-initiator-no-override.html
1184
1185         * loader/ResourceTimingInformation.cpp:
1186         (WebCore::ResourceTimingInformation::addResourceTiming): Don't remove CachedResource when entry is added, but
1187         mark it as added. Only add new entries for non-added resources.
1188         (WebCore::ResourceTimingInformation::storeResourceTimingInitiatorInformation): Initialize initiator info as NotYetAdded.
1189         * loader/ResourceTimingInformation.h:
1190
1191 2016-05-25  Yoav Weiss  <yoav@yoav.ws>
1192
1193         Fix ResourceTiming XHR flakiness
1194         https://bugs.webkit.org/show_bug.cgi?id=158019
1195
1196         Reviewed by Alex Christensen.
1197
1198         Remove XHR specific ResourceTiming information store and addition as it is not needed.
1199
1200         Test: http/tests/performance/performance-resource-timing-xhr-single-entry.html
1201
1202         * loader/DocumentThreadableLoader.cpp:
1203         (WebCore::DocumentThreadableLoader::loadRequest): Removed XHR-specific initiator info storage.
1204         (WebCore::DocumentThreadableLoader::didFinishLoading): Removed XHR-specific RT entry addition.
1205         * loader/DocumentThreadableLoader.h:
1206
1207 2016-05-25  Konstantin Tokarev  <annulen@yandex.ru>
1208
1209         [cmake] Deduplicate make-js-file-arrays usage and make it work on Windows.
1210         https://bugs.webkit.org/show_bug.cgi?id=157997
1211
1212         Reviewed by Alex Christensen.
1213
1214         No new tests needed.
1215
1216         * CMakeLists.txt: Use new MAKE_JS_FILE_ARRAYS macro.
1217
1218 2016-05-25  Chris Dumez  <cdumez@apple.com>
1219
1220         Use HashMap::add() instead of HashMap::set() in Node::ensureEventTargetData()
1221         https://bugs.webkit.org/show_bug.cgi?id=158092
1222
1223         Reviewed by Ryosuke Niwa.
1224
1225         Use HashMap::add() instead of HashMap::set() in Node::ensureEventTargetData()
1226         as we already checked that the key is not present in the HashMap.
1227
1228         * dom/Node.cpp:
1229         (WebCore::Node::ensureEventTargetData):
1230
1231 2016-05-25  Joseph Pecoraro  <pecoraro@apple.com>
1232
1233         REGRESSION (r191531): Web Inspector: WebSQL databases are no longer shown when first opening Web Inspector
1234         https://bugs.webkit.org/show_bug.cgi?id=158096
1235         <rdar://problem/26454671>
1236
1237         Reviewed by Brian Burg.
1238
1239         * inspector/InspectorInstrumentation.h:
1240         (WebCore::InspectorInstrumentation::didOpenDatabase):
1241         Remove the fast return errantly added in r191531. InspectorDatabaseAgent
1242         wants to track databases, even before a frontend may be open, so that
1243         on first open it can inform the frontend about open databases.
1244
1245 2016-05-25  Zalan Bujtas  <zalan@apple.com>
1246
1247         Setting overflow:hidden does not always repaint clipped content.
1248         https://bugs.webkit.org/show_bug.cgi?id=116994
1249         rdar://problem/26476697
1250
1251         Issue repaint for both layout and visual overflow rects when the container starts
1252         clipping overflow content.
1253
1254         Reviewed by David Hyatt.
1255
1256         Test: fast/repaint/overflow-hidden-repaint.html
1257
1258         * rendering/RenderBox.cpp:
1259         (WebCore::RenderBox::updateFromStyle):
1260
1261 2016-05-25  Anders Carlsson  <andersca@apple.com>
1262
1263         Get rid of WTF/Functional.h
1264         https://bugs.webkit.org/show_bug.cgi?id=158081
1265
1266         Reviewed by Chris Dumez.
1267
1268         * Modules/mediastream/MediaStreamTrack.cpp:
1269
1270 2016-05-25  Brent Fulgham  <bfulgham@apple.com>
1271
1272         [WebSockets] No infrastructure for testing secure web sockets (wss)
1273         https://bugs.webkit.org/show_bug.cgi?id=157884
1274         <rdar://problem/26477197>
1275
1276         Reviewed by Andy Estes.
1277
1278         Add a new test-only flag used to tell CFNetwork that we do not wish to
1279         validate the SLL certificate chain. This allows us to use self-signed
1280         certificates in test cases.
1281
1282         Tests: http/tests/websocket/tests/hybi/simple-wss.html
1283
1284         * page/Settings.cpp:
1285         (WebCore::Settings::setAllowsAnySSLCertificate): Added.
1286         (WebCore::Settings::allowsAnySSLCertificate): Added. This defaults
1287         to False.
1288         * page/Settings.h:
1289         * platform/network/cf/SocketStreamHandleCFNet.cpp:
1290         (WebCore::SocketStreamHandle::createStreams): When running under our
1291         testing infrastructure, do not require full certificate validation.
1292         * testing/js/WebCoreTestSupport.cpp:
1293         (WebCoreTestSupport::setAllowsAnySSLCertificate): Added.
1294         * testing/js/WebCoreTestSupport.h:
1295         * testing/InternalSettings.cpp:
1296         (WebCore::InternalSettings::setAllowsAnySSLCertificate): Added.
1297         * testing/InternalSettings.h:
1298
1299 2016-05-25  Jer Noble  <jer.noble@apple.com>
1300
1301         CRASH at WebCore::WebPlaybackSessionModelMediaElement::selectAudioMediaOption() + 104
1302         https://bugs.webkit.org/show_bug.cgi?id=158090
1303         <rdar://problem/26388936>
1304
1305         Reviewed by Eric Carlson.
1306
1307         Null-check m_mediaElement before using.
1308
1309         * platform/cocoa/WebPlaybackSessionModelMediaElement.mm:
1310         (WebPlaybackSessionModelMediaElement::selectAudioMediaOption):
1311         (WebPlaybackSessionModelMediaElement::selectLegibleMediaOption):
1312
1313 2016-05-25  Brady Eidson  <beidson@apple.com>
1314
1315         Race condition calling back to an IDBOpenDBRequest during WorkerThread shutdown.
1316         https://bugs.webkit.org/show_bug.cgi?id=158089
1317
1318         Reviewed by Alex Christensen.
1319
1320         No new tests (Only seen randomly under GuardMalloc).
1321
1322         Crash was seen once running under GuardMalloc. The error is obvious.
1323
1324         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
1325         (WebCore::IDBClient::IDBConnectionProxy::completeOpenDBRequest): Don't get a raw pointer out of the map.
1326           Instead store off as a RefPtr, as the map might be cleared out from the worker thread.
1327
1328 2016-05-25  Chris Dumez  <cdumez@apple.com>
1329
1330         Simplify and inline minimumValueForLength()
1331         https://bugs.webkit.org/show_bug.cgi?id=158084
1332
1333         Reviewed by Zalan Bujtas.
1334
1335         Simplify and inline minimumValueForLength(). Based on iOS PLT profiles,
1336         we spend up to 0.7% of CPU time during page loads in this function.
1337
1338         The roundPercentages parameter has been dropped because it was false
1339         for all call sites.
1340
1341         * css/LengthFunctions.cpp:
1342         (WebCore::minimumIntValueForLength): Deleted.
1343         (WebCore::minimumValueForLength): Deleted.
1344         * css/LengthFunctions.h:
1345         (WebCore::minimumValueForLength):
1346         (WebCore::minimumIntValueForLength):
1347         * rendering/RenderBoxModelObject.cpp:
1348         (WebCore::resolveEdgeRelativeLength):
1349         (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry):
1350         * rendering/RenderElement.h:
1351         (WebCore::RenderElement::minimumValueForLength):
1352
1353 2016-05-25  Manuel Rego Casasnovas  <rego@igalia.com>
1354
1355         [css-grid] Update <fixed-size> syntax
1356         https://bugs.webkit.org/show_bug.cgi?id=158063
1357
1358         Reviewed by Darin Adler.
1359
1360         The syntax for <fixed-size> has been updated on the spec:
1361         https://drafts.csswg.org/css-grid/#typedef-fixed-size
1362
1363         New syntax is:
1364           <fixed-size> =
1365             <fixed-breadth> |
1366             minmax( <fixed-breadth> , <track-breadth> ) |
1367             minmax( <inflexible-breadth> , <fixed-breadth> )
1368
1369         This means that it's enough to have one <fixed-breadth>,
1370         it doesn't matter if it's as minimum or maximum.
1371         Before it was required that the minimum was fixed.
1372
1373         * css/CSSParser.cpp:
1374         (WebCore::isGridTrackFixedSized):
1375         * rendering/RenderGrid.cpp:
1376         (WebCore::RenderGrid::computeAutoRepeatTracksCount):
1377
1378 2016-05-25  Alex Christensen  <achristensen@webkit.org>
1379
1380         Fix CMake build.
1381
1382         * PlatformMac.cmake:
1383         c++14 is needed since r201255.
1384         ColorSync (in ApplicationServices) is needed since r201065.
1385
1386 2016-05-25  Zalan Bujtas  <zalan@apple.com>
1387
1388         Swap search field's cancel and result button for RTL content.
1389         https://bugs.webkit.org/show_bug.cgi?id=158007
1390
1391         Reviewed by Dean Jackson.
1392
1393         Test: fast/forms/search-input-rtl.html
1394
1395         * css/html.css:
1396         (input[type="search"]::-webkit-textfield-decoration-container): Deleted.
1397         * rendering/RenderThemeMac.mm:
1398         (WebCore::RenderThemeMac::paintSearchFieldCancelButton):
1399         (WebCore::RenderThemeMac::paintSearchFieldResultsButton):
1400
1401 2016-05-25  Myles C. Maxfield  <mmaxfield@apple.com>
1402
1403         [Font Loading] ASSERT if calling FontFace.loaded twice with a garbage collection between them
1404         https://bugs.webkit.org/show_bug.cgi?id=158015
1405
1406         Reviewed by Darin Adler.
1407
1408         The following scenario may occur:
1409
1410         1. We create a FontFace object
1411         2. We create an associated JSFontFace object
1412         3. We start loading the FontFace, which causes an extra ref to hang around until loading finishes
1413         4. Javascript calls the "loaded" attribute on the FontFace, which saves a promise inside the FontFace
1414         5. The FontFace goes out of scope in Javascript
1415         6. A garbage collection occurs, causing us to delete the JSFontFace object
1416         7. Javascript then encounters the FontFace object without first going through a reference to a JSFontFace.
1417         It can do this via iterating through a FontFaceSet. We respond to this situation by creating a new
1418         JSFontFace object and associating it with the existing FontFace.
1419         8. Javascript calls the "loaded" attribute
1420
1421         In this situation, the newer JSFontFace object is out of sync with the older FontFace object. In
1422         particular, the FontFace has a saved promise, but the JSFontFace doesn't know about it. Therefore,
1423         the JSFontFace should be flexible to the presence of this member.
1424
1425         Test: fast/text/font-face-crash-2.html
1426
1427         * bindings/js/JSDOMPromise.h:
1428         (WebCore::DOMPromise::deferredWrapper):
1429         * bindings/js/JSFontFaceCustom.cpp:
1430         (WebCore::JSFontFace::loaded):
1431         * css/FontFace.h:
1432
1433 2016-05-25  Antti Koivisto  <antti@apple.com>
1434
1435         Shadow DOM: RenderTreePosition miscomputed when display:contents value changes
1436         https://bugs.webkit.org/show_bug.cgi?id=158072
1437         rdar://problem/25766333
1438
1439         Reviewed by Darin Adler.
1440
1441         Test: fast/shadow-dom/slot-crash.html
1442
1443         * style/RenderTreePosition.h:
1444         (WebCore::RenderTreePosition::invalidateNextSibling):
1445
1446             Add unconditional invalidation function.
1447
1448         * style/RenderTreeUpdater.cpp:
1449         (WebCore::RenderTreeUpdater::updateElementRenderer):
1450
1451             With display:contents rendering siblings may be found from the subtree and the existing cached
1452             position may become invalid.
1453             If the display:contents value changes invalidate the current render tree position.
1454
1455 2016-05-25  Brady Eidson  <beidson@apple.com>
1456
1457         Modern IDB: IDB objects from a worker thread might be destroyed on the main thread.
1458         https://bugs.webkit.org/show_bug.cgi?id=158004
1459
1460         Reviewed by Alex Christensen.
1461
1462         No new tests (Spuriously reproduces on the bots, but I've been unable to construct a reliable test).
1463
1464         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
1465         (WebCore::IDBClient::IDBConnectionProxy::completeOpenDBRequest):
1466         (WebCore::IDBClient::IDBConnectionProxy::notifyOpenDBRequestBlocked):
1467         (WebCore::IDBClient::IDBConnectionProxy::didCommitTransaction):
1468         (WebCore::IDBClient::IDBConnectionProxy::didAbortTransaction):
1469         (WebCore::IDBClient::IDBConnectionProxy::unregisterDatabaseConnection):
1470         (WebCore::IDBClient::removeItemsMatchingCurrentThread):
1471         (WebCore::IDBClient::IDBConnectionProxy::forgetActivityForCurrentThread): Clear out all objects that originated on this thread.
1472         (WebCore::IDBClient::IDBConnectionProxy::takeIDBOpenDBRequest): Deleted.
1473         * Modules/indexeddb/client/IDBConnectionProxy.h:
1474
1475         * workers/WorkerGlobalScope.cpp:
1476         (WebCore::WorkerGlobalScope::stopIndexedDatabase):
1477         * workers/WorkerGlobalScope.h:
1478
1479         * workers/WorkerThread.cpp:
1480         (WebCore::WorkerThread::stop):
1481
1482 2016-05-25  Nael Ouedraogo  <nael.ouedraogo@crf.canon.fr>
1483
1484         Remove unused slotBase parameter in bindings generator
1485         https://bugs.webkit.org/show_bug.cgi?id=158068
1486
1487         Reviewed by Darin Adler.
1488
1489         Remove unused slotBase parameter from attribute Getter functions.
1490
1491         * bindings/scripts/CodeGeneratorJS.pm:
1492         (GenerateImplementation):
1493         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
1494         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
1495         * bindings/scripts/test/JS/JSTestException.cpp:
1496         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
1497         * bindings/scripts/test/JS/JSTestInterface.cpp:
1498         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
1499         * bindings/scripts/test/JS/JSTestNode.cpp:
1500         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
1501         * bindings/scripts/test/JS/JSTestObj.cpp:
1502         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
1503         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1504         * bindings/scripts/test/JS/JSattribute.cpp:
1505
1506 2016-05-25  Alex Christensen  <achristensen@webkit.org>
1507
1508         Include fewer headers from headers
1509         https://bugs.webkit.org/show_bug.cgi?id=158043
1510
1511         Reviewed by Brady Eidson.
1512
1513         * platform/graphics/GraphicsContext.h:
1514         * rendering/svg/RenderSVGResourceClipper.h:
1515         (isType):
1516         * rendering/svg/RenderSVGResourceMasker.h:
1517
1518 2016-05-25  Eric Carlson  <eric.carlson@apple.com>
1519
1520         ASSERT in WebCore::TextTrackList::remove when running media/track/track-remove-track.html
1521         https://bugs.webkit.org/show_bug.cgi?id=158071
1522         <rdar://problem/26432041>
1523
1524         Reviewed by Chris Dumez.
1525
1526         No new tests, this prevents media/track/track-remove-track.html from crashing.
1527
1528         * html/track/TextTrackList.cpp:
1529         (TextTrackList::remove): Don't assert when the media element has  been set to null.
1530
1531 2016-05-25  Zalan Bujtas  <zalan@apple.com>
1532
1533         Addressing post-review comments on r200971.
1534
1535         Reviewed by Darin Adler.
1536
1537         * page/EventHandler.cpp:
1538         (WebCore::EventHandler::hitTestResultAtPoint):
1539
1540 2016-05-25  Manuel Rego Casasnovas  <rego@igalia.com>
1541
1542         [css-grid] Simplify grid track sizes parsing
1543         https://bugs.webkit.org/show_bug.cgi?id=158021
1544
1545         Reviewed by Sergio Villar Senin.
1546
1547         Previously once we saw an auto-repeat function,
1548         we passed the "FixedSizeOnly" restriction to the rest of methods.
1549         That way we were sure that all the tracks after the auto-repeat
1550         had fixed sizes.
1551         But we needed to call allTracksAreFixedSized() to be sure that
1552         the tracks before the auto-repeat had fixed sizes too.
1553
1554         Now we're introducing a new boolean |allTracksAreFixedSized|,
1555         to check in advance if the declaration contains any track not fixed.
1556         If that's the case and we found an auto-repeat method,
1557         we consider it invalid.
1558         With this approach we avoid the loop to verify
1559         that all the tracks (before and after the auto-repeat) are fixed.
1560         It also allows us to simplify the code and avoid passing
1561         the restriction to all the methods parsing the track size.
1562
1563         No new tests, no change of behavior.
1564
1565         * css/CSSParser.cpp:
1566         (WebCore::isGridTrackFixedSized): New method to check if a grid track
1567         size is fixed or not (based on old allTracksAreFixedSized()).
1568         (WebCore::CSSParser::parseGridTrackList): Add new boolean to detect
1569         if any track has not a fixed size.
1570         (WebCore::CSSParser::parseGridTrackRepeatFunction): Ditto.
1571         (WebCore::CSSParser::parseGridTrackSize): Remove usage of
1572         TrackSizeRestriction enum.
1573         Check here if |minTrackBreadth| is a flexible size.
1574         (WebCore::CSSParser::parseGridBreadth): Remove usage of
1575         TrackSizeRestriction enum.
1576         (WebCore::allTracksAreFixedSized): Deleted.
1577         * css/CSSParser.h: Remove TrackSizeRestriction enum and update headers.
1578
1579 2016-05-25  Sergio Villar Senin  <svillar@igalia.com>
1580
1581         [css-grid] Refactor populateGridPositions()
1582         https://bugs.webkit.org/show_bug.cgi?id=158065
1583
1584         Reviewed by Carlos Garcia Campos.
1585
1586         RenderGrid::populateGridPositions() was doing exactly the same thing for columns and rows
1587         but using different data structures. That lead to a lot of duplicated code. It's easy to
1588         refactor it in a new function that properly select the data structures to operate on based
1589         on the direction.
1590
1591         No new tests as there is no change in behaviour.
1592
1593         * rendering/RenderGrid.cpp:
1594         (WebCore::RenderGrid::layoutGridItems):
1595         (WebCore::RenderGrid::populateGridPositionsForDirection): Refactored from
1596         populateGridPositions().
1597         (WebCore::RenderGrid::populateGridPositions): Deleted.
1598         * rendering/RenderGrid.h:
1599
1600 2016-05-25  Commit Queue  <commit-queue@webkit.org>
1601
1602         Unreviewed, rolling out r201373.
1603         https://bugs.webkit.org/show_bug.cgi?id=158064
1604
1605         Several tests are hitting the ASSERT (Requested by rego on
1606         #webkit).
1607
1608         Reverted changeset:
1609
1610         "[css-grid] Simplify grid track sizes parsing"
1611         https://bugs.webkit.org/show_bug.cgi?id=158021
1612         http://trac.webkit.org/changeset/201373
1613
1614 2016-05-25  Nael Ouedraogo  <nael.ouedraogo@crf.canon.fr>
1615
1616         Purge PassRefPtr from TouchList
1617         https://bugs.webkit.org/show_bug.cgi?id=157985
1618
1619         Reviewed by Darin Adler.
1620
1621         Use RefPtr&& argument instead of PassRefPtr in append()
1622
1623         * dom/TouchList.h:
1624         (WebCore::TouchList::append):
1625         * page/EventHandler.cpp:
1626         (WebCore::EventHandler::handleTouchEvent):
1627
1628 2016-05-25  Antoine Quint  <graouts@apple.com>
1629
1630         Elements with backdrop-filter cannot be clipped with clip-path or mask
1631         https://bugs.webkit.org/show_bug.cgi?id=142662
1632         <rdar://problem/20150192>
1633
1634         Reviewed by Dean Jackson.
1635
1636         We used to only apply the mask to the layer contents but did not account
1637         for the fact that a layer backdrop may exist. We now correctly mask the
1638         backdrop layer as well as the layer contents.
1639
1640         Test: css3/filters/backdrop/backdrop-filter-with-clip-path.html
1641
1642         * platform/graphics/ca/GraphicsLayerCA.cpp:
1643         (WebCore::GraphicsLayerCA::updateShape):
1644         Ensure clones of a layer use the same shape path.
1645
1646         (WebCore::GraphicsLayerCA::updateMaskLayer):
1647         If we have a backdrop layer, ensure that we apply a clone of the mask layer applied to
1648         the layer contents.
1649
1650 2016-05-25  Manuel Rego Casasnovas  <rego@igalia.com>
1651
1652         [css-grid] Simplify grid track sizes parsing
1653         https://bugs.webkit.org/show_bug.cgi?id=158021
1654
1655         Reviewed by Sergio Villar Senin.
1656
1657         Previously once we saw an auto-repeat function,
1658         we passed the "FixedSizeOnly" restriction to the rest of methods.
1659         That way we were sure that all the tracks after the auto-repeat
1660         had fixed sizes.
1661         But we needed to call allTracksAreFixedSized() to be sure that
1662         the tracks before the auto-repeat had fixed sizes too.
1663
1664         Now we're introducing a new boolean |allTracksAreFixedSized|,
1665         to check in advance if the declaration contains any track not fixed.
1666         If that's the case and we found an auto-repeat method,
1667         we consider it invalid.
1668         With this approach we avoid the loop to verify
1669         that all the tracks (before and after the auto-repeat) are fixed.
1670         It also allows us to simplify the code and avoid passing
1671         the restriction to all the methods parsing the track size.
1672
1673         No new tests, no change of behavior.
1674
1675         * css/CSSParser.cpp:
1676         (WebCore::isGridTrackFixedSized): New method to check if a grid track
1677         size is fixed or not (based on old allTracksAreFixedSized()).
1678         (WebCore::CSSParser::parseGridTrackList): Add new boolean to detect
1679         if any track has not a fixed size.
1680         (WebCore::CSSParser::parseGridTrackRepeatFunction): Ditto.
1681         (WebCore::CSSParser::parseGridTrackSize): Remove usage of
1682         TrackSizeRestriction enum.
1683         Check here if |minTrackBreadth| is a flexible size.
1684         (WebCore::CSSParser::parseGridBreadth): Remove usage of
1685         TrackSizeRestriction enum.
1686         (WebCore::allTracksAreFixedSized): Deleted.
1687         * css/CSSParser.h: Remove TrackSizeRestriction enum and update headers.
1688
1689 2016-05-24  Myles C. Maxfield  <mmaxfield@apple.com>
1690
1691         [Font Loading] Crash during font download failure after garbage collection
1692         https://bugs.webkit.org/show_bug.cgi?id=158013
1693         <rdar://problem/25148032>
1694
1695         Reviewed by Darin Adler.
1696
1697         Usually, ownership during font loading is top-down - JavaScript owns a JSFontFace,
1698         which owns a FontFace, which owns a CSSFontFace. However, when we receive the
1699         asynchronous callback that a font finished loading, the call comes in from the
1700         bottom - it is delivered from the CSSFontFaceSource to the CSSFontFace, and then
1701         to the FontFace. If a garbage collection had previously run, we might remove
1702         the last reference to ourself during this asynchronous callback. A simple guard
1703         makes sure this doesn't happen.
1704
1705         Test: fast/text/font-face-crash.html
1706
1707         * css/CSSFontFace.cpp:
1708         (WebCore::CSSFontFace::fontLoaded):
1709
1710 2016-05-24  Ryan Haddad  <ryanhaddad@apple.com>
1711
1712         Unreviewed, rolling out r201349.
1713
1714         This change caused compositing tests to assert on iOS
1715         simulator
1716
1717         Reverted changeset:
1718
1719         "Elements with backdrop-filter cannot be clipped with clip-
1720         path or mask"
1721         https://bugs.webkit.org/show_bug.cgi?id=142662
1722         http://trac.webkit.org/changeset/201349
1723
1724 2016-05-24  Brady Eidson  <beidson@apple.com>
1725
1726         Modern IDB: (Workers) Eliminate race in getting the ScriptExecutionContext and using it.
1727         https://bugs.webkit.org/show_bug.cgi?id=158038
1728
1729         Reviewed by Alex Christensen.
1730
1731         No new tests (Resolves potential flakes in existing tests).
1732         
1733         When the main thread is trying to post a task to a worker thread's ScriptExecutionContext, there is a race
1734         between checking that the context still exists and actually using it.
1735         
1736         The solution is to add a new class - IDBActiveDOMObject - which does a few things things:
1737         1 - Remembers its origin thread.
1738         2 - Guards clearing its ScriptExecutionContext with a Lock.
1739         3 - Adds a templated "performCallbackOnOriginThread" that uses the same Lock to make sure posting the task to
1740             the ScriptExecutionContext's RunLoop is safe.
1741
1742         Also, tons of ASSERTions are updated because each object with an originThread no longer keeps its idea in an
1743         accessible member variable.
1744         
1745         * Modules/indexeddb/IDBActiveDOMObject.h:
1746         (WebCore::IDBActiveDOMObject::originThreadID):
1747         (WebCore::IDBActiveDOMObject::performCallbackOnOriginThread):
1748         (WebCore::IDBActiveDOMObject::IDBActiveDOMObject):
1749         
1750         * Modules/indexeddb/IDBDatabase.cpp:
1751         (WebCore::IDBDatabase::IDBDatabase):
1752         (WebCore::IDBDatabase::~IDBDatabase):
1753         (WebCore::IDBDatabase::hasPendingActivity):
1754         (WebCore::IDBDatabase::name):
1755         (WebCore::IDBDatabase::version):
1756         (WebCore::IDBDatabase::objectStoreNames):
1757         (WebCore::IDBDatabase::createObjectStore):
1758         (WebCore::IDBDatabase::transaction):
1759         (WebCore::IDBDatabase::deleteObjectStore):
1760         (WebCore::IDBDatabase::close):
1761         (WebCore::IDBDatabase::didCloseFromServer):
1762         (WebCore::IDBDatabase::maybeCloseInServer):
1763         (WebCore::IDBDatabase::activeDOMObjectName):
1764         (WebCore::IDBDatabase::canSuspendForDocumentSuspension):
1765         (WebCore::IDBDatabase::stop):
1766         (WebCore::IDBDatabase::startVersionChangeTransaction):
1767         (WebCore::IDBDatabase::didStartTransaction):
1768         (WebCore::IDBDatabase::willCommitTransaction):
1769         (WebCore::IDBDatabase::didCommitTransaction):
1770         (WebCore::IDBDatabase::willAbortTransaction):
1771         (WebCore::IDBDatabase::didAbortTransaction):
1772         (WebCore::IDBDatabase::didCommitOrAbortTransaction):
1773         (WebCore::IDBDatabase::fireVersionChangeEvent):
1774         (WebCore::IDBDatabase::dispatchEvent):
1775         (WebCore::IDBDatabase::didCreateIndexInfo):
1776         (WebCore::IDBDatabase::didDeleteIndexInfo):
1777         * Modules/indexeddb/IDBDatabase.h:
1778         (WebCore::IDBDatabase::originThreadID): Deleted.
1779         
1780         * Modules/indexeddb/IDBRequest.cpp:
1781         (WebCore::IDBRequest::IDBRequest):
1782         (WebCore::IDBRequest::~IDBRequest):
1783         (WebCore::IDBRequest::errorCode):
1784         (WebCore::IDBRequest::error):
1785         (WebCore::IDBRequest::setSource):
1786         (WebCore::IDBRequest::setVersionChangeTransaction):
1787         (WebCore::IDBRequest::transaction):
1788         (WebCore::IDBRequest::readyState):
1789         (WebCore::IDBRequest::sourceObjectStoreIdentifier):
1790         (WebCore::IDBRequest::sourceIndexIdentifier):
1791         (WebCore::IDBRequest::requestedIndexRecordType):
1792         (WebCore::IDBRequest::eventTargetInterface):
1793         (WebCore::IDBRequest::activeDOMObjectName):
1794         (WebCore::IDBRequest::canSuspendForDocumentSuspension):
1795         (WebCore::IDBRequest::hasPendingActivity):
1796         (WebCore::IDBRequest::stop):
1797         (WebCore::IDBRequest::enqueueEvent):
1798         (WebCore::IDBRequest::dispatchEvent):
1799         (WebCore::IDBRequest::uncaughtExceptionInEventHandler):
1800         (WebCore::IDBRequest::setResult):
1801         (WebCore::IDBRequest::setResultToStructuredClone):
1802         (WebCore::IDBRequest::clearResult):
1803         (WebCore::IDBRequest::setResultToUndefined):
1804         (WebCore::IDBRequest::resultCursor):
1805         (WebCore::IDBRequest::willIterateCursor):
1806         (WebCore::IDBRequest::didOpenOrIterateCursor):
1807         (WebCore::IDBRequest::requestCompleted):
1808         (WebCore::IDBRequest::onError):
1809         (WebCore::IDBRequest::onSuccess):
1810         * Modules/indexeddb/IDBRequest.h:
1811         (WebCore::IDBRequest::originThreadID): Deleted.
1812         
1813         * Modules/indexeddb/IDBTransaction.cpp:
1814         (WebCore::IDBTransaction::IDBTransaction):
1815         (WebCore::IDBTransaction::originThreadID): Deleted.
1816         * Modules/indexeddb/IDBTransaction.h:
1817         
1818         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
1819         (WebCore::IDBClient::IDBConnectionProxy::completeOpenDBRequest):
1820         (WebCore::IDBClient::IDBConnectionProxy::completeOperation):
1821         (WebCore::IDBClient::IDBConnectionProxy::fireVersionChangeEvent):
1822         (WebCore::IDBClient::IDBConnectionProxy::notifyOpenDBRequestBlocked):
1823         (WebCore::IDBClient::IDBConnectionProxy::didStartTransaction):
1824         (WebCore::IDBClient::IDBConnectionProxy::didCommitTransaction):
1825         (WebCore::IDBClient::IDBConnectionProxy::didAbortTransaction):
1826         (WebCore::IDBClient::IDBConnectionProxy::didCloseFromServer):
1827         (WebCore::IDBClient::performCallbackOnCorrectThread): Deleted.
1828         
1829         * Modules/indexeddb/client/TransactionOperation.cpp:
1830         (WebCore::IDBClient::TransactionOperation::scriptExecutionContext): Deleted.
1831         * Modules/indexeddb/client/TransactionOperation.h:
1832         (WebCore::IDBClient::TransactionOperation::performCompleteOnOriginThread):
1833         
1834         * WebCore.xcodeproj/project.pbxproj:
1835
1836 2016-05-23  Ada Chan  <adachan@apple.com>
1837
1838         Only set overflow:hidden on -webkit-media-controls when the placeholder is showing.
1839         https://bugs.webkit.org/show_bug.cgi?id=157975
1840
1841         Reviewed by Eric Carlson.
1842
1843         Test: media/mac/controls-panel-not-clipped-out.html
1844
1845         overflow:hidden was added to clip out content contained in -webkit-media-controls
1846         that sticks out of the bounds of that container when the inlinePlaybackPlaceholder
1847         is showing. However, that style also clips out things that we want to show when the
1848         inlinePlaybackPlaceholder is not showing. For example, the volume slider or the
1849         controls panel when the video element's height is too short.
1850
1851         To fix that, we only set overflow:hidden on -webkit-media-controls when the
1852         inlinePlaybackPlaceholder is visible.
1853
1854         * Modules/mediacontrols/mediaControlsApple.css:
1855         (::-webkit-media-controls):
1856         (::-webkit-media-controls.placeholder-showing):
1857         Set overflow:hidden only when the placeholder is showing.
1858
1859         * Modules/mediacontrols/mediaControlsApple.js:
1860         (Controller.prototype.handlePresentationModeChange):
1861         Add the placeholderShowing class to -webkit-media-controls only when the
1862         inlinePlaybackPlaceholder is not hidden.
1863
1864 2016-05-24  Ryan Haddad  <ryanhaddad@apple.com>
1865
1866         Unreviewed, rolling out r201341.
1867
1868         This change may have caused LayoutTests to crash on Mac and
1869         iOS
1870
1871         Reverted changeset:
1872
1873         "Use lambda capture with initializer instead of StringCapture"
1874         https://bugs.webkit.org/show_bug.cgi?id=158010
1875         http://trac.webkit.org/changeset/201341
1876
1877 2016-05-24  Adam Bergkvist  <adam.bergkvist@ericsson.com>
1878
1879         WebRTC: RTCIceCandidate: Make attributes readonly (and update constructor arg)
1880         https://bugs.webkit.org/show_bug.cgi?id=157859
1881
1882         Reviewed by Eric Carlson.
1883
1884         Make the RTCIceCandidate constructor argument mandatory and the attributes
1885         read-only (in accordance with the WebRTC 1.0 specification [1]).
1886
1887         [1] https://w3c.github.io/webrtc-pc/archives/20160513/webrtc.html#rtcicecandidate-interface
1888
1889         Updated existing test.
1890
1891         * Modules/mediastream/RTCIceCandidate.h:
1892         (WebCore::RTCIceCandidate::setCandidate): Deleted.
1893         (WebCore::RTCIceCandidate::setSdpMid): Deleted.
1894         (WebCore::RTCIceCandidate::setSdpMLineIndex): Deleted.
1895         * Modules/mediastream/RTCIceCandidate.idl:
1896
1897 2016-05-24  Antoine Quint  <graouts@apple.com>
1898
1899         Elements with backdrop-filter cannot be clipped with clip-path or mask
1900         https://bugs.webkit.org/show_bug.cgi?id=142662
1901         <rdar://problem/20150192>
1902
1903         Reviewed by Dean Jackson.
1904
1905         We used to only apply the mask to the layer contents but did not account
1906         for the fact that a layer backdrop may exist. We now correctly mask the
1907         backdrop layer as well as the layer contents.
1908
1909         Test: css3/filters/backdrop/backdrop-filter-with-clip-path.html
1910
1911         * platform/graphics/ca/GraphicsLayerCA.cpp:
1912         (WebCore::GraphicsLayerCA::updateShape):
1913         Ensure clones of a layer use the same shape path.
1914
1915         (WebCore::GraphicsLayerCA::updateMaskLayer):
1916         If we have a backdrop layer, ensure that we apply a clone of the mask layer applied to
1917         the layer contents.
1918
1919 2016-05-24  Zalan Bujtas  <zalan@apple.com>
1920
1921         fast/table/neighboring-cells-when-collapsed-border-changes.html is flaky.
1922         https://bugs.webkit.org/show_bug.cgi?id=158009
1923
1924         Reviewed by David Hyatt.
1925
1926         RenderTable::invalidateCollapsedBorders() early returns on m_collapsedEmptyBorderIsPresent
1927         which prevents us from marking neighboring cells dirty when style changes.
1928         Decouple the "invalidate the collapsed borders" and the "mark the neighboring cells dirty" logic.
1929
1930         Covered by existing tests. (and now we agree with FF on cached-change-cell-border-width.html)
1931
1932         * rendering/RenderTable.cpp:
1933         (WebCore::RenderTable::invalidateCollapsedBorders):
1934         (WebCore::markCellDirtyWhenCollapsedBorderChanges): Deleted.
1935         * rendering/RenderTableCell.cpp:
1936         (WebCore::markCellDirtyWhenCollapsedBorderChanges):
1937         (WebCore::RenderTableCell::styleDidChange):
1938
1939 2016-05-24  Alex Christensen  <achristensen@webkit.org>
1940
1941         Fix use-after-free after r201318
1942         https://bugs.webkit.org/show_bug.cgi?id=158037
1943         rdar://problem/26446729
1944
1945         Reviewed by Brady Eidson.
1946
1947         This fixes a crash when running fast/dom/navigation-with-sideeffects.html with GuardMalloc.
1948
1949         * bindings/scripts/CodeGeneratorJS.pm:
1950         (GenerateImplementation):
1951         * bindings/scripts/test/JS/JSTestObj.cpp:
1952         (WebCore::setJSTestObjPutForwardsNullableAttribute):
1953         Changing RefPtr<${type}> to auto caused the type to sometimes be a raw pointer, which does not keep the object alive.
1954         In the case of JSDocument.cpp, forwardedImpl was what Document::location returned, which is a Location* and not a RefPtr<Location>.
1955
1956 2016-05-24  Chris Dumez  <cdumez@apple.com>
1957
1958         Use lambda capture with initializer instead of StringCapture
1959         https://bugs.webkit.org/show_bug.cgi?id=158010
1960
1961         Reviewed by Antti Koivisto.
1962
1963         Use lambda capture with initializer instead of StringCapture now that
1964         we support C++14.
1965
1966         * fileapi/AsyncFileStream.cpp:
1967         (WebCore::AsyncFileStream::getSize):
1968         (WebCore::AsyncFileStream::openForRead):
1969         (WebCore::AsyncFileStream::openForWrite):
1970         * loader/DocumentLoader.cpp:
1971         (WebCore::DocumentLoader::installContentFilterUnblockHandler):
1972         * loader/WorkerThreadableLoader.cpp:
1973         (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge):
1974         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
1975         (WebVideoFullscreenControllerContext::setExternalPlayback):
1976         * platform/network/curl/CurlDownload.cpp:
1977         (WebCore::CurlDownload::didReceiveHeader):
1978         * workers/WorkerMessagingProxy.cpp:
1979         (WebCore::WorkerMessagingProxy::postExceptionToWorkerObject):
1980         (WebCore::WorkerMessagingProxy::postConsoleMessageToWorkerObject):
1981
1982 2016-05-24  Said Abou-Hallawa  <sabouhallawa@apple.com>
1983
1984         In accelerated drawing mode, ImageBuffer::putByteArray() should copy the bytes directly to the IOSurface backing store
1985         https://bugs.webkit.org/show_bug.cgi?id=157966
1986
1987         Reviewed by Dean Jackson.
1988         
1989         Roll out the the change of r106836 in ImageBuffer::putByteArray(). r106836
1990         was using CG to draw the image data as a native image in the accelerated
1991         drawing mode just to force invalidating the IOSurface cached image. Instead
1992         of doing that, we can use a light-weight fix, for now, to force recreating
1993         the IOSurface image if it is requested through CGIOSurfaceContextCreateImage().
1994
1995         * platform/graphics/cg/ImageBufferCG.cpp:
1996         (WebCore::ImageBuffer::putByteArray):
1997
1998 2016-05-24  Chris Dumez  <cdumez@apple.com>
1999
2000         Use auto for some of our lambda function parameters
2001         https://bugs.webkit.org/show_bug.cgi?id=158001
2002
2003         Reviewed by Darin Adler.
2004
2005         Use auto for some of our lambda function parameters now that we build with c++14.
2006
2007         * Modules/mediasource/MediaSource.cpp:
2008         (WebCore::MediaSource::buffered):
2009         (WebCore::MediaSource::monitorSourceBuffers):
2010         (WebCore::MediaSource::endOfStream):
2011         * Modules/mediasource/SampleMap.cpp:
2012         (WebCore::PresentationOrderSampleMap::findSamplesWithinPresentationRangeFromEnd):
2013         * accessibility/AccessibilityRenderObject.cpp:
2014         (WebCore::AccessibilityRenderObject::ariaSelectedRows):
2015         * bindings/js/SerializedScriptValue.cpp:
2016         (WebCore::SerializedScriptValue::writeBlobsToDiskForIndexedDB):
2017         * css/CSSValueList.cpp:
2018         (WebCore::CSSValueList::removeAll):
2019         * css/MediaList.cpp:
2020         (WebCore::MediaQuerySet::remove):
2021         * css/MediaQuery.cpp:
2022         (WebCore::MediaQuery::MediaQuery):
2023         * css/MediaQueryMatcher.cpp:
2024         (WebCore::MediaQueryMatcher::removeListener):
2025         * dom/Document.cpp:
2026         (WebCore::Document::validateAutoSizingNodes):
2027         * dom/Element.cpp:
2028         (WebCore::Element::detachAttrNodeFromElementWithValue):
2029         * dom/MutationObserver.cpp:
2030         (WebCore::MutationObserver::deliverAllMutations):
2031         * dom/Node.cpp:
2032         (WebCore::Node::unregisterMutationObserver):
2033         * html/LinkIconCollector.cpp:
2034         * inspector/InspectorIndexedDBAgent.cpp:
2035         (WebCore::InspectorIndexedDBAgent::requestDatabaseNames):
2036         * loader/ResourceLoader.cpp:
2037         (WebCore::ResourceLoader::loadDataURL):
2038         * page/CaptionUserPreferences.cpp:
2039         (WebCore::CaptionUserPreferences::sortedTrackListForMenu):
2040         * page/CaptionUserPreferencesMediaAF.cpp:
2041         (WebCore::CaptionUserPreferencesMediaAF::sortedTrackListForMenu):
2042         * page/animation/AnimationController.cpp:
2043         (WebCore::AnimationControllerPrivate::clear):
2044         * platform/graphics/FontCascade.cpp:
2045         (WebCore::pruneUnreferencedEntriesFromFontCascadeCache):
2046         * platform/graphics/FontCascadeFonts.cpp:
2047         (WebCore::FontCascadeFonts::pruneSystemFallbacks):
2048         * platform/graphics/PathUtilities.cpp:
2049         (WebCore::addIntersectionPoints):
2050         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
2051         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateTracks):
2052         * platform/graphics/texmap/TextureMapperGL.cpp:
2053         (WebCore::TextureMapperGLData::SharedGLData::~SharedGLData):
2054         * platform/mac/HIDGamepad.cpp:
2055         (WebCore::HIDGamepad::initElements):
2056         * svg/SVGToOTFFontConversion.cpp:
2057         (WebCore::SVGToOTFFontConverter::appendLigatureSubtable):
2058         (WebCore::SVGToOTFFontConverter::finishAppendingKERNSubtable):
2059
2060 2016-05-24  Antti Koivisto  <antti@apple.com>
2061
2062         REGRESSION (r196629): Safari can get into a state where switching Reader theme doesn't apply to the webpage
2063         https://bugs.webkit.org/show_bug.cgi?id=158018
2064         <rdar://problem/24732776>
2065
2066         Reviewed by Darin Adler.
2067
2068         When a tab goes to background we clear the style resolver. It is recreated lazily when the tab is again active.
2069         However style invalidation code tests if the style resolver exists and skips the invalidation if it doesn't.
2070         With sufficiently simple document (like in Reader) we may never create one for other reasons and so style
2071         invalidation doesn't work.
2072
2073         No test, don't know how to make one.
2074
2075         * dom/Element.cpp:
2076         (WebCore::Element::needsStyleInvalidation):
2077
2078             Remove styleResolverIfExists() check and do the invalidation normally.
2079             Instead check for forced style recalc. If there is one pending we don't need to bother with invalidation.
2080
2081 2016-05-24  Yusuke Suzuki  <utatane.tea@gmail.com>
2082
2083         Unreviewed, updating binding test results
2084         https://bugs.webkit.org/show_bug.cgi?id=157080
2085
2086         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
2087         (WebCore::jsTestActiveDOMObjectExcitingAttr):
2088         (WebCore::jsTestActiveDOMObjectConstructor):
2089         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
2090         (WebCore::jsTestClassWithJSBuiltinConstructorConstructor):
2091         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
2092         (WebCore::jsTestCustomConstructorWithNoInterfaceObjectConstructor):
2093         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
2094         (WebCore::jsTestCustomNamedGetterConstructor):
2095         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
2096         (WebCore::jsTestEventConstructorAttr1):
2097         (WebCore::jsTestEventConstructorAttr2):
2098         (WebCore::jsTestEventConstructorAttr3):
2099         (WebCore::jsTestEventConstructorConstructor):
2100         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
2101         (WebCore::jsTestEventTargetConstructor):
2102         * bindings/scripts/test/JS/JSTestException.cpp:
2103         (WebCore::jsTestExceptionName):
2104         (WebCore::jsTestExceptionConstructor):
2105         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
2106         (WebCore::jsTestGenerateIsReachableConstructor):
2107         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
2108         (WebCore::jsTestGlobalObjectRegularAttribute):
2109         (WebCore::jsTestGlobalObjectEnabledAtRuntimeAttribute):
2110         (WebCore::jsTestGlobalObjectConstructor):
2111         * bindings/scripts/test/JS/JSTestInterface.cpp:
2112         (WebCore::jsTestInterfaceConstructorImplementsStaticReadOnlyAttr):
2113         (WebCore::jsTestInterfaceConstructorImplementsStaticAttr):
2114         (WebCore::jsTestInterfaceImplementsStr1):
2115         (WebCore::jsTestInterfaceImplementsStr2):
2116         (WebCore::jsTestInterfaceImplementsStr3):
2117         (WebCore::jsTestInterfaceImplementsNode):
2118         (WebCore::jsTestInterfaceConstructorSupplementalStaticReadOnlyAttr):
2119         (WebCore::jsTestInterfaceConstructorSupplementalStaticAttr):
2120         (WebCore::jsTestInterfaceSupplementalStr1):
2121         (WebCore::jsTestInterfaceSupplementalStr2):
2122         (WebCore::jsTestInterfaceSupplementalStr3):
2123         (WebCore::jsTestInterfaceSupplementalNode):
2124         (WebCore::jsTestInterfaceConstructor):
2125         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
2126         (WebCore::jsTestJSBuiltinConstructorTestAttributeCustom):
2127         (WebCore::jsTestJSBuiltinConstructorTestAttributeRWCustom):
2128         (WebCore::jsTestJSBuiltinConstructorConstructor):
2129         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
2130         (WebCore::jsTestMediaQueryListListenerConstructor):
2131         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
2132         (WebCore::jsTestNamedConstructorConstructor):
2133         * bindings/scripts/test/JS/JSTestNode.cpp:
2134         (WebCore::jsTestNodeName):
2135         (WebCore::jsTestNodeConstructor):
2136         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
2137         (WebCore::jsTestNondeterministicNondeterministicReadonlyAttr):
2138         (WebCore::jsTestNondeterministicNondeterministicWriteableAttr):
2139         (WebCore::jsTestNondeterministicNondeterministicExceptionAttr):
2140         (WebCore::jsTestNondeterministicNondeterministicGetterExceptionAttr):
2141         (WebCore::jsTestNondeterministicNondeterministicSetterExceptionAttr):
2142         (WebCore::jsTestNondeterministicConstructor):
2143         * bindings/scripts/test/JS/JSTestObj.cpp:
2144         (WebCore::jsTestObjReadOnlyLongAttr):
2145         (WebCore::jsTestObjReadOnlyStringAttr):
2146         (WebCore::jsTestObjReadOnlyTestObjAttr):
2147         (WebCore::jsTestObjConstructorStaticReadOnlyLongAttr):
2148         (WebCore::jsTestObjConstructorStaticStringAttr):
2149         (WebCore::jsTestObjConstructorTestSubObj):
2150         (WebCore::jsTestObjTestSubObjEnabledBySettingConstructor):
2151         (WebCore::jsTestObjEnumAttr):
2152         (WebCore::jsTestObjByteAttr):
2153         (WebCore::jsTestObjOctetAttr):
2154         (WebCore::jsTestObjShortAttr):
2155         (WebCore::jsTestObjClampedShortAttr):
2156         (WebCore::jsTestObjEnforceRangeShortAttr):
2157         (WebCore::jsTestObjUnsignedShortAttr):
2158         (WebCore::jsTestObjLongAttr):
2159         (WebCore::jsTestObjLongLongAttr):
2160         (WebCore::jsTestObjUnsignedLongLongAttr):
2161         (WebCore::jsTestObjStringAttr):
2162         (WebCore::jsTestObjTestObjAttr):
2163         (WebCore::jsTestObjTestNullableObjAttr):
2164         (WebCore::jsTestObjLenientTestObjAttr):
2165         (WebCore::jsTestObjUnforgeableAttr):
2166         (WebCore::jsTestObjStringAttrTreatingNullAsEmptyString):
2167         (WebCore::jsTestObjXMLObjAttr):
2168         (WebCore::jsTestObjCreate):
2169         (WebCore::jsTestObjReflectedStringAttr):
2170         (WebCore::jsTestObjReflectedIntegralAttr):
2171         (WebCore::jsTestObjReflectedUnsignedIntegralAttr):
2172         (WebCore::jsTestObjReflectedBooleanAttr):
2173         (WebCore::jsTestObjReflectedURLAttr):
2174         (WebCore::jsTestObjReflectedCustomIntegralAttr):
2175         (WebCore::jsTestObjReflectedCustomBooleanAttr):
2176         (WebCore::jsTestObjReflectedCustomURLAttr):
2177         (WebCore::jsTestObjEnabledAtRuntimeAttribute):
2178         (WebCore::jsTestObjTypedArrayAttr):
2179         (WebCore::jsTestObjAttrWithGetterException):
2180         (WebCore::jsTestObjAttrWithGetterExceptionWithMessage):
2181         (WebCore::jsTestObjAttrWithSetterException):
2182         (WebCore::jsTestObjAttrWithSetterExceptionWithMessage):
2183         (WebCore::jsTestObjStringAttrWithGetterException):
2184         (WebCore::jsTestObjStringAttrWithSetterException):
2185         (WebCore::jsTestObjStrictTypeCheckingAttribute):
2186         (WebCore::jsTestObjCustomAttr):
2187         (WebCore::jsTestObjOnfoo):
2188         (WebCore::jsTestObjOnwebkitfoo):
2189         (WebCore::jsTestObjWithScriptStateAttribute):
2190         (WebCore::jsTestObjWithCallWithAndSetterCallWithAttribute):
2191         (WebCore::jsTestObjWithScriptExecutionContextAttribute):
2192         (WebCore::jsTestObjWithScriptStateAttributeRaises):
2193         (WebCore::jsTestObjWithScriptExecutionContextAttributeRaises):
2194         (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttribute):
2195         (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttributeRaises):
2196         (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute):
2197         (WebCore::jsTestObjWithScriptArgumentsAndCallStackAttribute):
2198         (WebCore::jsTestObjConditionalAttr1):
2199         (WebCore::jsTestObjConditionalAttr2):
2200         (WebCore::jsTestObjConditionalAttr3):
2201         (WebCore::jsTestObjConditionalAttr4Constructor):
2202         (WebCore::jsTestObjConditionalAttr5Constructor):
2203         (WebCore::jsTestObjConditionalAttr6Constructor):
2204         (WebCore::jsTestObjCachedAttribute1):
2205         (WebCore::jsTestObjCachedAttribute2):
2206         (WebCore::jsTestObjAnyAttribute):
2207         (WebCore::jsTestObjContentDocument):
2208         (WebCore::jsTestObjMutablePoint):
2209         (WebCore::jsTestObjImmutablePoint):
2210         (WebCore::jsTestObjStrawberry):
2211         (WebCore::jsTestObjStrictFloat):
2212         (WebCore::jsTestObjDescription):
2213         (WebCore::jsTestObjId):
2214         (WebCore::jsTestObjHash):
2215         (WebCore::jsTestObjReplaceableAttribute):
2216         (WebCore::jsTestObjNullableDoubleAttribute):
2217         (WebCore::jsTestObjNullableLongAttribute):
2218         (WebCore::jsTestObjNullableBooleanAttribute):
2219         (WebCore::jsTestObjNullableStringAttribute):
2220         (WebCore::jsTestObjNullableLongSettableAttribute):
2221         (WebCore::jsTestObjNullableStringSettableAttribute):
2222         (WebCore::jsTestObjNullableStringValue):
2223         (WebCore::jsTestObjAttribute):
2224         (WebCore::jsTestObjAttributeWithReservedEnumType):
2225         (WebCore::jsTestObjPutForwardsAttribute):
2226         (WebCore::jsTestObjPutForwardsNullableAttribute):
2227         (WebCore::jsTestObjConstructor):
2228         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
2229         (WebCore::jsTestOverloadedConstructorsConstructor):
2230         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
2231         (WebCore::jsTestOverrideBuiltinsConstructor):
2232         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
2233         (WebCore::jsTestSerializedScriptValueInterfaceValue):
2234         (WebCore::jsTestSerializedScriptValueInterfaceReadonlyValue):
2235         (WebCore::jsTestSerializedScriptValueInterfaceCachedValue):
2236         (WebCore::jsTestSerializedScriptValueInterfacePorts):
2237         (WebCore::jsTestSerializedScriptValueInterfaceCachedReadonlyValue):
2238         (WebCore::jsTestSerializedScriptValueInterfaceConstructor):
2239         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2240         (WebCore::jsTestTypedefsUnsignedLongLongAttr):
2241         (WebCore::jsTestTypedefsImmutableSerializedScriptValue):
2242         (WebCore::jsTestTypedefsConstructorTestSubObj):
2243         (WebCore::jsTestTypedefsAttrWithGetterException):
2244         (WebCore::jsTestTypedefsAttrWithSetterException):
2245         (WebCore::jsTestTypedefsStringAttrWithGetterException):
2246         (WebCore::jsTestTypedefsStringAttrWithSetterException):
2247         (WebCore::jsTestTypedefsConstructor):
2248         * bindings/scripts/test/JS/JSattribute.cpp:
2249         (WebCore::jsattributeReadonly):
2250         (WebCore::jsattributeConstructor):
2251         * bindings/scripts/test/JS/JSreadonly.cpp:
2252         (WebCore::jsreadonlyConstructor):
2253
2254 2016-05-24  Manuel Rego Casasnovas  <rego@igalia.com>
2255
2256         [css-grid] Fix behavior of flexible track breadths
2257         https://bugs.webkit.org/show_bug.cgi?id=157834
2258
2259         Reviewed by Sergio Villar Senin.
2260
2261         This patch is fixing 2 issues that are interrelated:
2262
2263         1) Flex sizes are invalid as min track sizing function.
2264
2265           The syntax has been recently updated on the spec:
2266             <track-size> =
2267               <track-breadth> |
2268               minmax( <inflexible-breadth> , <track-breadth> )
2269
2270         2) Flex sizes outside minmax() behave as auto minimum.
2271
2272           Flex sizes outside minmax() were previously behaving like
2273           minimum and maximum (e.g. 1fr => minmax(1fr, 1fr)).
2274           However the spec changed and now this would be invalid,
2275           so they should behave like auto minimum (e.g. minmax(auto, 1fr)).
2276
2277         * css/CSSParser.cpp:
2278         (WebCore::CSSParser::parseGridTrackSize): Call parseGridBreadth()
2279         for min sizing function using "InflexibleSizeOnly" restriction
2280         when needed.
2281         (WebCore::CSSParser::parseGridBreadth): Add check for
2282         "InflexibleSizeOnly" resctriction.
2283         * css/CSSParser.h: Add new type of restriction "InflexibleSizeOnly".
2284         * rendering/RenderGrid.cpp:
2285         (WebCore::RenderGrid::gridTrackSize): Add new condition to make
2286         |minTrackBreadth| auto if it was a flex size.
2287
2288 2016-05-24  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2289
2290         [Fetch API] Implement Fetch redirect mode
2291         https://bugs.webkit.org/show_bug.cgi?id=157837
2292
2293         Reviewed by Alex Christensen.
2294
2295         Implementing step 5 of https://fetch.spec.whatwg.org/#http-fetch.
2296         Making ResourceLoaderOptions include FetchOptions.
2297         This allows SubresourceLoader to follow or not redirections based on that option.
2298         CachedResource is made responsible to handle the type of the response (opaqueredirect, opaque, cors, basic...).
2299         If redirection is not to be followed, either an error is returned or an empty response is returned.
2300
2301         Moved Response type and redirected flag from FetchResponse to ResourceResponse.
2302         This allows CachedResource to easily communicate that information to FetchResponse.
2303
2304         Made some clean-up refactoring in ThreadableLoaderOptions.
2305
2306         http/tests/fetch/caching-with-different-options.html ensures that
2307         caching at CachedResourceLoader will not have bad effects on fetch.
2308         Covered by updated and rebased tests.
2309
2310         * Modules/fetch/FetchLoader.cpp:
2311         (WebCore::FetchLoader::start):
2312         * Modules/fetch/FetchResponse.cpp:
2313         (WebCore::FetchResponse::error):
2314         (WebCore::FetchResponse::redirect):
2315         (WebCore::FetchResponse::FetchResponse):
2316         (WebCore::FetchResponse::clone):
2317         (WebCore::FetchResponse::startFetching):
2318         * Modules/fetch/FetchResponse.h:
2319         * WebCore.xcodeproj/project.pbxproj:
2320         * loader/FetchOptions.h: Moved from Source/WebCore/Modules/fetch/FetchOptions.h.
2321         * loader/ResourceLoaderOptions.h:
2322         (WebCore::ResourceLoaderOptions::fetchOptions):
2323         (WebCore::ResourceLoaderOptions::setFetchOptions):
2324         * loader/SubresourceLoader.cpp:
2325         (WebCore::SubresourceLoader::willSendRequestInternal):
2326         * loader/ThreadableLoader.cpp:
2327         * loader/ThreadableLoader.h:
2328         * loader/cache/CachedResource.cpp:
2329         (WebCore::CachedResource::setResponse):
2330         * loader/cache/CachedResource.h:
2331         (WebCore::CachedResource::setOpaqueRedirect):
2332         * platform/network/ResourceResponseBase.cpp:
2333         (WebCore::ResourceResponseBase::adopt):
2334         (WebCore::ResourceResponseBase::copyData):
2335         * platform/network/ResourceResponseBase.h:
2336         (WebCore::ResourceResponseBase::type):
2337         (WebCore::ResourceResponseBase::setType):
2338         (WebCore::ResourceResponseBase::encode):
2339         (WebCore::ResourceResponseBase::decode):
2340
2341 2016-05-23  Yusuke Suzuki  <utatane.tea@gmail.com>
2342
2343         Assertion failure for Reflect.get with Proxy and primitive value as explicit receiver
2344         https://bugs.webkit.org/show_bug.cgi?id=157080
2345
2346         Reviewed by Saam Barati.
2347
2348         * bindings/js/JSDOMBinding.h:
2349         (WebCore::nonCachingStaticFunctionGetter):
2350         * bindings/js/JSDOMWindowCustom.cpp:
2351         (WebCore::jsDOMWindowWebKit):
2352         * bindings/js/JSPluginElementFunctions.cpp:
2353         (WebCore::pluginElementPropertyGetter):
2354         * bindings/js/JSPluginElementFunctions.h:
2355         * bindings/scripts/CodeGeneratorJS.pm:
2356         (GenerateHeader):
2357         (GenerateImplementation):
2358         * bridge/runtime_array.cpp:
2359         (JSC::RuntimeArray::lengthGetter):
2360         * bridge/runtime_array.h:
2361         * bridge/runtime_method.cpp:
2362         (JSC::RuntimeMethod::lengthGetter):
2363         * bridge/runtime_method.h:
2364         * bridge/runtime_object.cpp:
2365         (JSC::Bindings::RuntimeObject::fallbackObjectGetter):
2366         (JSC::Bindings::RuntimeObject::fieldGetter):
2367         (JSC::Bindings::RuntimeObject::methodGetter):
2368         * bridge/runtime_object.h:
2369
2370 2016-05-23  Alex Christensen  <achristensen@webkit.org>
2371
2372         Modernize CSS code
2373         https://bugs.webkit.org/show_bug.cgi?id=157875
2374
2375         Reviewed by Chris Dumez.
2376
2377         * bindings/scripts/CodeGeneratorJS.pm:
2378         (GenerateImplementation):
2379         (GenerateParametersCheck):
2380         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
2381         (WebCore::jsTestMediaQueryListListenerPrototypeFunctionMethod):
2382         * bindings/scripts/test/JS/JSTestObj.cpp:
2383         (WebCore::JSTestObjConstructor::construct):
2384         (WebCore::setJSTestObjPutForwardsNullableAttribute):
2385         (WebCore::jsTestObjPrototypeFunctionMethodWithCallbackArg):
2386         (WebCore::jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackArg):
2387         (WebCore::jsTestObjPrototypeFunctionMethodWithCallbackFunctionArg):
2388         (WebCore::jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackFunctionArg):
2389         (WebCore::jsTestObjConstructorFunctionStaticMethodWithCallbackArg):
2390         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod5):
2391         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2392         (WebCore::JSTestTypedefsConstructor::construct):
2393         * css/CSSBasicShapes.cpp:
2394         (WebCore::serializePositionOffset):
2395         (WebCore::buildSerializablePositionOffset):
2396         (WebCore::CSSBasicShapeCircle::cssText):
2397         (WebCore::CSSBasicShapeEllipse::cssText):
2398         * css/CSSCalculationValue.cpp:
2399         (WebCore::determineCategory):
2400         (WebCore::CSSCalcExpressionNodeParser::parseValue):
2401         * css/CSSMediaRule.cpp:
2402         (WebCore::CSSMediaRule::media):
2403         * css/CSSMediaRule.h:
2404         * css/CSSOMUtils.h:
2405         * css/CSSParser.cpp:
2406         (WebCore::CSSParser::createImportRule):
2407         (WebCore::CSSParser::createMediaRule):
2408         * css/CSSReflectValue.h:
2409         * css/CSSStyleSheet.cpp:
2410         (WebCore::CSSStyleSheet::setDisabled):
2411         (WebCore::CSSStyleSheet::setMediaQueries):
2412         (WebCore::CSSStyleSheet::insertRule):
2413         (WebCore::CSSStyleSheet::deleteRule):
2414         (WebCore::CSSStyleSheet::isLoading):
2415         (WebCore::CSSStyleSheet::media):
2416         (WebCore::CSSStyleSheet::parentStyleSheet):
2417         (WebCore::CSSStyleSheet::ownerDocument):
2418         (WebCore::CSSStyleSheet::clearChildRuleCSSOMWrappers):
2419         (WebCore::CSSStyleSheet::RuleMutationScope::RuleMutationScope):
2420         * css/CSSStyleSheet.h:
2421         * css/PropertySetCSSStyleDeclaration.cpp:
2422         * css/StyleRule.cpp:
2423         (WebCore::StyleRuleBase::createCSSOMWrapper):
2424         (WebCore::StyleRuleBase::destroy):
2425         (WebCore::StyleRuleGroup::wrapperRemoveRule):
2426         (WebCore::StyleRuleMedia::StyleRuleMedia):
2427         * css/StyleRule.h:
2428         (WebCore::StyleRuleBase::deref):
2429         (WebCore::StyleRuleBase::StyleRuleBase):
2430         (WebCore::StyleRuleMedia::create):
2431         (WebCore::StyleRuleMedia::mediaQueries):
2432         (WebCore::StyleRuleMedia::copy):
2433         (isType):
2434         * css/StyleRuleImport.cpp:
2435         (WebCore::StyleRuleImport::create):
2436         (WebCore::StyleRuleImport::StyleRuleImport):
2437         * css/StyleRuleImport.h:
2438         * css/StyleSheetContents.cpp:
2439         (WebCore::StyleSheetContents::isCacheable):
2440         (WebCore::StyleSheetContents::parserAppendRule):
2441         (WebCore::StyleSheetContents::ruleAt):
2442         (WebCore::StyleSheetContents::parserSetEncodingFromCharsetRule):
2443         (WebCore::StyleSheetContents::wrapperInsertRule):
2444         * css/StyleSheetContents.h:
2445         (WebCore::StyleSheetContents::hasSyntacticallyValidCSSHeader):
2446         (WebCore::StyleSheetContents::parserSetUsesRemUnits):
2447         (WebCore::StyleSheetContents::parserSetUsesStyleBasedEditability):
2448         (WebCore::StyleSheetContents::copy):
2449         * dom/InlineStyleSheetOwner.cpp:
2450         (WebCore::InlineStyleSheetOwner::createSheet):
2451         * inspector/InspectorStyleSheet.cpp:
2452
2453 2016-05-23  Zalan Bujtas  <zalan@apple.com>
2454
2455         Changing border color and size simultaneously fails to repaint.
2456         https://bugs.webkit.org/show_bug.cgi?id=157967
2457         <rdar://problem/26423918>
2458
2459         Reviewed by David Hyatt.
2460
2461         This patch ensures that the neighboring tables cells are dirtied when collapsed border change requires layout.
2462
2463         Test: fast/table/neighboring-cells-when-collapsed-border-changes.html
2464
2465         * rendering/RenderTable.cpp:
2466         (WebCore::markCellDirtyWhenCollapsedBorderChanges):
2467         (WebCore::RenderTable::invalidateCollapsedBorders):
2468
2469 2016-05-23  Chris Dumez  <cdumez@apple.com>
2470
2471         Avoid unnecessary call to Document::completeURL() in HTMLLinkElement::process()
2472         https://bugs.webkit.org/show_bug.cgi?id=157993
2473
2474         Reviewed by Ryosuke Niwa.
2475
2476         Avoid unnecessary call to Document::completeURL() in HTMLLinkElement::process().
2477         The call to getNonEmptyURLAttribute() already calls Document::completeURL()
2478         internally so we can just reuse the returned URL.
2479
2480         * html/HTMLLinkElement.cpp:
2481         (WebCore::HTMLLinkElement::process):
2482
2483 2016-05-23  Jiewen Tan  <jiewen_tan@apple.com>
2484
2485         Null popstate event fired when navigating back to a cached page with a stateless history entry
2486         https://bugs.webkit.org/show_bug.cgi?id=157963
2487         <rdar://problem/23414840>
2488
2489         Popstate events are not fired when WebKit navigates back to a history entry that doesn't
2490         have a state object if the entry's page is not cached. However, we fire popstate events
2491         unconditionally if the page is cached. This results in inconsistent behavior between
2492         initial navigations and cached navigations. Align the behavior of initial and cached
2493         navigations so that we produce consistent events.
2494
2495         Reviewed by Brent Fulgham.
2496
2497         Tests: fast/loader/stateobjects/no-popstate-when-back-to-stateless-entry-with-page-cache.html
2498                fast/loader/stateobjects/no-popstate-when-back-to-stateless-entry.html
2499
2500         * history/CachedFrame.cpp:
2501         (WebCore::CachedFrameBase::restore):
2502
2503 2016-05-23  Chris Dumez  <cdumez@apple.com>
2504
2505         Generate bindings code for EventTarget.addEventListener() / removeEventListener()
2506         https://bugs.webkit.org/show_bug.cgi?id=157882
2507
2508         Reviewed by Darin Adler.
2509
2510         Generate bindings code for EventTarget.addEventListener() / removeEventListener()
2511         instead of hardcoding them in the bindings generator.
2512
2513         No new tests, rebaselined existing test, no web-exposed behavior change.
2514
2515         * Modules/webaudio/AudioScheduledSourceNode.cpp:
2516         (WebCore::AudioScheduledSourceNode::addEventListener):
2517         (WebCore::AudioScheduledSourceNode::removeEventListener):
2518         * Modules/webaudio/AudioScheduledSourceNode.h:
2519         * Modules/webaudio/ScriptProcessorNode.cpp:
2520         (WebCore::ScriptProcessorNode::addEventListener):
2521         (WebCore::ScriptProcessorNode::removeEventListener):
2522         * Modules/webaudio/ScriptProcessorNode.h:
2523         * bindings/gobject/GObjectEventListener.cpp:
2524         (WebCore::GObjectEventListener::operator==):
2525         * bindings/gobject/GObjectEventListener.h:
2526         * bindings/js/JSEventListener.cpp:
2527         (WebCore::JSEventListener::operator==):
2528         (WebCore::eventHandlerAttribute): Deleted.
2529         * bindings/js/JSEventListener.h:
2530         (WebCore::JSEventListener::create):
2531         (WebCore::JSEventListener::cast): Deleted.
2532         (WebCore::JSEventListener::jsFunction): Deleted.
2533         * bindings/objc/ObjCEventListener.h:
2534         * bindings/objc/ObjCEventListener.mm:
2535         (WebCore::ObjCEventListener::operator==):
2536         * bindings/scripts/CodeGeneratorJS.pm:
2537         (GenerateImplementation):
2538         (JSValueToNative):
2539         (GetParentClassName): Deleted.
2540         (GetCallbackClassName): Deleted.
2541         (GetJSCallbackDataType): Deleted.
2542         * dom/EventListener.h:
2543         * dom/EventListenerMap.cpp:
2544         (WebCore::addListenerToVector):
2545         (WebCore::EventListenerMap::add):
2546         (WebCore::removeListenerFromVector):
2547         (WebCore::EventListenerMap::remove):
2548         (WebCore::copyListenersNotCreatedFromMarkupToTarget):
2549         * dom/EventListenerMap.h:
2550         * dom/EventTarget.cpp:
2551         (WebCore::EventTarget::addEventListener):
2552         (WebCore::EventTarget::addEventListenerForBindings):
2553         (WebCore::EventTarget::removeEventListenerForBindings):
2554         (WebCore::EventTarget::removeEventListener):
2555         (WebCore::EventTarget::setAttributeEventListener):
2556         (WebCore::EventTarget::clearAttributeEventListener):
2557         * dom/EventTarget.h:
2558         * dom/EventTarget.idl:
2559         * dom/MessagePort.cpp:
2560         (WebCore::MessagePort::addEventListener):
2561         * dom/MessagePort.h:
2562         * dom/Node.cpp:
2563         (WebCore::tryAddEventListener):
2564         (WebCore::Node::addEventListener):
2565         (WebCore::tryRemoveEventListener):
2566         (WebCore::Node::removeEventListener):
2567         * dom/Node.h:
2568         * dom/RegisteredEventListener.h:
2569         (WebCore::RegisteredEventListener::RegisteredEventListener):
2570         * html/HTMLMediaElement.cpp:
2571         (WebCore::HTMLMediaElement::addEventListener):
2572         (WebCore::HTMLMediaElement::removeEventListener):
2573         * html/HTMLMediaElement.h:
2574         * html/ImageDocument.cpp:
2575         (WebCore::ImageDocument::createDocumentStructure):
2576         (WebCore::ImageEventListener::operator==):
2577         * html/shadow/MediaControlsApple.cpp:
2578         (WebCore::MediaControlsApple::showClosedCaptionTrackList):
2579         (WebCore::MediaControlsApple::hideClosedCaptionTrackList):
2580         (WebCore::MediaControlsAppleEventListener::operator==):
2581         * html/shadow/MediaControlsApple.h:
2582         * inspector/InspectorIndexedDBAgent.cpp:
2583         * page/DOMWindow.cpp:
2584         (WebCore::DOMWindow::addEventListener):
2585         (WebCore::DOMWindow::removeEventListener):
2586         * page/DOMWindow.h:
2587         * platform/cocoa/WebPlaybackSessionModelMediaElement.h:
2588         * platform/cocoa/WebVideoFullscreenModelVideoElement.h:
2589         * svg/SVGElement.cpp:
2590         (WebCore::SVGElement::addEventListener):
2591         (WebCore::SVGElement::removeEventListener):
2592         * svg/SVGElement.h:
2593         * svg/SVGTRefElement.cpp:
2594         (WebCore::SVGTRefTargetEventListener::attach):
2595         (WebCore::SVGTRefTargetEventListener::detach):
2596         (WebCore::SVGTRefTargetEventListener::operator==):
2597         * svg/animation/SVGSMILElement.cpp:
2598         (WebCore::ConditionEventListener::operator==):
2599         (WebCore::SVGSMILElement::connectConditions):
2600         (WebCore::SVGSMILElement::disconnectConditions):
2601
2602 2016-05-23  Chris Dumez  <cdumez@apple.com>
2603
2604         Fix undefined behavior introduced in r201290.
2605         https://bugs.webkit.org/show_bug.cgi?id=157961
2606
2607         Reviewed by Alex Christensen.
2608
2609         The evaluation order of function arguments is undefined so it is unsafe to
2610         copyRef() and WTFMove() the same parameter in a function call.
2611
2612         * css/CSSBasicShapes.h:
2613
2614 2016-05-23  Brady Eidson  <beidson@apple.com>
2615
2616         Speculative fix for:
2617         Modern IDB: Some blob tests ASSERT sometimes on the bots.
2618         https://bugs.webkit.org/show_bug.cgi?id=157525
2619
2620         Reviewed by Alex Christensen.
2621
2622         No new tests (Should fix existing flakiness, not reproducibly testable).
2623
2624         For all of the lambdas involved in this operation, explicitly WTFMove all of the arguments around.
2625         
2626         Critically, this includes the RefPtr<TransactionOperation> protector as well as the 
2627         std::function<void ()> completionHandler(s).
2628         
2629         By doing so, this removes the possibility of a race between the background thread and the main thread
2630         tearing down the TransactionOperation, guaranteeing that it is torn down on its original thread.
2631         
2632         * Modules/indexeddb/IDBTransaction.cpp:
2633         (WebCore::IDBTransaction::putOrAddOnServer):
2634         * bindings/js/SerializedScriptValue.cpp:
2635         (WebCore::SerializedScriptValue::writeBlobsToDiskForIndexedDB):
2636         * platform/network/BlobRegistryImpl.cpp:
2637         (WebCore::BlobRegistryImpl::writeBlobsToTemporaryFiles):
2638
2639 2016-05-23  Commit Queue  <commit-queue@webkit.org>
2640
2641         Unreviewed, rolling out r201296.
2642         https://bugs.webkit.org/show_bug.cgi?id=158002
2643
2644         The LayoutTest added with this change is failing on mac-wk1
2645         (Requested by ryanhaddad on #webkit).
2646
2647         Reverted changeset:
2648
2649         "Changing border color and size simultaneously fails to
2650         repaint."
2651         https://bugs.webkit.org/show_bug.cgi?id=157967
2652         http://trac.webkit.org/changeset/201296
2653
2654 2016-05-23  Dean Jackson  <dino@apple.com>
2655
2656         Missing/Incomplete timestamp for inline Audio player in ePub book
2657         https://bugs.webkit.org/show_bug.cgi?id=157998
2658         <rdar://problem/25858437>
2659
2660         Reviewed by Jon Lee and Tim Horton.
2661
2662         On iOS it is rare to apply a text-zoom (Safari does not provide
2663         UI for it). However, iBooks uses text-zoom to increase the font
2664         size. This causes the time displays in the media controls to
2665         overflow their containers and be clipped.
2666
2667         The solution is to simply reset the text zoom for the media controls,
2668         which means the time displays will always be a constant size.
2669
2670         * Modules/mediacontrols/mediaControlsiOS.css:
2671         (audio::-webkit-media-controls-time-remaining-display):
2672
2673 2016-05-23  Zalan Bujtas  <zalan@apple.com>
2674
2675         Changing border color and size simultaneously fails to repaint.
2676         https://bugs.webkit.org/show_bug.cgi?id=157967
2677         <rdar://problem/26423918>
2678
2679         Reviewed by David Hyatt.
2680
2681         This patch ensures that the neighboring tables cells are dirtied when collapsed border change requires layout.
2682
2683         Test: fast/table/neighboring-cells-when-collapsed-border-changes.html
2684
2685         * rendering/RenderTable.cpp:
2686         (WebCore::markCellDirtyWhenCollapsedBorderChanges):
2687         (WebCore::RenderTable::invalidateCollapsedBorders):
2688
2689 2016-05-23  Chris Fleizach  <cfleizach@apple.com>
2690
2691         AX: iOS: when bringing focus to a text field we may zoom the page even if author wanted max scale = 1
2692         https://bugs.webkit.org/show_bug.cgi?id=157771
2693
2694         Reviewed by Tim Horton.
2695
2696         If the author requests scaling not to be enabled, we should not scale in when keyboard focus moves to a text field.
2697         Scaling should only happen when the user performs a gesture to do so in this case.
2698
2699         Tests: fast/viewport/ios/user-scalable-does-not-scale-for-keyboard-focus-with-author-defined-scale.html
2700                fast/viewport/ios/user-scalable-scales-for-keyboard-focus-with-no-author-defined-scale.html
2701
2702         * page/ViewportConfiguration.h:
2703         (WebCore::ViewportConfiguration::maximumScale):
2704
2705 2016-05-23  Ryan Haddad  <ryanhaddad@apple.com>
2706
2707         Unreviewed, rolling out r200414.
2708
2709         This change appears to have broken the 'write a reply' field
2710         on Nextdoor.com
2711
2712         Reverted changeset:
2713
2714         "Clicks inside button elements are sometimes discarded when
2715         the mouse moves"
2716         https://bugs.webkit.org/show_bug.cgi?id=39620
2717         http://trac.webkit.org/changeset/200414
2718
2719 2016-05-23  Chris Dumez  <cdumez@apple.com>
2720
2721         Clean up / Modernize the CSS Parser
2722         https://bugs.webkit.org/show_bug.cgi?id=157961
2723
2724         Reviewed by Alex Christensen.
2725
2726         Clean up / Modernize the CSS Parser.
2727
2728         * WebCore.xcodeproj/project.pbxproj:
2729         * css/BasicShapeFunctions.cpp:
2730         (WebCore::valueForBasicShape):
2731         (WebCore::convertToLength):
2732         (WebCore::convertToLengthSize):
2733         (WebCore::basicShapeForValue):
2734         * css/BasicShapeFunctions.h:
2735         * css/CSSBasicShapes.cpp:
2736         (WebCore::CSSBasicShapePolygon::cssText):
2737         (WebCore::CSSBasicShapePolygon::equals):
2738         * css/CSSBasicShapes.h:
2739         * css/CSSComputedStyleDeclaration.cpp:
2740         (WebCore::valueForReflection):
2741         (WebCore::ComputedStyleExtractor::valueForShadow):
2742         (WebCore::specifiedValueForGridTrackSize):
2743         * css/CSSCrossfadeValue.cpp:
2744         (WebCore::subimageKnownToBeOpaque):
2745         (WebCore::CSSCrossfadeValue::fixedSize):
2746         (WebCore::CSSCrossfadeValue::isPending):
2747         (WebCore::CSSCrossfadeValue::knownToBeOpaque):
2748         (WebCore::CSSCrossfadeValue::loadSubimages):
2749         (WebCore::CSSCrossfadeValue::image):
2750         (WebCore::CSSCrossfadeValue::blend):
2751         (WebCore::CSSCrossfadeValue::equals):
2752         (WebCore::CSSCrossfadeValue::equalInputImages):
2753         * css/CSSCrossfadeValue.h:
2754         (WebCore::CSSCrossfadeValue::create):
2755         (WebCore::CSSCrossfadeValue::CSSCrossfadeValue):
2756         * css/CSSCustomPropertyValue.h:
2757         (WebCore::CSSCustomPropertyValue::create):
2758         (WebCore::CSSCustomPropertyValue::CSSCustomPropertyValue):
2759         * css/CSSFilterImageValue.cpp:
2760         (WebCore::CSSFilterImageValue::fixedSize):
2761         (WebCore::CSSFilterImageValue::isPending):
2762         (WebCore::CSSFilterImageValue::loadSubimages):
2763         (WebCore::CSSFilterImageValue::image):
2764         (WebCore::CSSFilterImageValue::createFilterOperations):
2765         (WebCore::CSSFilterImageValue::equals):
2766         (WebCore::CSSFilterImageValue::equalInputImages):
2767         * css/CSSFilterImageValue.h:
2768         (WebCore::CSSFilterImageValue::CSSFilterImageValue):
2769         * css/CSSFontFaceSet.cpp:
2770         (WebCore::CSSFontFaceSet::matchingFaces):
2771         * css/CSSFunctionValue.cpp:
2772         (WebCore::CSSFunctionValue::CSSFunctionValue):
2773         * css/CSSFunctionValue.h:
2774         (WebCore::CSSFunctionValue::create):
2775         * css/CSSGradientValue.h:
2776         (WebCore::CSSLinearGradientValue::setAngle):
2777         * css/CSSGrammar.y.in:
2778         * css/CSSImageGeneratorValue.cpp:
2779         (WebCore::CSSImageGeneratorValue::subimageIsPending):
2780         (WebCore::CSSImageGeneratorValue::cachedImageForCSSValue):
2781         * css/CSSImageGeneratorValue.h:
2782         * css/CSSImageValue.cpp:
2783         (WebCore::CSSImageValue::cachedOrPendingImage):
2784         * css/CSSImageValue.h:
2785         * css/CSSKeyframesRule.cpp:
2786         (WebCore::StyleRuleKeyframes::StyleRuleKeyframes):
2787         (WebCore::StyleRuleKeyframes::parserAppendKeyframe):
2788         (WebCore::StyleRuleKeyframes::wrapperAppendKeyframe):
2789         (WebCore::CSSKeyframesRule::appendRule):
2790         (WebCore::CSSKeyframesRule::findRule):
2791         (WebCore::CSSKeyframesRule::item):
2792         (WebCore::StyleRuleKeyframes::~StyleRuleKeyframes): Deleted.
2793         * css/CSSKeyframesRule.h:
2794         (WebCore::StyleRuleKeyframes::keyframes):
2795         * css/CSSParser.cpp:
2796         (WebCore::parseColorValue):
2797         (WebCore::parseSimpleLengthValue):
2798         (WebCore::parseKeywordValue):
2799         (WebCore::parseTranslateTransformValue):
2800         (WebCore::CSSParser::parseFontFaceValue):
2801         (WebCore::CSSParser::parseValue):
2802         (WebCore::CSSParser::parseCustomPropertyValue):
2803         (WebCore::CSSParser::parseDeclaration):
2804         (WebCore::CSSParser::SourceSize::SourceSize):
2805         (WebCore::filterProperties):
2806         (WebCore::CSSParser::clearProperties):
2807         (WebCore::CSSParser::addExpandedPropertyForValue):
2808         (WebCore::CSSParser::parseVariableDependentValue):
2809         (WebCore::CSSParser::parseContentDistributionOverflowPosition):
2810         (WebCore::CSSParser::parseItemPositionOverflowPosition):
2811         (WebCore::CSSParser::parseNonElementSnapPoints):
2812         (WebCore::CSSParser::parseScrollSnapDestination):
2813         (WebCore::CSSParser::parseScrollSnapCoordinate):
2814         (WebCore::CSSParser::parseFillShorthand):
2815         (WebCore::CSSParser::addAnimationValue):
2816         (WebCore::CSSParser::parseAnimationShorthand):
2817         (WebCore::CSSParser::parseColumnWidth):
2818         (WebCore::CSSParser::parseColumnCount):
2819         (WebCore::CSSParser::parseColumnsShorthand):
2820         (WebCore::CSSParser::parseTransitionShorthand):
2821         (WebCore::CSSParser::parseSize):
2822         (WebCore::CSSParser::parseQuotes):
2823         (WebCore::CSSParser::parseAlt):
2824         (WebCore::CSSParser::parseCustomPropertyDeclaration):
2825         (WebCore::CSSParser::parseContent):
2826         (WebCore::CSSParser::parseAttr):
2827         (WebCore::CSSParser::parseBackgroundColor):
2828         (WebCore::CSSParser::parseFillPositionComponent):
2829         (WebCore::CSSParser::parse4ValuesFillPosition):
2830         (WebCore::CSSParser::parse3ValuesFillPosition):
2831         (WebCore::CSSParser::parseFillPosition):
2832         (WebCore::CSSParser::parseFillSize):
2833         (WebCore::CSSParser::parseFillProperty):
2834         (WebCore::CSSParser::parseAnimationDelay):
2835         (WebCore::CSSParser::parseAnimationDirection):
2836         (WebCore::CSSParser::parseAnimationDuration):
2837         (WebCore::CSSParser::parseAnimationFillMode):
2838         (WebCore::CSSParser::parseAnimationIterationCount):
2839         (WebCore::CSSParser::parseAnimationName):
2840         (WebCore::CSSParser::parseAnimationPlayState):
2841         (WebCore::CSSParser::parseAnimationTrigger):
2842         (WebCore::CSSParser::parseAnimationProperty):
2843         (WebCore::CSSParser::parseKeyframeSelector):
2844         (WebCore::CSSParser::parseGridPosition):
2845         (WebCore::gridMissingGridPositionValue):
2846         (WebCore::CSSParser::parseGridItemPositionShorthand):
2847         (WebCore::CSSParser::parseGridGapShorthand):
2848         (WebCore::CSSParser::parseGridTemplateRowsAndAreasAndColumns):
2849         (WebCore::CSSParser::parseGridTemplateShorthand):
2850         (WebCore::CSSParser::parseGridShorthand):
2851         (WebCore::CSSParser::parseGridAreaShorthand):
2852         (WebCore::CSSParser::parseGridLineNames):
2853         (WebCore::CSSParser::parseGridTrackList):
2854         (WebCore::CSSParser::parseGridTrackRepeatFunction):
2855         (WebCore::CSSParser::parseGridTrackSize):
2856         (WebCore::CSSParser::parseGridAutoFlow):
2857         (WebCore::skipCommaInDashboardRegion):
2858         (WebCore::CSSParser::parseDashboardRegions):
2859         (WebCore::parseGridTemplateAreasColumnNames):
2860         (WebCore::CSSParser::parseCounterContent):
2861         (WebCore::CSSParser::parseClipShape):
2862         (WebCore::CSSParser::parseInsetRoundedCorners):
2863         (WebCore::CSSParser::parseBasicShapeInset):
2864         (WebCore::CSSParser::parseBasicShapeCircle):
2865         (WebCore::CSSParser::parseBasicShapeEllipse):
2866         (WebCore::CSSParser::parseBasicShapePolygon):
2867         (WebCore::CSSParser::parseBasicShapePath):
2868         (WebCore::CSSParser::parseBasicShapeAndOrBox):
2869         (WebCore::CSSParser::parseFont):
2870         (WebCore::CSSParser::parseFontFamily):
2871         (WebCore::CSSParser::parseFontSynthesis):
2872         (WebCore::CSSParser::parseFontFaceSrcURI):
2873         (WebCore::CSSParser::parseFontFaceSrc):
2874         (WebCore::CSSParser::parseFontFaceUnicodeRange):
2875         (WebCore::parseAlphaValue):
2876         (WebCore::ShadowParseContext::commitValue):
2877         (WebCore::CSSParser::parseShadow):
2878         (WebCore::CSSParser::parseReflect):
2879         (WebCore::CSSParser::parseFlex):
2880         (WebCore::BorderImageParseContext::commitImage):
2881         (WebCore::BorderImageParseContext::commitImageSlice):
2882         (WebCore::BorderImageParseContext::commitBorderWidth):
2883         (WebCore::BorderImageParseContext::commitBorderOutset):
2884         (WebCore::BorderImageParseContext::commitRepeat):
2885         (WebCore::BorderImageParseContext::commitWebKitBorderImage):
2886         (WebCore::BorderImageParseContext::commitBorderImageProperty):
2887         (WebCore::CSSParser::parseBorderImage):
2888         (WebCore::CSSParser::parseBorderImageRepeat):
2889         (WebCore::BorderImageQuadParseContext::setTop):
2890         (WebCore::CSSParser::parseCounter):
2891         (WebCore::CSSParser::parseDeprecatedGradient):
2892         (WebCore::CSSParser::parseDeprecatedLinearGradient):
2893         (WebCore::CSSParser::parseDeprecatedRadialGradient):
2894         (WebCore::CSSParser::parseLinearGradient):
2895         (WebCore::CSSParser::parseRadialGradient):
2896         (WebCore::CSSParser::parseFilterImage):
2897         (WebCore::CSSParser::parseCrossfade):
2898         (WebCore::CSSParser::parseImageResolution):
2899         (WebCore::CSSParser::parseImageSet):
2900         (WebCore::CSSParser::parseTransform):
2901         (WebCore::CSSParser::parseTransformValue):
2902         (WebCore::CSSParser::parseFilter):
2903         (WebCore::CSSParser::parseTextDecoration):
2904         (WebCore::CSSParser::parseTextEmphasisStyle):
2905         (WebCore::CSSParser::parseTextEmphasisPosition):
2906         (WebCore::CSSParser::parseTextIndent):
2907         (WebCore::CSSParser::parseHangingPunctuation):
2908         (WebCore::CSSParser::parseFontFeatureSettings):
2909         (WebCore::CSSParser::parseWillChange):
2910         (WebCore::CSSParser::createImportRule):
2911         (WebCore::CSSParser::createMediaRule):
2912         (WebCore::CSSParser::createEmptyMediaRule):
2913         (WebCore::CSSParser::createSupportsRule):
2914         (WebCore::CSSParser::markSupportsRuleHeaderStart):
2915         (WebCore::CSSParser::popSupportsRuleData):
2916         (WebCore::CSSParser::processAndAddNewRuleToSourceTreeIfNeeded):
2917         (WebCore::CSSParser::addNewRuleToSourceTree):
2918         (WebCore::CSSParser::popRuleData):
2919         (WebCore::CSSParser::createKeyframesRule):
2920         (WebCore::CSSParser::createStyleRule):
2921         (WebCore::CSSParser::createFontFaceRule):
2922         (WebCore::CSSParser::createPageRule):
2923         (WebCore::CSSParser::createRegionRule):
2924         (WebCore::CSSParser::endDeclarationsForMarginBox):
2925         (WebCore::CSSParser::createKeyframe):
2926         (WebCore::CSSParser::updateLastMediaLine):
2927         (WebCore::fixUnparsedProperties):
2928         (WebCore::CSSParser::fixUnparsedPropertyRanges):
2929         (WebCore::CSSParser::parseViewportProperty):
2930         (WebCore::cssPropertyNameIOSAliasing):
2931         (WebCore::isAppleLegacyCssValueKeyword):
2932         (WebCore::quoteCSSString):
2933         (WebCore::AnimationParseContext::commitFirstAnimation): Deleted.
2934         (WebCore::strictCSSParserContext): Deleted.
2935         (WebCore::CSSParser::~CSSParser): Deleted.
2936         (WebCore::convertToASCIILowercaseInPlace): Deleted.
2937         (WebCore::CSSParserString::convertToASCIILowercaseInPlace): Deleted.
2938         (WebCore::CSSParser::setupParser): Deleted.
2939         (WebCore::isSimpleLengthPropertyID): Deleted.
2940         (WebCore::isValidKeywordPropertyAndValue): Deleted.
2941         (WebCore::parseTransformTranslateArguments): Deleted.
2942         (WebCore::CSSParser::parseColor): Deleted.
2943         (WebCore::CSSParser::parseMediaQuery): Deleted.
2944         (WebCore::CSSParser::parseSizesAttribute): Deleted.
2945         (WebCore::CSSParser::addProperty): Deleted.
2946         (WebCore::CSSParser::validateCalculationUnit): Deleted.
2947         (WebCore::isItemPositionKeyword): Deleted.
2948         (WebCore::CSSParser::parseShorthand): Deleted.
2949         (WebCore::CSSParser::parseSizeParameter): Deleted.
2950         (WebCore::CSSParser::parseFillImage): Deleted.
2951         (WebCore::CSSParser::parsePositionY): Deleted.
2952         (WebCore::CSSParser::parse2ValuesFillPosition): Deleted.
2953         (WebCore::CSSParser::parseTransformOriginShorthand): Deleted.
2954         (WebCore::CSSParser::parseAnimationTimingFunction): Deleted.
2955         (WebCore::CSSParser::parseGridTemplateColumns): Deleted.
2956         (WebCore::CSSParser::parseSingleGridAreaLonghand): Deleted.
2957         (WebCore::allTracksAreFixedSized): Deleted.
2958         (WebCore::CSSParser::parseGridBreadth): Deleted.
2959         (WebCore::CSSParser::parseGridTemplateAreasRow): Deleted.
2960         (WebCore::completeBorderRadii): Deleted.
2961         (WebCore::CSSParser::parseShapeRadius): Deleted.
2962         (WebCore::isBoxValue): Deleted.
2963         (WebCore::CSSParser::parseShapeProperty): Deleted.
2964         (WebCore::CSSParser::parseClipPath): Deleted.
2965         (WebCore::CSSParser::parseBasicShape): Deleted.
2966         (WebCore::FontFamilyValueBuilder::commit): Deleted.
2967         (WebCore::CSSParser::parseFontWeight): Deleted.
2968         (WebCore::CSSParser::parseFontFaceSrcLocal): Deleted.
2969         (WebCore::parseDouble): Deleted.
2970         (WebCore::mightBeRGBA): Deleted.
2971         (WebCore::mightBeRGB): Deleted.
2972         (WebCore::ShadowParseContext::commitColor): Deleted.
2973         (WebCore::BorderImageParseContext::BorderImageParseContext): Deleted.
2974         (WebCore::BorderImageParseContext::commitForwardSlashOperator): Deleted.
2975         (WebCore::BorderImageParseContext::commitBorderImage): Deleted.
2976         (WebCore::isBorderImageRepeatKeyword): Deleted.
2977         (WebCore::BorderImageSliceParseContext::commitBorderImageSlice): Deleted.
2978         (WebCore::CSSParser::parseBorderImageQuad): Deleted.
2979         (WebCore::parseDeprecatedGradientColorStop): Deleted.
2980         (WebCore::valueFromSideKeyword): Deleted.
2981         (WebCore::CSSParser::isGeneratedImageValue): Deleted.
2982         (WebCore::CSSParser::parseCanvas): Deleted.
2983         (WebCore::CSSParser::parseNamedImage): Deleted.
2984         (WebCore::TransformOperationInfo::TransformOperationInfo): Deleted.
2985         (WebCore::CSSParser::isBlendMode): Deleted.
2986         (WebCore::filterInfoForName): Deleted.
2987         (WebCore::CSSParser::parseFlowThread): Deleted.
2988         (WebCore::CSSParser::parseRegionThread): Deleted.
2989         (WebCore::CSSParser::parseLineBoxContain): Deleted.
2990         (WebCore::CSSParser::parseFontFeatureTag): Deleted.
2991         (WebCore::CSSParser::parseFontVariantLigatures): Deleted.
2992         (WebCore::isCSSLetter): Deleted.
2993         (WebCore::CSSParser::markSupportsRuleHeaderEnd): Deleted.
2994         (WebCore::CSSParser::syntaxError): Deleted.
2995         (WebCore::CSSParser::logError): Deleted.
2996         (WebCore::CSSParser::rewriteSpecifiersWithElementName): Deleted.
2997         (WebCore::CSSParser::rewriteSpecifiers): Deleted.
2998         (WebCore::CSSParser::invalidBlockHit): Deleted.
2999         (WebCore::CSSParser::markRuleHeaderStart): Deleted.
3000         (WebCore::CSSParser::setRuleHeaderEnd): Deleted.
3001         (WebCore::CSSParser::markRuleHeaderEnd): Deleted.
3002         (WebCore::CSSParser::markRuleBodyStart): Deleted.
3003         (WebCore::cssPropertyID): Deleted.
3004         (WebCore::isCSSTokenizerIdentifier): Deleted.
3005         * css/CSSParser.h:
3006         (WebCore::CSSParser::ValueWithCalculation::setCalculation): Deleted.
3007         * css/CSSPrimitiveValue.cpp:
3008         (WebCore::CSSPrimitiveValue::cloneForCSSOM):
3009         * css/CSSPrimitiveValue.h:
3010         * css/CSSPropertySourceData.h:
3011         * css/CSSReflectValue.cpp:
3012         (WebCore::CSSReflectValue::equals):
3013         * css/CSSReflectValue.h:
3014         (WebCore::CSSReflectValue::create):
3015         (WebCore::CSSReflectValue::direction):
3016         (WebCore::CSSReflectValue::offset):
3017         (WebCore::CSSReflectValue::CSSReflectValue):
3018         * css/CSSShadowValue.cpp:
3019         (WebCore::CSSShadowValue::CSSShadowValue):
3020         (WebCore::CSSShadowValue::customCSSText): Deleted.
3021         * css/CSSShadowValue.h:
3022         (WebCore::CSSShadowValue::create):
3023         * css/CSSValue.h:
3024         (WebCore::compareCSSValueVector):
3025         * css/CSSVariableDependentValue.cpp:
3026         (WebCore::CSSVariableDependentValue::checkVariablesForCycles):
3027         * css/CSSVariableDependentValue.h:
3028         (WebCore::CSSVariableDependentValue::create):
3029         (WebCore::CSSVariableDependentValue::customCSSText):
3030         (WebCore::CSSVariableDependentValue::valueList):
3031         (WebCore::CSSVariableDependentValue::CSSVariableDependentValue):
3032         * css/CSSVariableValue.cpp:
3033         (WebCore::CSSVariableValue::buildParserValueListSubstitutingVariables):
3034         * css/Counter.h:
3035         (WebCore::Counter::create):
3036         (WebCore::Counter::identifier):
3037         (WebCore::Counter::listStyle):
3038         (WebCore::Counter::separator):
3039         (WebCore::Counter::listStyleIdent):
3040         (WebCore::Counter::setIdentifier):
3041         (WebCore::Counter::setListStyle):
3042         (WebCore::Counter::setSeparator):
3043         (WebCore::Counter::cloneForCSSOM):
3044         (WebCore::Counter::Counter):
3045         * css/DOMCSSNamespace.cpp:
3046         (WebCore::DOMCSSNamespace::supports):
3047         * css/FontFace.cpp:
3048         (WebCore::FontFace::parseString):
3049         (WebCore::FontFace::setVariant):
3050         * css/Rect.h:
3051         (WebCore::RectBase::RectBase):
3052         * css/SVGCSSParser.cpp:
3053         (WebCore::CSSParser::parseSVGStrokeDasharray):
3054         (WebCore::CSSParser::parseSVGPaint):
3055         (WebCore::CSSParser::parseSVGColor):
3056         (WebCore::CSSParser::parsePaintOrder):
3057         * css/StyleBuilderConverter.h:
3058         (WebCore::StyleBuilderConverter::convertReflection):
3059         * css/StyleProperties.cpp:
3060         (WebCore::MutableStyleProperties::setProperty):
3061         (WebCore::MutableStyleProperties::setCustomProperty):
3062         (WebCore::MutableStyleProperties::parseDeclaration):
3063         * css/StyleResolver.cpp:
3064         (WebCore::StyleResolver::keyframeStylesForAnimation):
3065         (WebCore::StyleResolver::cachedOrPendingFromValue):
3066         * css/StyleResolver.h:
3067         * css/WebKitCSSMatrix.cpp:
3068         (WebCore::WebKitCSSMatrix::setMatrixValue):
3069         * html/canvas/CanvasRenderingContext2D.cpp:
3070         (WebCore::CanvasRenderingContext2D::setFont):
3071         * inspector/InspectorStyleSheet.cpp:
3072         (flattenSourceData):
3073         (ParsedStyleSheet::setSourceData):
3074         (ParsedStyleSheet::ruleSourceDataAt):
3075         (WebCore::InspectorStyleSheetForInlineStyle::getStyleAttributeRanges):
3076         * page/PageSerializer.cpp:
3077         (WebCore::PageSerializer::retrieveResourcesForProperties):
3078         * page/animation/CSSPropertyAnimation.cpp:
3079         (WebCore::crossfadeBlend):
3080         * rendering/style/RenderStyle.cpp:
3081         (WebCore::RenderStyle::checkVariablesInCustomProperties):
3082
3083 2016-05-22  Brady Eidson  <beidson@apple.com>
3084
3085         Move to C++14.
3086         https://bugs.webkit.org/show_bug.cgi?id=157948
3087
3088         Reviewed by Michael Catanzaro.
3089
3090         No new tests (No change in behavior).
3091
3092         * Configurations/Base.xcconfig:
3093         
3094         Replace time literal suffixes that have underscores to the forms without
3095         (e.g. 0_ms becomes 0ms):
3096         * page/mac/ServicesOverlayController.mm:
3097         (WebCore::ServicesOverlayController::remainingTimeUntilHighlightShouldBeShown):
3098         * platform/graphics/cg/IOSurfacePool.cpp:
3099
3100 2016-05-22  Chris Dumez  <cdumez@apple.com>
3101
3102         Remove uses of PassRefPtr in JS bindings code
3103         https://bugs.webkit.org/show_bug.cgi?id=157949
3104
3105         Reviewed by Andreas Kling.
3106
3107         Remove uses of PassRefPtr in JS bindings code.
3108
3109         * bindings/js/JSDOMBinding.cpp:
3110         (WebCore::jsArray):
3111         * bindings/js/JSDOMBinding.h:
3112         * bindings/js/JSDOMGlobalObject.cpp:
3113         (WebCore::JSDOMGlobalObject::JSDOMGlobalObject):
3114         * bindings/js/JSDOMGlobalObject.h:
3115         * bindings/js/JSDOMGlobalObjectTask.cpp:
3116         (WebCore::JSGlobalObjectTask::JSGlobalObjectTask):
3117         * bindings/js/JSDOMGlobalObjectTask.h:
3118         * bindings/js/JSDOMWindowBase.cpp:
3119         (WebCore::JSDOMWindowBase::JSDOMWindowBase):
3120         (WebCore::JSDOMWindowMicrotaskCallback::create):
3121         (WebCore::JSDOMWindowMicrotaskCallback::call):
3122         (WebCore::JSDOMWindowMicrotaskCallback::JSDOMWindowMicrotaskCallback):
3123         (WebCore::JSDOMWindowBase::queueTaskToEventLoop):
3124         * bindings/js/JSDOMWindowBase.h:
3125         * bindings/js/JSDOMWindowShell.cpp:
3126         (WebCore::JSDOMWindowShell::finishCreation):
3127         (WebCore::JSDOMWindowShell::setWindow):
3128         * bindings/js/JSDOMWindowShell.h:
3129         (WebCore::JSDOMWindowShell::create):
3130         * bindings/js/JSWorkerGlobalScopeBase.cpp:
3131         (WebCore::JSWorkerGlobalScopeBase::JSWorkerGlobalScopeBase):
3132         (WebCore::JSWorkerGlobalScopeBase::queueTaskToEventLoop):
3133         * bindings/js/JSWorkerGlobalScopeBase.h:
3134         * bindings/objc/DOMCustomXPathNSResolver.h:
3135         * bindings/scripts/CodeGeneratorJS.pm:
3136         (GetNativeTypeForCallbacks):
3137         * bindings/scripts/test/JS/JSTestCallback.cpp:
3138         (WebCore::JSTestCallback::callbackWithSerializedScriptValueParam):
3139         (WebCore::JSTestCallback::callbackWithStringList):
3140         * bindings/scripts/test/JS/JSTestCallback.h:
3141         * bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
3142         (WebCore::JSTestCallbackFunction::callbackWithSerializedScriptValueParam):
3143         (WebCore::JSTestCallbackFunction::callbackWithStringList):
3144         * bindings/scripts/test/JS/JSTestCallbackFunction.h:
3145
3146 2016-05-20  Dan Bernstein  <mitz@apple.com>
3147
3148         Fixed USE(APPLE_INTERNAL_SDK) builds.
3149
3150         * platform/cocoa/ThemeCocoa.mm:
3151         (WebCore::fitContextToBox):
3152
3153 2016-05-20  Joseph Pecoraro  <pecoraro@apple.com>
3154
3155         Remove LegacyProfiler
3156         https://bugs.webkit.org/show_bug.cgi?id=153565
3157
3158         Reviewed by Mark Lam.
3159
3160         * ForwardingHeaders/profiler/Profile.h: Removed.
3161         * ForwardingHeaders/profiler/ProfileNode.h: Removed.
3162         * testing/js/WebCoreTestSupport.cpp:
3163         * xml/XSLStyleSheetLibxslt.cpp:
3164         * xml/XSLTProcessorLibxslt.cpp:
3165
3166 2016-05-20  Joseph Pecoraro  <pecoraro@apple.com>
3167
3168         Remove LegacyProfiler
3169         https://bugs.webkit.org/show_bug.cgi?id=153565
3170
3171         Reviewed by Saam Barati.
3172
3173         JavaScriptCore now provides a sampling profiler and it is enabled
3174         by all ports. Web Inspector switched months ago to using the
3175         sampling profiler and displaying its data. Remove the legacy
3176         profiler, as it is no longer being used by anything other then
3177         console.profile and tests. We will update console.profile's
3178         behavior soon to have new behavior and use the sampling data.
3179
3180         * CMakeLists.txt:
3181         * DerivedSources.cpp:
3182         * DerivedSources.make:
3183         * ForwardingHeaders/profiler/LegacyProfiler.h: Removed.
3184         * WebCore.xcodeproj/project.pbxproj:
3185         * bindings/js/JSCustomXPathNSResolver.cpp:
3186         * bindings/js/JSDOMWindowBase.cpp:
3187         (WebCore::JSDOMWindowBase::supportsLegacyProfiling): Deleted.
3188         (WebCore::JSDOMWindowBase::supportsRichSourceInfo): Deleted.
3189         * bindings/js/JSDOMWindowBase.h:
3190         * bindings/js/JSWorkerGlobalScopeBase.cpp:
3191         (WebCore::JSWorkerGlobalScopeBase::supportsLegacyProfiling): Deleted.
3192         * bindings/js/JSWorkerGlobalScopeBase.h:
3193         * bindings/js/ScriptCachedFrameData.cpp:
3194         * bindings/js/ScriptController.cpp:
3195         (WebCore::ScriptController::clearWindowShell): Deleted.
3196         * bindings/js/ScriptProfile.h: Removed.
3197         * bindings/js/ScriptProfileNode.h: Removed.
3198         * bindings/scripts/CodeGeneratorJS.pm:
3199         (AddClassForwardIfNeeded): Deleted.
3200         * bindings/scripts/test/JS/JSTestObj.cpp:
3201         (WebCore::jsTestObjPrototypeFunctionMethodWithSequenceArg): Deleted.
3202         (WebCore::jsTestObjPrototypeFunctionMethodReturningSequence): Deleted.
3203         * bindings/scripts/test/TestObj.idl:
3204         * css/CSSParser.cpp:
3205         * dom/Document.cpp:
3206         * inspector/InspectorConsoleInstrumentation.h:
3207         (WebCore::InspectorInstrumentation::stopProfiling):
3208         * inspector/InspectorController.cpp:
3209         (WebCore::InspectorController::InspectorController):
3210         (WebCore::InspectorController::legacyProfilerEnabled): Deleted.
3211         (WebCore::InspectorController::setLegacyProfilerEnabled): Deleted.
3212         * inspector/InspectorController.h:
3213         * inspector/InspectorInstrumentation.cpp:
3214         (WebCore::InspectorInstrumentation::stopProfilingImpl):
3215         * inspector/InspectorInstrumentation.h:
3216         * inspector/InspectorTimelineAgent.cpp:
3217         (WebCore::InspectorTimelineAgent::startFromConsole):
3218         (WebCore::InspectorTimelineAgent::stopFromConsole):
3219         * inspector/InspectorTimelineAgent.h:
3220         * inspector/PageDebuggerAgent.cpp:
3221         * inspector/PageRuntimeAgent.cpp:
3222         * inspector/ScriptProfile.idl: Removed.
3223         * inspector/ScriptProfileNode.idl: Removed.
3224         * inspector/TimelineRecordFactory.cpp:
3225         (WebCore::buildAggregateCallInfoInspectorObject): Deleted.
3226         (WebCore::buildInspectorObject): Deleted.
3227         (WebCore::buildProfileInspectorObject): Deleted.
3228         (WebCore::TimelineRecordFactory::appendProfile): Deleted.
3229         * inspector/TimelineRecordFactory.h:
3230         * page/DOMWindow.cpp:
3231         * page/Page.cpp:
3232         * page/PageConsoleClient.cpp:
3233         (WebCore::PageConsoleClient::profileEnd):
3234         (WebCore::PageConsoleClient::clearProfiles): Deleted.
3235         * page/PageConsoleClient.h:
3236         * testing/Internals.cpp:
3237         (WebCore::Internals::resetToConsistentState): Deleted.
3238         (WebCore::Internals::consoleProfiles): Deleted.
3239         (WebCore::Internals::setLegacyJavaScriptProfilingEnabled): Deleted.
3240         * testing/Internals.h:
3241         * testing/Internals.idl:
3242
3243 2016-05-20  Zalan Bujtas  <zalan@apple.com>
3244
3245         `width: 1%` on nested table cell causes its table to hog horizontal space
3246         https://bugs.webkit.org/show_bug.cgi?id=144696
3247         <rdar://problem/20839572>
3248
3249         Reviewed by David Hyatt and Tim Horton.
3250         
3251         This patch is based on https://chromium.googlesource.com/chromium/src/+/9428cfb16993a2329e87c65da096ca295132ef0f
3252
3253         Tests: fast/table/inner-percent-width-affects-outer-floated-div.html
3254                fast/table/inner-percent-width-doesnt-affect-ancestor-columns.html
3255
3256         * rendering/AutoTableLayout.cpp:
3257         (WebCore::shouldScaleColumnsForParent):
3258         (WebCore::shouldScaleColumnsForSelf):
3259         (WebCore::AutoTableLayout::computeIntrinsicLogicalWidths):
3260         (WebCore::shouldScaleColumns): Deleted.
3261         * rendering/AutoTableLayout.h:
3262         * rendering/RenderTable.cpp:
3263         (WebCore::RenderTable::updateLogicalWidth):
3264         * rendering/TableLayout.h:
3265         (WebCore::TableLayout::scaledWidthFromPercentColumns):
3266
3267 2016-05-20  Jer Noble  <jer.noble@apple.com>
3268
3269         Inconsistent state in playback controls
3270         https://bugs.webkit.org/show_bug.cgi?id=157962
3271         <rdar://problem/26397571>
3272
3273         Reviewed by Beth Dakin.
3274
3275         Do not use the playbackSessionManager() as the model, that's what the model is for.
3276
3277         * platform/mac/WebPlaybackSessionInterfaceMac.mm:
3278         (WebCore::WebPlaybackSessionInterfaceMac::setClient):
3279
3280 2016-05-20  Brady Eidson  <beidson@apple.com>
3281
3282         Modern IDB: Properly handle blobs in Workers.
3283         https://bugs.webkit.org/show_bug.cgi?id=157947
3284
3285         Reviewed by Alex Christensen.
3286
3287         Test: storage/indexeddb/modern/blob-simple-workers.html
3288
3289         * Modules/indexeddb/IDBTransaction.cpp:
3290         (WebCore::IDBTransaction::putOrAddOnServer): Use writeBlobsToDiskForIndexedDBSynchronously from
3291           background threads instead of the asynchronous form.
3292         
3293         Add ability to set an existing empty IDBValue to be an isolated copy of a different IDBValue:
3294         * Modules/indexeddb/IDBValue.cpp:
3295         (WebCore::IDBValue::setAsIsolatedCopy):
3296         (WebCore::IDBValue::isolatedCopy):
3297         * Modules/indexeddb/IDBValue.h:
3298         
3299         Add a method - only to be called from a non-main thread - that synchronously writes blobs to disk:
3300         * bindings/js/SerializedScriptValue.cpp:
3301         (WebCore::SerializedScriptValue::writeBlobsToDiskForIndexedDBSynchronously):
3302         * bindings/js/SerializedScriptValue.h:
3303         
3304 2016-05-20  Anders Carlsson  <andersca@apple.com>
3305
3306         Allow named images on iOS
3307         https://bugs.webkit.org/show_bug.cgi?id=157960
3308         rdar://problem/26396532
3309
3310         Reviewed by Dean Jackson.
3311
3312         USE(NEW_THEME) is false on iOS so force named images to be drawn by checking PLATFORM(IOS) as well.
3313
3314         * platform/graphics/NamedImageGeneratedImage.cpp:
3315         (WebCore::NamedImageGeneratedImage::draw):
3316
3317 2016-05-20  Myles C. Maxfield  <mmaxfield@apple.com>
3318
3319         [Cocoa] REGRESSION(r184899): Ascent adjustments are applied to web fonts
3320         https://bugs.webkit.org/show_bug.cgi?id=157954
3321         <rdar://problem/24204349>
3322
3323         Reviewed by Dean Jackson.
3324
3325         There are a few specific fonts which exist on Windows and Cocoa OSes, and we will adjust
3326         the ascents of these fonts to better match their counterparts on Windows. However, in
3327         r184899, we started applying this adjustment to web fonts too.
3328
3329         Test: fast/text/ascent-adjustment-webfont.html
3330
3331         * platform/graphics/cocoa/FontCocoa.mm:
3332         (WebCore::Font::platformInit):
3333         * svg/SVGToOTFFontConversion.cpp: We were reporting the length of font names wrong, so
3334         it made the test pass without this patch even when it shouldn't have. Previously, we
3335         were recording the number of characters in the font, not the number of bytes (each
3336         character is 2 bytes).
3337
3338 2016-05-20  John Wilander  <wilander@apple.com>
3339
3340         Remove unnecessary PageOverlay client function pageOverlayDestroyed
3341         https://bugs.webkit.org/show_bug.cgi?id=157388
3342         <rdar://problem/25471523>
3343
3344         Reviewed by Tim Horton.
3345
3346         Remove dead PageOverlay code. Almost all of these overrides were empty and
3347         never called. In the case of WebPageOverlay it was never called but had a
3348         function body, causing confusion. There was a fear of dangling pointers in
3349         WebPageOverlay's static hash map between PageOverlays and WebPageOverlays.
3350         Only WebPageOverlay's constructor creates its PageOverlay object and adds it
3351         to the hash map. Its client object is kept in a unique pointer member which
3352         is automatically deleted when the WebPageOverlay object itself is deleted.
3353         This explains why PageOverlayClientImpl::pageOverlayDestroyed in
3354         WKBundlePageOverlay can safely be removed. Finally, WebPageOverlay's
3355         destructor clears the hash map entry for its PageOverlay object. Thus, there
3356         is no need to call WebPageOverlay::pageOverlayDestroyed nor a need for
3357         WebPageOverlay's destructor to call pageOverlayDestroyed on its client.
3358
3359         No new tests. I tried to come up with a WebKit API test for this but I
3360         wasn't able to test presence/absence of WebPageOverlay's map entries since
3361         the map is not exposed.
3362
3363         * page/DebugPageOverlays.cpp:
3364         (WebCore::RegionOverlay::pageOverlayDestroyed): Deleted.
3365         * page/PageOverlay.h:
3366         (WebCore::PageOverlay::Client::pageOverlayDestroyed): Deleted.
3367         * page/ResourceUsageOverlay.h:
3368         (WebCore::ResourceUsageOverlay::pageOverlayDestroyed): Deleted.
3369         * page/mac/ServicesOverlayController.h:
3370         * page/mac/ServicesOverlayController.mm:
3371         (WebCore::ServicesOverlayController::pageOverlayDestroyed): Deleted.
3372         * testing/MockPageOverlayClient.cpp:
3373         * testing/MockPageOverlayClient.h:
3374         (WebCore::MockPageOverlayClient::pageOverlayDestroyed): Deleted.
3375
3376 2016-05-20  Alex Christensen  <achristensen@webkit.org>
3377
3378         Fix null dereferencing in CSSAnimationTriggerScrollValue::equals
3379         https://bugs.webkit.org/show_bug.cgi?id=157930
3380
3381         Reviewed by Dean Jackson.
3382
3383         Test: fast/css/compare-animation-trigger.html
3384
3385         * css/CSSAnimationTriggerScrollValue.cpp:
3386         (WebCore::CSSAnimationTriggerScrollValue::equals):
3387         * css/CSSAnimationTriggerScrollValue.h:
3388         (WebCore::CSSAnimationTriggerScrollValue::create):
3389         (WebCore::CSSAnimationTriggerScrollValue::startValue):
3390         (WebCore::CSSAnimationTriggerScrollValue::endValue):
3391         (WebCore::CSSAnimationTriggerScrollValue::hasEndValue):
3392         (WebCore::CSSAnimationTriggerScrollValue::operator==):
3393         (WebCore::CSSAnimationTriggerScrollValue::CSSAnimationTriggerScrollValue):
3394         * css/CSSToStyleMap.cpp:
3395         (WebCore::CSSToStyleMap::mapAnimationTrigger):
3396         * css/CSSValue.h:
3397         (WebCore::CSSValue::operator==):
3398
3399 2016-05-20  Dave Hyatt  <hyatt@apple.com>
3400
3401         Scrolling broken in iTunes connect pages
3402         https://bugs.webkit.org/show_bug.cgi?id=157678
3403
3404         Reviewed by Zalan Bujtas.
3405
3406         Added fast/flexbox/nested-columns-min-intrinsic-disabled.html
3407
3408         Turn off minimum intrinsic size adjustment for flexboxes. This violates the spec,
3409         but until we can produce good results that is what we need to do. Blink has also
3410         turned off nested columns intrinsic sizing as well, so we match them with this
3411         change.
3412
3413         * rendering/RenderFlexibleBox.cpp:
3414         (WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax):
3415
3416 2016-05-20  Rawinder Singh  <rawinder.singh-webkit@cisra.canon.com.au>
3417
3418         Implement operator== for WeakPtr
3419         https://bugs.webkit.org/show_bug.cgi?id=157883
3420
3421         Reviewed by Chris Dumez.
3422
3423         Implement operator== and operator!= for WeakPtr and update code to use the operators.
3424
3425         * page/EventHandler.cpp:
3426         (WebCore::EventHandler::handleMousePressEvent):
3427         (WebCore::EventHandler::updateLastScrollbarUnderMouse):
3428         * page/mac/EventHandlerMac.mm:
3429         (WebCore::EventHandler::platformCompleteWheelEvent):
3430
3431 2016-05-19  Tim Horton  <timothy_horton@apple.com>
3432
3433         REGRESSION (r200638): -[DOMHTMLVideoElement play] disappeared from ObjC bindings
3434         https://bugs.webkit.org/show_bug.cgi?id=157940
3435         <rdar://problem/26385907>
3436
3437         Reviewed by Dan Bernstein.
3438
3439         * html/HTMLMediaElement.idl:
3440         Drop the return value of play from the ObjC bindings, because the bindings
3441         generator doesn't seem to know what to do with a Promise.
3442
3443 2016-05-19  Chris Dumez  <cdumez@apple.com>
3444
3445         Improve compile-time assertions in is<>() / downcast<>()
3446         https://bugs.webkit.org/show_bug.cgi?id=157817
3447
3448         Reviewed by Darin Adler.
3449
3450         Add missing includes and drop unnecessary is<WebVTTElement>() check
3451         in SharingResolver::canShareStyleWithElement() that was identified
3452         by the new assertions. WebVTTElement inherits Element but the check
3453         was done on a StyledElement.
3454
3455         * accessibility/AccessibilityRenderObject.cpp:
3456         * accessibility/AccessibilitySVGElement.cpp:
3457         * css/CSSDefaultStyleSheets.cpp:
3458         * css/CSSParser.cpp:
3459         * css/CSSStyleSheet.cpp:
3460         * css/StyleResolver.cpp:
3461         * cssjit/SelectorCompiler.cpp:
3462         * dom/Document.cpp:
3463         * dom/Element.cpp:
3464         * dom/Node.cpp:
3465         * dom/Position.cpp:
3466         * editing/ApplyStyleCommand.cpp:
3467         * editing/FrameSelection.cpp:
3468         * editing/ReplaceSelectionCommand.cpp:
3469         * editing/TextIterator.cpp:
3470         * editing/VisiblePosition.cpp:
3471         * editing/VisibleUnits.cpp:
3472         * editing/cocoa/HTMLConverter.mm:
3473         * editing/htmlediting.cpp:
3474         * editing/markup.cpp:
3475         * html/GenericCachedHTMLCollection.cpp:
3476         * html/HTMLBodyElement.cpp:
3477         * html/HTMLFormElement.cpp:
3478         * html/HTMLLIElement.cpp:
3479         * html/HTMLNameCollection.cpp:
3480         * html/HTMLSelectElement.cpp:
3481         * html/parser/HTMLTreeBuilder.cpp:
3482         * inspector/InspectorDOMAgent.cpp:
3483         * inspector/InspectorStyleSheet.cpp:
3484         * loader/SubframeLoader.cpp:
3485         * loader/archive/cf/LegacyWebArchive.cpp:
3486         * mathml/MathMLElement.cpp:
3487         * page/EventHandler.cpp:
3488         * page/FrameView.cpp:
3489         * page/PageSerializer.cpp:
3490         * page/SpatialNavigation.cpp:
3491         * page/mac/EventHandlerMac.mm:
3492         * rendering/HitTestResult.cpp:
3493         * rendering/RenderBlockFlow.cpp:
3494         * rendering/RenderBox.cpp:
3495         * rendering/RenderBoxModelObject.cpp:
3496         * rendering/RenderElement.cpp:
3497         * rendering/RenderFieldset.cpp:
3498         * rendering/RenderLayer.cpp:
3499         * rendering/svg/RenderSVGTransformableContainer.cpp:
3500         * style/StyleSharingResolver.cpp:
3501         (WebCore::Style::SharingResolver::canShareStyleWithElement):
3502         * svg/SVGAnimationElement.cpp:
3503         * svg/SVGFELightElement.cpp:
3504         * svg/SVGTextPositioningElement.cpp:
3505
3506 2016-05-19  Zalan Bujtas  <zalan@apple.com>
3507
3508         Cleanup RenderObject::container()
3509         https://bugs.webkit.org/show_bug.cgi?id=157914
3510
3511         Reviewed by David Hyatt.
3512
3513         1. Now we have a dedicated method for the optional, repaintContainerSkipped branch. The container finding
3514         logic is moved to a static inline function so the compiler can optimize out the repaintContainerSkipped branches, when
3515         container() is called instead of container(repaintContainer, isRepaintContainerSkipped).
3516         2. Use helper functions like canContainAbsolutelyPositionedObjects()
3517         3. Remove stale comments.
3518
3519         No behaviour change.
3520
3521         * rendering/RenderBox.cpp:
3522         (WebCore::RenderBox::mapLocalToContainer):
3523         (WebCore::RenderBox::pushMappingToContainer):
3524         (WebCore::RenderBox::computeRectForRepaint):
3525         * rendering/RenderInline.cpp:
3526         (WebCore::RenderInline::computeRectForRepaint):
3527         (WebCore::RenderInline::mapLocalToContainer):
3528         (WebCore::RenderInline::pushMappingToContainer):
3529         * rendering/RenderObject.cpp:
3530         (WebCore::containerForElement):
3531         (WebCore::RenderObject::container):
3532         * rendering/RenderObject.h:
3533         * rendering/RenderText.h:
3534
3535 2016-05-16  Enrica Casucci  <enrica@apple.com>
3536
3537         No candidate punctuation when typing punctuation in WK2 text field.
3538         https://bugs.webkit.org/show_bug.cgi?id=157773
3539         rdar://problem/23084603
3540
3541         Reviewed by Sam Weinig.
3542
3543         We need to keep the inputManagerHint as part of the platform key event
3544         information. Adding a new initializer for the task and a property to retrieve
3545         the stored hint.
3546
3547         * platform/ios/WebEvent.h:
3548         * platform/ios/WebEvent.mm:
3549         (-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:keyCode:isTabKey:characterSet:]):
3550         (-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:withInputManagerHint:keyCode:isTabKey:]):
3551         (-[WebEvent dealloc]):
3552         (-[WebEvent inputManagerHint]):
3553
3554 2016-05-19  Brady Eidson  <beidson@apple.com>
3555
3556         Finishing off: Modern IDB: Website data store management.
3557         https://bugs.webkit.org/show_bug.cgi?id=157626
3558
3559         Reviewed by Alex Christensen.
3560
3561         Test: storage/indexeddb/modern/new-database-after-user-delete.html
3562
3563         This patch does two primary things:
3564         1 - Implements the actual "delete files on disk" code for unopened databases,
3565             taken from existing WK2 code.
3566
3567         2 - When a UniqueIBDDatabase is told to close immediately for user delete, it also
3568             queues up a "delete backing store unconditionally" operation in the database task queue.
3569
3570             That way, all of the open databases are deleted before the primary "delete all files"
3571             pass, and they are also deleted before any future openDB requests are handled that might
3572             recreate the files.
3573
3574         * Modules/indexeddb/server/IDBServer.cpp:
3575         (WebCore::IDBServer::IDBServer::getOrCreateUniqueIDBDatabase):
3576         (WebCore::IDBServer::IDBServer::deleteDatabase):
3577         (WebCore::IDBServer::IDBServer::closeUniqueIDBDatabase):
3578         (WebCore::IDBServer::IDBServer::openDBRequestCancelled):
3579         (WebCore::IDBServer::removeAllDatabasesForOriginPath):
3580         (WebCore::IDBServer::IDBServer::performCloseAndDeleteDatabasesModifiedSince):
3581         (WebCore::IDBServer::IDBServer::performCloseAndDeleteDatabasesForOrigins):
3582
3583         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
3584         (WebCore::IDBServer::UniqueIDBDatabase::performUnconditionalDeleteBackingStore):
3585         (WebCore::IDBServer::UniqueIDBDatabase::doneWithHardClose):
3586         (WebCore::IDBServer::UniqueIDBDatabase::immediateCloseForUserDelete):
3587         * Modules/indexeddb/server/UniqueIDBDatabase.h:
3588
3589 2016-05-19  Brady Eidson  <beidson@apple.com>
3590
3591         REGRESSION(201098) GuardMalloc / ASan crashes in WebCore::IDBServer::UniqueIDBDatabase::executeNextDatabaseTaskReply
3592         https://bugs.webkit.org/show_bug.cgi?id=157917
3593
3594         Reviewed by Alex Christensen.
3595
3596         No new tests (Covered by all existing tests in Gmalloc/ASAN configs).
3597
3598         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
3599         (WebCore::IDBServer::UniqueIDBDatabase::~UniqueIDBDatabase):
3600         (WebCore::IDBServer::UniqueIDBDatabase::executeNextDatabaseTaskReply): Protect this from deletion before executing the task.
3601
3602 2016-05-19  Jer Noble  <jer.noble@apple.com>
3603
3604         [IOS] Add setting to allow playback to continue inline after exiting fullscreen.
3605         https://bugs.webkit.org/show_bug.cgi?id=157912
3606
3607         Reviewed by Eric Carlson.
3608
3609         Test: media/media-fullscreen-return-to-inline.html
3610
3611         Allow playback to continue when exiting fullscreen via settings.
3612
3613         * html/HTMLMediaElement.cpp:
3614         (WebCore::HTMLMediaElement::exitFullscreen):
3615         * page/Settings.in:
3616
3617 2016-05-19  Dave Hyatt  <hyatt@apple.com>
3618
3619         Fix childrenInline() check in markAllDescendantsWithFloatsForLayout()
3620         https://bugs.webkit.org/show_bug.cgi?id=157866
3621
3622         Reviewed by Zalan Bujtas.
3623
3624         * rendering/RenderBlockFlow.cpp:
3625         (WebCore::RenderBlockFlow::markAllDescendantsWithFloatsForLayout):
3626
3627 2016-05-19  Chris Dumez  <cdumez@apple.com>
3628
3629         Update RenderBlockFlow::adjustComputedFontSizes() to use RenderObjectTraversal
3630         https://bugs.webkit.org/show_bug.cgi?id=157784
3631
3632         Reviewed by Zalan Bujtas.
3633
3634         Update RenderBlockFlow::adjustComputedFontSizes() to use RenderObjectTraversal
3635         instead of having its own Renderer tree traversal API, specifically for iOS
3636         text autosizing.
3637
3638         * rendering/RenderBlockFlow.cpp:
3639         (WebCore::isVisibleRenderText):
3640         (WebCore::resizeTextPermitted):
3641         (WebCore::isNonBlocksOrNonFixedHeightListItems):
3642         (WebCore::RenderBlockFlow::adjustComputedFontSizes):
3643         * rendering/RenderIterator.h:
3644         (WebCore::RenderObjectTraversal::nextSkippingChildren):
3645         * rendering/RenderObject.cpp:
3646         (WebCore::RenderObject::traverseNext): Deleted.
3647         (WebCore::RenderObject::enclosingBox): Deleted.
3648         (WebCore::RenderObject::enclosingBoxModelObject): Deleted.
3649         (WebCore::RenderObject::fixedPositionedWithNamedFlowContainingBlock): Deleted.
3650         (WebCore::hasFixedPosInNamedFlowContainingBlock): Deleted.
3651         (WebCore::RenderObject::firstLineBlock): Deleted.
3652         (WebCore::objectIsRelayoutBoundary): Deleted.
3653         * rendering/RenderObject.h:
3654
3655 2016-05-19  Csaba Osztrogon√°c  <ossy@webkit.org>
3656
3657         Fix the build with GCC 4.9 in CSSParser.cpp
3658         https://bugs.webkit.org/show_bug.cgi?id=157887
3659
3660         Reviewed by Chris Dumez.
3661
3662         * css/CSSParser.cpp:
3663         (WebCore::CSSParser::createViewportRule):
3664         * css/CSSParser.h:
3665
3666 2016-05-18  Brian Burg  <bburg@apple.com>
3667
3668         Web Inspector: use a consistent prefix for injected scripts
3669         https://bugs.webkit.org/show_bug.cgi?id=157715
3670         <rdar://problem/26287188>
3671
3672         Reviewed by Timothy Hatcher.
3673
3674         * CMakeLists.txt:
3675         * DerivedSources.make:
3676         * inspector/CommandLineAPIModuleSource.js:
3677
3678 2016-05-18  Jer Noble  <jer.noble@apple.com>
3679
3680         Playback controls should not be active for muted media elements.
3681         https://bugs.webkit.org/show_bug.cgi?id=157876
3682         <rdar://problem/26007525>
3683
3684         Reviewed by Eric Carlson.
3685
3686         Consolidate calls to setUpPlaybackControlsManager() and clearUpPlaybackControlsManager()
3687         into a new method, updatePlaybackControlsManager(), which checks with the MediaElementSession
3688         whether the media element can currently control the playback controls manager, and call
3689         one or the other method conditionally.
3690
3691         That means more logic needs to be moved into MediaElementSession::canControlControlsManager(),
3692         such as whether the element is muted(), has ended(), or whether the element's document has
3693         been suspended.
3694
3695         * html/HTMLMediaElement.cpp:
3696         (WebCore::HTMLMediaElement::~HTMLMediaElement):
3697         (WebCore::HTMLMediaElement::setMuted):
3698         (WebCore::HTMLMediaElement::updatePlayState):
3699         (WebCore::HTMLMediaElement::clearMediaPlayer):
3700         (WebCore::HTMLMediaElement::stopWithoutDestroyingMediaPlayer):
3701         (WebCore::HTMLMediaElement::createMediaPlayer):
3702         (WebCore::HTMLMediaElement::updatePlaybackControlsManager):
3703         * html/HTMLMediaElement.h:
3704         * html/MediaElementSession.cpp:
3705         (WebCore::MediaElementSession::canControlControlsManager):
3706
3707 2016-05-19  Chris Dumez  <cdumez@apple.com>
3708
3709         Kill JSDOMBindings' createNewWrapper()
3710         https://bugs.webkit.org/show_bug.cgi?id=157842
3711
3712         Reviewed by Youenn Fablet.
3713
3714         Kill JSDOMBindings' createNewWrapper() as it is identical to createWrapper().
3715
3716         * bindings/js/JSDOMBinding.h:
3717         (WebCore::createNewWrapper): Deleted.
3718         * bindings/js/JSDocumentFragmentCustom.cpp:
3719         (WebCore::toJSNewlyCreated):
3720         * bindings/js/JSNodeListCustom.cpp:
3721         (WebCore::createWrapper):
3722         * bindings/scripts/CodeGeneratorJS.pm:
3723         (GenerateImplementation):
3724         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
3725         (WebCore::toJSNewlyCreated):
3726         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
3727         (WebCore::toJSNewlyCreated):
3728         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
3729         (WebCore::toJSNewlyCreated):
3730         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
3731         (WebCore::toJSNewlyCreated):
3732         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
3733         (WebCore::toJSNewlyCreated):
3734         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
3735         (WebCore::toJSNewlyCreated):
3736         * bindings/scripts/test/JS/JSTestException.cpp:
3737         (WebCore::toJSNewlyCreated):
3738         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
3739         (WebCore::toJSNewlyCreated):
3740         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
3741         (WebCore::toJSNewlyCreated):
3742         * bindings/scripts/test/JS/JSTestInterface.cpp:
3743         (WebCore::toJSNewlyCreated):
3744         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
3745         (WebCore::toJSNewlyCreated):
3746         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
3747         (WebCore::toJSNewlyCreated):
3748         * bindings/scripts/test/JS/JSTestNode.cpp:
3749         (WebCore::toJSNewlyCreated):
3750         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
3751         (WebCore::toJSNewlyCreated):
3752         * bindings/scripts/test/JS/JSTestObj.cpp:
3753         (WebCore::toJSNewlyCreated):
3754         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
3755         (WebCore::toJSNewlyCreated):
3756         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
3757         (WebCore::toJSNewlyCreated):
3758         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
3759         (WebCore::toJSNewlyCreated):
3760         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
3761         (WebCore::toJSNewlyCreated):
3762         * bindings/scripts/test/JS/JSattribute.cpp:
3763         (WebCore::toJSNewlyCreated):
3764         * bindings/scripts/test/JS/JSreadonly.cpp:
3765         (WebCore::toJSNewlyCreated):
3766
3767 2016-05-18  Jer Noble  <jer.noble@apple.com>
3768
3769         Playback controls still valid after navigating back after watching YouTube video.
3770         https://bugs.webkit.org/show_bug.cgi?id=157874
3771         <rdar://problem/25993063>
3772
3773         Reviewed by Eric Carlson.
3774
3775         YouTube uses window.onpopstate to "navigate" backwards from a video page to the main page
3776         (or other video page). This causes the playback controls to not be cleared (since no
3777         navigation actually occured). Instead, clear the playback controls when we clear our
3778         MediaPlayer due to load() being called, when the src= attribute is changed, or when a
3779         <source> element is added to the <video>.
3780
3781         * html/HTMLMediaElement.cpp:
3782         (WebCore::HTMLMediaElement::clearMediaPlayer):
3783         (WebCore::HTMLMediaElement::createMediaPlayer):
3784
3785 2016-05-19  Philippe Normand  <pnormand@igalia.com>
3786
3787         [GStreamer] unrelated codecs required to play videos
3788         https://bugs.webkit.org/show_bug.cgi?id=135972
3789
3790         Reviewed by Michael Catanzaro.
3791
3792         Instead of hard-coding the list of supported mime-types, check the
3793         decoder and demuxer GStreamer elements available and dynamically
3794         build the list of mime-types accordingly. This patch also removes
3795         support for under-used and exotic mime-types.
3796
3797         Based on a patch by Mario Sanchez Prada.
3798
3799         No new tests, existing media tests cover this change.
3800
3801         * platform/graphics/gstreamer/GStreamerUtilities.cpp:
3802         (WebCore::gstRegistryHasElementForMediaType): New function
3803         checking the elements registered in the factories have a sink pad
3804         matching the caps specified as second argument of the function.
3805         * platform/graphics/gstreamer/GStreamerUtilities.h:
3806         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3807         (WebCore::mimeTypeSet): Hard-coded list of mime-types replaced by
3808         runtime-built list of mime-types that can be supported by the
3809         GStreamer decoders and demuxers available on the host machine.
3810         (WebCore::MediaPlayerPrivateGStreamer::getSupportedTypes):
3811         mimeTypeCache renamed to mimeTypeSet.
3812         (WebCore::MediaPlayerPrivateGStreamer::supportsType): Ditto.
3813
3814 2016-05-19  Csaba Osztrogon√°c  <ossy@webkit.org>
3815
3816         [ARM] Fix Wformat warning in MemoryPressureHandler.cpp
3817         https://bugs.webkit.org/show_bug.cgi?id=157892
3818
3819         Reviewed by Michael Saboff.
3820
3821         * platform/MemoryPressureHandler.cpp:
3822         (WebCore::MemoryPressureHandler::ReliefLogger::logMemoryUsageChange):
3823
3824 2016-05-19  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3825
3826         Remove castDOMMobjectForWrapperCreation(T&)
3827         https://bugs.webkit.org/show_bug.cgi?id=157886
3828
3829         Reviewed by Andreas Kling.
3830
3831         No change of behavior.
3832
3833         * bindings/js/JSDOMBinding.h:
3834         (WebCore::castDOMObjectForWrapperCreation): Deleted.
3835
3836 2016-05-18  Antti Koivisto  <antti@apple.com>
3837
3838         Style resolution for explicitly inherited properties is inefficient
3839         https://bugs.webkit.org/show_bug.cgi?id=157860
3840
3841         Reviewed by Andreas Kling.
3842
3843         We mark the parent style with hasExplicitlyInheritedProperties bit rather than the style that is actually
3844         affected by inherited properties. This leads to various inefficiencies including unnecessarily wide style recalcs.
3845
3846         * css/StyleResolver.cpp:
3847         (WebCore::isCacheableInMatchedPropertiesCache):
3848
3849             Check the style itself rather than the parent. This allows more caching.
3850
3851         (WebCore::StyleResolver::applyProperty):
3852
3853             Mark the style rather than the parent.
3854
3855         * style/StyleChange.cpp:
3856         (WebCore::Style::determineChange):
3857
3858             Remove hasExplicitlyInheritedProperties test and just return NoInherit. Having explicitly inherited
3859             properties doesn't make the children inherit them automatically.
3860
3861             This allows smaller style recalcs.
3862
3863         * style/StyleTreeResolver.cpp:
3864         (WebCore::Style::TreeResolver::resolveElement):
3865
3866             This patch exposed a bug with appearance property in meter and progress elements.
3867             They may construct different renderer based on appearance so we need to force
3868             render tree reconstruction when it changes.
3869
3870         (WebCore::Style::TreeResolver::popParentsToDepth):
3871         (WebCore::Style::shouldResolvePseudoElement):
3872
3873             Don't clear the style recalc bits here.
3874
3875         (WebCore::Style::shouldResolveElement):
3876
3877             Add a helper.
3878             If the parent had a NoInherit style change, test if the element has existing style with
3879             hasExplicitlyInheritedProperties bit. If so we need to re-resolve this element.
3880
3881         (WebCore::Style::clearNeedsStyleResolution):
3882
3883             Also clear pseudo elements.
3884
3885         (WebCore::Style::TreeResolver::resolveComposedTree):
3886
3887 2016-05-19  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3888
3889         Refactor toJS functions to use toJSNewlyCreated
3890         https://bugs.webkit.org/show_bug.cgi?id=157835
3891
3892         Reviewed by Chris Dumez.
3893
3894         Moving checks generated by binding generator from toJS to toJSNewlyCreated.
3895         Changing wrap template function to use toJSNewlyCreated function.
3896         This allows DOMClass toJS() to be equivalent to wrap template function.
3897
3898         Refactored custom binding code to take benefit of this.
3899
3900         Covered by existing tests.
3901
3902         * bindings/js/JSAnimationTimelineCustom.cpp:
3903         (WebCore::toJSNewlyCreated):
3904         (WebCore::toJS):
3905         * bindings/js/JSBlobCustom.cpp:
3906         (WebCore::toJSNewlyCreated):
3907         (WebCore::toJS):
3908         * bindings/js/JSCSSRuleCustom.cpp:
3909         (WebCore::toJSNewlyCreated):
3910         (WebCore::toJS):
3911         * bindings/js/JSCSSValueCustom.cpp:
3912         (WebCore::toJSNewlyCreated):
3913         (WebCore::toJS):
3914         * bindings/js/JSCanvasRenderingContextCustom.cpp:
3915         (WebCore::toJSNewlyCreated):
3916         (WebCore::toJS):
3917         * bindings/js/JSDOMBinding.h:
3918         (WebCore::wrap):
3919         (WebCore::toJS):
3920         * bindings/js/JSDocumentCustom.cpp:
3921         (WebCore::toJS):
3922         (WebCore::cachedDocumentWrapper): Deleted.
3923         * bindings/js/JSDocumentFragmentCustom.cpp:
3924         (WebCore::toJSNewlyCreated):
3925         (WebCore::toJS):
3926         * bindings/js/JSEventCustom.cpp:
3927         (WebCore::toJSNewlyCreated):
3928         (WebCore::toJS):
3929         * bindings/js/JSHTMLCollectionCustom.cpp:
3930         (WebCore::toJSNewlyCreated):
3931         (WebCore::toJS):
3932         * bindings/js/JSHTMLDocumentCustom.cpp:
3933         (WebCore::toJSNewlyCreated):
3934         (WebCore::toJS):
3935         * bindings/js/JSHTMLTemplateElementCustom.cpp:
3936         (WebCore::JSHTMLTemplateElement::content):
3937         * bindings/js/JSIDBCursorCustom.cpp:
3938         (WebCore::toJSNewlyCreated):
3939         (WebCore::toJS):
3940         * bindings/js/JSImageDataCustom.cpp:
3941         (WebCore::toJSNewlyCreated):
3942         (WebCore::toJS):
3943         * bindings/js/JSMediaStreamCapabilitiesCustom.cpp:
3944         (WebCore::toJSNewlyCreated):
3945         (WebCore::toJS):
3946         * bindings/js/JSNodeListCustom.h:
3947         (WebCore::toJS):
3948         * bindings/js/JSPerformanceEntryCustom.cpp:
3949         (WebCore::toJSNewlyCreated):
3950         (WebCore::toJS):
3951         * bindings/js/JSSVGPathSegCustom.cpp:
3952         (WebCore::toJSNewlyCreated):
3953         (WebCore::toJS):
3954         * bindings/js/JSStyleSheetCustom.cpp:
3955         (WebCore::toJSNewlyCreated):
3956         (WebCore::toJS):
3957         * bindings/js/JSTextCustom.cpp:
3958         (WebCore::toJSNewlyCreated):
3959         (WebCore::toJS):
3960         * bindings/js/JSTextTrackCueCustom.cpp:
3961         (WebCore::toJSNewlyCreated):
3962         (WebCore::toJS):
3963         * bindings/js/JSTrackCustom.cpp:
3964         (WebCore::toJS):
3965         * bindings/js/JSXMLDocumentCustom.cpp:
3966         (WebCore::toJSNewlyCreated):
3967         (WebCore::toJS):
3968         * bindings/scripts/CodeGeneratorJS.pm:
3969         (GenerateImplementation):
3970         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
3971         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
3972         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
3973         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
3974         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
3975         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
3976         * bindings/scripts/test/JS/JSTestException.cpp:
3977         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
3978         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
3979         * bindings/scripts/test/JS/JSTestInterface.cpp:
3980         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
3981         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
3982         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
3983         * bindings/scripts/test/JS/JSTestObj.cpp:
3984         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
3985         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
3986         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
3987         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
3988         * bindings/scripts/test/JS/JSattribute.cpp:
3989         * bindings/scripts/test/JS/JSreadonly.cpp:
3990
3991 2016-05-19  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3992
3993         Make binding DOM constructor use toJSNewlyCreated instead of toJS
3994         https://bugs.webkit.org/show_bug.cgi?id=157832
3995
3996         Reviewed by Chris Dumez.
3997
3998         Using toJSNewlyCreated in generated constructors instead of toJS.