No need to guard the sizes attribute against PICTURE_SIZES in preload scanner.
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-06-02  Dean Jackson  <dino@apple.com>
2
3         No need to guard the sizes attribute against PICTURE_SIZES in preload scanner.
4         https://bugs.webkit.org/show_bug.cgi?id=145573
5         <rdar://problem/21210038>
6
7         Reviewed by Myles Maxfield.
8
9         The PICTURE_SIZES feature flag doesn't need to be used to
10         guard preloading of the sizes attribute.
11
12         * html/parser/HTMLPreloadScanner.cpp:
13         (WebCore::TokenPreloadScanner::StartTagScanner::processAttributes): Deleted.
14         (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute): Deleted.
15
16 2015-06-02  Anders Carlsson  <andersca@apple.com>
17
18         Use UUIDs for WebSQL database filenames instead of a sequential number
19         https://bugs.webkit.org/show_bug.cgi?id=145571
20
21         Reviewed by Dan Bernstein.
22
23         This is a first step towards getting rid of the iOS specific code path where we truncate
24         database files instead of deleting them (in order to avoid file corruption).
25
26         * Modules/webdatabase/DatabaseTracker.cpp:
27         (WebCore::generateDatabaseFileName):
28         (WebCore::DatabaseTracker::fullPathForDatabaseNoLock):
29         * platform/sql/SQLiteFileSystem.cpp:
30         (WebCore::SQLiteFileSystem::getFileNameForNewDatabase): Deleted.
31         * platform/sql/SQLiteFileSystem.h:
32
33 2015-06-02  Dean Jackson  <dino@apple.com>
34
35         Crash in GraphicsContext3D::getInternalFramebufferSize
36         https://bugs.webkit.org/show_bug.cgi?id=145479
37         <rdar://problem/16461048>
38
39         Reviewed by Eric Carlson.
40
41         If we are in an unitialized or lost state, don't try to access the context.
42
43         In order to test this, I added an Internal setting that always
44         forces WebGL into a pending state.
45
46         Test: fast/canvas/webgl/useWhilePending.html
47
48         * html/canvas/WebGLRenderingContextBase.cpp:
49         (WebCore::WebGLRenderingContextBase::create): Check internal settings for
50         a forced pending state.
51         (WebCore::WebGLRenderingContextBase::drawingBufferWidth): Guard against a pending state.
52         (WebCore::WebGLRenderingContextBase::drawingBufferHeight): Ditto.
53         * page/Settings.cpp: New Internal setting for forcing a pending policy.
54         (WebCore::Settings::Settings):
55         (WebCore::Settings::setForcePendingWebGLPolicy):
56         * page/Settings.h:
57         (WebCore::Settings::isForcePendingWebGLPolicy):
58         * testing/InternalSettings.cpp:
59         (WebCore::InternalSettings::Backup::Backup):
60         (WebCore::InternalSettings::Backup::restoreTo):
61         (WebCore::InternalSettings::setForcePendingWebGLPolicy):
62         * testing/InternalSettings.h:
63         * testing/InternalSettings.idl:
64
65 2015-06-02  Matt Rajca  <mrajca@apple.com>
66
67         Added a stub implementation of MediaSession, part of the Media Session spec.
68         https://bugs.webkit.org/show_bug.cgi?id=145530
69
70         Reviewed by Eric Carlson.
71
72         * CMakeLists.txt: Added new MediaSession sources.
73         * DerivedSources.make:
74         * Modules/mediasession/MediaSession.cpp: Added stub implementation.
75         (WebCore::MediaSession::MediaSession): Per the Media Session spec, a Media Remote Controls object should only be
76           set for 'content' sessions; it is null otherwise.
77         (WebCore::MediaSession::~MediaSession):
78         (WebCore::MediaSession::controls):
79         (WebCore::MediaSession::releaseSession):
80         * Modules/mediasession/MediaSession.h: Added basic translation of IDL file.
81         * Modules/mediasession/MediaSession.idl: Added from the Media Session spec.
82         * WebCore.xcodeproj/project.pbxproj: Added new MediaSession sources.
83
84 2015-06-02  Zalan Bujtas  <zalan@apple.com>
85
86         Backdrop filter is pulling in content from behind the window.
87         https://bugs.webkit.org/show_bug.cgi?id=145561
88         rdar://problem/20909309
89
90         Reviewed by Simon Fraser.
91
92         This patch ensures that the backdrop filter layer is positioned and sized properly.
93
94         The backdrop filter layer should take its size and position from its renderer and not
95         directly from the composited layer.
96         In certain cases the composited layer's size is expanded to cover items like box shadow or an absolute positioned descendant.
97         In such cases, we ended up applying the backdrop filter to those areas as well.
98
99         Tests: css3/filters/backdrop/backdrop-filter-does-not-size-properly-absolute.html
100                css3/filters/backdrop/backdrop-filter-does-not-size-properly-border-and-padding.html
101
102         * platform/graphics/GraphicsLayer.h:
103         (WebCore::GraphicsLayer::setBackdropFiltersRect):
104         (WebCore::GraphicsLayer::backdropFiltersRect):
105         * platform/graphics/ca/GraphicsLayerCA.cpp:
106         (WebCore::GraphicsLayerCA::setBackdropFiltersRect):
107         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
108         (WebCore::GraphicsLayerCA::updateBackdropFilters):
109         (WebCore::GraphicsLayerCA::updateBackdropFiltersRect):
110         (WebCore::GraphicsLayerCA::updateContentsRects):
111         (WebCore::GraphicsLayerCA::updateGeometry): Deleted.
112         * platform/graphics/ca/GraphicsLayerCA.h:
113         * rendering/RenderLayerBacking.cpp:
114         (WebCore::RenderLayerBacking::updateBackdropFiltersGeometry):
115         (WebCore::RenderLayerBacking::updateGeometry):
116         * rendering/RenderLayerBacking.h:
117
118 2015-06-02  Eric Carlson  <eric.carlson@apple.com>
119
120         [Mac] occasional crash in Document::playbackTargetAvailabilityDidChange
121         https://bugs.webkit.org/show_bug.cgi?id=145559
122
123         Reviewed by Darin Adler.
124
125         No new tests, covered by existing tests.
126
127         * html/HTMLMediaElement.cpp:
128         (WebCore::HTMLMediaElement::registerWithDocument): Pass document to m_mediaSession->registerWithDocument.
129         (WebCore::HTMLMediaElement::unregisterWithDocument): Pass document to m_mediaSession->unRegisterWithDocument.
130         (WebCore::HTMLMediaElement::documentWillSuspendForPageCache): Ditto.
131         (WebCore::HTMLMediaElement::documentDidResumeFromPageCache): Ditto.
132
133         * html/MediaElementSession.cpp:
134         (WebCore::MediaElementSession::registerWithDocument): Take a document.
135         (WebCore::MediaElementSession::unregisterWithDocument): Ditto.
136         * html/MediaElementSession.h:
137
138 2015-06-02  Chris Dumez  <cdumez@apple.com>
139
140         Calling FrameView::viewportContentsChanged() after style recalcs is too expensive
141         https://bugs.webkit.org/show_bug.cgi?id=145554
142         <rdar://problem/21189478>
143
144         Reviewed by Darin Adler and Simon Fraser.
145
146         Only call FrameView::viewportContentsChanged() after a style recalc if
147         composited layers have been updated (and there is no pending layout).
148
149         We already viewportContentsChanged() after layout so we only need to
150         call viewportContentsChanged() after a style recalc if it did not cause
151         a layout but may have caused an element to become visible. In
152         particular, this can happen in the case of composited animations (e.g.
153         using -webkit-transform to move an element inside the viewport).
154         Therefore, we now only call viewportContentsChanged() after a style
155         recalc if it caused composited layers to be updated. This avoids a lot
156         of unnecessary calls to viewportContentsChanged(), which is expensive.
157
158         No new tests, already covered by:
159         fast/images/animated-gif-webkit-transform.html
160
161         * dom/Document.cpp:
162         (WebCore::Document::recalcStyle):
163         * page/FrameView.cpp:
164         (WebCore::FrameView::updateCompositingLayersAfterStyleChange):
165         * page/FrameView.h:
166         * rendering/RenderLayerCompositor.cpp:
167         (WebCore::RenderLayerCompositor::didRecalcStyleWithNoPendingLayout):
168         (WebCore::RenderLayerCompositor::updateCompositingLayers):
169         * rendering/RenderLayerCompositor.h:
170
171 2015-06-02  Myles C. Maxfield  <mmaxfield@apple.com>
172
173         Remove use of CTFontSetRenderingParameters()
174         https://bugs.webkit.org/show_bug.cgi?id=145560
175
176         Reviewed by Simon Fraser.
177
178         Instead, always use CTFontSetRenderingStyle().
179
180         No new tests because there is no behavior change.
181
182         * platform/graphics/cocoa/FontCascadeCocoa.mm:
183         (WebCore::RenderingStyleSaver::RenderingStyleSaver): Deleted.
184         (WebCore::RenderingStyleSaver::~RenderingStyleSaver): Deleted.
185
186 2015-06-02  Anders Carlsson  <andersca@apple.com>
187
188         Move WKFontAntialiasingStateSaver to its own file
189         https://bugs.webkit.org/show_bug.cgi?id=145557
190         rdar://problem/21134776
191
192         Reviewed by Dan Bernstein.
193
194         Also rename it to FontAntialiasingStateSaver. Also, change it to use the CoreGraphicsSPI.h header for its
195         CGFontAntialiasingStyle definition instead of using an explicit typedef.
196
197         * WebCore.xcodeproj/project.pbxproj:
198         * platform/graphics/ca/mac/PlatformCALayerMac.mm:
199         (PlatformCALayer::drawLayerContents):
200         * platform/graphics/ios/FontAntialiasingStateSaver.h: Copied from Source/WebCore/platform/ios/wak/WKGraphics.h.
201         (WebCore::FontAntialiasingStateSaver::FontAntialiasingStateSaver):
202         (WebCore::FontAntialiasingStateSaver::setup):
203         (WebCore::FontAntialiasingStateSaver::restore):
204         * platform/ios/LegacyTileCache.mm:
205         (WebCore::LegacyTileCache::drawWindowContent):
206         * platform/ios/wak/WKGraphics.h:
207         (WKFontAntialiasingStateSaver::WKFontAntialiasingStateSaver): Deleted.
208         * platform/ios/wak/WKGraphics.mm:
209         (WKFontAntialiasingStateSaver::setup): Deleted.
210         (WKFontAntialiasingStateSaver::restore): Deleted.
211
212 2015-06-02  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
213
214         [Streams API] Implement ReadableStreamReader read method in closed and errored state
215         https://bugs.webkit.org/show_bug.cgi?id=144790
216
217         Reviewed by Darin Adler.
218
219         Reader delegates read() promise handling to its stream except if reader is no longer locking the stream and stream is readable.
220         Storing of reader read() promise callbacks as a Vector in ReadableStream.
221         Added resolution/rejection of read() promises in case of errored/closed streams.
222
223         Test: streams/readable-stream-reader-read.html
224
225         * ForwardingHeaders/runtime/IteratorOperations.h: Added.
226         * Modules/streams/ReadableStream.cpp:
227         (WebCore::ReadableStream::cleanCallbacks): Clean the read requests.
228         (WebCore::ReadableStream::changeStateToClosed): Run success callbacks with undefined for read requests.
229         (WebCore::ReadableStream::changeStateToErrored): Run failure callbacks with the errors for read requests.
230         (WebCore::ReadableStream::closed): Parameter name changed.
231         (WebCore::ReadableStream::read): Added. Succeeds with empty when closed, fails with error when errored, reads a
232         value if there is one and pushes the callbacks to the queue otherwise.
233         * Modules/streams/ReadableStream.h:
234         (WebCore::ReadableStream::ReadCallbacks::ReadCallbacks): Struct containing success and failure callbacks.
235         * Modules/streams/ReadableStreamReader.cpp:
236         (WebCore::ReadableStreamReader::closed): Parameter name changed.
237         (WebCore::ReadableStreamReader::read): Invoke success with empty if we streams if we don't have the right reader
238         and call the stream otherwise to read.
239         * Modules/streams/ReadableStreamReader.h:
240         * bindings/js/JSReadableStreamReaderCustom.cpp:
241         (WebCore::JSReadableStreamReader::read): Create the callback lambdas and invoke read. Failure rejects the
242         promise and success creates the result from the read value.
243         * bindings/js/ReadableJSStream.cpp:
244         (WebCore::ReadableJSStream::hasValue):
245         (WebCore::ReadableJSStream::read): Not implemented yet.
246         * bindings/js/ReadableJSStream.h:
247
248 2015-06-01  Myles C. Maxfield  <mmaxfield@apple.com>
249
250         [Cocoa] FontPlatformData's equality check should always use reference URLs
251         https://bugs.webkit.org/show_bug.cgi?id=144168
252
253         Reviewed by Tim Horton.
254
255         <rdar://problem/18985642> is not fixed, so we need to continue using the older
256         objectForEqualityCheck().
257
258         No new tests because there is no behavior change.
259
260         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
261         (WebCore::FontPlatformData::objectForEqualityCheck):
262
263 2015-06-02  Andy Estes  <aestes@apple.com>
264
265         [Mac] REGRESSION (r175941): Max.app crashes when adding a sound file to a patch due to removing cursor resources from WebCore.framework
266         https://bugs.webkit.org/show_bug.cgi?id=145555
267
268         Reviewed by Darin Adler.
269
270         Re-added the cursor resources used by Max.app and ran sort-Xcode-project-file.
271
272         * Resources/copyCursor.png: Added.
273         * Resources/moveCursor.png: Added.
274         * Resources/northEastSouthWestResizeCursor.png: Added.
275         * Resources/northSouthResizeCursor.png: Added.
276         * Resources/northWestSouthEastResizeCursor.png: Added.
277         * WebCore.xcodeproj/project.pbxproj:
278
279 2015-06-02  Brady Eidson  <beidson@apple.com>
280
281         WebKit policy delegate should suggest if a navigation should be allowed to open URLs externally.
282         rdar://problem/21025301 and https://bugs.webkit.org/show_bug.cgi?id=145280
283
284         Reviewed by Alex Christensen.
285
286         Tests: loader/navigation-policy/should-open-external-urls/main-frame-click.html
287                loader/navigation-policy/should-open-external-urls/main-frame-navigated-programatically-by-subframe.html
288                loader/navigation-policy/should-open-external-urls/main-frame-with-flag-progamatic.html
289                loader/navigation-policy/should-open-external-urls/main-frame-without-flag-programatic.html
290                loader/navigation-policy/should-open-external-urls/subframe-click-target-self.html
291                loader/navigation-policy/should-open-external-urls/subframe-click-target-top.html
292                loader/navigation-policy/should-open-external-urls/user-gesture-target-blank-with-flag-from-subframe.html
293                loader/navigation-policy/should-open-external-urls/user-gesture-target-blank-with-flag.html
294                loader/navigation-policy/should-open-external-urls/user-gesture-target-blank-without-flag-from-subframe.html
295                loader/navigation-policy/should-open-external-urls/user-gesture-target-blank-without-flag.html
296                loader/navigation-policy/should-open-external-urls/user-gesture-window-open-with-flag-from-subframe.html
297                loader/navigation-policy/should-open-external-urls/user-gesture-window-open-with-flag.html
298                loader/navigation-policy/should-open-external-urls/user-gesture-window-open-without-flag-from-subframe.html
299                loader/navigation-policy/should-open-external-urls/user-gesture-window-open-without-flag.html
300                loader/navigation-policy/should-open-external-urls/window-open-with-flag-from-subframe.html
301                loader/navigation-policy/should-open-external-urls/window-open-with-flag.html
302                loader/navigation-policy/should-open-external-urls/window-open-without-flag-from-subframe.html
303                loader/navigation-policy/should-open-external-urls/window-open-without-flag.html
304
305         The "should open external URLs" flag is only for main frames.
306         It doesn't enforce any sort of policy internal to WebKit, but rather is for notifications to the policy delegate.
307         
308         It is set from one of two places:
309         1 - A main frame is navigated by any frame as the result of a user gesture.
310         2 - WebKit2 API explicitly states the flag is true.
311         
312         The flag value propagates when:
313         1 - When a main frame document is navigated to a new main frame document.
314         2 - When a new window is opened from a page whose main frame had the flag set.
315         3 - When a new window is opened as the result of a user gesture.
316         
317         The flag resets to false when:
318         1 - A subframe navigates a main frame without a user gesture.
319         
320         This patch is large, but does little more than the following:
321         1 - Adds a ShouldOpenExternalURLs flag to both FrameLoadRequest and NavigationAction.
322         2 - Makes sure anybody who creates either of those objects sets a sensible for that flag.
323         3 - When FrameLoader creates a new DocumentLoader, it sets its flag based on whether or not the load is in a main frame,
324             whether or not the load is from a user gesture, and based on the initiator's value of the flag. 
325             
326         * dom/Document.cpp:
327         (WebCore::Document::processHttpEquiv):
328         (WebCore::Document::shouldOpenExternalURLsPolicyToPropagate):
329         * dom/Document.h:
330         
331         * html/HTMLAnchorElement.cpp:
332         (WebCore::HTMLAnchorElement::handleClick):
333         
334         * html/HTMLLinkElement.cpp:
335         (WebCore::HTMLLinkElement::handleClick):
336         
337         * html/parser/XSSAuditorDelegate.cpp:
338         (WebCore::XSSAuditorDelegate::didBlockScript):
339         
340         * inspector/InspectorFrontendClientLocal.cpp:
341         (WebCore::InspectorFrontendClientLocal::openInNewTab):
342         
343         * inspector/InspectorPageAgent.cpp:
344         (WebCore::InspectorPageAgent::navigate):
345         
346         * loader/DocumentLoader.cpp:
347         (WebCore::DocumentLoader::setTriggeringAction):
348         (WebCore::DocumentLoader::shouldOpenExternalURLsPolicyToPropagate):
349         * loader/DocumentLoader.h:
350         (WebCore::DocumentLoader::shouldOpenExternalURLsPolicy): Deleted.
351         
352         * loader/FrameLoadRequest.cpp:
353         (WebCore::FrameLoadRequest::FrameLoadRequest):
354         * loader/FrameLoadRequest.h:
355         (WebCore::FrameLoadRequest::FrameLoadRequest):
356         
357         * loader/FrameLoader.cpp:
358         (WebCore::FrameLoader::urlSelected):
359         (WebCore::FrameLoader::receivedFirstData):
360         (WebCore::FrameLoader::loadURLIntoChildFrame):
361         (WebCore::FrameLoader::loadURL):
362         (WebCore::FrameLoader::load):
363         (WebCore::FrameLoader::loadWithNavigationAction):
364         (WebCore::FrameLoader::reloadWithOverrideEncoding):
365         (WebCore::FrameLoader::reload):
366         (WebCore::FrameLoader::loadPostRequest):
367         (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
368         (WebCore::FrameLoader::applyShouldOpenExternalURLsPolicyToNewDocumentLoader):
369         * loader/FrameLoader.h:
370         
371         * loader/NavigationAction.cpp:
372         (WebCore::NavigationAction::NavigationAction):
373         (WebCore::NavigationAction::copyWithShouldOpenExternalURLsPolicy):
374         * loader/NavigationAction.h:
375         (WebCore::NavigationAction::setShouldOpenExternalURLsPolicy): Deleted.
376         
377         * loader/NavigationScheduler.cpp:
378         (WebCore::ScheduledURLNavigation::ScheduledURLNavigation):
379         (WebCore::ScheduledRedirect::ScheduledRedirect):
380         (WebCore::ScheduledLocationChange::ScheduledLocationChange):
381         (WebCore::ScheduledRefresh::ScheduledRefresh):
382         (WebCore::ScheduledFormSubmission::ScheduledFormSubmission):
383         (WebCore::NavigationScheduler::scheduleRedirect):
384         (WebCore::NavigationScheduler::scheduleLocationChange):
385         (WebCore::NavigationScheduler::scheduleRefresh):
386         * loader/NavigationScheduler.h:
387         
388         * loader/PolicyChecker.cpp:
389         (WebCore::PolicyChecker::checkNavigationPolicy):
390         
391         * loader/SubframeLoader.cpp:
392         (WebCore::SubframeLoader::loadOrRedirectSubframe):
393         
394         * loader/appcache/ApplicationCacheGroup.cpp:
395         (WebCore::ApplicationCacheGroup::selectCache):
396         
397         * page/ContextMenuController.cpp:
398         (WebCore::openNewWindow):
399         (WebCore::ContextMenuController::contextMenuItemSelected):
400         
401         * page/DOMWindow.cpp:
402         (WebCore::DOMWindow::setLocation):
403         (WebCore::DOMWindow::createWindow):
404         (WebCore::DOMWindow::open):
405         
406         * page/DragController.cpp:
407         (WebCore::DragController::performDragOperation):
408         
409         * page/Location.cpp:
410         (WebCore::Location::reload):
411         
412         * replay/ReplayInputDispatchMethods.cpp:
413         (WebCore::InitialNavigation::dispatch):
414         
415         * svg/SVGAElement.cpp:
416         (WebCore::SVGAElement::defaultEventHandler):
417
418 2015-06-02  Yusuke Suzuki  <utatane.tea@gmail.com>
419
420         Heap-use-after-free read of size 4 in JavaScriptCore: WTF::StringImpl::isSymbol() (StringImpl.h:496)
421         https://bugs.webkit.org/show_bug.cgi?id=145532
422
423         Reviewed by Geoffrey Garen.
424
425         Hold the ownership of AtomicStringImpl*.
426
427         * bindings/scripts/CodeGeneratorJS.pm:
428         (GenerateParametersCheck):
429         * dom/TreeScope.cpp:
430         (WebCore::TreeScope::getElementById):
431
432 2015-06-02  Youenn Fablet  <youenn.fablet@crf.canon.fr>
433
434         SharedBuffer::copy should return a Ref<SharedBuffer>
435         https://bugs.webkit.org/show_bug.cgi?id=145499
436
437         Reviewed by Andreas Kling.
438
439         Changing SharedBuffer::copy to return a Ref<> and adapting some code accordingly.
440
441         Covered by existing tests.
442
443         * loader/SubresourceLoader.cpp:
444         (WebCore::SubresourceLoader::didReceiveResponse):
445         * loader/appcache/ApplicationCacheResource.cpp:
446         (WebCore::ApplicationCacheResource::deliver):
447         * platform/SharedBuffer.cpp:
448         (WebCore::SharedBuffer::copy):
449         * platform/SharedBuffer.h:
450
451 2015-06-01  Hunseop Jeong  <hs85.jeong@samsung.com>
452
453         Use modern for-loops in WebCore/Modules - 1
454         https://bugs.webkit.org/show_bug.cgi?id=145507
455
456         Reviewed by Darin Adler.
457
458         No new tests, no behavior changes.
459
460         * Modules/battery/BatteryController.cpp:
461         (WebCore::BatteryController::~BatteryController):
462         (WebCore::BatteryController::updateBatteryStatus):
463         (WebCore::BatteryController::didChangeBatteryStatus):
464         * Modules/encryptedmedia/CDM.cpp:
465         (WebCore::CDMFactoryForKeySystem):
466         * Modules/encryptedmedia/MediaKeys.cpp:
467         (WebCore::MediaKeys::~MediaKeys):
468         * Modules/geolocation/Geolocation.cpp:
469         (WebCore::Geolocation::resumeTimerFired):
470         (WebCore::Geolocation::resetAllGeolocationPermission):
471         (WebCore::Geolocation::makeCachedPositionCallbacks):
472         (WebCore::Geolocation::sendError):
473         (WebCore::Geolocation::sendPosition):
474         (WebCore::Geolocation::stopTimer):
475         (WebCore::Geolocation::cancelRequests):
476         (WebCore::Geolocation::extractNotifiersWithCachedPosition):
477         (WebCore::Geolocation::copyToSet):
478         (WebCore::Geolocation::handlePendingPermissionNotifiers):
479         * Modules/geolocation/GeolocationController.cpp:
480         (WebCore::GeolocationController::positionChanged):
481         (WebCore::GeolocationController::errorOccurred):
482         * Modules/indexeddb/IDBDatabase.cpp:
483         (WebCore::IDBDatabase::objectStoreNames):
484         (WebCore::IDBDatabase::transaction):
485         (WebCore::IDBDatabase::forceClose):
486         (WebCore::IDBDatabase::closeConnection):
487         (WebCore::IDBDatabase::findObjectStoreId):
488         * Modules/indexeddb/IDBDatabaseBackend.cpp:
489         (WebCore::IDBDatabaseBackend::runIntVersionChangeTransaction):
490         (WebCore::IDBDatabaseBackend::deleteDatabase):
491         (WebCore::IDBDatabaseBackend::close):
492         * Modules/indexeddb/IDBDatabaseMetadata.cpp:
493         (WebCore::IDBDatabaseMetadata::isolatedCopy):
494         (WebCore::IDBObjectStoreMetadata::isolatedCopy):
495         * Modules/indexeddb/IDBKey.cpp:
496         (WebCore::IDBKey::isValid):
497         * Modules/indexeddb/IDBKey.h:
498         (WebCore::IDBKey::createMultiEntryArray):
499         (WebCore::IDBKey::createArray):
500         * Modules/indexeddb/IDBKeyPath.cpp:
501         (WebCore::IDBKeyPath::IDBKeyPath):
502         (WebCore::IDBKeyPath::isValid):
503         (WebCore::IDBKeyPath::isolatedCopy):
504         * Modules/indexeddb/IDBObjectStore.cpp:
505         (WebCore::IDBObjectStore::indexNames):
506         (WebCore::IDBObjectStore::put):
507         Rename the two 'i's to 'keyData' and 'indexKeyData'.
508         (WebCore::IDBObjectStore::index):
509         (WebCore::IDBObjectStore::findIndexId):
510         * Modules/indexeddb/IDBPendingTransactionMonitor.cpp:
511         (WebCore::IDBPendingTransactionMonitor::deactivateNewTransactions):
512         * Modules/indexeddb/IDBRequest.cpp:
513         (WebCore::IDBRequest::abort):
514         * Modules/indexeddb/IDBTransaction.cpp:
515         (WebCore::IDBTransaction::closeOpenCursors):
516         (WebCore::IDBTransaction::onAbort):
517         (WebCore::IDBTransaction::dispatchEvent):
518         * Modules/indexeddb/IDBTransactionBackend.cpp:
519         (WebCore::IDBTransactionBackend::create):
520         (WebCore::IDBTransactionBackend::closeOpenCursors):
521         * Modules/mediasource/MediaSource.cpp:
522         (WebCore::MediaSource::onReadyStateChange):
523         * Modules/mediastream/MediaConstraintsImpl.cpp:
524         (WebCore::MediaConstraintsImpl::initialize):
525         (WebCore::MediaConstraintsImpl::getMandatoryConstraints):
526         (WebCore::MediaConstraintsImpl::getOptionalConstraintValue):
527         * Modules/mediastream/MediaStream.cpp:
528         (WebCore::MediaStream::create):
529         (WebCore::MediaStream::cloneMediaStreamTrackVector):
530         (WebCore::MediaStream::addTrack):
531         (WebCore::MediaStream::removeTrack):
532         (WebCore::MediaStream::haveTrackWithSource):
533         (WebCore::MediaStream::getTrackById):
534         (WebCore::MediaStream::getTracks):
535         (WebCore::MediaStream::trackDidEnd):
536         (WebCore::MediaStream::scheduledEventTimerFired):
537         * Modules/mediastream/MediaStreamCapabilities.cpp:
538         (WebCore::MediaStreamCapabilities::sourceType):
539         (WebCore::MediaStreamCapabilities::sourceId):
540         (WebCore::MediaStreamCapabilities::facingMode):
541         * Modules/mediastream/MediaStreamTrack.cpp:
542         (WebCore::MediaStreamTrack::trackDidEnd):
543         * Modules/mediastream/MediaStreamTrackSourcesRequest.cpp:
544         (WebCore::MediaStreamTrackSourcesRequest::didCompleteRequest):
545
546 2015-06-01  Myles C. Maxfield  <mmaxfield@apple.com>
547
548         [SVG -> OTF Converter] Remove unnecessary hacks
549         https://bugs.webkit.org/show_bug.cgi?id=145088
550
551         Reviewed by Simon Fraser.
552
553         Not needed anymore.
554
555         Test: svg/text/offset-square-svg-font.html
556
557         * svg/SVGToOTFFontConversion.cpp:
558         (WebCore::SVGToOTFFontConverter::appendKERNTable):
559         (WebCore::SVGToOTFFontConverter::SVGToOTFFontConverter):
560
561 2015-06-01  Andreas Kling  <akling@apple.com>
562
563         CSS animations in filling-forwards state shouldn't force compositing.
564         <https://webkit.org/b/145389>
565         <rdar://problem/17923642>
566
567         Reviewed by Simon Fraser.
568
569         Stop checking if a CSS animation is filling forwards when computing
570         compositing requirements.
571
572         This prevents finished animations from pinning elements in composited
573         state, and frees up a bunch of IOSurface memory on some content.
574
575         * page/animation/AnimationBase.h:
576         (WebCore::AnimationBase::isAnimatingProperty): Deleted.
577         * rendering/RenderLayerBacking.cpp:
578         (WebCore::RenderLayerBacking::updateGeometry):
579         * rendering/RenderLayerCompositor.cpp:
580         (WebCore::RenderLayerCompositor::requiresCompositingForAnimation):
581
582 2015-06-01  Myles C. Maxfield  <mmaxfield@apple.com>
583
584         Out of bounds read in WebCore::ComplexTextController::adjustGlyphsAndAdvances
585         https://bugs.webkit.org/show_bug.cgi?id=145537
586         <rdar://problem/20959267>
587
588         Reviewed by Darin Adler.
589
590         U16_IS_SURROGATE_LEAD(ch) assumes U16_IS_SURROGATE(ch). In this case, that isn't true.
591
592         Test: fast/text/crash-complex-text-surrogate.html
593
594         * platform/graphics/mac/ComplexTextController.cpp:
595         (WebCore::ComplexTextController::adjustGlyphsAndAdvances):
596
597 2015-05-30  Zalan Bujtas  <zalan@apple.com>
598
599         REGRESSION (179771): zooming on facebook images covers image
600         https://bugs.webkit.org/show_bug.cgi?id=145485
601
602         Reviewed by Simon Fraser.
603
604         Scaling an infinite rect should always produce an infinite rect.
605         (Based on Simon Fraser's patch)
606
607         Test: compositing/layer-creation/zoomed-clip-intersection.html
608
609         * platform/graphics/LayoutRect.cpp:
610         (WebCore::LayoutRect::scale):
611
612 2015-06-01  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
613
614         Purge PassRefPtr in WebCore/Modules - 3
615         https://bugs.webkit.org/show_bug.cgi?id=145508
616
617         Reviewed by Darin Adler.
618
619         As a step to purge PassRefPtr, this patch removes PassRefPtr, then use Ref or RefPtr.
620
621         * Modules/indexeddb/IDBCursor.cpp:
622         (WebCore::IDBCursor::create):
623         * Modules/indexeddb/IDBCursor.h:
624         * Modules/indexeddb/IDBCursorBackend.h:
625         (WebCore::IDBCursorBackend::create):
626         * Modules/indexeddb/IDBCursorBackendOperations.h:
627         (WebCore::CursorIterationOperation::create):
628         (WebCore::CursorAdvanceOperation::create):
629         * Modules/indexeddb/IDBDatabase.cpp:
630         (WebCore::IDBDatabase::create):
631         * Modules/indexeddb/IDBDatabase.h:
632         * Modules/indexeddb/IDBDatabaseBackend.cpp:
633         (WebCore::IDBDatabaseBackend::create):
634         * Modules/indexeddb/IDBDatabaseBackend.h:
635         * Modules/indexeddb/IDBDatabaseCallbacksImpl.cpp:
636         (WebCore::IDBDatabaseCallbacksImpl::create):
637         * Modules/indexeddb/IDBDatabaseCallbacksImpl.h:
638         * Modules/indexeddb/IDBDatabaseError.h:
639         (WebCore::IDBDatabaseError::create):
640         * Modules/indexeddb/IDBIndex.h:
641         (WebCore::IDBIndex::create):
642         * Modules/indexeddb/IDBKey.h:
643         (WebCore::IDBKey::createInvalid):
644         (WebCore::IDBKey::createNumber):
645         (WebCore::IDBKey::createString):
646         (WebCore::IDBKey::createDate):
647         (WebCore::IDBKey::createArray):
648         * Modules/indexeddb/IDBKeyRange.cpp:
649         (WebCore::IDBKeyRange::create):
650         * Modules/indexeddb/IDBKeyRange.h:
651         (WebCore::IDBKeyRange::create):
652         * Modules/indexeddb/IDBObjectStore.cpp:
653         * Modules/indexeddb/IDBObjectStore.h:
654         (WebCore::IDBObjectStore::create):
655         * Modules/indexeddb/IDBOpenDBRequest.cpp:
656         (WebCore::IDBOpenDBRequest::create):
657         * Modules/indexeddb/IDBOpenDBRequest.h:
658         * Modules/indexeddb/IDBRecordIdentifier.h:
659         (WebCore::IDBRecordIdentifier::create):
660         * Modules/indexeddb/IDBRequest.cpp:
661         (WebCore::IDBRequest::create):
662         (WebCore::IDBRequest::getResultCursor):
663         * Modules/indexeddb/IDBRequest.h:
664         * Modules/indexeddb/IDBTransaction.cpp:
665         (WebCore::IDBTransaction::create):
666         * Modules/indexeddb/IDBTransaction.h:
667         * Modules/indexeddb/IDBTransactionBackend.cpp:
668         (WebCore::IDBTransactionBackend::create):
669         * Modules/indexeddb/IDBTransactionBackend.h:
670         * Modules/indexeddb/IDBTransactionBackendOperations.h:
671         (WebCore::CreateObjectStoreOperation::create):
672         (WebCore::DeleteObjectStoreOperation::create):
673         (WebCore::IDBDatabaseBackend::VersionChangeOperation::create):
674         (WebCore::CreateObjectStoreAbortOperation::create):
675         (WebCore::DeleteObjectStoreAbortOperation::create):
676         (WebCore::IDBDatabaseBackend::VersionChangeAbortOperation::create):
677         (WebCore::CreateIndexOperation::create):
678         (WebCore::CreateIndexAbortOperation::create):
679         (WebCore::DeleteIndexOperation::create):
680         (WebCore::DeleteIndexAbortOperation::create):
681         (WebCore::GetOperation::create):
682         (WebCore::PutOperation::create):
683         (WebCore::SetIndexesReadyOperation::create):
684         (WebCore::OpenCursorOperation::create):
685         (WebCore::CountOperation::create):
686         (WebCore::DeleteRangeOperation::create):
687         (WebCore::ClearObjectStoreOperation::create):
688         * Modules/mediasource/VideoPlaybackQuality.cpp:
689         (WebCore::VideoPlaybackQuality::create):
690         * Modules/mediasource/VideoPlaybackQuality.h:
691         * Modules/mediastream/MediaConstraintsImpl.cpp:
692         (WebCore::MediaConstraintsImpl::create):
693         * Modules/mediastream/MediaConstraintsImpl.h:
694         * Modules/mediastream/MediaStream.cpp:
695         (WebCore::MediaStream::create):
696         * Modules/mediastream/MediaStream.h:
697         * Modules/mediastream/RTCDTMFSender.cpp:
698         (WebCore::RTCDTMFSender::create):
699         * Modules/mediastream/RTCDTMFSender.h:
700         * Modules/mediastream/RTCOfferAnswerOptions.cpp:
701         (WebCore::RTCOfferAnswerOptions::create):
702         (WebCore::RTCOfferOptions::create):
703         * Modules/mediastream/RTCOfferAnswerOptions.h:
704         * Modules/mediastream/RTCPeerConnection.cpp:
705         (WebCore::RTCPeerConnection::parseConfiguration):
706         (WebCore::RTCPeerConnection::create):
707         * Modules/mediastream/RTCPeerConnection.h:
708         * Modules/webaudio/AudioContext.cpp:
709         (WebCore::AudioContext::create):
710         * Modules/webdatabase/AbstractDatabaseServer.h:
711         * Modules/webdatabase/DOMWindowWebDatabase.cpp:
712         (WebCore::DOMWindowWebDatabase::openDatabase):
713         * Modules/webdatabase/DOMWindowWebDatabase.h:
714         * Modules/webdatabase/DatabaseManager.cpp:
715         (WebCore::DatabaseManager::existingDatabaseContextFor):
716         (WebCore::DatabaseManager::databaseContextFor):
717         (WebCore::DatabaseManager::openDatabase):
718         * Modules/webdatabase/DatabaseManager.h:
719         * Modules/webdatabase/DatabaseServer.cpp:
720         (WebCore::DatabaseServer::openDatabase):
721         (WebCore::DatabaseServer::createDatabase):
722         * Modules/webdatabase/DatabaseServer.h:
723
724 2015-06-01  Daniel Bates  <dabates@apple.com>
725
726         Notify client that we began editing when text field is focused
727         https://bugs.webkit.org/show_bug.cgi?id=145439
728         <rdar://problem/21142108>
729
730         Reviewed by Anders Carlsson.
731
732         Inform the editor client that we began editing when a text field is focused either
733         by being explicitly focused (programmatically or by user interaction) or implicitly
734         focused when the window became active.
735
736         Currently we only notify the editor client that we began editing a text field when
737         when a person actually changes the value of the field. And we always notify the
738         client that we ended editing when a text field is defocused regardless of whether
739         we executed a began editing callback. Moreover we notify a client that we
740         ended editing when the field is defocused (either explicitly or implicitly when the
741         window becomes inactive). Instead we should always notify the client that we began
742         editing when the field is focused so that this callback is symmetric with the end
743         editing callback.
744
745         * html/SearchInputType.cpp:
746         (WebCore::SearchInputType::didSetValueByUserEdit): Remove parameter for ValueChangeState,
747         which was used to determine whether we should notify the client that we began editing, because
748         we we will notify the client that editing began when the text field is focused as opposed to
749         when the value of text field first changes.
750         * html/SearchInputType.h: Ditto.
751         * html/TextFieldInputType.cpp:
752         (WebCore::TextFieldInputType::forwardEvent): Notify the client that we began editing when
753         the text field is focused.
754         (WebCore::TextFieldInputType::subtreeHasChanged): Update call site of didSetValueByUserEdit()
755         following the removal of its parameter.
756         (WebCore::TextFieldInputType::didSetValueByUserEdit): Ditto.
757         * html/TextFieldInputType.h:
758
759 2015-06-01  Anders Carlsson  <andersca@apple.com>
760
761         WAKScrollView.h cannot be imported standalone
762         https://bugs.webkit.org/show_bug.cgi?id=145529
763
764         Reviewed by Dan Bernstein.
765
766         * page/mac/WebCoreFrameView.h:
767         Remove the __cplusplus #ifdefs since WebCoreFrameView.h is only used by Objective-C++ code.
768         (The different non-C++ method declarations were wrong anyway!)
769
770         * platform/ScrollTypes.h:
771         Remove the #ifdef __cplusplus surrounding the code, add header includes to make the file self-contained,
772         and reformat the enum definitions.
773
774 2015-06-01  Alex Christensen  <achristensen@webkit.org>
775
776         [Content Extensions] resource-type and load-type should be independent.
777         https://bugs.webkit.org/show_bug.cgi?id=145528
778         rdar://problem/21190765
779
780         Reviewed by Benjamin Poulain.
781
782         Covered by existing tests and a new API test.
783         
784         Right now we use the same uint16_t to store all the load-type and resource-type flags,
785         then we just do a bitwise and to check both at the same time. This results in a trigger
786         with load-type and resource-type firing if either condition is met, not both conditions.
787         A trigger with both resource-type and load-type conditions should only fire if both conditions are met.
788
789         * contentextensions/DFABytecodeInterpreter.cpp:
790         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpretTestFlagsAndAppendAction):
791         Check and correctly handle rules with both resource-type and load-type flags.
792         * loader/ResourceLoadInfo.h:
793         Add masks to separate flags from resource-type and load-type.
794
795 2015-06-01  Alex Christensen  <achristensen@webkit.org>
796
797         [Content Extensions] Reduce DFA memory usage.
798         https://bugs.webkit.org/show_bug.cgi?id=145526
799
800         Reviewed by Benjamin Poulain.
801
802         * contentextensions/DFA.cpp:
803         (WebCore::ContentExtensions::DFA::memoryUsed):
804         (WebCore::ContentExtensions::DFANode::transitions):
805         (WebCore::ContentExtensions::DFANode::fallbackTransitionDestination):
806         (WebCore::ContentExtensions::DFANode::changeFallbackTransition):
807         (WebCore::ContentExtensions::DFANode::addFallbackTransition):
808         (WebCore::ContentExtensions::DFANode::containsTransition):
809         (WebCore::ContentExtensions::DFANode::kill):
810         * contentextensions/DFA.h:
811         * contentextensions/DFAMinimizer.cpp:
812         (WebCore::ContentExtensions::DFAMinimizer::minimize):
813         * contentextensions/NFAToDFA.cpp:
814         (WebCore::ContentExtensions::NFAToDFA::convert):
815         Use separate Vectors for the transition characters and destinations to avoid wasting memory to padding a std::pair.
816
817 2015-06-01  Matt Rajca  <mrajca@apple.com>
818
819         Implemented the `eventTargetInterface` and `scriptExecutionContext` methods required by EventTarget, as well as
820         some required infrastructure.
821         https://bugs.webkit.org/show_bug.cgi?id=145523
822
823         Reviewed by Eric Carlson.
824
825         * Modules/mediasession/MediaRemoteControls.cpp:
826         (WebCore::MediaRemoteControls::MediaRemoteControls): Initialize all instance variables.
827         * Modules/mediasession/MediaRemoteControls.h: MediaRemoteControl's constructor now takes a script execution
828           context, which we provide to EventTarget. The required eventTargetInterface method has also been implemented.
829         (WebCore::MediaRemoteControls::create):
830         * Modules/mediasession/MediaRemoteControls.idl: Indicate MediaRemoteControls now takes a constructor that is
831           passed in a script execution context. To prevent build errors, event handlers have been removed until they are
832           implemented.
833         * WebCore.xcodeproj/project.pbxproj: We should be building the derived JSMediaRemoteControls class with WebCore.
834         * dom/EventTargetFactory.in: Ensure a MediaRemoteControlsEventTargetInterfaceType is generated.
835
836 2015-06-01  Benjamin Poulain  <bpoulain@apple.com>
837
838         [CSS JIT] Fail to compile when we are out of executable memory
839         https://bugs.webkit.org/show_bug.cgi?id=145483
840         rdar://problem/21166612
841
842         Reviewed by Andreas Kling.
843
844         We should use a soft failure when the Linker fails to allocate
845         executable memory for the CSS JIT. We will just fallback to slow
846         code when that happen, better slow CSS than crashing.
847
848         Credit to Chris for finding this problem.
849
850         * cssjit/SelectorCompiler.cpp:
851         (WebCore::SelectorCompiler::SelectorCodeGenerator::compile):
852
853 2015-06-01  Chris Dumez  <cdumez@apple.com>
854
855         ASSERT(revalidatingResource.inCache()) in MemoryCache when reloading tumblr.com
856         https://bugs.webkit.org/show_bug.cgi?id=145518
857         <rdar://problem/21168573>
858
859         Reviewed by Darin Adler.
860
861         There was an assertion in MemoryCache::revalidationSucceeded() making
862         sure that the resource that was revalidated is still in the memory
863         cache. However, nothing prevents this resource from being pruned while
864         it is being revalidated. We do make sure that the resource in question
865         cannot be destroyed though (see CachedResource::canDelete()).
866
867         This patch gets rid of this assertion as it is incorrect. Also, the
868         fact that the resource is no longer in the memory cache is not an
869         issue. We are merely going to call MemoryCache::remove() to remove
870         it from the memory cache before re-adding it and updating its
871         HTTP response. The call to MemoryCache::remove() will simply be a
872         no-op in this case and we will not have any problem adding the
873         resource back to the memory cache because the resource is kept alive.
874
875         Test: http/tests/cache/memory-cache-pruning-during-revalidation.html
876
877         * loader/cache/MemoryCache.cpp:
878         (WebCore::MemoryCache::revalidationSucceeded): Deleted.
879
880 2015-06-01  Matt Rajca  <mrajca@apple.com>
881
882         Add stub implementation of MediaRemoteControls, part of the Media Session spec.
883         https://bugs.webkit.org/show_bug.cgi?id=145462
884
885         Reviewed by Eric Carlson.
886
887         * CMakeLists.txt: Added IDL file as well as the corresponding implementation file.
888         * DerivedSources.make: Included the new IDL file.
889         * Modules/mediasession/MediaRemoteControls.cpp: Added an empty implementation file.
890         (MediaRemoteControls::~MediaRemoteControls):
891         * Modules/mediasession/MediaRemoteControls.h: Added a stubbed header file with accessors for the four attributes declared in the IDL file.
892         (WebCore::MediaRemoteControls::previousTrackEnabled):
893         (WebCore::MediaRemoteControls::setPreviousTrackEnabled):
894         (WebCore::MediaRemoteControls::nextTrackEnabled):
895         (WebCore::MediaRemoteControls::setNextTrackEnabled):
896         (WebCore::MediaRemoteControls::seekForwardEnabled):
897         (WebCore::MediaRemoteControls::setSeekForwardEnabled):
898         (WebCore::MediaRemoteControls::seekBackwardEnabled):
899         (WebCore::MediaRemoteControls::setSeekBackwardEnabled):
900         * Modules/mediasession/MediaRemoteControls.idl: Added from the Media Session spec.
901         * WebCore.xcodeproj/project.pbxproj: Included the new IDL file and MediaRemoteControls.cpp/.h sources.
902
903 2015-06-01  Sergio Villar Senin  <svillar@igalia.com>
904
905         [CSS Grid Layout] Simplify the interface of GridResolvedPosition
906         https://bugs.webkit.org/show_bug.cgi?id=139077
907
908         Reviewed by Darin Adler.
909
910         The interface of GridResolvedPosition is full of static methods
911         that are used only internally, we should not expose them.
912
913         Apart from that resolveGridPositionsFromStyle() do always return
914         a valid GridSpan from now on meaning that the caller has to ensure
915         that the resolution does not require running the auto-placement
916         algorithm. A new class called GridUnresolvedSpan was added for
917         that purpose.
918
919         No new tests as this is a refactoring.
920
921         * rendering/RenderGrid.cpp:
922         (WebCore::RenderGrid::placeItemsOnGrid):
923         (WebCore::RenderGrid::populateExplicitGridAndOrderIterator):
924         (WebCore::RenderGrid::placeSpecifiedMajorAxisItemsOnGrid):
925         (WebCore::RenderGrid::placeAutoMajorAxisItemOnGrid):
926         * rendering/style/GridPosition.h:
927         * rendering/style/GridResolvedPosition.cpp:
928         (WebCore::gridLinesForSide):
929         (WebCore::implicitNamedGridLineForSide):
930         (WebCore::isNonExistentNamedLineOrArea):
931         (WebCore::GridUnresolvedSpan::requiresAutoPlacement):
932         (WebCore::GridUnresolvedSpan::adjustGridPositionsFromStyle):
933         (WebCore::adjustGridPositionForRowEndColumnEndSide):
934         (WebCore::adjustGridPositionForSide):
935         (WebCore::resolveNamedGridLinePositionFromStyle):
936         (WebCore::firstNamedGridLineBeforePosition):
937         (WebCore::resolveRowStartColumnStartNamedGridLinePositionAgainstOppositePosition):
938         (WebCore::resolveRowEndColumnEndNamedGridLinePositionAgainstOppositePosition):
939         (WebCore::resolveNamedGridLinePositionAgainstOppositePosition):
940         (WebCore::resolveGridPositionAgainstOppositePosition):
941         (WebCore::GridResolvedPosition::resolveGridPositionsFromAutoPlacementPosition):
942         (WebCore::resolveGridPositionFromStyle):
943         (WebCore::GridResolvedPosition::GridResolvedPosition):
944         (WebCore::GridResolvedPosition::unresolvedSpanFromStyle):
945         (WebCore::GridResolvedPosition::resolveGridPositionsFromStyle):
946         (WebCore::GridResolvedPosition::adjustGridPositionsFromStyle): Deleted.
947         (WebCore::GridResolvedPosition::resolveNamedGridLinePositionFromStyle): Deleted.
948         (WebCore::GridResolvedPosition::resolveGridPositionFromStyle): Deleted.
949         (WebCore::GridResolvedPosition::resolveGridPositionAgainstOppositePosition): Deleted.
950         (WebCore::GridResolvedPosition::resolveNamedGridLinePositionAgainstOppositePosition): Deleted.
951         (WebCore::GridResolvedPosition::resolveRowStartColumnStartNamedGridLinePositionAgainstOppositePosition): Deleted.
952         (WebCore::GridResolvedPosition::resolveRowEndColumnEndNamedGridLinePositionAgainstOppositePosition): Deleted.
953         * rendering/style/GridResolvedPosition.h:
954         (WebCore::GridUnresolvedSpan::GridUnresolvedSpan): New class.
955         (WebCore::GridUnresolvedSpan::initialPosition):
956         (WebCore::GridUnresolvedSpan::finalPosition):
957         (WebCore::GridUnresolvedSpan::initialPositionSide):
958         (WebCore::GridUnresolvedSpan::finalPositionSide):
959         (WebCore::GridResolvedPosition::adjustGridPositionForRowEndColumnEndSide): Deleted.
960         (WebCore::GridResolvedPosition::adjustGridPositionForSide): Deleted.
961         (WebCore::GridResolvedPosition::GridResolvedPosition): Deleted.
962
963 2015-06-01  Csaba Osztrogonác  <ossy@webkit.org>
964
965         Fix the !ENABLE(VIDEO_TRACK) build after r184799
966         https://bugs.webkit.org/show_bug.cgi?id=145510
967
968         Reviewed by Eric Carlson.
969
970         * testing/Internals.cpp:
971         (WebCore::Internals::userPreferredAudioCharacteristics):
972         (WebCore::Internals::setUserPreferredAudioCharacteristic):
973
974 2015-06-01  Csaba Osztrogonác  <ossy@webkit.org>
975
976         Fix logical-not-parentheses warning in CachedScript.cpp
977         https://bugs.webkit.org/show_bug.cgi?id=145254
978
979         Reviewed by Sam Weinig.
980
981         * loader/cache/CachedScript.cpp:
982         (WebCore::CachedScript::mimeTypeAllowedByNosniff): "!X==Y" should be "X!=Y" here.
983
984 2015-05-31  Dan Bernstein  <mitz@apple.com>
985
986         Remove Panther support
987         https://bugs.webkit.org/show_bug.cgi?id=145506
988
989         Reviewed by Sam Weinig.
990
991         * platform/ios/wak/WAKAppKitStubs.h: Don't check for pre-Tiger SDKs.
992
993 2015-05-31  Carlos Alberto Lopez Perez  <clopez@igalia.com>
994
995         Remove unused variable kZoomTicks.
996         https://bugs.webkit.org/show_bug.cgi?id=145504
997
998         Reviewed by Sam Weinig.
999
1000         No new tests, no behavior changes.
1001
1002         * platform/ScrollAnimatorNone.cpp:
1003
1004 2015-05-31  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1005
1006         Async XMLHttpRequest should get access to AppCache resources stored as flat files
1007         https://bugs.webkit.org/show_bug.cgi?id=138506
1008
1009         Reviewed by Darin Adler.
1010
1011         This patch reads flat file data when DocumentLoader substituteResource delivery timer is fired.
1012         Refactoring to remove ApplicationCacheHost/DocumentLoader friend link.
1013         Added ResourceLoader::deliverResponseAndData helper function, taking a SharedBuffer as input to remove an unneeded copy for flat files (no change for other files). 
1014
1015         Test: http/tests/appcache/simple-video-async.html
1016
1017         * loader/DocumentLoader.cpp:
1018         (WebCore::DocumentLoader::substituteResourceDeliveryTimerFired):
1019         (WebCore::DocumentLoader::scheduleArchiveLoad):
1020         (WebCore::DocumentLoader::scheduleSubstituteResourceLoad): Helper function to remove ApplicationCacheHost friend link.
1021         * loader/DocumentLoader.h:
1022         * loader/ResourceLoader.cpp:
1023         (WebCore::ResourceLoader::deliverResponseAndData): Helper function, code mostly moved from DocumentLoader::substituteResourceDeliveryTimerFired.
1024         * loader/ResourceLoader.h:
1025         * loader/SubstituteResource.h:
1026         (WebCore::SubstituteResource::deliver): Introduced to be overriden by ApplicationCacheResource to take care of flat file case.
1027         * loader/appcache/ApplicationCacheHost.cpp:
1028         (WebCore::ApplicationCacheHost::maybeLoadResource):
1029         (WebCore::ApplicationCacheHost::scheduleLoadFallbackResourceFromApplicationCache):
1030         * loader/appcache/ApplicationCacheResource.cpp:
1031         (WebCore::ApplicationCacheResource::deliver): Use SharedBuffer::createWithContentsOfFile to load data stored in flat file.
1032         * loader/appcache/ApplicationCacheResource.h:
1033
1034 2015-05-31  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
1035
1036         [Streams API] Implement ReadableStreamController constructor
1037         https://bugs.webkit.org/show_bug.cgi?id=143752
1038
1039         Reviewed by Darin Adler.
1040
1041         Covered by rebased test and expectation.
1042
1043         * Modules/streams/ReadableStreamController.idl: Adding CustomConstructor.
1044         * bindings/js/JSReadableStreamControllerCustom.cpp:
1045         (WebCore::constructJSReadableStreamController): Throws an exception whenever called.
1046
1047 2015-05-30  Brady Eidson  <beidson@apple.com>
1048
1049         Make FrameLoader methods that take PassRefPtr<Event> take raw pointers instead.
1050         https://bugs.webkit.org/show_bug.cgi?id=145495
1051
1052         Reviewed by Alexey Proskuryakov.
1053
1054         No new tests (No change in behavior).
1055
1056         In most cases ownership of the Event is not actually being transferred, and these functions are all rarely called anyways.
1057         
1058         * html/HTMLLinkElement.cpp:
1059         (WebCore::HTMLLinkElement::handleClick):
1060         
1061         * loader/FrameLoader.cpp:
1062         (WebCore::FrameLoader::urlSelected):
1063         (WebCore::FrameLoader::loadFrameRequest):
1064         (WebCore::FrameLoader::loadURL):
1065         (WebCore::FrameLoader::loadPostRequest):
1066         * loader/FrameLoader.h:
1067
1068 2015-05-30  Andreas Kling  <akling@apple.com>
1069
1070         [iOS] Tiling coverage sometimes inflated by outdated scale factor.
1071         <https://webkit.org/b/145494>
1072         <rdar://problem/20989389>
1073
1074         Reviewed by Benjamin Poulain.
1075
1076         Have GraphicsLayerCA plumb the current contents scale through to TileController::adjustCoverageRect()
1077         instead of TileController getting it from TileGrid.
1078
1079         This avoids a situation where adjustCoverageRect() could cause temporarily oversized tiling coverage
1080         if called while TileGrid's content scale is outdated, and we're neither zooming or pinching, following
1081         a pinch zoom that increased the scale factor.
1082
1083         Specifically, if all the velocity data is zero, we pad the coverage rect by a horizontal and vertical
1084         margin computed like so:
1085
1086             margin = defaultTileSize / tileGrid.scale
1087
1088         If the actual scale is 5, but the TileGrid's outdated scale is e.g 0.8, you'll get a much larger
1089         margin than you really wanted. Then the whole thing gets scaled up by 5x later on, and we explode
1090         in a fiery feast of IOSurface allocations.
1091
1092         * platform/graphics/TiledBacking.h:
1093         * platform/graphics/ca/GraphicsLayerCA.cpp:
1094         (WebCore::GraphicsLayerCA::adjustCoverageRect):
1095         * platform/graphics/ca/TileController.cpp:
1096         (WebCore::TileController::computeTileCoverageRect):
1097         * platform/graphics/ca/TileController.h:
1098
1099 2015-05-30  Brady Eidson  <beidson@apple.com>
1100
1101         Fix Windows tests broken by r185007.
1102         https://bugs.webkit.org/show_bug.cgi?id=145472
1103
1104         Unreviewed. Discussed with Alexey Proskuryakov.
1105
1106         No new tests (Fixing the four broken ones should suffice).
1107
1108         The bug was that evaluating arguments in a method/constructor call has no guaranteed sequencing.
1109         
1110         Clang seems to always do LTR, allowing the PassRefPtr to be evaluated as a bool in the call to
1111         navigationType() before it is "consumed" by the PassRefPtr argument.
1112         
1113         In Visual Studio the PassRefPtr consumption happened before the bool evaluation, meaning `false`
1114         was always passed in to navigationType(), breaking the four tests.
1115         
1116         The fix? Using PassRefPtr here was silly in the first place.
1117         No ownership is being transferred.
1118         Raw pointers it is.
1119         
1120         * loader/FrameLoader.cpp:
1121         (WebCore::FrameLoader::loadURL):
1122         (WebCore::FrameLoader::loadPostRequest):
1123         * loader/NavigationAction.cpp:
1124
1125         (WebCore::NavigationAction::NavigationAction):
1126         * loader/NavigationAction.h: Nobody is actually transferring ownership of these Events.
1127           Raw pointers will work just fine, thanks.
1128
1129 2015-05-29  Joseph Pecoraro  <pecoraro@apple.com>
1130
1131         Unreviewed bindings test rebaseline after r185023.
1132
1133         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
1134         (WebCore::isObservable): Deleted.
1135         (WebCore::JSTestGenerateIsReachableOwner::isReachableFromOpaqueRoots): Deleted.
1136
1137 2015-05-29  Andreas Kling  <akling@apple.com>
1138
1139         [iOS] Reduce tiling coverage when doing a pure pinch zoom with no panning.
1140         <https://webkit.org/b/145481>
1141         <rdar://problem/20989389>
1142
1143         Reviewed by Benjamin Poulain.
1144
1145         When we're zooming in with a pinch gesture but not panning the page
1146         at the same time, make the coverage rect be the visible rect.
1147
1148         This reduces memory pressure during zooming, especially on slower
1149         devices that struggle to keep up with the current viewport.
1150
1151         * platform/graphics/ca/TileController.cpp:
1152         (WebCore::TileController::computeTileCoverageRect):
1153
1154 2015-05-29  Keith Miller  <keith_miller@apple.com>
1155
1156         WeakMap reference w/ DOM element as key does not survive long enough.
1157         https://bugs.webkit.org/show_bug.cgi?id=137651
1158
1159         Reviewed by Geoffrey Garen.
1160
1161         Remove isObservable functions as an "unobservable wrappers"
1162         optimization is invalid with WeakMaps. Performance testing
1163         will be done after the code is commited. If major
1164         performance issues occur the patch will be rolled out.
1165
1166         Test: js/dom/weakmap-gc-unobservable-dom-nodes.html
1167
1168         * bindings/js/JSNodeCustom.cpp:
1169         (WebCore::isReachableFromDOM):
1170         (WebCore::JSNodeOwner::isReachableFromOpaqueRoots):
1171         (WebCore::JSNode::insertBefore):
1172         (WebCore::isObservable): Deleted.
1173         * bindings/scripts/CodeGeneratorJS.pm:
1174         (GenerateImplementation):
1175
1176 2015-05-29  Anders Carlsson  <andersca@apple.com>
1177
1178         Get rid of WAKViewPrivate.h
1179         https://bugs.webkit.org/show_bug.cgi?id=145482
1180         rdar://problem/21162149
1181
1182         Reviewed by Dan Bernstein.
1183
1184         Merge WAKViewPrivate.h into WAKViewInternal.h and move the NSView sizing enum
1185         to WAKView.h since that was the only thing WebKit used (indirectly) from WAKViewPrivate.h.
1186
1187         * WebCore.xcodeproj/project.pbxproj:
1188         * platform/WAKViewInternal.h:
1189         (WAKViewForWKViewRef):
1190         * platform/ios/ScrollViewIOS.mm:
1191         * platform/ios/wak/WAKResponder.m:
1192         * platform/ios/wak/WAKView.h:
1193         * platform/ios/wak/WAKView.mm:
1194         * platform/ios/wak/WAKViewPrivate.h: Removed.
1195         (WAKViewForWKViewRef): Deleted.
1196         * platform/ios/wak/WAKWindow.mm:
1197         * platform/ios/wak/WKView.h:
1198         * platform/ios/wak/WKView.mm:
1199
1200 2015-05-29  Daniel Bates  <dabates@apple.com>
1201
1202         Clean up logic for updating caps lock indicator state
1203         https://bugs.webkit.org/show_bug.cgi?id=145329
1204
1205         Reviewed by Sam Weinig.
1206
1207         Remove logic to explicitly update the state of the caps lock indicator, which was used
1208         when the caps logic indicator was implemented as part of RenderTextControl. Currently,
1209         the caps logic indicator is implemented as part of a shadow DOM and we have existing
1210         logic to forward DOM focus and blur events to it so that it may update its state.
1211
1212         No change in behavior.
1213
1214         * editing/FrameSelection.cpp:
1215         (WebCore::FrameSelection::focusedOrActiveStateChanged): Deleted.
1216         * editing/FrameSelection.h:
1217         * page/EventHandler.cpp:
1218         (WebCore::EventHandler::keyEvent): Inline the code from EventHandler::capsLockStateMayHaveChanged()
1219         into this function because it is the only caller of EventHandler::capsLockStateMayHaveChanged() after
1220         we removed the call site in FrameSelection::focusedOrActiveStateChanged().
1221         (WebCore::EventHandler::capsLockStateMayHaveChanged): Deleted.
1222         * page/EventHandler.h:
1223
1224 2015-05-29  Zalan Bujtas  <zalan@apple.com>
1225
1226         Text disappears shortly after page load on Nexus 7 site.
1227         https://bugs.webkit.org/show_bug.cgi?id=145467
1228         rdar://problem/18327239
1229
1230         Reviewed by Simon Fraser.
1231
1232         This patch ensures that overlap testing for composited layers works properly when the sibling
1233         layer gets composited through its child.
1234
1235         When a layer gets composited through its child content, the recursive overlap testing should build up the
1236         overlapmap stack so that sibling content is intersected both against the child and its parent bounds.
1237
1238         Tests: compositing/sibling-layer-does-not-get-composited-overflow-hidden-case.html
1239                compositing/sibling-layer-does-not-get-composited-transform-case.html
1240
1241         * rendering/RenderLayerCompositor.cpp:
1242         (WebCore::RenderLayerCompositor::addToOverlapMapRecursive):
1243         (WebCore::RenderLayerCompositor::OverlapMap::contains): Deleted.
1244
1245 2015-05-29  Brady Eidson  <beidson@apple.com>
1246
1247         Review feedback followup for r185003.
1248         https://bugs.webkit.org/show_bug.cgi?id=145463
1249
1250         Reviewed by Darin Adler.
1251
1252         * platform/sql/SQLiteDatabase.cpp:
1253         (WebCore::SQLiteDatabase::overrideUnauthorizedFunctions): `static const` one thing, c++-style cast another.
1254
1255 2015-05-29  Chris Dumez  <cdumez@apple.com>
1256
1257         WebContent crash in WebCore::Page::sessionID() const + 0 (Page.cpp:1660)
1258         https://bugs.webkit.org/show_bug.cgi?id=145422
1259         <rdar://problem/20613631>
1260
1261         Reviewed by Brady Eidson.
1262
1263         We sometimes crash when destroying a PageCache CachedFrame because its
1264         DocumentLoader is still loading. This should never happen as we are not
1265         supposed to let pages are still have pending loads into the PageCache.
1266
1267         However, we were using DocumentLoader::isLoadingInAPISense() as check
1268         in PageCache::canCachePageContainingThisFrame() which is not exactly
1269         what we want. isLoadingInAPISense() no longer considers subresource
1270         loads once the frame as loaded. This means if the JS triggers a new
1271         load in a subframe after it has been loaded, then isLoadingInAPISense()
1272         will return false, despite the pending load.
1273
1274         This patch replaces the isLoadingInAPISense() check with isLoading()
1275         as this will consider all pending loads, even after the frame is
1276         loaded.
1277
1278         In most cases, using isLoadingInAPISense() was not an issue because
1279         we call DocumentLoader::stopLoading() in all subframes before starting
1280         a provisional load. However, nothing seems to prevent JS from
1281         triggering a new load after that and before the new load gets committed
1282         (which is when we save the page into PageCache).
1283
1284         No new test as we don't have a reliable reproduction case and the
1285         issue is timing related.
1286
1287         * history/PageCache.cpp:
1288         (WebCore::logCanCacheFrameDecision):
1289         (WebCore::PageCache::canCachePageContainingThisFrame):
1290         * page/DiagnosticLoggingKeys.cpp:
1291         (WebCore::DiagnosticLoggingKeys::isLoading):
1292         (WebCore::DiagnosticLoggingKeys::loadingAPISenseKey): Deleted.
1293         * page/DiagnosticLoggingKeys.h:
1294
1295 2015-05-29  Chris Dumez  <cdumez@apple.com>
1296
1297         Consider throttling DOM timers in iframes outside the viewport
1298         https://bugs.webkit.org/show_bug.cgi?id=145465
1299         <rdar://problem/20768957>
1300
1301         Reviewed by Darin Adler.
1302
1303         Throttle DOM timers in iframes that are outside the viewport to decrease
1304         CPU usage, improve performance and reduce power use.
1305
1306         The approach is similar to what we already did for requestAnimationFrame
1307         in r183998.
1308
1309         We already has support for throttling DOM timers at:
1310         - Page level: for backgound pages
1311         - DOM timer level: for timers changing the style of an element outside
1312           the viewport or drawing on a canvas outside the viewport.
1313
1314         This patch adds support for throttling DOM timers at Document level so
1315         we can throttle all timers inside a specific iframe / Document. It relies
1316         on the same timerAlignmentInterval that is used for throttling at Page
1317         level with tweaks so that different Documents inside the same Page can
1318         have a different timerAlignmentInterval.
1319
1320         Test: fast/dom/timer-throttling-subframe.html
1321
1322         * dom/Document.cpp:
1323         (WebCore::Document::setTimerThrottlingEnabled):
1324         (WebCore::Document::timerAlignmentInterval):
1325         * dom/Document.h:
1326         (WebCore::Document::isTimerThrottlingEnabled):
1327         * page/DOMTimer.cpp:
1328         (WebCore::DOMTimer::alignedFireTime):
1329         The previous code was not throttling the timer if its fireTime was in
1330         the past. This was causing some aggressive timers on mashable.com to
1331         not be throttled so I got rid of this behavior. I don't see any reason
1332         why we would not throttle a timer simply because it is supposed to have
1333         fired already.
1334
1335         * page/FrameView.cpp:
1336         (WebCore::FrameView::viewportContentsChanged):
1337         (WebCore::FrameView::updateScriptedAnimationsAndTimersThrottlingState):
1338         * page/FrameView.h:
1339
1340         * testing/Internals.cpp:
1341         (WebCore::Internals::areTimersThrottled):
1342         * testing/Internals.h:
1343         * testing/Internals.idl:
1344         Add API to facilitate layout testing of this functionality.
1345
1346 2015-05-29  Brady Eidson  <beidson@apple.com>
1347
1348         NavigationAction constructor cleanup.
1349         https://bugs.webkit.org/show_bug.cgi?id=145472
1350
1351         Reviewed by Alex Christensen.
1352
1353         No new tests (Refactor, no change in behavior).
1354
1355         * loader/NavigationAction.cpp:
1356         (WebCore::NavigationAction::NavigationAction): Delegate many of the various constructors
1357           to a single full-featured constructor.
1358         * loader/NavigationAction.h:
1359
1360 2015-05-29  Matt Rajca  <mrajca@apple.com>
1361
1362         Rename MediaSession and MediaSessionClient to PlatformMediaSession and PlatformMediaSessionClient so we can use MediaSession for the formal implementation of the Media Session spec.
1363         https://bugs.webkit.org/show_bug.cgi?id=145447
1364
1365         Reviewed by Eric Carlson.
1366
1367         * Modules/webaudio/AudioContext.cpp:
1368         (WebCore::AudioContext::AudioContext):
1369         (WebCore::AudioContext::suspendPlayback):
1370         * Modules/webaudio/AudioContext.h:
1371         * WebCore.vcxproj/WebCore.vcxproj:
1372         * WebCore.vcxproj/WebCore.vcxproj.filters:
1373         * WebCore.xcodeproj/project.pbxproj:
1374         * html/HTMLAudioElement.h:
1375         * html/HTMLMediaElement.cpp:
1376         (WebCore::HTMLMediaElement::pausedForUserInteraction):
1377         (WebCore::HTMLMediaElement::mediaType):
1378         (WebCore::HTMLMediaElement::presentationType):
1379         (WebCore::HTMLMediaElement::displayType):
1380         (WebCore::HTMLMediaElement::didReceiveRemoteControlCommand):
1381         * html/HTMLMediaElement.h:
1382         * html/HTMLMediaSession.cpp:
1383         (WebCore::HTMLMediaSession::HTMLMediaSession):
1384         (WebCore::HTMLMediaSession::requiresFullscreenForVideoPlayback):
1385         * html/HTMLMediaSession.h:
1386         * html/HTMLVideoElement.h:
1387         * platform/RemoteCommandListener.h:
1388         * platform/audio/MediaSessionManager.cpp:
1389         (WebCore::MediaSessionManager::resetRestrictions):
1390         (WebCore::MediaSessionManager::has):
1391         (WebCore::MediaSessionManager::activeAudioSessionRequired):
1392         (WebCore::MediaSessionManager::count):
1393         (WebCore::MediaSessionManager::beginInterruption):
1394         (WebCore::MediaSessionManager::endInterruption):
1395         (WebCore::MediaSessionManager::addSession):
1396         (WebCore::MediaSessionManager::removeSession):
1397         (WebCore::MediaSessionManager::addRestriction):
1398         (WebCore::MediaSessionManager::removeRestriction):
1399         (WebCore::MediaSessionManager::restrictions):
1400         (WebCore::MediaSessionManager::sessionWillBeginPlayback):
1401         (WebCore::MediaSessionManager::sessionWillEndPlayback):
1402         (WebCore::MediaSessionManager::setCurrentSession):
1403         (WebCore::MediaSessionManager::currentSession):
1404         (WebCore::MediaSessionManager::sessionRestrictsInlineVideoPlayback):
1405         (WebCore::MediaSessionManager::sessionCanLoadMedia):
1406         (WebCore::MediaSessionManager::applicationWillEnterBackground):
1407         (WebCore::MediaSessionManager::applicationWillEnterForeground):
1408         (WebCore::MediaSessionManager::didReceiveRemoteControlCommand):
1409         (WebCore::MediaSessionManager::systemWillSleep):
1410         (WebCore::MediaSessionManager::systemDidWake):
1411         * platform/audio/MediaSessionManager.h:
1412         (WebCore::MediaSessionManager::sessions):
1413         * platform/audio/PlatformMediaSession.cpp: Renamed from Source/WebCore/platform/audio/MediaSession.cpp.
1414         (WebCore::stateName):
1415         (WebCore::PlatformMediaSession::create):
1416         (WebCore::PlatformMediaSession::PlatformMediaSession):
1417         (WebCore::PlatformMediaSession::~PlatformMediaSession):
1418         (WebCore::PlatformMediaSession::setState):
1419         (WebCore::PlatformMediaSession::beginInterruption):
1420         (WebCore::PlatformMediaSession::endInterruption):
1421         (WebCore::PlatformMediaSession::clientWillBeginPlayback):
1422         (WebCore::PlatformMediaSession::clientWillPausePlayback):
1423         (WebCore::PlatformMediaSession::pauseSession):
1424         (WebCore::PlatformMediaSession::mediaType):
1425         (WebCore::PlatformMediaSession::presentationType):
1426         (WebCore::PlatformMediaSession::title):
1427         (WebCore::PlatformMediaSession::duration):
1428         (WebCore::PlatformMediaSession::currentTime):
1429         (WebCore::PlatformMediaSession::canReceiveRemoteControlCommands):
1430         (WebCore::PlatformMediaSession::didReceiveRemoteControlCommand):
1431         (WebCore::PlatformMediaSession::visibilityChanged):
1432         (WebCore::PlatformMediaSession::clientDataBufferingTimerFired):
1433         (WebCore::PlatformMediaSession::updateClientDataBuffering):
1434         (WebCore::PlatformMediaSession::isHidden):
1435         (WebCore::PlatformMediaSession::displayType):
1436         (WebCore::PlatformMediaSessionClient::mediaSessionTitle):
1437         (WebCore::PlatformMediaSessionClient::mediaSessionDuration):
1438         (WebCore::PlatformMediaSessionClient::mediaSessionCurrentTime):
1439         * platform/audio/PlatformMediaSession.h: Renamed from Source/WebCore/platform/audio/MediaSession.h.
1440         (WebCore::PlatformMediaSession::state):
1441         (WebCore::PlatformMediaSession::canPlayToWirelessPlaybackTarget):
1442         (WebCore::PlatformMediaSession::isPlayingToWirelessPlaybackTarget):
1443         (WebCore::PlatformMediaSession::requiresPlaybackTargetRouteMonitoring):
1444         (WebCore::PlatformMediaSession::client):
1445         (WebCore::PlatformMediaSessionClient::PlatformMediaSessionClient):
1446         (WebCore::PlatformMediaSessionClient::displayType):
1447         (WebCore::PlatformMediaSessionClient::setShouldBufferData):
1448         (WebCore::PlatformMediaSessionClient::elementIsHidden):
1449         (WebCore::PlatformMediaSessionClient::wirelessRoutesAvailableDidChange):
1450         (WebCore::PlatformMediaSessionClient::setWirelessPlaybackTarget):
1451         (WebCore::PlatformMediaSessionClient::canPlayToWirelessPlaybackTarget):
1452         (WebCore::PlatformMediaSessionClient::isPlayingToWirelessPlaybackTarget):
1453         (WebCore::PlatformMediaSessionClient::setShouldPlayToPlaybackTarget):
1454         (WebCore::PlatformMediaSessionClient::~PlatformMediaSessionClient):
1455         * platform/audio/ios/MediaSessionManagerIOS.h:
1456         * platform/audio/ios/MediaSessionManagerIOS.mm:
1457         (WebCore::MediaSessionManageriOS::resetRestrictions):
1458         (WebCore::MediaSessionManageriOS::sessionWillBeginPlayback):
1459         (WebCore::MediaSessionManageriOS::sessionWillEndPlayback):
1460         (WebCore::MediaSessionManageriOS::updateNowPlayingInfo):
1461         (WebCore::MediaSessionManageriOS::sessionCanLoadMedia):
1462         (-[WebMediaSessionHelper interruption:]):
1463         * platform/audio/mac/MediaSessionManagerMac.cpp:
1464         (MediaSessionManager::updateSessionState):
1465         * platform/graphics/MediaPlayer.cpp:
1466         (WebCore::MediaPlayer::handlePlaybackCommand):
1467         * platform/graphics/MediaPlayer.h:
1468         (WebCore::MediaPlayerClient::mediaPlayerHandlePlaybackCommand):
1469         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
1470         (WebCore::MediaPlayerPrivateAVFoundation::rateChanged):
1471         * platform/ios/RemoteCommandListenerIOS.mm:
1472         (WebCore::RemoteCommandListenerIOS::RemoteCommandListenerIOS):
1473         * testing/Internals.cpp:
1474         (WebCore::Internals::beginMediaSessionInterruption):
1475         (WebCore::Internals::endMediaSessionInterruption):
1476         (WebCore::Internals::setMediaSessionRestrictions):
1477         (WebCore::Internals::postRemoteControlCommand):
1478
1479 2015-05-29  Alex Christensen  <achristensen@webkit.org>
1480
1481         [Content Extensions] Decrease maxNFASize
1482         https://bugs.webkit.org/show_bug.cgi?id=145461
1483
1484         Reviewed by Gavin Barraclough.
1485
1486         * contentextensions/ContentExtensionCompiler.cpp:
1487         (WebCore::ContentExtensions::compileRuleList):
1488         Decrease maxNFASize based on analysis of memory usage and compiling and interpreting time.
1489
1490 2015-05-29  Brady Eidson  <beidson@apple.com>
1491
1492         WebSQL default functions can bypass authorizer.
1493         <rdar://problem/21048994> and https://bugs.webkit.org/show_bug.cgi?id=145463
1494
1495         Reviewed by Sam Weinig and Alexey Proskuryakov.
1496
1497         No new tests yet.
1498
1499         * platform/sql/SQLiteDatabase.cpp:
1500         (WebCore::unauthorizedSQLFunction): Function to install into SQLite to override some built-in functions.
1501         (WebCore::SQLiteDatabase::open):
1502         (WebCore::SQLiteDatabase::overrideUnauthorizedFunctions): Install function overrides for functions that
1503            take arbitrary input that are also meant to be disabled by virtue of them not being whitelisted.
1504         * platform/sql/SQLiteDatabase.h:
1505
1506 2015-05-29  Roger Fong  <roger_fong@apple.com>
1507
1508         Unreviewed. Shift fullscreen controls down 20px.
1509         <rdar://problem/21161523>
1510
1511         * Modules/mediacontrols/mediaControlsApple.css:
1512         (video:-webkit-full-screen::-webkit-media-controls-panel):
1513         Fullscreen control panel is too high and overlaps with caption menu.
1514         Shift it down 20px.
1515
1516 2015-05-28  Simon Fraser  <simon.fraser@apple.com>
1517
1518         Some assertion failures in compositing code after r183820
1519         https://bugs.webkit.org/show_bug.cgi?id=144630
1520
1521         Reviewed by Alexey Proskuryakov.
1522
1523         Reinstate the assertion commented out in r183843. Fixed by having blending no longer
1524         escape the media elements, which was fixed via bug 145420.
1525
1526         * rendering/RenderLayerCompositor.cpp:
1527         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
1528
1529 2015-05-29  Hunseop Jeong  <hs85.jeong@samsung.com>
1530
1531         Use modern for-loops in WebCore/plugins, storage, style, testing and workers.
1532         https://bugs.webkit.org/show_bug.cgi?id=145425
1533
1534         Reviewed by Darin Adler.
1535
1536         No new tests, no behavior changes.
1537
1538         * plugins/DOMMimeTypeArray.cpp:
1539         (WebCore::DOMMimeTypeArray::canGetItemsForName):
1540         * plugins/DOMPlugin.cpp:
1541         (WebCore::DOMPlugin::canGetItemsForName):
1542         * plugins/DOMPluginArray.cpp:
1543         (WebCore::DOMPluginArray::canGetItemsForName):
1544         * plugins/PluginData.cpp:
1545         (WebCore::PluginData::getWebVisibleMimesAndPluginIndices):
1546         * plugins/PluginMainThreadScheduler.cpp:
1547         (WebCore::PluginMainThreadScheduler::dispatchCallsForPlugin):
1548         (WebCore::PluginMainThreadScheduler::dispatchCalls):
1549         * storage/StorageEventDispatcher.cpp:
1550         (WebCore::StorageEventDispatcher::dispatchLocalStorageEvents):
1551         (WebCore::StorageEventDispatcher::dispatchSessionStorageEventsToFrames):
1552         (WebCore::StorageEventDispatcher::dispatchLocalStorageEventsToFrames):
1553         * storage/StorageMap.cpp:
1554         (WebCore::StorageMap::importItems):
1555         * style/StyleResolveTree.cpp:
1556         (WebCore::Style::pseudoStyleCacheIsInvalid):
1557         * testing/Internals.cpp:
1558         (WebCore::Internals::nodesFromRect):
1559         * workers/Worker.cpp:
1560         (WebCore::networkStateChanged):
1561         * workers/WorkerGlobalScope.cpp:
1562         (WebCore::WorkerGlobalScope::importScripts):
1563
1564 2015-05-29  Alex Christensen  <achristensen@webkit.org>
1565
1566         Unreviewed build fix when using content extensions debugging.
1567
1568         * contentextensions/ContentExtensionCompiler.cpp:
1569         (WebCore::ContentExtensions::compileRuleList):
1570         Update variable name.
1571
1572 2015-05-29  Brady Eidson  <beidson@apple.com>
1573
1574         Typo followup to r184987
1575
1576         Unreviewed.
1577
1578         * loader/FrameLoader.cpp:
1579         (WebCore::FrameLoader::loadURLIntoChildFrame): Misplaced brace.
1580
1581 2015-05-29  Brady Eidson  <beidson@apple.com>
1582
1583         Small FrameLoader refactoring.
1584         https://bugs.webkit.org/show_bug.cgi?id=145459
1585
1586         Reviewed by Alex Christensen.
1587
1588         No new tests (No behavior change).
1589
1590         * loader/FrameLoader.cpp:
1591         (WebCore::FrameLoader::loadURLIntoChildFrame):
1592         (WebCore::FrameLoader::loadFrameRequest):
1593         (WebCore::FrameLoader::loadURL):
1594         (WebCore::FrameLoader::loadPostRequest):
1595         * loader/FrameLoader.h:
1596
1597 2015-05-29  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1598
1599         MediaDevices.getUserMedia should reject promise instead of throwing exceptions
1600         https://bugs.webkit.org/show_bug.cgi?id=145282
1601
1602         Reviewed by Darin Adler.
1603
1604         Ensuring at the custom binding level that all potential errors are used to reject promise.
1605         Cleaned up the wrappers by removing unneeded RefPtr.
1606
1607         Covered by modified test.
1608
1609         * Modules/mediastream/MediaDevices.cpp:
1610         (WebCore::MediaDevices::getUserMedia):
1611         * Modules/mediastream/MediaDevices.h:
1612         * Modules/mediastream/UserMediaRequest.cpp:
1613         (WebCore::UserMediaRequest::create):
1614         * bindings/js/JSMediaDevicesCustom.cpp:
1615         (WebCore::JSMediaDevices::getUserMedia):
1616
1617 2015-05-28  Hunseop Jeong  <hs85.jeong@samsung.com>
1618
1619         Replaced 0 with nullptr in WebCore/accessibility.
1620         https://bugs.webkit.org/show_bug.cgi?id=145309
1621
1622         Reviewed by Chris Fleizach.
1623
1624         No new tests, no behavior change.
1625
1626         * accessibility/AccessibilityRenderObject.cpp:
1627         (WebCore::AccessibilityRenderObject::mathPrescripts):
1628         (WebCore::AccessibilityRenderObject::mathPostscripts):
1629         * accessibility/AccessibilityScrollView.cpp:
1630         (WebCore::AccessibilityScrollView::scrollBar):
1631         * accessibility/atk/AXObjectCacheAtk.cpp:
1632         (WebCore::notifyChildrenSelectionChange):
1633         * accessibility/atk/WebKitAccessibleHyperlink.cpp:
1634         (webkitAccessibleHyperlinkInit):
1635         * accessibility/atk/WebKitAccessibleInterfaceDocument.cpp:
1636         (webkitAccessibleDocumentGetAttributes):
1637         * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
1638         (getAttributeSetForAccessibilityObject):
1639         (attributeSetDifference):
1640         * accessibility/atk/WebKitAccessibleUtil.h:
1641         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
1642         (webkitAccessibleRefChild):
1643         (webkitAccessibleGetAttributes):
1644         (webkitAccessibleGetObjectLocale):
1645         (getInterfaceMaskFromObject):
1646         (objectFocusedAndCaretOffsetUnignored):
1647         (cacheAndReturnAtkProperty):
1648
1649 2015-05-28  Zalan Bujtas  <zalan@apple.com>
1650
1651         Subpixel rendering: Pixel crack in text selection of simple text in <textarea>.
1652         https://bugs.webkit.org/show_bug.cgi?id=145393
1653         rdar://problem/19918941
1654
1655         Reviewed by Darin Adler.
1656
1657         Float to LayoutUnit conversion is lossy. To ensure that selection
1658         painting always lines up (snaps) properly, the calculated width needs to
1659         be adjusted by ceiling the float to the next LayoutUnit value.
1660
1661         Test: fast/text/hidpi-text-selection-gap-between-words.html
1662
1663         * platform/graphics/FontCascade.cpp:
1664         (WebCore::FontCascade::adjustSelectionRectForSimpleText):
1665         * platform/graphics/cocoa/FontCascadeCocoa.mm:
1666         (WebCore::FontCascade::adjustSelectionRectForComplexText):
1667
1668 2015-05-28  Andreas Kling  <akling@apple.com>
1669
1670         GraphicsLayerCA should start out with m_intersectsCoverageRect=false
1671         <https://webkit.org/b/145443>
1672         <rdar://problem/19685798>
1673
1674         Reviewed by Simon Fraser.
1675
1676         Since the coverage rect of a newly-constructed GraphicsLayerCA is always empty,
1677         there's no way that the layer's own bounding box can intersect with it.
1678         Hence the m_intersectsCoverageRect flag should be false after construction.
1679
1680         This fixes an issue where compositing layers in subframes would be marked as
1681         non-volatile, despite being far outside the viewport and coverage rect.
1682
1683         Test: compositing/visible-rect/iframe-with-layers-outside-viewport.html
1684
1685         * platform/graphics/ca/GraphicsLayerCA.cpp:
1686         (WebCore::GraphicsLayerCA::GraphicsLayerCA):
1687
1688 2015-05-28  Commit Queue  <commit-queue@webkit.org>
1689
1690         Unreviewed, rolling out r184796 and r184832.
1691         https://bugs.webkit.org/show_bug.cgi?id=145449
1692
1693         2% performance regression (Requested by litherum on #webkit).
1694
1695         Reverted changesets:
1696
1697         "[Cocoa] Use CTFontDrawGlyphs() instead of
1698         CGContextShowGlyphsWithAdvances()/CGContextShowGlyphsAtPositions()"
1699         https://bugs.webkit.org/show_bug.cgi?id=145234
1700         http://trac.webkit.org/changeset/184796
1701
1702         "Cleanup after r184796"
1703         https://bugs.webkit.org/show_bug.cgi?id=145333
1704         http://trac.webkit.org/changeset/184832
1705
1706 2015-05-28  Matt Rajca  <mrajca@apple.com>
1707
1708         Rename HTMLMediaSession to MediaElementSession to reserve "media session" for the Media Session API.
1709         https://bugs.webkit.org/show_bug.cgi?id=145440
1710
1711         Reviewed by Eric Carlson.
1712
1713         * CMakeLists.txt:
1714         * WebCore.vcxproj/WebCore.vcxproj:
1715         * WebCore.vcxproj/WebCore.vcxproj.filters:
1716         * WebCore.xcodeproj/project.pbxproj:
1717         * html/HTMLMediaElement.cpp:
1718         (WebCore::HTMLMediaElement::HTMLMediaElement):
1719         (WebCore::HTMLMediaElement::loadInternal):
1720         (WebCore::HTMLMediaElement::loadResource):
1721         (WebCore::HTMLMediaElement::suspend):
1722         (WebCore::HTMLMediaElement::resume):
1723         (WebCore::HTMLMediaElement::removeBehaviorsRestrictionsAfterFirstUserGesture):
1724         (WebCore::HTMLMediaElement::mediaState):
1725         * html/HTMLMediaElement.h:
1726         (WebCore::HTMLMediaElement::mediaSession):
1727         * html/MediaElementSession.cpp: Renamed from Source/WebCore/html/HTMLMediaSession.cpp.
1728         (WebCore::restrictionName):
1729         (WebCore::MediaElementSession::MediaElementSession):
1730         (WebCore::MediaElementSession::registerWithDocument):
1731         (WebCore::MediaElementSession::unregisterWithDocument):
1732         (WebCore::MediaElementSession::addBehaviorRestriction):
1733         (WebCore::MediaElementSession::removeBehaviorRestriction):
1734         (WebCore::MediaElementSession::playbackPermitted):
1735         (WebCore::MediaElementSession::dataLoadingPermitted):
1736         (WebCore::MediaElementSession::fullscreenPermitted):
1737         (WebCore::MediaElementSession::pageAllowsDataLoading):
1738         (WebCore::MediaElementSession::pageAllowsPlaybackAfterResuming):
1739         (WebCore::MediaElementSession::showPlaybackTargetPicker):
1740         (WebCore::MediaElementSession::hasWirelessPlaybackTargets):
1741         (WebCore::MediaElementSession::wirelessVideoPlaybackDisabled):
1742         (WebCore::MediaElementSession::setWirelessVideoPlaybackDisabled):
1743         (WebCore::MediaElementSession::setHasPlaybackTargetAvailabilityListeners):
1744         (WebCore::MediaElementSession::setPlaybackTarget):
1745         (WebCore::MediaElementSession::targetAvailabilityChangedTimerFired):
1746         (WebCore::MediaElementSession::externalOutputDeviceAvailableDidChange):
1747         (WebCore::MediaElementSession::canPlayToWirelessPlaybackTarget):
1748         (WebCore::MediaElementSession::isPlayingToWirelessPlaybackTarget):
1749         (WebCore::MediaElementSession::setShouldPlayToPlaybackTarget):
1750         (WebCore::MediaElementSession::mediaStateDidChange):
1751         (WebCore::MediaElementSession::effectivePreloadForElement):
1752         (WebCore::MediaElementSession::requiresFullscreenForVideoPlayback):
1753         (WebCore::MediaElementSession::mediaEngineUpdated):
1754         (WebCore::MediaElementSession::allowsAlternateFullscreen):
1755         (WebCore::MediaElementSession::maximumMediaSourceBufferSize):
1756         * html/MediaElementSession.h: Renamed from Source/WebCore/html/HTMLMediaSession.h.
1757         * testing/Internals.cpp:
1758         (WebCore::Internals::setMediaElementRestrictions):
1759         (WebCore::Internals::setAudioContextRestrictions):
1760
1761 2015-05-28  Myles C. Maxfield  <mmaxfield@apple.com>
1762
1763         Crash under ICU with ASAN during editing/selection/move-by-word-visually-crash-test-5.html
1764         https://bugs.webkit.org/show_bug.cgi?id=145429
1765         <rdar://problem/20992218>
1766
1767         Reviewed by Alexey Proskuryakov.
1768
1769         WebKit uses some strings which contain the lower 8-bits of UTF-16 (thereby saving space). However,
1770         ICU doesn't understand this encoding. When we want to use ICU functions with strings in this encoding,
1771         we create a UTextProvider which converts our encoded strings to UTF-16 for ICU, one chunk at a time.
1772         This object contains a vtable which we populate to perform the conversion.
1773
1774         The WebKit function which actually returns the UTF-16 chunks has two relevant arguments: an index into
1775         the encoded string which ICU is requesting, and a direction from that index which ICU is interested
1776         in. This function populates a "chunk" which is characterized by a pointer to a buffer, the length of
1777         the populated data in the buffer, and an offset into the chunk which represents the index that the
1778         requested character was put into.
1779
1780         When ICU requests data going backward, we fill in the chunk accordingly, with the requested character
1781         all the way at the end. We then set the offset equal to the length of the buffer. However, this length
1782         value is stale from the previous time the function ran. Therefore, ICU was reading the wrong index in
1783         the chunk when expecting the requested character.
1784
1785         Covered by editing/selection/move-by-word-visually-crash-test-5.html.
1786
1787         * platform/text/icu/UTextProviderLatin1.cpp:
1788         (WebCore::uTextLatin1Access):
1789
1790 2015-05-28  Eric Carlson  <eric.carlson@apple.com>
1791
1792         [iOS] Fix controls bug caused by r184794
1793         https://bugs.webkit.org/show_bug.cgi?id=145445
1794
1795         Reviewed by Dean Jackson.
1796
1797         * Modules/mediacontrols/mediaControlsiOS.js:
1798         (ControllerIOS.prototype.showControls): Check video.controls instead of trying to call
1799         showInlinePlaybackPlaceholderOnly, which doesn't exist.
1800
1801 2015-05-28  Said Abou-Hallawa  <sabouhallawa@apple.com>
1802
1803         Code clean up for extracting information from the mix of WritingMode and TextDirection
1804         https://bugs.webkit.org/show_bug.cgi?id=143399
1805
1806         Reviewed by Darin Adler.
1807         
1808         There should be eight TextFlows. A TextFlow consists of two directions.
1809         The first one controls the inline growing direction and the second one
1810         controls the block growing direction. We are going to use the cardinal
1811         directions to define these combinations.
1812
1813         We need to extract the following information easily from the TextFlow
1814
1815         -- isTextFlowReversed() // RTL
1816         -- isTextFlowFlipped()  // the opposite direction to normal
1817         -- isTextFlowVertical() // The line grows vertically
1818         
1819         Mixing WritingMode and TextDirection into TextFlow and choosing their values
1820         carefully to ease implementing the above functions can make things clearer.
1821
1822         * Modules/notifications/Notification.h:
1823         * platform/graphics/TextRun.h:
1824         * platform/ios/SelectionRect.h:
1825         * platform/text/BidiResolver.h:
1826         * platform/text/StringWithDirection.h:
1827         * platform/text/TextFlags.h:
1828         (WebCore::isLeftToRightDirection): Deleted.
1829         enum TextDirection is moved from TextFlags.h to WritingMode.h. So include
1830         WritingMode.h instead of including TextFlags.h.
1831         
1832         * css/CSSProperty.cpp:
1833         (WebCore::resolveToPhysicalProperty): Instead of handling the eight possible
1834         cases of the text flows one by one, we can map from a LogicalSide to a
1835         PhysicalSide using the TextFlow value.
1836         
1837         * platform/LengthBox.h:
1838         (WebCore::BoxExtent::before):
1839         (WebCore::BoxExtent::after):
1840         (WebCore::BoxExtent::start):
1841         (WebCore::BoxExtent::end):
1842         Use mapLogicalSideToPhysicalSide() to convert from a LogicalSide to a PhysicalSide.
1843         
1844         * platform/text/WritingMode.h:
1845         (WebCore::isLeftToRightDirection): Usually the default enum is defined
1846         first. And usually the default value is equal to zero. Since LTR is the
1847         default for the text direction, it should be defined before RTL.
1848         
1849         (WebCore::makeTextFlow): Returns a TextFlow given a WritingMode and a
1850         TextDirection.
1851         
1852         (WebCore::isReversedTextFlow): Returns true if the text direction is RTL.
1853         
1854         (WebCore::isFlippedTextFlow):
1855         (WebCore::isFlippedWritingMode): Returns true if the block growing direction
1856         is in the opposite direction of normal.
1857         
1858         (WebCore::isVerticalTextFlow):
1859         (WebCore::isVerticalWritingMode): Returns true if the line grows vertically.
1860                
1861         (WebCore::isHorizontalWritingMode):
1862         (WebCore::isFlippedLinesWritingMode): Use isVerticalWritingMode() and 
1863         isFlippedWritingMode() to answer these questions.
1864         
1865         (WebCore::isHorizontalPhysicalSide): 
1866         (WebCore::mirrorPhysicalSide): top <-> bottom and left <-> right conversion.
1867         (WebCore::rotatePhysicalSide): top <-> left and right <-> bottom conversion.
1868         
1869         (WebCore::mapLogicalSideToPhysicalSide): Maps a LogicalSide to a PhysicalSide
1870         using either the TextFlow or the WritingMode.
1871         
1872         (WebCore::isFlippedBlocksWritingMode): Deleted.
1873         * rendering/RenderMultiColumnSet.cpp:
1874         (WebCore::RenderMultiColumnSet::collectLayerFragments):
1875         (WebCore::RenderMultiColumnSet::columnTranslationForOffset):
1876         * rendering/shapes/Shape.cpp:
1877         (WebCore::physicalRectToLogical):
1878         (WebCore::physicalPointToLogical):
1879         * rendering/style/RenderStyle.h:
1880         Rename isFlippedBlocksWritingMode() to be isFlippedWritingMode() so we can
1881         be consistent with other WritingMode query functions.
1882
1883 2015-05-28  Matt Rajca  <mrajca@apple.com>
1884
1885         Add ENABLE_MEDIA_SESSION feature flag (which is off by default).
1886         https://bugs.webkit.org/show_bug.cgi?id=145415
1887
1888         Reviewed by Eric Carlson.
1889
1890         * Configurations/FeatureDefines.xcconfig:
1891
1892 2015-05-28  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
1893
1894         [Streams API] ReadableStreamReader should not be exposed
1895         https://bugs.webkit.org/show_bug.cgi?id=143564
1896
1897         Reviewed by Darin Adler.
1898
1899         Covered by rebased tests.
1900
1901         * Modules/streams/ReadableStreamReader.idl: Adding NoInterfaceObject to ReadableStreamReader.idl.
1902
1903 2015-05-28  Carlos Alberto Lopez Perez  <clopez@igalia.com>
1904
1905         [CMake] Improve detection and usage of GL/GLES/EGL libraries.
1906         https://bugs.webkit.org/show_bug.cgi?id=145408
1907
1908         Reviewed by Carlos Garcia Campos.
1909
1910         No new tests, no behavior changes.
1911
1912         * CMakeLists.txt: Ensure that we include the libraries and includes
1913         for the GL/GLESv2/EGL libraries before including the ANGLE directories.
1914         Define also any CFLAG that the system GL/GLESv2/EGL libraries may need.
1915         * PlatformEfl.cmake: Remove some includes that are now unneeded,
1916         because we are including now the EGL libraries on CMakeLists.txt
1917         * PlatformGTK.cmake: Remove unneeded include (We are including the EGL
1918         libraries now on CMakeLists.txt)
1919
1920 2015-05-28  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1921
1922         Binding generator should support interfaces with CustomConstructor and NoInterfaceObject
1923         https://bugs.webkit.org/show_bug.cgi?id=145016
1924
1925         Reviewed by Darin Adler.
1926
1927         Updated code generator to generate the necessary declarations (constructor property in the prototype, the constructor class).
1928         In the case of CustomConstructor with NoInterfaceObject, the implementation of the constructor property related JS function is changed as follow:
1929         It creates a constructor object and shadows the constructor property JS function with this object.
1930         This ensures that only one constructor object is created per prototype.
1931         The constructor is not exposed as it is not added to the global object constructor map.
1932
1933         NoInterfaceObject is asking to not make the interface visible, which is contradictory with having a visible constructor of the interface.
1934         The case for having NoInterfaceObject and CustomConstructor is the following:
1935         We do not want to expose the interface but we still want to have a constructor property on the prototype of objects implementing the interface.
1936         One such case is https://streams.spec.whatwg.org/#globals
1937
1938         Added TestCustomConstructorWithNoInterfaceObject.idl to check that case.
1939
1940         * bindings/scripts/CodeGeneratorJS.pm:
1941         (GenerateHeader):
1942         (GenerateAttributesHashTable):
1943         (GenerateImplementation):
1944         (HasConstructorProperty):
1945         * bindings/scripts/test/GObject/WebKitDOMTestCustomConstructorWithNoInterfaceObject.cpp: Added.
1946         (WebKit::kit):
1947         (WebKit::core):
1948         (WebKit::wrapTestCustomConstructorWithNoInterfaceObject):
1949         (webkit_dom_test_custom_constructor_with_no_interface_object_finalize):
1950         (webkit_dom_test_custom_constructor_with_no_interface_object_constructor):
1951         (webkit_dom_test_custom_constructor_with_no_interface_object_class_init):
1952         (webkit_dom_test_custom_constructor_with_no_interface_object_init):
1953         * bindings/scripts/test/GObject/WebKitDOMTestCustomConstructorWithNoInterfaceObject.h: Added.
1954         * bindings/scripts/test/GObject/WebKitDOMTestCustomConstructorWithNoInterfaceObjectPrivate.h: Added.
1955         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp: Added.
1956         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectPrototype::create):
1957         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectPrototype::createStructure):
1958         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectPrototype::JSTestCustomConstructorWithNoInterfaceObjectPrototype):
1959         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::create):
1960         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::createStructure):
1961         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::JSTestCustomConstructorWithNoInterfaceObjectConstructor):
1962         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::finishCreation):
1963         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::getConstructData):
1964         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectPrototype::finishCreation):
1965         (WebCore::JSTestCustomConstructorWithNoInterfaceObject::JSTestCustomConstructorWithNoInterfaceObject):
1966         (WebCore::JSTestCustomConstructorWithNoInterfaceObject::createPrototype):
1967         (WebCore::JSTestCustomConstructorWithNoInterfaceObject::getPrototype):
1968         (WebCore::JSTestCustomConstructorWithNoInterfaceObject::destroy):
1969         (WebCore::JSTestCustomConstructorWithNoInterfaceObject::~JSTestCustomConstructorWithNoInterfaceObject):
1970         (WebCore::jsTestCustomConstructorWithNoInterfaceObjectConstructor):
1971         (WebCore::JSTestCustomConstructorWithNoInterfaceObject::getConstructor):
1972         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectOwner::isReachableFromOpaqueRoots):
1973         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectOwner::finalize):
1974         (WebCore::toJS):
1975         (WebCore::JSTestCustomConstructorWithNoInterfaceObject::toWrapped):
1976         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h: Added.
1977         (WebCore::wrapperOwner):
1978         (WebCore::toJS):
1979         * bindings/scripts/test/ObjC/DOMTestCustomConstructorWithNoInterfaceObject.h: Added.
1980         * bindings/scripts/test/ObjC/DOMTestCustomConstructorWithNoInterfaceObject.mm: Added.
1981         (-[DOMTestCustomConstructorWithNoInterfaceObject dealloc]):
1982         (-[DOMTestCustomConstructorWithNoInterfaceObject finalize]):
1983         (core):
1984         (kit):
1985         * bindings/scripts/test/ObjC/DOMTestCustomConstructorWithNoInterfaceObjectInternal.h: Added.
1986         * bindings/scripts/test/TestCustomConstructor.idl: Added.
1987
1988 2015-05-19  Jon Honeycutt  <jhoneycutt@apple.com>
1989
1990         [iOS] When viewing an MJPEG stream as the main resource, only the first
1991         frame paints
1992
1993         <https://bugs.webkit.org/show_bug.cgi?id=145185>
1994         <rdar://problem/20124694>
1995
1996         This bug is caused by state not being restored between successive loads
1997         of multipart/x-mixed-replace content. Each part of the stream is not
1998         treated as a wholly new load, so if state is cleared as part of the
1999         previous page being destroyed, it may not be restored when loading
2000         the next stream part.
2001
2002         On WK1, tile cache updates are disabled in FrameView::clear(), which is
2003         called as the previous page is destroyed, but were not being
2004         reenabled when loading new replacement content from the stream.
2005
2006         On WK2, the exposed content rect was being reset to an empty rect as
2007         the previous page was destroyed, but it was not being reset by loading
2008         replacement content.
2009
2010         To fix these issues, I added two WebFrameLoaderClient callbacks;
2011         willReplaceMultipartContent() and didReplaceMultipartContent(). These
2012         are used to save and restore state between successive loads.
2013
2014         Reviewed by Darin Adler.
2015
2016         * loader/DocumentLoader.cpp:
2017         Call the new client callbacks.
2018         (WebCore::DocumentLoader::commitLoad):
2019         If replacing content in a multipart/x-mixed-replace stream, call the
2020         WebFrameLoaderClient's didReplaceMultipartContent().
2021
2022         (WebCore::DocumentLoader::setupForReplace):
2023         Call the WebFrameLoaderClient's willReplaceMultipartContent().
2024
2025         * loader/EmptyClients.h:
2026
2027         * loader/FrameLoaderClient.h:
2028
2029         * page/FrameView.cpp:
2030         (WebCore::FrameView::didReplaceMultipartContent):
2031         Re-enable tile cache updates that were disabled in FrameView::clear().
2032         This fixes the issue for WK1.
2033
2034         * page/FrameView.h:
2035         Declare an exported function, didReplaceMultipartContent(), that WebKit
2036         can call.
2037
2038 2015-05-27  Brady Eidson  <beidson@apple.com>
2039
2040         Remove unused ResourceRequest "user initiated" flag.
2041         https://bugs.webkit.org/show_bug.cgi?id=145428
2042
2043         Reviewed by Alexey Proskuryakov.
2044
2045         No new tests (No change in behavior).
2046
2047         * platform/ios/WebCoreSystemInterfaceIOS.mm:
2048         * platform/mac/WebCoreSystemInterface.mm:
2049
2050         * platform/network/ResourceRequestBase.h:
2051         (WebCore::ResourceRequestBase::initiatedByUserGesture): Deleted.
2052         (WebCore::ResourceRequestBase::setInitiatedByUserGesture): Deleted.
2053         (WebCore::ResourceRequestBase::encodeWithoutPlatformData): Deleted.
2054         (WebCore::ResourceRequestBase::decodeWithoutPlatformData): Deleted.
2055
2056         * platform/network/cf/ResourceRequestCFNet.cpp:
2057         (WebCore::ResourceRequest::doUpdatePlatformRequest): Deleted.
2058         (WebCore::ResourceRequest::doUpdateResourceRequest): Deleted.
2059
2060         * platform/network/cocoa/ResourceRequestCocoa.mm:
2061         (WebCore::ResourceRequest::doUpdateResourceRequest): Deleted.
2062         (WebCore::ResourceRequest::doUpdatePlatformRequest): Deleted.
2063
2064 2015-05-27  Brady Eidson  <beidson@apple.com>
2065
2066         Add a "should open urls externally" flag to DocumentLoader.
2067         rdar://problem/21025301 and https://bugs.webkit.org/show_bug.cgi?id=145417
2068
2069         Reviewed by Geoff Garen.
2070
2071         No new tests (No change in behavior, testable at API level with a followup patch)
2072
2073         * loader/DocumentLoader.cpp:
2074         (WebCore::DocumentLoader::setTriggeringAction): Apply the current flag value to the 
2075           new NavigationAction so it can be used later.
2076         * loader/DocumentLoader.h:
2077         (WebCore::DocumentLoader::setShouldOpenExternalURLsPolicy):
2078         (WebCore::DocumentLoader::shouldOpenExternalURLsPolicy):
2079         (WebCore::DocumentLoader::setTriggeringAction): Deleted.
2080
2081         FrameLoadRequest should hold the new flag to pass into FrameLoader machinery:
2082         * loader/FrameLoadRequest.h:
2083         (WebCore::FrameLoadRequest::setShouldOpenExternalURLsPolicy):
2084         (WebCore::FrameLoadRequest::shouldOpenExternalURLsPolicy):
2085
2086         * loader/FrameLoader.cpp:
2087         (WebCore::FrameLoader::load): Set the flag on the newly created DocumentLoader but
2088           only if it is for the main frame.
2089
2090         * loader/FrameLoaderTypes.h: Add a new enum for the flag.
2091
2092         Navigation action should hold the new flag to pass to the policy delegate:
2093         * loader/NavigationAction.cpp:
2094         (WebCore::NavigationAction::NavigationAction):
2095         * loader/NavigationAction.h:
2096         (WebCore::NavigationAction::shouldOpenExternalURLsPolicy):
2097         (WebCore::NavigationAction::setShouldOpenExternalURLsPolicy):
2098
2099         * loader/PolicyChecker.cpp:
2100         (WebCore::PolicyChecker::checkNavigationPolicy): Include the flag from the DocumentLoader
2101           in the NavigationAction.
2102
2103 2015-05-27  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
2104
2105         Purge PassRefPtr in WebCore/Modules - 2
2106         https://bugs.webkit.org/show_bug.cgi?id=145304
2107
2108         Reviewed by Darin Adler.
2109
2110         As a step to remove PassRefPtr, this patch replaces PassRefPtr with Ref or RefPtr.
2111
2112         No new tests, no behavior changes
2113
2114         * Modules/mediasource/SourceBufferList.h:
2115         * Modules/mediastream/AllAudioCapabilities.h:
2116         (WebCore::AllAudioCapabilities::create):
2117         * Modules/mediastream/AllVideoCapabilities.h:
2118         (WebCore::AllVideoCapabilities::create):
2119         * Modules/mediastream/CapabilityRange.cpp:
2120         (WebCore::CapabilityRange::create):
2121         * Modules/mediastream/CapabilityRange.h:
2122         * Modules/mediastream/MediaSourceStates.cpp:
2123         (WebCore::MediaSourceStates::create):
2124         * Modules/mediastream/MediaStream.cpp:
2125         (WebCore::MediaStream::create):
2126         * Modules/mediastream/MediaStreamTrack.cpp:
2127         (WebCore::MediaStreamTrack::create):
2128         * Modules/mediastream/MediaStreamTrackSourcesRequest.cpp:
2129         (WebCore::MediaStreamTrackSourcesRequest::create):
2130         * Modules/mediastream/MediaTrackConstraint.cpp:
2131         (WebCore::MediaTrackConstraint::create):
2132         * Modules/mediastream/MediaTrackConstraint.h:
2133         * Modules/mediastream/RTCConfiguration.h:
2134         (WebCore::RTCConfiguration::create):
2135         * Modules/mediastream/RTCIceServer.h:
2136         (WebCore::RTCIceServer::create):
2137         * Modules/mediastream/RTCSessionDescription.cpp:
2138         (WebCore::RTCSessionDescription::create):
2139         * Modules/mediastream/RTCSessionDescription.h:
2140         * Modules/mediastream/RTCSessionDescriptionRequestImpl.cpp:
2141         (WebCore::RTCSessionDescriptionRequestImpl::create):
2142         * Modules/mediastream/RTCStatsReport.cpp:
2143         (WebCore::RTCStatsReport::create):
2144         * Modules/mediastream/RTCStatsReport.h:
2145         * Modules/mediastream/RTCStatsRequestImpl.cpp:
2146         (WebCore::RTCStatsRequestImpl::create):
2147         * Modules/mediastream/RTCStatsRequestImpl.h:
2148         * Modules/mediastream/RTCStatsResponse.cpp:
2149         (WebCore::RTCStatsResponse::create):
2150         * Modules/mediastream/RTCStatsResponse.h:
2151         * Modules/mediastream/RTCVoidRequestImpl.cpp:
2152         (WebCore::RTCVoidRequestImpl::create):
2153         * Modules/mediastream/RTCVoidRequestImpl.h:
2154         * Modules/mediastream/SourceInfo.cpp:
2155         (WebCore::SourceInfo::create):
2156         * Modules/mediastream/SourceInfo.h:
2157         * Modules/mediastream/UserMediaRequest.cpp:
2158         (WebCore::UserMediaRequest::create):
2159         * Modules/mediastream/UserMediaRequest.h:
2160         * Modules/quota/StorageInfo.h:
2161         (WebCore::StorageInfo::create):
2162         * Modules/quota/StorageQuota.h:
2163         (WebCore::StorageQuota::create):
2164         * Modules/speech/SpeechSynthesis.cpp:
2165         (WebCore::SpeechSynthesis::create):
2166         * Modules/speech/SpeechSynthesis.h:
2167         * Modules/speech/SpeechSynthesisUtterance.cpp:
2168         (WebCore::SpeechSynthesisUtterance::create):
2169         * Modules/speech/SpeechSynthesisUtterance.h:
2170         * Modules/speech/SpeechSynthesisVoice.cpp:
2171         (WebCore::SpeechSynthesisVoice::create):
2172         * Modules/speech/SpeechSynthesisVoice.h:
2173         * Modules/webaudio/ChannelMergerNode.cpp:
2174         (WebCore::ChannelMergerNode::create):
2175         * Modules/webaudio/ChannelMergerNode.h:
2176         * Modules/webaudio/ChannelSplitterNode.cpp:
2177         (WebCore::ChannelSplitterNode::create):
2178         * Modules/webaudio/ChannelSplitterNode.h:
2179         * Modules/webaudio/DefaultAudioDestinationNode.h:
2180         (WebCore::DefaultAudioDestinationNode::create):
2181         * Modules/webaudio/GainNode.h:
2182         (WebCore::GainNode::create):
2183         * Modules/webaudio/MediaElementAudioSourceNode.cpp:
2184         (WebCore::MediaElementAudioSourceNode::create):
2185         * Modules/webaudio/MediaElementAudioSourceNode.h:
2186         * Modules/webaudio/MediaStreamAudioDestinationNode.cpp:
2187         (WebCore::MediaStreamAudioDestinationNode::create):
2188         * Modules/webaudio/MediaStreamAudioDestinationNode.h:
2189         * Modules/webaudio/MediaStreamAudioSource.cpp:
2190         (WebCore::MediaStreamAudioSource::create):
2191         * Modules/webaudio/MediaStreamAudioSource.h:
2192         * Modules/webaudio/MediaStreamAudioSourceNode.cpp:
2193         (WebCore::MediaStreamAudioSourceNode::create):
2194         * Modules/webaudio/MediaStreamAudioSourceNode.h:
2195         * Modules/webaudio/OscillatorNode.cpp:
2196         (WebCore::OscillatorNode::setType):
2197         * Modules/webaudio/PannerNode.h:
2198         (WebCore::PannerNode::create):
2199         * Modules/webaudio/PeriodicWave.cpp:
2200         (WebCore::PeriodicWave::create):
2201         (WebCore::PeriodicWave::createSine):
2202         (WebCore::PeriodicWave::createSquare):
2203         (WebCore::PeriodicWave::createSawtooth):
2204         (WebCore::PeriodicWave::createTriangle):
2205         * Modules/webaudio/PeriodicWave.h:
2206         * Modules/webaudio/ScriptProcessorNode.cpp:
2207         (WebCore::ScriptProcessorNode::create):
2208         * Modules/webaudio/ScriptProcessorNode.h:
2209         * Modules/webaudio/WaveShaperNode.h:
2210         (WebCore::WaveShaperNode::create):
2211
2212 2015-05-27  Simon Fraser  <simon.fraser@apple.com>
2213
2214         REGRESSION (r183820): webkit.org/blog/ background painting issue on reload, when the page contains videos
2215         https://bugs.webkit.org/show_bug.cgi?id=145420
2216
2217         Reviewed by Dean Jackson.
2218
2219         After r183820, the media controls no longer had a wrapper that created CSS stacking context.
2220         The media controls on Mac use mix-blend-mode, which causes the compositing code to look for
2221         a stacking context ancestor and make it composited. After this change, it would walk up
2222         to a layer outside of the media element (e.g. the document element's layer), and make
2223         that composited. This triggered bugs with root background painting.
2224
2225         Prevent mix-blend-mode affecting content outside the media elements by having the media element's
2226         layer act as a stacking context.
2227
2228         Test: media/controls-layers.html
2229
2230         * rendering/RenderLayer.cpp:
2231         (WebCore::RenderLayer::RenderLayer):
2232         * rendering/RenderLayer.h:
2233
2234 2015-05-27  Andreas Kling  <akling@apple.com>
2235
2236         [WK2] Local storage areas should get torn down when they have no remaining references.
2237         <https://webkit.org/b/143339>
2238         <rdar://problem/20156436>
2239
2240         Reviewed by Darin Adler.
2241
2242         Add StorageArea::securityOrigin() implementations.
2243
2244         * loader/EmptyClients.cpp:
2245         * storage/StorageArea.h:
2246
2247 2015-05-27  Dean Jackson  <dino@apple.com>
2248
2249         img.currentSrc problem in strict mode with old picturefill
2250         https://bugs.webkit.org/show_bug.cgi?id=144095
2251         <rdar://problem/21087013>
2252
2253         Reviewed by Simon Fraser.
2254
2255         Add a PICTURE_SIZES flag. This allows us to easily remove the currentSrc
2256         attribute on HTMLImageElement, which is causing some issues with
2257         <picture> polyfills.
2258
2259         * Configurations/FeatureDefines.xcconfig:
2260         * html/HTMLImageElement.cpp:
2261         (WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate): Add guard around use of m_currentSrc.
2262         * html/HTMLImageElement.h:
2263         * html/HTMLImageElement.idl: Guard the currentSrc attribute.
2264         * html/parser/HTMLPreloadScanner.cpp:
2265         (WebCore::TokenPreloadScanner::StartTagScanner::processAttributes):
2266         (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):
2267
2268 2015-05-27  Daniel Bates  <dabates@apple.com>
2269
2270         Attempt to fix internal build following <http://trac.webkit.org/changeset/184760>
2271         (https://bugs.webkit.org/show_bug.cgi?id=145289)
2272
2273         Reviewed by Jer Noble.
2274
2275         * platform/spi/mac/AVFoundationSPI.h:
2276
2277 2015-05-27  Jeremy Jones  <jeremyj@apple.com>
2278
2279         Refactor WebKit1 specific threading code out of WebVideoFullscreen code that is shared with WebKit2.
2280         https://bugs.webkit.org/show_bug.cgi?id=143954
2281
2282         Reviewed by Darin Adler.
2283
2284         WebVideoFullscreenInterfaceAVKit is used in both WebKit1 and WebKit2. In WebKit1, the model runs in the WebThread, while
2285         the interface is on the main thread. So there is code to dispatch between these two thread when communicating between the
2286         interface and the model. In WebKit2, this is handled automatically by the IPC mechanism. As a result, the threading code
2287         in WebVideoFullscreenbInterfaceAVKit and in WebVideoFullscreenModelVideoElement is redundant in WebKit2 and relies on
2288         WebThreadRun being a no-op in WebKit2.
2289
2290         This change clarifies this and simplifies the WebKit2 path by moving the WebKit1 specific threading code into
2291         WebVideoFullscreenControllerContext, which is the WebKit1 specific controller.
2292
2293         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
2294         (WebVideoFullscreenControllerContext::WebVideoFullscreenControllerContext):
2295         (WebVideoFullscreenControllerContext::setController):
2296         (WebVideoFullscreenControllerContext::didSetupFullscreen):
2297         (WebVideoFullscreenControllerContext::didExitFullscreen):
2298         (WebVideoFullscreenControllerContext::didCleanupFullscreen):
2299         (WebVideoFullscreenControllerContext::fullscreenMayReturnToInline):
2300         (WebVideoFullscreenControllerContext::resetMediaState):
2301         (WebVideoFullscreenControllerContext::setDuration):
2302         (WebVideoFullscreenControllerContext::setCurrentTime):
2303         (WebVideoFullscreenControllerContext::setBufferedTime):
2304         (WebVideoFullscreenControllerContext::setRate):
2305         (WebVideoFullscreenControllerContext::setVideoDimensions):
2306         (WebVideoFullscreenControllerContext::setSeekableRanges):
2307         (WebVideoFullscreenControllerContext::setCanPlayFastReverse):
2308         (WebVideoFullscreenControllerContext::setAudioMediaSelectionOptions):
2309         (WebVideoFullscreenControllerContext::setLegibleMediaSelectionOptions):
2310         (WebVideoFullscreenControllerContext::setExternalPlayback):
2311         (WebVideoFullscreenControllerContext::play):
2312         (WebVideoFullscreenControllerContext::pause):
2313         (WebVideoFullscreenControllerContext::togglePlayState):
2314         (WebVideoFullscreenControllerContext::beginScrubbing):
2315         (WebVideoFullscreenControllerContext::endScrubbing):
2316         (WebVideoFullscreenControllerContext::seekToTime):
2317         (WebVideoFullscreenControllerContext::fastSeek):
2318         (WebVideoFullscreenControllerContext::beginScanningForward):
2319         (WebVideoFullscreenControllerContext::beginScanningBackward):
2320         (WebVideoFullscreenControllerContext::endScanning):
2321         (WebVideoFullscreenControllerContext::requestExitFullscreen):
2322         (WebVideoFullscreenControllerContext::setVideoLayerFrame):
2323         (WebVideoFullscreenControllerContext::setVideoLayerGravity):
2324         (WebVideoFullscreenControllerContext::selectAudioMediaOption):
2325         (WebVideoFullscreenControllerContext::selectLegibleMediaOption):
2326         (WebVideoFullscreenControllerContext::fullscreenModeChanged):
2327         (WebVideoFullscreenControllerContext::setupFullscreen):
2328         (WebVideoFullscreenControllerContext::exitFullscreen):
2329         (WebVideoFullscreenControllerContext::requestHideAndExitFullscreen):
2330         (-[WebVideoFullscreenController init]):
2331         (-[WebVideoFullscreenController dealloc]):
2332         (-[WebVideoFullscreenController enterFullscreen:mode:]):
2333         (-[WebVideoFullscreenController exitFullscreen]):
2334         (-[WebVideoFullscreenController requestHideAndExitFullscreen]):
2335         (-[WebVideoFullscreenController didFinishFullscreen:]):
2336         (WebVideoFullscreenControllerChangeObserver::setTarget): Deleted.
2337         (-[WebVideoFullscreenController didSetupFullscreen]): Deleted.
2338         (-[WebVideoFullscreenController didEnterFullscreen]): Deleted.
2339         (-[WebVideoFullscreenController didExitFullscreen]): Deleted.
2340         (-[WebVideoFullscreenController didCleanupFullscreen]): Deleted.
2341         (-[WebVideoFullscreenController fullscreenMayReturnToInline]): Deleted.
2342         * platform/ios/WebVideoFullscreenInterfaceAVKit.h:
2343         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
2344         (-[WebAVVideoLayer setBounds:]):
2345         (-[WebAVVideoLayer resolveBounds]):
2346         (WebVideoFullscreenInterfaceAVKit::resetMediaState):
2347         (WebVideoFullscreenInterfaceAVKit::setDuration):
2348         (WebVideoFullscreenInterfaceAVKit::setCurrentTime):
2349         (WebVideoFullscreenInterfaceAVKit::setBufferedTime):
2350         (WebVideoFullscreenInterfaceAVKit::setRate):
2351         (WebVideoFullscreenInterfaceAVKit::setVideoDimensions):
2352         (WebVideoFullscreenInterfaceAVKit::setSeekableRanges):
2353         (WebVideoFullscreenInterfaceAVKit::setCanPlayFastReverse):
2354         (WebVideoFullscreenInterfaceAVKit::setAudioMediaSelectionOptions):
2355         (WebVideoFullscreenInterfaceAVKit::setLegibleMediaSelectionOptions):
2356         (WebVideoFullscreenInterfaceAVKit::setExternalPlayback):
2357         (WebVideoFullscreenInterfaceAVKit::setupFullscreen):
2358         (WebVideoFullscreenInterfaceAVKit::enterFullscreen):
2359         (WebVideoFullscreenInterfaceAVKit::enterFullscreenStandard):
2360         (WebVideoFullscreenInterfaceAVKit::exitFullscreen):
2361         (WebVideoFullscreenInterfaceAVKit::exitFullscreenInternal):
2362         (WebVideoFullscreenInterfaceAVKit::cleanupFullscreen):
2363         (WebVideoFullscreenInterfaceAVKit::cleanupFullscreenInternal):
2364         (WebVideoFullscreenInterfaceAVKit::requestHideAndExitFullscreen):
2365         (WebVideoFullscreenInterfaceAVKit::preparedToReturnToInline):
2366         (WebVideoFullscreenInterfaceAVKit::willStartOptimizedFullscreen):
2367         (WebVideoFullscreenInterfaceAVKit::didStartOptimizedFullscreen):
2368         (WebVideoFullscreenInterfaceAVKit::willStopOptimizedFullscreen):
2369         (WebVideoFullscreenInterfaceAVKit::didStopOptimizedFullscreen):
2370         (WebVideoFullscreenInterfaceAVKit::willCancelOptimizedFullscreen):
2371         (WebVideoFullscreenInterfaceAVKit::didCancelOptimizedFullscreen):
2372         (WebVideoFullscreenInterfaceAVKit::setVideoLayerFrame):
2373         (WebVideoFullscreenInterfaceAVKit::setupFullscreenInternal): Deleted.
2374         * platform/ios/WebVideoFullscreenModel.h:
2375         * platform/ios/WebVideoFullscreenModelVideoElement.h:
2376         * platform/ios/WebVideoFullscreenModelVideoElement.mm:
2377         (WebVideoFullscreenModelVideoElement::setVideoFullscreenLayer):
2378         (WebVideoFullscreenModelVideoElement::play):
2379         (WebVideoFullscreenModelVideoElement::pause):
2380         (WebVideoFullscreenModelVideoElement::togglePlayState):
2381         (WebVideoFullscreenModelVideoElement::beginScrubbing):
2382         (WebVideoFullscreenModelVideoElement::endScrubbing):
2383         (WebVideoFullscreenModelVideoElement::seekToTime):
2384         (WebVideoFullscreenModelVideoElement::fastSeek):
2385         (WebVideoFullscreenModelVideoElement::beginScanningForward):
2386         (WebVideoFullscreenModelVideoElement::beginScanningBackward):
2387         (WebVideoFullscreenModelVideoElement::endScanning):
2388         (WebVideoFullscreenModelVideoElement::requestExitFullscreen):
2389         (WebVideoFullscreenModelVideoElement::fullscreenModeChanged):
2390         (WebVideoFullscreenModelVideoElement::videoLayerFrame): Deleted.
2391         (WebVideoFullscreenModelVideoElement::videoLayerGravity): Deleted.
2392
2393 2015-05-27  Eric Carlson  <eric.carlson@apple.com>
2394
2395         [Mac] short-circuit MIME type lookup when possible
2396         https://bugs.webkit.org/show_bug.cgi?id=145362
2397
2398         Reviewed by Jer Noble.
2399
2400         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2401         (WebCore::isUnsupportedMIMEType): Renamed from unsupportedMIMEType. Convert type to lower case
2402         once instead of calling equalIgnoringCase many times.
2403         (WebCore::staticMIMETypeList): Renamed from staticMimeTypeCache. Initialize static set in a lambda,
2404         using an array of C strings in a loop.
2405         (WebCore::avfMIMETypes): Renamed from avfMimeTypeCache. Initialize static set in a lambda.
2406         (WebCore::MediaPlayerPrivateAVFoundationObjC::getSupportedTypes): avfMimeTypeCache -> avfMIMETypes.
2407         (WebCore::keySystemIsSupported): equalIgnoringCase -> equalIgnoringASCIICase.
2408         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsType): Ditto.
2409         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsKeySystem): unsupportedMIMEType -> 
2410         isUnsupportedMIMEType, equalIgnoringCase -> equalIgnoringASCIICase, staticMimeTypeCache -> 
2411         staticMIMETypeList, avfMimeTypeCache -> avfMIMETypes.
2412         (WebCore::unsupportedMIMEType): Deleted.
2413         (WebCore::staticMimeTypeCache): Deleted.
2414         (WebCore::avfMimeTypeCache): Deleted.
2415
2416 2015-05-27  Eric Carlson  <eric.carlson@apple.com>
2417
2418         [Mac] short-circuit MIME type lookup when possible
2419         https://bugs.webkit.org/show_bug.cgi?id=145362
2420
2421         Reviewed by Dean Jackson.
2422
2423         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2424         (WebCore::unsupportedMIMEType): New, reject types known to not be supported.
2425         (WebCore::staticMimeTypeCache): Accept MIME types known to be supported.
2426         (WebCore::avfMimeTypeCache): Renamed from mimeTypeCache.
2427         (WebCore::MediaPlayerPrivateAVFoundationObjC::getSupportedTypes): mimeTypeCache -> staticMimeTypeCache.
2428         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsType): Return immediately if
2429         unsupportedMIMEType returns true, don't call AVFoundation if staticMimeTypeCache returns true.
2430         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsKeySystem): Ditto.
2431         (WebCore::mimeTypeCache): Deleted.
2432
2433 2015-05-27  Eric Carlson  <eric.carlson@apple.com>
2434
2435         [Mac] occasional crash in MediaPlayerPrivateAVFoundationObjC::didStopLoadingRequest
2436         https://bugs.webkit.org/show_bug.cgi?id=145409
2437
2438         Reviewed by Dean Jackson.
2439
2440         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
2441         (WebCore::WebCoreAVFResourceLoader::stopLoading): NULL-check m_avRequest.
2442
2443 2015-05-26  Dean Jackson  <dino@apple.com>
2444
2445         Backdrop filters don't animate
2446         https://bugs.webkit.org/show_bug.cgi?id=145386
2447         <rdar://problem/21110037>
2448
2449         Reviewed by Simon Fraser.
2450
2451         Add support for animation of backdrop filters.
2452
2453         Note that, at the moment, we can only animate/transition
2454         backdrop-filter if it is already present on the element. See
2455         https://bugs.webkit.org/show_bug.cgi?id=145107
2456
2457         Test: css3/filters/backdrop/animation.html
2458
2459         * page/animation/AnimationBase.h: Add m_backdropFilterFunctionListsMatch and backdropFilterFunctionListsMatch.
2460         (WebCore::AnimationBase::backdropFilterFunctionListsMatch):
2461
2462         * page/animation/CSSPropertyAnimation.cpp:
2463         (WebCore::blendFunc): backdrop-filter is also supported.
2464         (WebCore::PropertyWrapperAcceleratedBackdropFilter::PropertyWrapperAcceleratedBackdropFilter): Added. Works
2465         similarly to the PropertyWrapperAcceleratedFilter.
2466         (WebCore::PropertyWrapperAcceleratedBackdropFilter::animationIsAccelerated):
2467         (WebCore::PropertyWrapperAcceleratedBackdropFilter::blend):
2468         (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap): Construct the
2469         PropertyWrapperAcceleratedBackdropFilter.
2470
2471         * page/animation/ImplicitAnimation.cpp:
2472         (WebCore::ImplicitAnimation::reset): Call checkForMatchingBackdropFilterFunctionLists.
2473         (WebCore::ImplicitAnimation::validateTransformFunctionList): Fix typo.
2474         (WebCore::ImplicitAnimation::checkForMatchingFilterFunctionLists): Remove whitespace.
2475         (WebCore::ImplicitAnimation::checkForMatchingBackdropFilterFunctionLists): New method that
2476         checks if the individual filters in a filter list match.
2477         * page/animation/ImplicitAnimation.h: Add checkForMatchingBackdropFilterFunctionLists.
2478
2479         * page/animation/KeyframeAnimation.cpp:
2480         (WebCore::KeyframeAnimation::KeyframeAnimation): Call checkForMatchingBackdropFilterFunctionLists.
2481         (WebCore::KeyframeAnimation::checkForMatchingBackdropFilterFunctionLists): Copied from
2482         checkForMatchingFilterFunctionLists, but calls backdropFilter() instead of filter().
2483         (WebCore::KeyframeAnimation::checkForMatchingFilterFunctionLists): This was accidentally checking
2484         for backdrop filters as well, but it wouldn't have worked.
2485         * page/animation/KeyframeAnimation.h: Add checkForMatchingBackdropFilterFunctionLists.
2486
2487         * platform/graphics/GraphicsLayer.cpp:
2488         (WebCore::GraphicsLayer::validateFilterOperations): Modify the ASSERT to allow AnimatedPropertyWebkitBackdropFilter.
2489         * platform/graphics/GraphicsLayerClient.h: Add AnimatedPropertyWebkitBackdropFilter to the enum.
2490
2491         * platform/graphics/ca/GraphicsLayerCA.cpp:
2492         (WebCore::propertyIdToString): Support new enum.
2493         (WebCore::GraphicsLayerCA::addAnimation): Support AnimatedPropertyWebkitBackdropFilter.
2494         (WebCore::GraphicsLayerCA::createFilterAnimationsFromKeyframes): Ditto.
2495         (WebCore::GraphicsLayerCA::animatedLayer): Use a switch statement now that we have more than
2496         two options, and handle AnimatedPropertyWebkitBackdropFilter.
2497         (WebCore::GraphicsLayerCA::updateAnimations): Deleted a blank line.
2498
2499         * rendering/RenderLayerBacking.cpp:
2500         (WebCore::RenderLayerBacking::startAnimation): Support animation of backdrop-filter.
2501         (WebCore::RenderLayerBacking::startTransition): Ditto. Copied the code from the filter transition.
2502         (WebCore::RenderLayerBacking::graphicsLayerToCSSProperty):
2503         (WebCore::RenderLayerBacking::cssToGraphicsLayerProperty):
2504         * rendering/RenderLayerCompositor.cpp:
2505         (WebCore::RenderLayerCompositor::requiresCompositingForAnimation):
2506
2507 2015-05-27  Jeremy Jones  <jeremyj@apple.com>
2508
2509         Handle case where -startOptimizedFullscreen fails.
2510         https://bugs.webkit.org/show_bug.cgi?id=145340
2511
2512         Reviewed by Eric Carlson.
2513
2514         Add new AVPlayerViewController delegate methods and remove old ones.
2515         -startOptimizedFullscreen can either fail silently because it is not allowed or it will call a delegate.
2516         We prevent silent failure by testing preconditions in enterFullscreenOptimized, and add the 
2517         delegate -playerViewControllerFailedToStartOptimizedFullscreen to handle explicitly failure.
2518
2519         * platform/ios/WebVideoFullscreenInterfaceAVKit.h: added/removed method declarations.
2520         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm: 
2521         (-[WebAVPlayerController playerViewControllerFailedToStartOptimizedFullscreen:withError:]): Added.
2522         (WebVideoFullscreenInterfaceAVKit::enterFullscreenOptimized): Handle silent failure.
2523         (WebVideoFullscreenInterfaceAVKit::didStartOptimizedFullscreen): Hide window on main thread.
2524         (WebVideoFullscreenInterfaceAVKit::failedToStartOptimizedFullscreen): Added
2525         (-[WebAVPlayerController playerViewControllerWillCancelOptimizedFullscreen:]): Deleted.
2526         (-[WebAVPlayerController playerViewControllerDidCancelOptimizedFullscreen:]): Deleted.
2527         (WebVideoFullscreenInterfaceAVKit::willCancelOptimizedFullscreen): Deleted.
2528         (WebVideoFullscreenInterfaceAVKit::didCancelOptimizedFullscreen): Deleted.
2529         * platform/spi/cocoa/AVKitSPI.h: Remove dead SPI. Add isOptimizedFullscreenPossible.
2530
2531 2015-05-27  Myles C. Maxfield  <mmaxfield@apple.com>
2532
2533         [iOS] Arabic ligatures are broken in Google Maps
2534         https://bugs.webkit.org/show_bug.cgi?id=145336
2535         <rdar://problem/20689607>
2536
2537         Reviewed by Darin Adler.
2538
2539         When we fall off the end of the font fallback list, we ask the platform for which particular font we should use
2540         to display a particular codepoint. When we do this, we supply the font which is first in the fallback list so
2541         that the platform can try to match it as best it can. However, web fonts' FontPlatformData have a null m_font
2542         property, which means that we were passing nullptr to this platform fallback function.
2543
2544         The solution is something I've wanted to do for a while, which is migrate webfonts from using
2545         CGDataProviderCreateWithCFData() to using CTFontManagerCreateFontDescriptorFromData(). This call creates a
2546         CoreText font for an in-memory buffer (the old call was creating a CoreGraphics front from the same thing).
2547         This means that we can use the FontPlatformData constructor which accepts a CoreText font, thereby making web
2548         fonts not have a null m_font property. Note that not all platforms can use this call, which means that this
2549         new codepath is gated to only certain OSes (which is okay because only certain OSes use the
2550         CTFontCreatePhysicalFontDescriptorForCharactersWithLanguage() call inside FontCache). Because web fonts are the
2551         only user of the constructor which just takes a CG font, we can make the constructor private to the
2552         FontPlatformData class (as soon as all platforms can use this new codepath).
2553
2554         Test: platform/ios-simulator/fast/text/arabic-with-no-supporting-webfont.html
2555
2556         * platform/graphics/FontPlatformData.h: Make the FontPlatformData constructor which takes a CGFontRef private.
2557         * platform/graphics/mac/FontCustomPlatformData.cpp:
2558         (WebCore::FontCustomPlatformData::fontPlatformData): Use the CoreText type instead of the CoreGraphics type.
2559         (WebCore::createFontCustomPlatformData): Migrate to CTFontManagerCreateFontDescriptorFromData().
2560         * platform/graphics/mac/FontCustomPlatformData.h:
2561         (WebCore::FontCustomPlatformData::FontCustomPlatformData): Store a CTFontDescriptorRef instead of a CGFontRef.
2562
2563 2015-05-26  Said Abou-Hallawa  <sabouhallawa@apple.com>
2564
2565         An SVG with no intrinsic size does not draw correct slices when used as a border-image for an HTML element.
2566         https://bugs.webkit.org/show_bug.cgi?id=139405
2567
2568         Reviewed by Darin Adler.
2569         
2570         When using a non-intrinsic-sized image as an image-border, all the source
2571         slices have to be extracted from the top-left corner of the source image.
2572         This is because the right and bottom sides of the image can not be known.
2573         Also all the slices should not be stretched. In other words, the sizes of
2574         source slices for a non-intrinsic-sized image should be equal to the sizes
2575         of the destination container slices.
2576
2577         This is not compliant with the css3 w3c specs. I think the specs makes it
2578         harder to predict what exactly will be drawn for the image-border in this
2579         case. See http://www.w3.org/TR/css3-background/#border-image-slice. This
2580         approach is implemented by FireFox. And I think it gives a more predictable 
2581         rendering for image-border in the case of non-intrinsic-sized images.
2582         
2583         Test: fast/borders/border-image-fill-no-intrinsic-size.html
2584
2585         * CMakeLists.txt:
2586         * WebCore.vcxproj/WebCore.vcxproj:
2587         * WebCore.vcxproj/WebCore.vcxproj.filters:
2588         * WebCore.xcodeproj/project.pbxproj:
2589         * platform/LengthBox.cpp: Removed.
2590         * platform/graphics/LayoutBoxExtent.cpp: Removed.
2591         * platform/graphics/LayoutBoxExtent.h: Removed.
2592         * platform/graphics/LayoutRect.h:
2593         Delete LengthBox.cpp and move all the functionalities to LengthBox.h.
2594         Delete LayoutBoxExtent.cpp since it is the same class as LengthBox.
2595         
2596         * css/CSSProperty.cpp:
2597         * platform/text/WritingMode.h:
2598         Move the enums LogicalBoxSide and PhysicalBoxSide
2599         from CSSProperty.cpp to WritingMode.h so it can be used by other classes.
2600         
2601         * css/CSSToStyleMap.cpp:
2602         (WebCore::CSSToStyleMap::mapNinePieceImageSlice):
2603         (WebCore::CSSToStyleMap::mapNinePieceImageQuad):
2604         * css/CSSToStyleMap.h:
2605         * inspector/InspectorOverlay.cpp:
2606         (WebCore::buildRendererHighlight):
2607         * rendering/InlineFlowBox.cpp:
2608         (WebCore::InlineFlowBox::addBorderOutsetVisualOverflow):
2609         * rendering/RenderBox.h:
2610         (WebCore::RenderBox::marginLogicalLeft):
2611         (WebCore::RenderBox::marginLogicalRight):
2612         (WebCore::RenderBox::setMarginBefore):
2613         (WebCore::RenderBox::setMarginAfter):
2614         (WebCore::RenderBox::setMarginStart):
2615         (WebCore::RenderBox::setMarginEnd):
2616         * rendering/style/RenderStyle.cpp:
2617         (WebCore::RenderStyle::setClip):
2618         (WebCore::RenderStyle::noneDashboardRegions):
2619         * rendering/style/RenderStyle.h:
2620         Use the new BoxExtent access methods for getting and settings the sides of
2621         LengthBox and LayoutBoxExtent.
2622         
2623         * platform/LengthBox.h:
2624         (WebCore::BoxExtent::BoxExtent):
2625         (WebCore::BoxExtent::at):
2626         (WebCore::BoxExtent::top):
2627         (WebCore::BoxExtent::right):
2628         (WebCore::BoxExtent::bottom):
2629         (WebCore::BoxExtent::left):
2630         (WebCore::BoxExtent::setAt):
2631         (WebCore::BoxExtent::setTop):
2632         (WebCore::BoxExtent::setRight):
2633         (WebCore::BoxExtent::setBottom):
2634         (WebCore::BoxExtent::setLeft):
2635         (WebCore::BoxExtent::before):
2636         (WebCore::BoxExtent::end):
2637         (WebCore::BoxExtent::after):
2638         (WebCore::BoxExtent::start):
2639         (WebCore::BoxExtent::setBefore):
2640         (WebCore::BoxExtent::setEnd):
2641         (WebCore::BoxExtent::setAfter):
2642         (WebCore::BoxExtent::setStart):
2643         (WebCore::BoxExtent::operator==):
2644         (WebCore::BoxExtent::operator!=):
2645         (WebCore::LengthBox::LengthBox):
2646         (WebCore::LengthBox::isZero):
2647         (WebCore::LengthBox::left): Deleted.
2648         (WebCore::LengthBox::right): Deleted.
2649         (WebCore::LengthBox::top): Deleted.
2650         (WebCore::LengthBox::bottom): Deleted.
2651         (WebCore::LengthBox::operator==): Deleted.
2652         (WebCore::LengthBox::operator!=): Deleted.
2653         (WebCore::LengthBox::nonZero): Deleted.
2654         Define a new template class for 'BoxExtent'. A 'BoxExtent' represents the
2655         extent of four sides of a box. Use this class template to define the exiting 
2656         classes 'LengthBox' and 'LayoutBoxExtent'. Use it also to and define the
2657         new class FloatBoxExtent
2658             
2659         * rendering/RenderBoxModelObject.cpp:
2660         (WebCore::RenderBoxModelObject::calculateImageIntrinsicDimensions):
2661         * rendering/RenderBoxModelObject.h:
2662         (WebCore::RenderBoxModelObject::calculateFillTileSize):
2663         * rendering/RenderListMarker.cpp:
2664         (WebCore::RenderListMarker::updateContent):
2665         * rendering/shapes/ShapeOutsideInfo.cpp:
2666         (WebCore::ShapeOutsideInfo::createShapeForImage):
2667         Change the return value of calculateImageIntrinsicDimensions() to be a
2668         bool which indicates whether the image has an intrinsic size or not. Add
2669         a new reference argument to this function receive the resolved image size.
2670         
2671         (WebCore::RenderBoxModelObject::paintNinePieceImage): Move all the painting
2672         code of this function to NinePieceImage::paint()
2673         
2674         (WebCore::computeBorderImageSide): Deleted.
2675         Renamed to be NinePieceImage::computeSlice().
2676         
2677         * rendering/style/BorderData.h:
2678         (WebCore::BorderData::borderWidth): Add a new method to return the extents
2679         of the border in a FloatBoxExtent.
2680         
2681         * rendering/style/NinePieceImage.cpp:
2682         (WebCore::NinePieceImage::computeSlice): Moved from NinePieceImage::computeSlice().
2683         
2684         (WebCore::NinePieceImage::computeSlices): The first version of this function
2685         computes the slices given their lengths. The slices have to be clamped to
2686         the container size. The second version of this function computes the slices
2687         given their lengths, their actual extents and their source slices.
2688         
2689         (WebCore::NinePieceImage::scaleSlicesIfNeeded):  Reduce the slices if they
2690         are too large.
2691         
2692         (WebCore::NinePieceImage::isEmptyPieceRect): Returns true if an ImagePiece
2693         should not be drawn.
2694         
2695         (WebCore::NinePieceImage::horizontalTileRules):
2696         (WebCore::NinePieceImage::verticalTileRules):
2697         Fill vectors of tiling rules to be passed to GraphicsContext::drawTiledImage()
2698         
2699         (WebCore::NinePieceImage::computeIntrinsicRects): Computes the nine pieces
2700         rectangles for an intrinsic-sized container.
2701         
2702         (WebCore::NinePieceImage::computeNonIntrinsicRects): Computes the nine
2703         pieces rectangles for an non-intrinsic-sized source image. The computed
2704         rectangles have to start at (0, 0) and their sizes should be equal to
2705         the sizes of the nine pieces rectangles of the destination container.
2706         
2707         (WebCore::NinePieceImage::computeIntrinsicSideTileScale):
2708         (WebCore::NinePieceImage::computeIntrinsicMiddleTileScale):
2709         (WebCore::NinePieceImage::computeIntrinsicTileScales):
2710         (WebCore::NinePieceImage::computeNonIntrinsicTileScales):
2711         Computes the scaling factors for drawing the tiles. For non-intrinsic source
2712         images, there should not be any scaling factors. 
2713         
2714         (WebCore::NinePieceImage::paint): Moved from RenderBoxModelObject::paintNinePieceImage()
2715         but simplified and restructured.
2716         
2717         (WebCore::NinePieceImageData::NinePieceImageData): Use nullptr instead of 0.
2718         
2719         * rendering/style/NinePieceImage.h:
2720         (WebCore::operator++):
2721         (WebCore::isCornerPiece): 
2722         (WebCore::isMiddlePiece):
2723         (WebCore::imagePieceHorizontalSide):
2724         (WebCore::imagePieceVerticalSide):
2725         Add helper functions for the enum ImagePiece.
2726
2727 2015-05-26  Andreas Kling  <akling@apple.com>
2728
2729         <font face> doesn't support plus character in font family names.
2730         <https://webkit.org/b/145400>
2731         <rdar://problem/21097484>
2732
2733         Reviewed by Darin Adler.
2734
2735         Turn CSSParser::parseFontFaceValue() into a fast-path parser for
2736         <font face> attributes.
2737         Going through the full CSS parser was hurting us here, as it would
2738         misunderstand unquoted family names and choke on e.g '+'.
2739
2740         Test: fast/dom/HTMLFontElement/face-attribute.html
2741
2742         * css/CSSParser.cpp:
2743         (WebCore::CSSParser::parseFontFaceValue):
2744
2745 2015-05-26  Chris Fleizach  <cfleizach@apple.com>
2746
2747         AX: display:none content exposed to accessibility when aria-hidden is toggled on ancestor element
2748         https://bugs.webkit.org/show_bug.cgi?id=139142
2749
2750         Reviewed by Darin Adler.
2751      
2752         Amend the code that determines when an invisible, but aria-hidden=false, element is exposed to accessibility.
2753
2754         The new guideline is that you must have aria-hidden=false on every node that is not rendered (except text which inherits)
2755         otherwise the element will not be visible.
2756
2757         Modified existing test: accessibility/aria-hidden-false-works-in-subtrees.html
2758
2759         * accessibility/AXObjectCache.cpp:
2760         (WebCore::isNodeAriaVisible):
2761         (WebCore::AXObjectCache::rootWebArea):
2762
2763 2015-05-26  Roger Fong  <roger_fong@apple.com>
2764
2765         Enable element unsigned index in WebGL2 again.
2766         https://bugs.webkit.org/show_bug.cgi?id=145392
2767         <rdar://problem/21112585>.
2768
2769         Reviewed by Dean Jackson.
2770
2771         * html/canvas/WebGLRenderingContextBase.cpp:
2772         (WebCore::WebGLRenderingContextBase::validateDrawElements):
2773         Fix some incorrect logic that disables the feature for WebGL2.
2774
2775 2015-05-26  Chris Dumez  <cdumez@apple.com>
2776
2777         Add assertions to make sure pages in the PageCache are not loading
2778         https://bugs.webkit.org/show_bug.cgi?id=145397
2779         <rdar://problem/20613631>
2780
2781         Reviewed by Antti Koivisto.
2782
2783         Add assertions to make sure pages in the PageCache are not loading.
2784         These will hopefully help track down why PacheCache entries sometimes
2785         have pending subresource loads when being destroyed.
2786
2787         * history/CachedFrame.cpp:
2788         (WebCore::CachedFrame::CachedFrame):
2789         * loader/DocumentLoader.cpp:
2790         (WebCore::DocumentLoader::stopLoadingSubresources):
2791         (WebCore::DocumentLoader::addSubresourceLoader):
2792
2793 2015-05-26  Commit Queue  <commit-queue@webkit.org>
2794
2795         Unreviewed, rolling out r184872.
2796         https://bugs.webkit.org/show_bug.cgi?id=145396
2797
2798         Bindings tests broken on the bots. (Requested by dethbakin on
2799         #webkit).
2800
2801         Reverted changeset:
2802
2803         "Binding generator should support interfaces with
2804         CustomConstructor and NoInterfaceObject"
2805         https://bugs.webkit.org/show_bug.cgi?id=145016
2806         http://trac.webkit.org/changeset/184872
2807
2808 2015-05-26  Zalan Bujtas  <zalan@apple.com>
2809
2810         Overhanging float sets are not cleaned up properly when floating renderer is destroyed.
2811         https://bugs.webkit.org/show_bug.cgi?id=145323
2812         rdar://problem/20980628
2813
2814         Reviewed by Dave Hyatt.
2815
2816         This patch ensures when an overhanging float renderer is destroyed,
2817         all the sibling containers' floating object set(m_floatingObjects) gets properly cleaned up.
2818
2819         When an overhanging float is present, we cache the renderer on the parent and on the affected
2820         sibling containers too. (RenderBlockFlow::m_floatingObjects) These caches(sets) get cleared and repopulated
2821         during ::layout(). In order to have a float renderer removed from a set, a layout needs to be initiated on the container.
2822         This is normally done through RenderBlockFlow::markSiblingsWithFloatsForLayout() and RenderBlockFlow::markAllDescendantsWithFloatsForLayout().
2823         However, when the float container's parent's writing direction changes (and we promote the children containers to new formatting contexts),
2824         the layout propagation through siblings does not work anymore.
2825
2826         The avoidsFloats() check in RenderBlockFlow::markSiblingsWithFloatsForLayout() has very little performance gain, but it prevents us
2827         from propagating layout to siblings when certain properties of the parent container changes.
2828
2829         Test: fast/block/float/crash-when-floating-object-is-removed.xhtml
2830
2831         * rendering/RenderBlockFlow.cpp:
2832         (WebCore::RenderBlockFlow::markSiblingsWithFloatsForLayout):
2833         * rendering/RenderBox.cpp:
2834         (WebCore::outermostBlockContainingFloatingObject):
2835         (WebCore::RenderBox::removeFloatingOrPositionedChildFromBlockLists):
2836         (WebCore::RenderBox::outermostBlockContainingFloatingObject): Deleted.
2837         * rendering/RenderBox.h:
2838
2839 2015-05-26  Ryuan Choi  <ryuan.choi@navercorp.com>
2840
2841         [EFL][CoordinatedGraphics] Remove CoordinatedTileClient and CoordinatedTileBackend
2842         https://bugs.webkit.org/show_bug.cgi?id=133337
2843
2844         Reviewed by Darin Adler.
2845
2846         This patch simplifies relationship between CoordinatedGraphicsLayer and TiledBackingStore
2847         by removing TiledBackingStoreBackend because TiledBackingStore only support
2848         CoordinatedTileBackend.
2849         And it also moves CoordinatedTileClient interface to TiledBackingStoreClient.
2850
2851         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
2852         (WebCore::CoordinatedGraphicsLayer::createBackingStore):
2853         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
2854         * platform/graphics/texmap/coordinated/CoordinatedTile.cpp:
2855         (WebCore::CoordinatedTile::create):
2856         (WebCore::CoordinatedTile::CoordinatedTile):
2857         (WebCore::CoordinatedTile::~CoordinatedTile):
2858         (WebCore::CoordinatedTile::updateBackBuffer):
2859         (WebCore::CoordinatedTileBackend::CoordinatedTileBackend): Deleted.
2860         (WebCore::CoordinatedTileBackend::createTile): Deleted.
2861         (WebCore::CoordinatedTileBackend::paintCheckerPattern): Deleted.
2862         * platform/graphics/texmap/coordinated/CoordinatedTile.h:
2863         (WebCore::CoordinatedTile::create): Deleted.
2864         (WebCore::CoordinatedTileClient::~CoordinatedTileClient): Deleted.
2865         * platform/graphics/texmap/coordinated/TiledBackingStore.cpp:
2866         (WebCore::TiledBackingStore::TiledBackingStore):
2867         (WebCore::TiledBackingStore::createTiles):
2868         * platform/graphics/texmap/coordinated/TiledBackingStore.h:
2869         * platform/graphics/texmap/coordinated/TiledBackingStoreBackend.h: Removed.
2870         (WebCore::TiledBackingStoreBackend::~TiledBackingStoreBackend): Deleted.
2871         * platform/graphics/texmap/coordinated/TiledBackingStoreClient.h:
2872
2873 2015-05-26  Daegyu Lee  <daegyu.lee@navercorp.com>
2874
2875         Fullscreen video does not display on platforms without accelerated video rendering
2876         https://bugs.webkit.org/show_bug.cgi?id=145118
2877
2878         In order to paint video contents in fullscreen mode, add supportsAcceleratedRendering condition. 
2879
2880         Reviewed by Simon Fraser.
2881
2882         * rendering/RenderVideo.cpp:
2883         (WebCore::RenderVideo::paintReplaced):
2884
2885 2015-05-26  Said Abou-Hallawa  <sabouhallawa@apple.com>
2886
2887         SVG fragment identifier rendering issue
2888         https://bugs.webkit.org/show_bug.cgi?id=137328
2889
2890         Reviewed by Darin Adler.
2891
2892         This is a follow up for http://trac.webkit.org/changeset/164983. In this
2893         changeset, scrolling to the fragment should have been added before the
2894         the paint to guarantee setting the proper display position for the SVG
2895         fragment.
2896
2897         Test: svg/css/svg-resource-fragment-identifier-order.html
2898
2899         * svg/graphics/SVGImage.cpp:
2900         (WebCore::SVGImage::draw): Move view->scrollToFragment() before calling 
2901         view->paint().
2902
2903 2015-05-26  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2904
2905         Binding generator should support interfaces with CustomConstructor and NoInterfaceObject
2906         https://bugs.webkit.org/show_bug.cgi?id=145016
2907
2908         Reviewed by Darin Adler.
2909
2910         Updated code generator to generate the necessary declarations (constructor property in the prototype, the constructor class).
2911         In the case of CustomConstructor with NoInterfaceObject, the implementation of the constructor property related JS function is changed as follow:
2912         It creates a constructor object and shadows the constructor property JS function with this object.
2913         This ensures that only one constructor object is created per prototype.
2914         The constructor is not exposed as it is not added to the global object constructor map.
2915
2916         NoInterfaceObject is asking to not make the interface visible, which is contradictory with having a visible constructor of the interface.
2917         The case for having NoInterfaceObject and CustomConstructor is the following:
2918         We do not want to expose the interface but we still want to have a constructor property on the prototype of objects implementing the interface.
2919         One such case is https://streams.spec.whatwg.org/#globals
2920
2921         Added TestCustomConstructorWithNoInterfaceObject.idl to check that case.
2922
2923         * bindings/scripts/CodeGeneratorJS.pm:
2924         (GenerateHeader):
2925         (GenerateAttributesHashTable):
2926         (GenerateImplementation):
2927         (HasConstructorProperty):
2928         * bindings/scripts/test/GObject/WebKitDOMTestCustomConstructorWithNoInterfaceObject.cpp: Added.
2929         (WebKit::kit):
2930         (WebKit::core):
2931         (WebKit::wrapTestCustomConstructorWithNoInterfaceObject):
2932         (webkit_dom_test_custom_constructor_with_no_interface_object_finalize):
2933         (webkit_dom_test_custom_constructor_with_no_interface_object_constructor):
2934         (webkit_dom_test_custom_constructor_with_no_interface_object_class_init):
2935         (webkit_dom_test_custom_constructor_with_no_interface_object_init):
2936         * bindings/scripts/test/GObject/WebKitDOMTestCustomConstructorWithNoInterfaceObject.h: Added.
2937         * bindings/scripts/test/GObject/WebKitDOMTestCustomConstructorWithNoInterfaceObjectPrivate.h: Added.
2938         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp: Added.
2939         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectPrototype::create):
2940         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectPrototype::createStructure):
2941         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectPrototype::JSTestCustomConstructorWithNoInterfaceObjectPrototype):
2942         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::create):
2943         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::createStructure):
2944         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::JSTestCustomConstructorWithNoInterfaceObjectConstructor):
2945         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::finishCreation):
2946         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::getConstructData):
2947         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectPrototype::finishCreation):
2948         (WebCore::JSTestCustomConstructorWithNoInterfaceObject::JSTestCustomConstructorWithNoInterfaceObject):
2949         (WebCore::JSTestCustomConstructorWithNoInterfaceObject::createPrototype):
2950         (WebCore::JSTestCustomConstructorWithNoInterfaceObject::getPrototype):
2951         (WebCore::JSTestCustomConstructorWithNoInterfaceObject::destroy):
2952         (WebCore::JSTestCustomConstructorWithNoInterfaceObject::~JSTestCustomConstructorWithNoInterfaceObject):
2953         (WebCore::jsTestCustomConstructorWithNoInterfaceObjectConstructor):
2954         (WebCore::JSTestCustomConstructorWithNoInterfaceObject::getConstructor):
2955         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectOwner::isReachableFromOpaqueRoots):
2956         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectOwner::finalize):
2957         (WebCore::toJS):
2958         (WebCore::JSTestCustomConstructorWithNoInterfaceObject::toWrapped):
2959         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h: Added.
2960         (WebCore::wrapperOwner):
2961         (WebCore::toJS):
2962         * bindings/scripts/test/ObjC/DOMTestCustomConstructorWithNoInterfaceObject.h: Added.
2963         * bindings/scripts/test/ObjC/DOMTestCustomConstructorWithNoInterfaceObject.mm: Added.
2964         (-[DOMTestCustomConstructorWithNoInterfaceObject dealloc]):
2965         (-[DOMTestCustomConstructorWithNoInterfaceObject finalize]):
2966         (core):
2967         (kit):
2968         * bindings/scripts/test/ObjC/DOMTestCustomConstructorWithNoInterfaceObjectInternal.h: Added.
2969         * bindings/scripts/test/TestCustomConstructor.idl: Added.
2970
2971 2015-05-26  Joseph Pecoraro  <pecoraro@apple.com>
2972
2973         CSS properties (font-synthesis, column-fill) are missing in getComputedStyles
2974         https://bugs.webkit.org/show_bug.cgi?id=145343
2975
2976         Reviewed by Timothy Hatcher.
2977
2978         * css/CSSComputedStyleDeclaration.cpp:
2979
2980 2015-05-26  Dan Bernstein  <mitz@apple.com>
2981
2982         <rdar://problem/21104551> Update build settings
2983
2984         Reviewed by Anders Carlsson.
2985
2986         * Configurations/DebugRelease.xcconfig:
2987         * Configurations/FeatureDefines.xcconfig:
2988         * Configurations/Version.xcconfig:
2989
2990 2015-05-26  Csaba Osztrogonác  <ossy@webkit.org>
2991
2992         [ARM] Build SVGPathElement.cpp with -O2 due to a GCC bug
2993         https://bugs.webkit.org/show_bug.cgi?id=145377
2994
2995         Reviewed by Carlos Garcia Campos.
2996
2997         * CMakeLists.txt:
2998
2999 2015-05-25  Dan Bernstein  <mitz@apple.com>
3000
3001         Fixed a failing bindings test after r184853.
3002
3003         * bindings/scripts/CodeGeneratorObjC.pm:
3004         (GenerateImplementation): Removed an extraneous semicolon.
3005
3006 2015-05-25  Dan Bernstein  <mitz@apple.com>
3007
3008         ASSERT_MAIN_THREAD and DOM_ASSERT_MAIN_THREAD are unnecessary no-ops
3009         https://bugs.webkit.org/show_bug.cgi?id=145372
3010
3011         Reviewed by Sam Weinig.
3012
3013         * Configurations/Base.xcconfig: Removed DISABLE_THREAD_CHECK from DEBUG_DEFINES.
3014
3015         * bindings/objc/DOMAbstractView.mm:
3016         (-[DOMAbstractView dealloc]): Removed use of DOM_ASSERT_MAIN_THREAD.
3017         (kit): Ditto.
3018
3019         * bindings/objc/ExceptionHandlers.h: Removed definition of DOM_ASSERT_MAIN_THREAD.
3020
3021         * bindings/scripts/CodeGeneratorObjC.pm:
3022         (GenerateImplementation): Don’t emit DOM_ASSERT_MAIN_THREAD.
3023
3024         Updated expected bindings test results:
3025         * bindings/scripts/test/ObjC/DOMFloat64Array.mm:
3026         * bindings/scripts/test/ObjC/DOMTestActiveDOMObject.mm:
3027         * bindings/scripts/test/ObjC/DOMTestCallback.mm:
3028         * bindings/scripts/test/ObjC/DOMTestCustomNamedGetter.mm:
3029         * bindings/scripts/test/ObjC/DOMTestEventConstructor.mm:
3030         * bindings/scripts/test/ObjC/DOMTestEventTarget.mm:
3031         * bindings/scripts/test/ObjC/DOMTestException.mm:
3032         * bindings/scripts/test/ObjC/DOMTestGenerateIsReachable.mm:
3033         * bindings/scripts/test/ObjC/DOMTestInterface.mm:
3034         * bindings/scripts/test/ObjC/DOMTestMediaQueryListListener.mm:
3035         * bindings/scripts/test/ObjC/DOMTestNamedConstructor.mm:
3036         * bindings/scripts/test/ObjC/DOMTestNode.mm:
3037         * bindings/scripts/test/ObjC/DOMTestNondeterministic.mm:
3038         * bindings/scripts/test/ObjC/DOMTestObj.mm:
3039         * bindings/scripts/test/ObjC/DOMTestOverloadedConstructors.mm:
3040         * bindings/scripts/test/ObjC/DOMTestSerializedScriptValueInterface.mm:
3041         * bindings/scripts/test/ObjC/DOMTestTypedefs.mm:
3042         * bindings/scripts/test/ObjC/DOMattribute.mm:
3043         * bindings/scripts/test/ObjC/DOMreadonly.mm:
3044
3045 2015-05-25  Hunseop Jeong  <hs85.jeong@samsung.com>
3046
3047         Replaced 0 with nullptr in WebCore/svg.
3048         https://bugs.webkit.org/show_bug.cgi?id=145367
3049
3050         Reviewed by Gyuyoung Kim.
3051
3052         No new tests, no behavior changes.
3053
3054         * svg/PatternAttributes.h:
3055         (WebCore::PatternAttributes::PatternAttributes):
3056         * svg/SVGAnimatedType.h:
3057         * svg/SVGElement.cpp:
3058         (WebCore::SVGElement::cursorElementRemoved):
3059         (WebCore::SVGElement::cursorImageValueRemoved):
3060         (WebCore::SVGElement::getPresentationAttribute):
3061         * svg/SVGException.cpp:
3062         (WebCore::SVGException::initializeDescription):
3063         * svg/SVGFEImageElement.cpp:
3064         (WebCore::SVGFEImageElement::clearResourceReferences):
3065         * svg/SVGFontFaceElement.cpp:
3066         (WebCore::SVGFontFaceElement::SVGFontFaceElement):
3067         (WebCore::SVGFontFaceElement::removedFrom):
3068         * svg/SVGFontFaceUriElement.cpp:
3069         (WebCore::SVGFontFaceUriElement::loadFont):
3070         * svg/SVGLength.h:
3071         (WebCore::SVGLength::blend):
3072         * svg/SVGPathBlender.cpp:
3073         (WebCore::SVGPathBlender::SVGPathBlender):
3074         (WebCore::SVGPathBlender::cleanup):
3075         * svg/SVGPathBuilder.cpp:
3076         (WebCore::SVGPathBuilder::SVGPathBuilder):
3077         * svg/SVGPathBuilder.h:
3078         * svg/SVGPathByteStreamBuilder.cpp:
3079         (WebCore::SVGPathByteStreamBuilder::SVGPathByteStreamBuilder):
3080         * svg/SVGPathByteStreamBuilder.h:
3081         * svg/SVGPathElement.cpp:
3082         (WebCore::SVGPathElement::dPropertyInfo):
3083         * svg/SVGPathParser.cpp:
3084         (WebCore::SVGPathParser::SVGPathParser):
3085         (WebCore::SVGPathParser::cleanup):
3086         * svg/SVGPathSegListBuilder.cpp:
3087         (WebCore::SVGPathSegListBuilder::SVGPathSegListBuilder):
3088         * svg/SVGPathSegListBuilder.h:
3089         * svg/SVGPathTraversalStateBuilder.cpp:
3090         (WebCore::SVGPathTraversalStateBuilder::SVGPathTraversalStateBuilder):
3091         * svg/SVGPathUtilities.cpp:
3092         (WebCore::globalSVGPathBuilder):
3093         (WebCore::globalSVGPathSegListBuilder):
3094         (WebCore::globalSVGPathByteStreamBuilder):
3095         (WebCore::globalSVGPathStringBuilder):
3096         (WebCore::globalSVGPathTraversalStateBuilder):
3097         (WebCore::globalSVGPathParser):
3098         (WebCore::globalSVGPathBlender):
3099         * svg/SVGPolyElement.cpp:
3100         (WebCore::SVGPolyElement::pointsPropertyInfo):
3101         * svg/SVGTRefElement.cpp:
3102         (WebCore::SVGTRefTargetEventListener::cast):
3103         (WebCore::SVGTRefTargetEventListener::SVGTRefTargetEventListener):
3104         * svg/SVGTextContentElement.cpp:
3105         (WebCore::SVGTextContentElement::textLengthPropertyInfo):
3106         * svg/SVGURIReference.h:
3107         * svg/SVGViewSpec.cpp:
3108         (WebCore::SVGViewSpec::viewBoxPropertyInfo):
3109         (WebCore::SVGViewSpec::preserveAspectRatioPropertyInfo):
3110         (WebCore::SVGViewSpec::transformPropertyInfo):
3111         * svg/SVGViewSpec.h:
3112         (WebCore::SVGViewSpec::resetContextElement):
3113         * svg/animation/SMILTimeContainer.cpp:
3114         (WebCore::SMILTimeContainer::updateAnimations):
3115         * svg/animation/SVGSMILElement.cpp:
3116         (WebCore::ConditionEventListener::cast):
3117         (WebCore::ConditionEventListener::disconnectAnimation):
3118         (WebCore::SVGSMILElement::SVGSMILElement):
3119         (WebCore::SVGSMILElement::removedFrom):
3120         * svg/graphics/SVGImage.cpp:
3121         (WebCore::SVGImage::drawForContainer):
3122         * svg/graphics/filters/SVGFEImage.cpp:
3123         (WebCore::FEImage::FEImage):
3124         * svg/graphics/filters/SVGFilterBuilder.cpp:
3125         (WebCore::SVGFilterBuilder::clearEffects):
3126         * svg/properties/SVGAnimatedPathSegListPropertyTearOff.h:
3127         (WebCore::SVGAnimatedPathSegListPropertyTearOff::animationEnded):
3128         (WebCore::SVGAnimatedPathSegListPropertyTearOff::SVGAnimatedPathSegListPropertyTearOff):
3129         * svg/properties/SVGAnimatedPropertyDescription.h:
3130         (WebCore::SVGAnimatedPropertyDescription::SVGAnimatedPropertyDescription):
3131         * svg/properties/SVGAnimatedPropertyTearOff.h:
3132         (WebCore::SVGAnimatedPropertyTearOff::~SVGAnimatedPropertyTearOff):
3133         * svg/properties/SVGAnimatedStaticPropertyTearOff.h:
3134         (WebCore::SVGAnimatedStaticPropertyTearOff::animationEnded):
3135         (WebCore::SVGAnimatedStaticPropertyTearOff::SVGAnimatedStaticPropertyTearOff):
3136         * svg/properties/SVGPropertyTearOff.h:
3137         (WebCore::SVGPropertyTearOff::SVGPropertyTearOff):
3138
3139 2015-05-24  Sam Weinig  <sam@webkit.org>
3140
3141         Crash when using a removed ScriptMessageHandler
3142         <rdar://problem/20888499>
3143         https://bugs.webkit.org/show_bug.cgi?id=145359
3144
3145         Reviewed by Dan Bernstein.
3146
3147         Added tests:
3148             WKUserContentController.ScriptMessageHandlerBasicRemove
3149             WKUserContentController.ScriptMessageHandlerCallRemovedHandler
3150
3151         * page/UserMessageHandler.cpp:
3152         (WebCore::UserMessageHandler::~UserMessageHandler):
3153         (WebCore::UserMessageHandler::postMessage):
3154         (WebCore::UserMessageHandler::name):
3155         * page/UserMessageHandler.h:
3156         (WebCore::UserMessageHandler::create):
3157         * page/UserMessageHandler.idl:
3158         * page/UserMessageHandlerDescriptor.cpp:
3159         (WebCore::UserMessageHandlerDescriptor::UserMessageHandlerDescriptor):
3160         * page/UserMessageHandlerDescriptor.h:
3161         (WebCore::UserMessageHandlerDescriptor::client):
3162         (WebCore::UserMessageHandlerDescriptor::invalidateClient):
3163         Add support for invalidating the descriptor and throw an exception if someone tries
3164         to post a message using an invalidated descriptor.
3165
3166         * page/UserMessageHandlersNamespace.cpp:
3167         (WebCore::UserMessageHandlersNamespace::handler):
3168         Add logic to remove message handlers if their descriptor has been invalidated.
3169
3170 2015-05-23  Dan Bernstein  <mitz@apple.com>
3171
3172         Remove unused definitions of WEBKIT_VERSION_MIN_REQUIRED
3173         https://bugs.webkit.org/show_bug.cgi?id=145345
3174
3175         Reviewed by Sam Weinig.
3176
3177         * Configurations/WebCore.xcconfig: Also changed to use $(inherited).
3178
3179 2015-05-24  Hunseop Jeong  <hs85.jeong@samsung.com>
3180
3181         Use modern for-loops in WebCore/svg.
3182         https://bugs.webkit.org/show_bug.cgi?id=145209
3183
3184         Reviewed by Darin Adler.
3185
3186         No new tests, no behavior changes.
3187
3188         * svg/SVGAnimateElementBase.cpp:
3189         (WebCore::propertyTypesAreConsistent):
3190         * svg/SVGAnimatedPath.cpp:
3191         (WebCore::SVGAnimatedPathAnimator::startAnimValAnimation):
3192         * svg/SVGAnimatedTypeAnimator.h:
3193         (WebCore::SVGAnimatedTypeAnimator::executeAction):
3194         * svg/SVGAnimationElement.cpp:
3195         (WebCore::SVGAnimationElement::parseAttribute):
3196         * svg/SVGCursorElement.cpp:
3197         (WebCore::SVGCursorElement::~SVGCursorElement):
3198         * svg/SVGDocumentExtensions.cpp:
3199         (WebCore::SVGDocumentExtensions::pauseAnimations):
3200         (WebCore::SVGDocumentExtensions::unpauseAnimations):
3201         (WebCore::SVGDocumentExtensions::dispatchSVGLoadEventToOutermostSVGElements):
3202         (WebCore::SVGDocumentExtensions::isElementWithPendingResources):
3203         (WebCore::SVGDocumentExtensions::removeElementFromPendingResources):
3204         (WebCore::SVGDocumentExtensions::removeAllTargetReferencesForElement):
3205         * svg/SVGElement.cpp:
3206         (WebCore::populateAttributeNameToCSSPropertyIDMap):
3207         (WebCore::populateAttributeNameToAnimatedPropertyTypeMap):
3208         (WebCore::populateCSSPropertyWithSVGDOMNameToAnimatedPropertyTypeMap):
3209         (WebCore::hasLoadListener):
3210         * svg/SVGFontData.cpp:
3211         (WebCore::SVGFontData::applySVGGlyphSelection):
3212         * svg/SVGFontElement.cpp:
3213         (WebCore::SVGFontElement::registerLigaturesInGlyphCache):
3214         (WebCore::SVGKerningMap::insert):
3215         (WebCore::stringMatchesUnicodeRange):
3216         * svg/SVGPathByteStream.h:
3217         (WebCore::SVGPathByteStream::append):
3218         * svg/animation/SMILTimeContainer.cpp:
3219         (WebCore::SMILTimeContainer::setElapsed):
3220         (WebCore::SMILTimeContainer::updateAnimations):
3221         * svg/animation/SVGSMILElement.cpp:
3222         (WebCore::SVGSMILElement::parseBeginOrEnd):
3223         (WebCore::SVGSMILElement::connectConditions):
3224         (WebCore::SVGSMILElement::disconnectConditions):
3225         (WebCore::SVGSMILElement::notifyDependentsIntervalChanged):
3226         (WebCore::SVGSMILElement::createInstanceTimesFromSyncbase):
3227         * svg/graphics/filters/SVGFilterBuilder.cpp:
3228         (WebCore::SVGFilterBuilder::clearResultsRecursive):
3229         * svg/graphics/filters/SVGFilterBuilder.h:
3230         (WebCore::SVGFilterBuilder::addBuiltinEffects):
3231         * svg/properties/SVGAnimatedProperty.cpp:
3232         (WebCore::SVGAnimatedProperty::~SVGAnimatedProperty):
3233         * svg/properties/SVGListProperty.h:
3234         (WebCore::SVGListProperty::detachListWrappersAndResize):
3235         * svg/properties/SVGPathSegListPropertyTearOff.cpp:
3236         (WebCore::SVGPathSegListPropertyTearOff::clearContextAndRoles):
3237
3238 2015-05-24  Jeremy Jones  <jeremyj@apple.com>
3239
3240         Register media MIME types as supported by HTML view in WebKit1.
3241         https://bugs.webkit.org/show_bug.cgi?id=145356
3242
3243         Reviewed by Eric Carlson.
3244
3245         getSupportedMediaMIMETypes is now used in WebKit1.
3246
3247         * platform/MIMETypeRegistry.h: Export getSupportedMediaMIMETypes.
3248
3249 2015-05-23  Antti Koivisto  <antti@apple.com>
3250
3251         Permanent redirects should have long implicit cache lifetime
3252         https://bugs.webkit.org/show_bug.cgi?id=145348
3253         rdar://problem/20680519
3254
3255         Reviewed by Sam Weinig.
3256
3257         301 Moved Permanently response that doesn't specify explicit lifetime should have long implicit lifetime.
3258         This matches other browsers.
3259
3260         * platform/network/CacheValidation.cpp:
3261         (WebCore::computeFreshnessLifetimeForHTTPFamily):
3262
3263             Give 301 Moved Permanently (and similarly semantically permanent 410 Gone) long implicit lifetime.
3264
3265         (WebCore::updateRedirectChainStatus):
3266
3267 2015-05-23  Myles C. Maxfield  <mmaxfield@apple.com>
3268
3269         Cleanup after r184796
3270         https://bugs.webkit.org/show_bug.cgi?id=145333
3271
3272         Reviewed by Alexey Proskuryakov.
3273
3274         No new tests because there is no behavior change.
3275
3276         * platform/graphics/cocoa/FontCascadeCocoa.mm:
3277         (WebCore::RenderingStyleSaver::RenderingStyleSaver): Deleted.
3278         (WebCore::RenderingStyleSaver::~RenderingStyleSaver): Deleted.
3279
3280 2015-05-23  Yusuke Suzuki  <utatane.tea@gmail.com>
3281
3282         Introduce UniquedStringImpl and SymbolImpl to separate symbolic strings from AtomicStringImpl
3283         https://bugs.webkit.org/show_bug.cgi?id=144848
3284
3285         Reviewed by Darin Adler.
3286
3287         Use UniquedStringImpl, SymbolImpl and AtomicStringImpl.
3288
3289         * bindings/js/JSDOMWindowCustom.cpp:
3290         (WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
3291         * bindings/js/SerializedScriptValue.cpp:
3292         (WebCore::CloneSerializer::write):
3293
3294 2015-05-23  Zalan Bujtas  <zalan@apple.com>
3295
3296         Simple line layout: Ignore -webkit-flow-*content while collecting text content for innerText.
3297         https://bugs.webkit.org/show_bug.cgi?id=145344
3298         rdar://problem/20959522
3299
3300         Reviewed by Antti Koivisto.
3301
3302         This patch ensures that when a -webkit-flow-into content is present in a simple line layout container,
3303         we skip it while collecting the text content for innerText.
3304         It's not always guaranteed that a simple line layout container only contains simple text nodes. In such cases,
3305         we need to ensure that text offset computing only takes the simple text nodes into account.
3306
3307         Test: fast/text/simple-line-layout-inner-text-with-flow-content.html
3308
3309         * editing/TextIterator.cpp:
3310         (WebCore::TextIterator::handleTextNode):
3311         * editing/TextIterator.h:
3312
3313 2015-05-22  Mark Lam  <mark.lam@apple.com>
3314
3315         Document::ensurePlugInsInjectedScript() should evaluate the injected script on its own frame.
3316         https://bugs.webkit.org/show_bug.cgi?id=145328
3317
3318         Reviewed by Jon Lee.
3319
3320         trac.webkit.org/r184329 fixed HTMLPlugInImageElement::didAddUserAgentShadowRoot()
3321         to use the document's frame instead of the page's main frame.  However,
3322         Document::ensurePlugInsInjectedScript() is still evaluating the injected script on
3323         the main frame.
3324
3325         As a result, HTMLPlugInImageElement::didAddUserAgentShadowRoot()'s attempt to get
3326         the injected createOverlay function from the document frame's global object will
3327         fail.  Fixing Document::ensurePlugInsInjectedScript() to evaluating the injected
3328         script on the document's frame fixes the issue.
3329
3330         No new tests.
3331
3332         * dom/Document.cpp:
3333         (WebCore::Document::ensurePlugInsInjectedScript):
3334
3335 2015-05-22  Eric Carlson  <eric.carlson@apple.com>
3336
3337         MediaPlayer doesn't need isPlayingToWirelessPlaybackTarget and isCurrentPlaybackTargetWireless
3338         https://bugs.webkit.org/show_bug.cgi?id=145325
3339
3340         Reviewed by Brent Fulgham.
3341
3342         * html/HTMLMediaElement.cpp:
3343         (WebCore::HTMLMediaElement::webkitCurrentPlaybackTargetIsWireless): Call isCurrentPlaybackTargetWireless
3344         directly.
3345         (WebCore::HTMLMediaElement::wirelessRoutesAvailableDidChange): Ditto.
3346         (WebCore::HTMLMediaElement::isPlayingToWirelessPlaybackTarget): Ditto.
3347         (WebCore::HTMLMediaElement::mediaState): Ditto.
3348
3349         * html/HTMLMediaSession.cpp:
3350         (WebCore::HTMLMediaSession::currentPlaybackTargetIsWireless): Deleted.
3351         * html/HTMLMediaSession.h:
3352
3353         * platform/graphics/MediaPlayer.cpp:
3354         (WebCore::MediaPlayer::isPlayingToWirelessPlaybackTarget): Deleted.
3355         * platform/graphics/MediaPlayer.h:
3356
3357         * platform/graphics/MediaPlayerPrivate.h:
3358         (WebCore::MediaPlayerPrivateInterface::isPlayingToWirelessPlaybackTarget): Deleted.
3359
3360         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
3361         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3362         (WebCore::MediaPlayerPrivateAVFoundationObjC::isPlayingToWirelessPlaybackTarget): Deleted.
3363
3364         * platform/ios/WebVideoFullscreenModelVideoElement.mm:
3365         (WebVideoFullscreenModelVideoElement::updateForEventName): Call webkitCurrentPlaybackTargetIsWireless.
3366
3367 2015-05-22  Jon Lee  <jonlee@apple.com>
3368
3369         Rename MediaPlaybackAllowsInline
3370         https://bugs.webkit.org/show_bug.cgi?id=145315
3371
3372         Reviewed by Eric Carlson.
3373
3374         Our API uses allowsInlineMediaPlayback. Our symbols should reflect the same.
3375
3376         * page/Settings.cpp: Update the static variable name as well as the setting.
3377         * page/Settings.in: Ditto.
3378
3379         * Modules/mediacontrols/MediaControlsHost.idl: Rename to allowsInlineMediaPlayback.
3380         Affects the media controls code.
3381         * Modules/mediacontrols/MediaControlsHost.h:
3382         * Modules/mediacontrols/MediaControlsHost.cpp:
3383         (WebCore::MediaControlsHost::allowsInlineMediaPlayback):
3384         (WebCore::MediaControlsHost::mediaPlaybackAllowsInline): Deleted.
3385
3386         Update to use the new name in the media controls.
3387         * Modules/mediacontrols/mediaControlsApple.js:
3388         (Controller.prototype.shouldHaveControls):
3389         * Modules/mediacontrols/mediaControlsiOS.js:
3390         (ControllerIOS.prototype.shouldHaveStartPlaybackButton):
3391
3392         * css/MediaQueryEvaluator.cpp:
3393         (WebCore::video_playable_inlineMediaFeatureEval):
3394         * html/HTMLMediaSession.cpp:
3395         (WebCore::HTMLMediaSession::requiresFullscreenForVideoPlayback):
3396
3397 2015-05-22  Jon Lee  <jonlee@apple.com>
3398
3399         Rename MediaPlaybackAllowsAirPlay
3400         https://bugs.webkit.org/show_bug.cgi?id=145316
3401
3402         Reviewed by Eric Carlson.
3403