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