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