2015-11-21 Michael Catanzaro [GTK] Off-by-one error in getStyleContext() https://bugs.webkit.org/show_bug.cgi?id=151524 Reviewed by Carlos Garcia Campos. GtkWidgetPath* path = gtk_widget_path_new(); gtk_widget_path_append_type(path, widgetType); // ... gtk_widget_path_iter_add_class(path, 0, GTK_STYLE_CLASS_BUTTON); gtk_widget_path_iter_add_class(path, 1, "text-button"); Only one widget type was appended to the widget path, so the maximum valid index is 0. This code means to add both style classes to the first widget type in the widget path, so the second call should use index 0 rather than index 1. This caused no bug in practice, because when the index is invalid, gtk_widget_path_iter_add_class() automatically changes the index to the last valid position in the widget path -- in this case, 0. This is routinely done with -1 as a convention for specifying the last position in the widget path. * rendering/RenderThemeGtk.cpp: (WebCore::getStyleContext): 2015-11-21 Michael Catanzaro [GTK] Warning spam from GtkStyleContext https://bugs.webkit.org/show_bug.cgi?id=151520 Reviewed by Carlos Garcia Campos. Audit every use of gtk_style_context_get_* to fix compatibility with GTK+ 3.19. Some of these were already fine and are only changed for clarity. Company: gtk_style_context_get() (and _get_padding/border/color()) should only ever be called with the same state as gtk_style_context_get_state() Company: usually that's a simple replacing of the old state (like in the trace you posted) Company: sometimes it requires calling gtk_style_context_set_sate() with the right state first Company: and in very rare cases it needs a gtk_style_context_save() before the set_state(), too * platform/gtk/ScrollbarThemeGtk.cpp: (WebCore::adjustRectAccordingToMargin): * rendering/RenderThemeGtk.cpp: (gtk_css_section_print): (WebCore::getStyleContext): (WebCore::RenderThemeGtk::initMediaColors): (WebCore::renderButton): (WebCore::getComboBoxMetrics): (WebCore::RenderThemeGtk::paintMenuList): (WebCore::RenderThemeGtk::paintTextField): (WebCore::RenderThemeGtk::paintProgressBar): (WebCore::spinButtonArrowSize): (WebCore::RenderThemeGtk::adjustInnerSpinButtonStyle): (WebCore::styleColor): 2015-11-20 Brady Eidson Modern IDB: After versionchange transactions complete, fire onsuccess on the original IDBOpenDBRequest https://bugs.webkit.org/show_bug.cgi?id=151522 Reviewed by Alex Christensen. Test: storage/indexeddb/modern/opendatabase-success-after-versionchange.html (And changes to other existing tests) * Modules/indexeddb/client/IDBDatabaseImpl.cpp: (WebCore::IDBClient::IDBDatabase::startVersionChangeTransaction): * Modules/indexeddb/client/IDBDatabaseImpl.h: * Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp: (WebCore::IDBClient::IDBOpenDBRequest::fireSuccessAfterVersionChangeCommit): (WebCore::IDBClient::IDBOpenDBRequest::onUpgradeNeeded): * Modules/indexeddb/client/IDBOpenDBRequestImpl.h: * Modules/indexeddb/client/IDBTransactionImpl.cpp: (WebCore::IDBClient::IDBTransaction::create): (WebCore::IDBClient::IDBTransaction::IDBTransaction): (WebCore::IDBClient::IDBTransaction::dispatchEvent): * Modules/indexeddb/client/IDBTransactionImpl.h: 2015-11-20 Simon Fraser More deviceRGB color cleanup https://bugs.webkit.org/show_bug.cgi?id=151523 Reviewed by Tim Horton. Replace calls to deviceRGBColorSpaceRef() with sRGBColorSpaceRef(), and use sRGBColorSpaceRef() in a few places that were manually creating the colorspace. Also use cachedCGColor() in a more places that were manually constructing CGColorRefs from Colors. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::createImageForTimeInRect): (WebCore::createImageFromPixelBuffer): * platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm: * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm: (PlatformCALayerCocoa::setBackgroundColor): (PlatformCALayerCocoa::setBorderColor): * platform/graphics/ca/cocoa/WebSystemBackdropLayer.mm: (-[WebLightSystemBackdropLayer init]): (-[WebDarkSystemBackdropLayer init]): * platform/graphics/cg/GradientCG.cpp: (WebCore::Gradient::platformGradient): * platform/graphics/cg/GraphicsContext3DCG.cpp: (WebCore::GraphicsContext3D::ImageExtractor::extractImage): (WebCore::GraphicsContext3D::paintToCanvas): * platform/graphics/cg/ImageBufferCG.cpp: (WebCore::ImageBuffer::copyImage): (WebCore::ImageBuffer::toDataURL): (WebCore::ImageDataToDataURL): * platform/graphics/mac/GraphicsContextMac.mm: (WebCore::linearRGBColorSpaceRef): * platform/graphics/mac/WebGLLayer.mm: (-[WebGLLayer copyImageSnapshotWithColorSpace:]): * platform/mediastream/mac/AVVideoCaptureSource.mm: (WebCore::AVVideoCaptureSource::currentFrameCGImage): * rendering/RenderThemeIOS.mm: (WebCore::drawRadialGradient): * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::paintMenuListButtonGradients): (WebCore::RenderThemeMac::paintSliderTrack): 2015-11-20 Katlyn Graff Renaming PageCache suspension code to support more reasons for suspension. https://bugs.webkit.org/show_bug.cgi?id=151527 Reviewed by Ryosuke Niwa. No new tests because this is simply a refactor. Renamed Element:: and Document:: documentWillSuspendForPageCache(), documentDidResumeFromPageCache(), registerForPageCacheSuspensionCallbacks(), unregisterForPageCacheSuspensionCallbacks() to prepare to support alternate reasons for document-level suspension. * dom/Document.cpp: (WebCore::Document::suspend): (WebCore::Document::resume): (WebCore::Document::registerForDocumentSuspensionCallbacks): (WebCore::Document::unregisterForDocumentSuspensionCallbacks): (WebCore::Document::documentWillSuspendForPageCache): Deleted. (WebCore::Document::documentDidResumeFromPageCache): Deleted. (WebCore::Document::registerForPageCacheSuspensionCallbacks): Deleted. (WebCore::Document::unregisterForPageCacheSuspensionCallbacks): Deleted. * dom/Document.h: * dom/Element.h: (WebCore::Element::prepareForDocumentSuspension): (WebCore::Element::resumeFromDocumentSuspension): (WebCore::Element::documentWillSuspendForPageCache): Deleted. (WebCore::Element::documentDidResumeFromPageCache): Deleted. * history/CachedFrame.cpp: (WebCore::CachedFrameBase::restore): (WebCore::CachedFrame::CachedFrame): * html/HTMLFormElement.cpp: (WebCore::HTMLFormElement::~HTMLFormElement): (WebCore::HTMLFormElement::parseAttribute): (WebCore::HTMLFormElement::resumeFromDocumentSuspension): (WebCore::HTMLFormElement::didMoveToNewDocument): (WebCore::HTMLFormElement::documentDidResumeFromPageCache): Deleted. * html/HTMLFormElement.h: * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::~HTMLInputElement): (WebCore::HTMLInputElement::registerForSuspensionCallbackIfNeeded): (WebCore::HTMLInputElement::unregisterForSuspensionCallbackIfNeeded): (WebCore::HTMLInputElement::resumeFromDocumentSuspension): (WebCore::HTMLInputElement::prepareForDocumentSuspension): (WebCore::HTMLInputElement::didMoveToNewDocument): (WebCore::HTMLInputElement::documentDidResumeFromPageCache): Deleted. (WebCore::HTMLInputElement::documentWillSuspendForPageCache): Deleted. * html/HTMLInputElement.h: * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::registerWithDocument): (WebCore::HTMLMediaElement::unregisterWithDocument): (WebCore::HTMLMediaElement::prepareForDocumentSuspension): (WebCore::HTMLMediaElement::resumeFromDocumentSuspension): (WebCore::HTMLMediaElement::documentWillSuspendForPageCache): Deleted. (WebCore::HTMLMediaElement::documentDidResumeFromPageCache): Deleted. * html/HTMLMediaElement.h: * html/HTMLPlugInImageElement.cpp: (WebCore::HTMLPlugInImageElement::~HTMLPlugInImageElement): (WebCore::HTMLPlugInImageElement::createElementRenderer): (WebCore::HTMLPlugInImageElement::didMoveToNewDocument): (WebCore::HTMLPlugInImageElement::prepareForDocumentSuspension): (WebCore::HTMLPlugInImageElement::resumeFromDocumentSuspension): (WebCore::HTMLPlugInImageElement::documentWillSuspendForPageCache): Deleted. (WebCore::HTMLPlugInImageElement::documentDidResumeFromPageCache): Deleted. * html/HTMLPlugInImageElement.h: * loader/FrameLoader.cpp: (WebCore::FrameLoader::commitProvisionalLoad): * svg/SVGSVGElement.cpp: (WebCore::SVGSVGElement::SVGSVGElement): (WebCore::SVGSVGElement::~SVGSVGElement): (WebCore::SVGSVGElement::didMoveToNewDocument): (WebCore::SVGSVGElement::prepareForDocumentSuspension): (WebCore::SVGSVGElement::resumeFromDocumentSuspension): (WebCore::SVGSVGElement::documentWillSuspendForPageCache): Deleted. (WebCore::SVGSVGElement::documentDidResumeFromPageCache): Deleted. * svg/SVGSVGElement.h: 2015-11-20 Simon Fraser Fix the Windows build. * platform/graphics/cg/IOSurfacePool.h: 2015-11-20 Simon Fraser Allow more buffer formats in the IOSurface pool https://bugs.webkit.org/show_bug.cgi?id=151516 Reviewed by Tim Horton. Previously IOSurface::create was only looking in the pool for RGBA-format surfaces. Change that to always look in the pool, and to cache all format types. We include format in the criteria used to pick a surface from the pool. * platform/graphics/cg/IOSurfacePool.cpp: (WebCore::surfaceMatchesParameters): (WebCore::IOSurfacePool::takeSurface): (WebCore::IOSurfacePool::shouldCacheFormat): (WebCore::IOSurfacePool::shouldCacheSurface): (WebCore::IOSurfacePool::addSurface): * platform/graphics/cg/IOSurfacePool.h: * platform/graphics/cocoa/IOSurface.h: * platform/graphics/cocoa/IOSurface.mm: (IOSurface::surfaceFromPool): (IOSurface::create): (IOSurface::IOSurface): 2015-11-20 Brent Fulgham [Win] Support High DPI drawing with CACFLayers https://bugs.webkit.org/show_bug.cgi?id=147242 Reviewed by Simon Fraser. * platform/graphics/ca/win/WKCACFViewLayerTreeHost.cpp: (WebCore::WKCACFViewLayerTreeHost::initializeContext): Set correct content scale factor for current screen, and apply an appropriate base transform to the CACFLayer so drawing operations are done properly. 2015-11-20 Brady Eidson Modern IDB: In the VersionChangeEvent for delete database calls, oldVersion should be null instead of 0. https://bugs.webkit.org/show_bug.cgi?id=151481 Reviewed by Sam Weinig. No new tests, covered by changes to: storage/indexeddb/modern/deletedatabase-1.html storage/indexeddb/modern/deletedatabase-2.html * Modules/indexeddb/IDBVersionChangeEvent.h: * Modules/indexeddb/IDBVersionChangeEvent.idl: * Modules/indexeddb/client/IDBVersionChangeEventImpl.cpp: (WebCore::IDBClient::IDBVersionChangeEvent::newVersion): * Modules/indexeddb/client/IDBVersionChangeEventImpl.h: * Modules/indexeddb/legacy/LegacyVersionChangeEvent.cpp: (WebCore::LegacyVersionChangeEvent::newVersion): * Modules/indexeddb/legacy/LegacyVersionChangeEvent.h: 2015-11-20 Brady Eidson Addressing missed review feedback for: Modern IDB: Make in-memory ObjectStore cursors work. https://bugs.webkit.org/show_bug.cgi?id=151196 Reviewed by Darin Adler. * Modules/indexeddb/server/MemoryObjectStore.cpp: (WebCore::IDBServer::MemoryObjectStore::maybeOpenCursor): * Modules/indexeddb/server/MemoryObjectStoreCursor.cpp: (WebCore::IDBServer::MemoryObjectStoreCursor::create): Deleted. * Modules/indexeddb/server/MemoryObjectStoreCursor.h: 2015-11-20 Chris Dumez Caching of properties on objects that have named property getters is sometimes incorrect https://bugs.webkit.org/show_bug.cgi?id=151453 Reviewed by Gavin Barraclough. In r188590, we dropped the JSC::GetOwnPropertySlotIsImpure TypeInfo flag for interfaces that have a non-'OverrideBuiltins' named property getter in order to allow caching of properties returns by GetOwnPropertySlot(). We assumed this was safe as it was no longer possible for named properties to override own properties (or properties on the prototype). However, there is an issue when we cache the non-existence of a property. Even though at one point the property did not exist, a named property with this name may later become available. In such case, caching would cause us to wrongly report a property as missing. To address the problem, this patch introduces a new GetOwnPropertySlotIsImpureForPropertyAbsence TypeInfo flag and uses it for interfaces that have a non-'OverrideBuiltins' named property getter. This will cause us to not cache the fact that a property is missing on such objects, while maintaining the performance win from r188590 in the common case. Test: fast/dom/NamedNodeMap-named-getter-caching.html * bindings/scripts/CodeGeneratorJS.pm: (GenerateHeader): * bindings/scripts/test/JS/JSTestCustomNamedGetter.h: * bindings/scripts/test/JS/JSTestEventTarget.h: * bindings/scripts/test/JS/JSTestOverrideBuiltins.h: 2015-11-19 Simon Fraser Back-buffer to front-buffer copy fails for some buffer formats https://bugs.webkit.org/show_bug.cgi?id=151475 rdar://problem/23617899 Reviewed by Tim Horton. Fix some fo the bitsPerComponent/bitsPerPixel options in IOSurface::ensurePlatformContext() for RGB10 buffers. Fix IOSurface::format() to return the new formats. Implement IOSurface::copyToSurface(), which does a synchronous copy between surfaces. * platform/graphics/cocoa/IOSurface.h: * platform/graphics/cocoa/IOSurface.mm: (IOSurface::create): (IOSurface::ensurePlatformContext): (IOSurface::format): (IOSurface::copyToSurface): 2015-11-20 Zalan Bujtas Simple line layout: Add text-indent support. https://bugs.webkit.org/show_bug.cgi?id=151472 Reviewed by Simon Fraser. This enables us to use simple line layout on text-indent content. Test: fast/text/simple-line-text-indent.html * rendering/SimpleLineLayout.cpp: (WebCore::SimpleLineLayout::updateLineConstrains): (WebCore::SimpleLineLayout::createTextRuns): (WebCore::SimpleLineLayout::canUseForStyle): Deleted. 2015-11-20 Brady Eidson Modern IDB: IDBFactory.deleteDatabase() support. https://bugs.webkit.org/show_bug.cgi?id=151456 Reviewed by Alex Christensen. Tests: storage/indexeddb/modern/deletedatabase-1.html storage/indexeddb/modern/deletedatabase-2.html * Modules/indexeddb/client/IDBDatabaseImpl.cpp: (WebCore::IDBClient::IDBDatabase::hasPendingActivity): (WebCore::IDBClient::IDBDatabase::didCommitOrAbortTransaction): * Modules/indexeddb/client/IDBDatabaseImpl.h: * Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp: (WebCore::IDBClient::IDBOpenDBRequest::onDeleteDatabaseSuccess): (WebCore::IDBClient::IDBOpenDBRequest::requestCompleted): * Modules/indexeddb/client/IDBOpenDBRequestImpl.h: * Modules/indexeddb/client/IDBTransactionImpl.cpp: (WebCore::IDBClient::IDBTransaction::hasPendingActivity): Deleted. * Modules/indexeddb/server/IDBServer.cpp: (WebCore::IDBServer::IDBServer::deleteDatabase): (WebCore::IDBServer::IDBServer::deleteUniqueIDBDatabase): * Modules/indexeddb/server/IDBServer.h: * Modules/indexeddb/server/UniqueIDBDatabase.cpp: (WebCore::IDBServer::UniqueIDBDatabase::UniqueIDBDatabase): (WebCore::IDBServer::UniqueIDBDatabase::hasAnyPendingCallbacks): (WebCore::IDBServer::UniqueIDBDatabase::maybeDeleteDatabase): (WebCore::IDBServer::UniqueIDBDatabase::handleOpenDatabaseOperations): (WebCore::IDBServer::UniqueIDBDatabase::handleDelete): (WebCore::IDBServer::UniqueIDBDatabase::notifyConnectionsOfVersionChangeForUpgrade): (WebCore::IDBServer::UniqueIDBDatabase::notifyConnectionsOfVersionChange): (WebCore::IDBServer::UniqueIDBDatabase::connectionClosedFromClient): (WebCore::IDBServer::UniqueIDBDatabase::enqueueTransaction): (WebCore::IDBServer::UniqueIDBDatabase::invokeDeleteOrRunTransactionTimer): (WebCore::IDBServer::UniqueIDBDatabase::deleteOrRunTransactionsTimerFired): (WebCore::IDBServer::UniqueIDBDatabase::didPerformActivateTransactionInBackingStore): (WebCore::IDBServer::UniqueIDBDatabase::inProgressTransactionCompleted): (WebCore::IDBServer::UniqueIDBDatabase::invokeTransactionScheduler): Deleted. (WebCore::IDBServer::UniqueIDBDatabase::transactionSchedulingTimerFired): Deleted. * Modules/indexeddb/server/UniqueIDBDatabase.h: (WebCore::IDBServer::UniqueIDBDatabase::identifier): (WebCore::IDBServer::UniqueIDBDatabase::deletePending): * Modules/indexeddb/shared/IDBResultData.cpp: (WebCore::IDBResultData::deleteDatabaseSuccess): * Modules/indexeddb/shared/IDBResultData.h: 2015-11-20 Brady Eidson Modern IDB: Get IDBRequest.readyState right. https://bugs.webkit.org/show_bug.cgi?id=151484 Reviewed by Alex Christensen. Test: storage/indexeddb/modern/request-readystate.html * Modules/indexeddb/client/IDBRequestImpl.cpp: (WebCore::IDBClient::IDBRequest::readyState): 2015-11-20 Youenn Fablet Use HTTPHeaderName as much as possible in XMLHttpRequest https://bugs.webkit.org/show_bug.cgi?id=151438 Reviewed by Darin Adler. Removing XMLHttpRequest::setRequestHeaderInternal and XMLHttpRequest::getRequestHeader. Using directly HTTPHeaderMap.add, HTTPHeaderMap.set and HTTPHeaderMap.get. No change in behavior. * xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::send): (WebCore::XMLHttpRequest::setRequestHeader): (WebCore::XMLHttpRequest::getAllResponseHeaders): * xml/XMLHttpRequest.h: 2015-11-20 Eric Carlson MediaStream: Fix mock video source crash https://bugs.webkit.org/show_bug.cgi?id=151462 Reviewed by Alexey Proskuryakov. No new tests, this fixes existing tests. * platform/mock/MockRealtimeVideoSource.cpp: (WebCore::MockRealtimeVideoSource::drawText): Declare the String used to intialize a StringView explicitly so it outlives the StringView. 2015-11-20 David Kilzer REGRESSION (r192460,r192677): Fix all the builds * platform/spi/cocoa/QuartzCoreSPI.h: Check different. 2015-11-19 David Kilzer REGRESSION (r192460): Fix tvOS build again * platform/spi/cocoa/QuartzCoreSPI.h: Update version check. This will probably need to be backed out in the future. 2015-11-19 Adam Bergkvist WebRTC: Initial testing of updated RTCPeerConnection API https://bugs.webkit.org/show_bug.cgi?id=151304 Reviewed by Eric Carlson. Remove faulty ASSERT since the selector argument to RTCPeerConnection.getStats() is nullable. Also use pointers instead of a ref (for the same reason). Tests: Unskip two crashing tests. * Modules/mediastream/MediaEndpointPeerConnection.cpp: (WebCore::MediaEndpointPeerConnection::getStats): * Modules/mediastream/MediaEndpointPeerConnection.h: * Modules/mediastream/PeerConnectionBackend.h: * Modules/mediastream/RTCPeerConnection.cpp: (WebCore::RTCPeerConnection::privateGetStats): 2015-11-19 Hunseop Jeong [EFL][GTK] context_menu API test failed after r192333 https://bugs.webkit.org/show_bug.cgi?id=151437 Reviewed by Carlos Garcia Campos. EFL,GTK port didn't use the share Menu. * page/ContextMenuController.cpp: (WebCore::ContextMenuController::populate): 2015-11-19 Brian Burg Web Inspector: yank/kill shortcuts (CTRL+Y, K) don't work in Console / QuickConsole https://bugs.webkit.org/show_bug.cgi?id=151157 Reviewed by Joseph Pecoraro. CodeMirror maintains its own editor buffer and implements its own `killLine` command but doesn't implement the yank command. So, text that is "killed" with CTRL-k inside a CodeMirror instance isn't added to Editor's kill ring. Subsequent yank commands won't match up with the killed text, instead returning text from a prior kill that was handled by Editor (i.e., in a contenteditable or form input). This patch adds a host function so that the Inspector frontend can append "missed" killed text to Editor's kill ring. Subsequent yanks handled by Editor will then match the text killed by CodeMirror. No new tests, because we need to use both InspectorFrontendHost and TestRunner.execCommand, but the latter is not available in the inspector context where we would need to simulate a kill. * inspector/InspectorFrontendHost.cpp: (WebCore::InspectorFrontendHost::killText): Added. This appends the killed text to the kill ring, starting a new sequence if necessary. Unlike Editor, Inspector waits until the next kill command to clear the existing sequence. * inspector/InspectorFrontendHost.h: * inspector/InspectorFrontendHost.idl: 2015-11-19 Zalan Bujtas Simple line layout: Add word-spacing support. https://bugs.webkit.org/show_bug.cgi?id=151420 Reviewed by Antti Koivisto. This enables us to use simple line layout on word-spacing content. Test: fast/text/simple-line-wordspacing.html * rendering/SimpleLineLayout.cpp: (WebCore::SimpleLineLayout::createLineRuns): (WebCore::SimpleLineLayout::canUseForStyle): Deleted. * rendering/SimpleLineLayoutTextFragmentIterator.cpp: (WebCore::SimpleLineLayout::TextFragmentIterator::Style::Style): (WebCore::SimpleLineLayout::TextFragmentIterator::skipToNextPosition): (WebCore::SimpleLineLayout::TextFragmentIterator::runWidth): * rendering/SimpleLineLayoutTextFragmentIterator.h: 2015-11-19 Brady Eidson Modern IDB: IDBObjectStore.deleteIndex() support. https://bugs.webkit.org/show_bug.cgi?id=150911 Reviewed by Alex Christensen. Tests: storage/indexeddb/modern/deleteindex-1.html storage/indexeddb/modern/deleteindex-2.html * Modules/indexeddb/client/IDBConnectionToServer.cpp: (WebCore::IDBClient::IDBConnectionToServer::deleteIndex): (WebCore::IDBClient::IDBConnectionToServer::didDeleteIndex): * Modules/indexeddb/client/IDBConnectionToServer.h: * Modules/indexeddb/client/IDBConnectionToServerDelegate.h: * Modules/indexeddb/client/IDBDatabaseImpl.cpp: (WebCore::IDBClient::IDBDatabase::didDeleteIndexInfo): * Modules/indexeddb/client/IDBDatabaseImpl.h: * Modules/indexeddb/client/IDBIndexImpl.cpp: (WebCore::IDBClient::IDBIndex::markAsDeleted): * Modules/indexeddb/client/IDBIndexImpl.h: * Modules/indexeddb/client/IDBObjectStoreImpl.cpp: (WebCore::IDBClient::IDBObjectStore::index): (WebCore::IDBClient::IDBObjectStore::deleteIndex): * Modules/indexeddb/client/IDBTransactionImpl.cpp: (WebCore::IDBClient::IDBTransaction::deleteIndex): (WebCore::IDBClient::IDBTransaction::deleteIndexOnServer): (WebCore::IDBClient::IDBTransaction::didDeleteIndexOnServer): * Modules/indexeddb/client/IDBTransactionImpl.h: * Modules/indexeddb/client/TransactionOperation.h: (WebCore::IDBClient::createTransactionOperation): * Modules/indexeddb/server/IDBBackingStore.h: * Modules/indexeddb/server/IDBConnectionToClient.cpp: (WebCore::IDBServer::IDBConnectionToClient::didDeleteIndex): * Modules/indexeddb/server/IDBConnectionToClient.h: * Modules/indexeddb/server/IDBConnectionToClientDelegate.h: * Modules/indexeddb/server/IDBServer.cpp: (WebCore::IDBServer::IDBServer::deleteIndex): * Modules/indexeddb/server/IDBServer.h: * Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp: (WebCore::IDBServer::MemoryBackingStoreTransaction::indexDeleted): (WebCore::IDBServer::MemoryBackingStoreTransaction::abort): * Modules/indexeddb/server/MemoryBackingStoreTransaction.h: * Modules/indexeddb/server/MemoryIDBBackingStore.cpp: (WebCore::IDBServer::MemoryIDBBackingStore::deleteIndex): * Modules/indexeddb/server/MemoryIDBBackingStore.h: * Modules/indexeddb/server/MemoryIndex.cpp: (WebCore::IDBServer::MemoryIndex::clearIndexValueStore): * Modules/indexeddb/server/MemoryIndex.h: * Modules/indexeddb/server/MemoryObjectStore.cpp: (WebCore::IDBServer::MemoryObjectStore::maybeRestoreDeletedIndex): (WebCore::IDBServer::MemoryObjectStore::takeIndexByName): (WebCore::IDBServer::MemoryObjectStore::deleteIndex): * Modules/indexeddb/server/MemoryObjectStore.h: * Modules/indexeddb/server/UniqueIDBDatabase.cpp: (WebCore::IDBServer::UniqueIDBDatabase::deleteIndex): (WebCore::IDBServer::UniqueIDBDatabase::performDeleteIndex): (WebCore::IDBServer::UniqueIDBDatabase::didPerformDeleteIndex): * Modules/indexeddb/server/UniqueIDBDatabase.h: * Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp: (WebCore::IDBServer::UniqueIDBDatabaseConnection::didDeleteIndex): * Modules/indexeddb/server/UniqueIDBDatabaseConnection.h: * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp: (WebCore::IDBServer::UniqueIDBDatabaseTransaction::deleteIndex): * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h: * Modules/indexeddb/shared/IDBDatabaseInfo.cpp: (WebCore::IDBDatabaseInfo::loggingString): * Modules/indexeddb/shared/IDBDatabaseInfo.h: * Modules/indexeddb/shared/IDBIndexInfo.cpp: (WebCore::IDBIndexInfo::loggingString): * Modules/indexeddb/shared/IDBIndexInfo.h: * Modules/indexeddb/shared/IDBObjectStoreInfo.cpp: (WebCore::IDBObjectStoreInfo::hasIndex): (WebCore::IDBObjectStoreInfo::deleteIndex): (WebCore::IDBObjectStoreInfo::loggingString): * Modules/indexeddb/shared/IDBObjectStoreInfo.h: * Modules/indexeddb/shared/IDBResultData.cpp: (WebCore::IDBResultData::deleteIndexSuccess): * Modules/indexeddb/shared/IDBResultData.h: * Modules/indexeddb/shared/InProcessIDBServer.cpp: (WebCore::InProcessIDBServer::didDeleteIndex): (WebCore::InProcessIDBServer::createIndex): (WebCore::InProcessIDBServer::deleteIndex): * Modules/indexeddb/shared/InProcessIDBServer.h: 2015-11-19 Brian Burg REGRESSION(r8780): Backwards delete by word incorrectly appends deleted text to kill ring, should be prepend https://bugs.webkit.org/show_bug.cgi?id=151300 Reviewed by Darin Adler. Over 11 years ago, someone was in a big hurry to fix a bunch of emacs keybindings bugs, and accidentally regressed the kill ring behavior for backwards-delete-word. It should prepend to the beginning. This patch fixes the regression and cleans up the kill ring-related code in Editor and commands. It also adds some tests to cover the regressed code a bit better. Tests: editing/pasteboard/emacs-killring-alternating-append-prepend.html editing/pasteboard/emacs-killring-backward-delete-prepend.html * editing/Editor.cpp: Use more explicit names for insertion mode parameters and member variables. (WebCore::Editor::deleteWithDirection): (WebCore::Editor::performDelete): (WebCore::Editor::addRangeToKillRing): (WebCore::Editor::addTextToKillRing): Only one call site for now, but another will be added in a dependent fix. (WebCore::Editor::addToKillRing): Deleted. * editing/Editor.h: * editing/TypingCommand.cpp: (WebCore::TypingCommand::TypingCommand): (WebCore::TypingCommand::deleteKeyPressed): (WebCore::TypingCommand::forwardDeleteKeyPressed): (WebCore::TypingCommand::doApply): * editing/TypingCommand.h: * platform/mac/KillRingMac.mm: (WebCore::KillRing::append): (WebCore::KillRing::prepend): It turns out that the native API implicitly clears the kill sequence when alternating between prepend and append operations. Its behavior does not match what Sublime Text or Emacs do in this case. Clear the previous operation flag to prevent this behavior from happening. 2015-11-19 Myles C. Maxfield Tatechuyoko in ruby sits too high https://bugs.webkit.org/show_bug.cgi?id=151309 Reviewed by Darin Adler. When combining text, we ask what the text's width is in order to determine if it fits in the column. However, when we do that, we were not setting the font's orientation to horizontal. This means that, for CJK text, the "width" which was returned was actually the height of the glyph, and the GlyphOverflow data was similarly garbled. We actually already were creating a corrected FontDescription, and using it in two places. However, we weren't using it in the last place, which was causing this bug. Test: fast/text/text-combine-placement.html * platform/graphics/FontCascade.cpp: (WebCore::FontCascade::width): * rendering/RenderCombineText.cpp: (WebCore::RenderCombineText::combineText): 2015-11-19 Hunseop Jeong [EFL] http/tests/navigation/useragent test failed after r192459. https://bugs.webkit.org/show_bug.cgi?id=151340 Reviewed by Gyuyoung Kim. We need the convert process the predifined value to string. * platform/efl/UserAgentEfl.cpp: (WebCore::versionForUAString): 2015-11-19 Commit Queue Unreviewed, rolling out r192622. https://bugs.webkit.org/show_bug.cgi?id=151446 This test is failing on multiple mac testers (Requested by ryanhaddad on #webkit). Reverted changeset: "Add a test for media control dropoff" https://bugs.webkit.org/show_bug.cgi?id=151287 http://trac.webkit.org/changeset/192622 2015-11-19 Csaba Osztrogonác [EFL] Fix -Winconsistent-missing-override clang warnings https://bugs.webkit.org/show_bug.cgi?id=151443 Reviewed by Darin Adler. * loader/EmptyClients.h: (WebCore::EmptyChromeClient::delegatedScrollRequested): (WebCore::EmptyChromeClient::scheduleAnimation): 2015-11-19 Jon Lee Add a test for media control dropoff https://bugs.webkit.org/show_bug.cgi?id=151287 rdar://problem/23544666 Reviewed by Dean Jackson. Test: media/controls/inline-elements-dropoff-order.html * Modules/mediacontrols/mediaControlsApple.css: (audio::-webkit-media-controls-timeline-container.dropped): Override the display:none since we want the container to remain visible but acting as a flexible width space to push the other elements to the ends of the inline flexbox. We will want to refactor the CSS rules so that all of the components in the timeline are keyed off of the container's dropped class rather than having each individual component have that class attached. (audio::-webkit-media-controls-panel.hidden): Deleted. Consolidate a couple rules. * Modules/mediacontrols/mediaControlsApple.js: (Controller.prototype.updateLayoutForDisplayedWidth): Also attach the "dropped" class on the timeline box. Add the captions button for reporting media control state. * testing/Internals.cpp: (WebCore::Internals::setMockMediaPlaybackTargetPickerState): Extend this to also take "DeviceNotAvailable" to update the mock device's availability. * testing/Internals.cpp: Update to use a reference to Page. (WebCore::Internals::resetToConsistentState): Reset mock enabled setting for each test. * testing/Internals.h: * testing/js/WebCoreTestSupport.cpp: (WebCoreTestSupport::resetInternalsObject): Update to use a reference to Page. 2015-11-19 Xabier Rodriguez Calvar [Streams API] Implement IsReadableStreamDisturbed according to spec https://bugs.webkit.org/show_bug.cgi?id=151356 Reviewed by Darin Adler. Implemente IsReadableStreamDisturbed according to the spec. This is an internal function to be used by other internal implementations. The function is exported as internals to be tested. Test: streams/reference-implementation/abstract-ops.html. * Modules/streams/ReadableStream.js: (initializeReadableStream): * Modules/streams/ReadableStreamInternals.js: (cancelReadableStream): (readFromReadableStreamReader): (isReadableStreamDisturbed): * bindings/js/WebCoreBuiltinNames.h: * testing/Internals.cpp: (WebCore::Internals::isReadableStreamDisturbed): * testing/Internals.h: * testing/Internals.idl: 2015-11-19 Youenn Fablet XHR should not combine empty content-type value with default one https://bugs.webkit.org/show_bug.cgi?id=147784 Reviewed by Darin Adler. Previously, XHR was testing whether a "Content-Type" was set using setRequestHeader by checking whether a "Content-Type" header value was empty. This now tests whether "Content-Type" request header is set using either HTTPHeaderMap::contains or checking whether a "Content-Type" header value is null. Test: http/tests/xmlhttprequest/post-empty-content-type.html * xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::send): 2015-11-19 Brady Eidson Modern IDB: Populate indexes created in object stores that already have records. https://bugs.webkit.org/show_bug.cgi?id=151421 Reviewed by Alex Christensen. Test: storage/indexeddb/modern/index-4.html storage/indexeddb/modern/index-5.html * Modules/indexeddb/server/MemoryObjectStore.cpp: (WebCore::IDBServer::MemoryObjectStore::createIndex): (WebCore::IDBServer::MemoryObjectStore::populateIndexWithExistingRecords): * Modules/indexeddb/server/MemoryObjectStore.h: 2015-11-18 Brady Eidson Modern IDB:Make in-memory Index cursors work. https://bugs.webkit.org/show_bug.cgi?id=151278 Reviewed by Alex Christensen. Tests: storage/indexeddb/modern/index-cursor-1.html storage/indexeddb/modern/index-cursor-2.html storage/indexeddb/modern/index-cursor-3.html * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * Modules/indexeddb/client/IDBIndexImpl.cpp: (WebCore::IDBClient::IDBIndex::openCursor): (WebCore::IDBClient::IDBIndex::openKeyCursor): * Modules/indexeddb/server/IndexValueEntry.cpp: (WebCore::IDBServer::IndexValueEntry::removeKey): (WebCore::IDBServer::IndexValueEntry::Iterator::Iterator): (WebCore::IDBServer::IndexValueEntry::Iterator::key): (WebCore::IDBServer::IndexValueEntry::Iterator::isValid): (WebCore::IDBServer::IndexValueEntry::Iterator::invalidate): (WebCore::IDBServer::IndexValueEntry::Iterator::operator++): (WebCore::IDBServer::IndexValueEntry::begin): (WebCore::IDBServer::IndexValueEntry::reverseBegin): (WebCore::IDBServer::IndexValueEntry::find): (WebCore::IDBServer::IndexValueEntry::reverseFind): * Modules/indexeddb/server/IndexValueEntry.h: (WebCore::IDBServer::IndexValueEntry::Iterator::Iterator): (WebCore::IDBServer::IndexValueEntry::unique): * Modules/indexeddb/server/IndexValueStore.cpp: (WebCore::IDBServer::IndexValueStore::removeEntriesWithValueKey): (WebCore::IDBServer::IndexValueStore::lowestKeyWithRecordInRange): (WebCore::IDBServer::IndexValueStore::lowestIteratorInRange): (WebCore::IDBServer::IndexValueStore::highestReverseIteratorInRange): (WebCore::IDBServer::IndexValueStore::find): (WebCore::IDBServer::IndexValueStore::reverseFind): (WebCore::IDBServer::IndexValueStore::Iterator::Iterator): (WebCore::IDBServer::IndexValueStore::Iterator::nextIndexEntry): (WebCore::IDBServer::IndexValueStore::Iterator::operator++): (WebCore::IDBServer::IndexValueStore::Iterator::invalidate): (WebCore::IDBServer::IndexValueStore::Iterator::isValid): (WebCore::IDBServer::IndexValueStore::Iterator::key): (WebCore::IDBServer::IndexValueStore::Iterator::primaryKey): * Modules/indexeddb/server/IndexValueStore.h: (WebCore::IDBServer::IndexValueStore::Iterator::Iterator): * Modules/indexeddb/server/MemoryIDBBackingStore.cpp: (WebCore::IDBServer::MemoryIDBBackingStore::openCursor): * Modules/indexeddb/server/MemoryIndex.cpp: (WebCore::IDBServer::MemoryIndex::cursorDidBecomeClean): (WebCore::IDBServer::MemoryIndex::cursorDidBecomeDirty): (WebCore::IDBServer::MemoryIndex::objectStoreCleared): (WebCore::IDBServer::MemoryIndex::notifyCursorsOfValueChange): (WebCore::IDBServer::MemoryIndex::notifyCursorsOfAllRecordsChanged): (WebCore::IDBServer::MemoryIndex::putIndexKey): (WebCore::IDBServer::MemoryIndex::removeRecord): (WebCore::IDBServer::MemoryIndex::removeEntriesWithValueKey): (WebCore::IDBServer::MemoryIndex::maybeOpenCursor): * Modules/indexeddb/server/MemoryIndex.h: (WebCore::IDBServer::MemoryIndex::valueStore): (WebCore::IDBServer::MemoryIndex::objectStore): * Modules/indexeddb/server/MemoryIndexCursor.cpp: Added. (WebCore::IDBServer::MemoryIndexCursor::MemoryIndexCursor): (WebCore::IDBServer::MemoryIndexCursor::~MemoryIndexCursor): (WebCore::IDBServer::MemoryIndexCursor::currentData): (WebCore::IDBServer::MemoryIndexCursor::iterate): (WebCore::IDBServer::MemoryIndexCursor::indexRecordsAllChanged): (WebCore::IDBServer::MemoryIndexCursor::indexValueChanged): * Modules/indexeddb/server/MemoryIndexCursor.h: * Modules/indexeddb/server/MemoryObjectStore.cpp: (WebCore::IDBServer::MemoryObjectStore::indexForIdentifier): (WebCore::IDBServer::MemoryObjectStore::valueForKey): * Modules/indexeddb/server/MemoryObjectStore.h: * Modules/indexeddb/shared/IDBCursorInfo.cpp: (WebCore::IDBCursorInfo::objectStoreCursor): (WebCore::IDBCursorInfo::indexCursor): (WebCore::IDBCursorInfo::IDBCursorInfo): (WebCore::IDBCursorInfo::isDirectionNoDuplicate): (WebCore::IDBCursorInfo::isolatedCopy): * Modules/indexeddb/shared/IDBCursorInfo.h: (WebCore::IDBCursorInfo::objectStoreIdentifier): 2015-11-18 Antti Koivisto Assertion failure in RenderTreePosition::computeNextSibling https://bugs.webkit.org/show_bug.cgi?id=151337 rdar://problem/23250075 Reviewed by Zalan Bujtas. Test: fast/html/details-mathml-crash.html * html/ads: Added. * style/StyleResolveTree.cpp: (WebCore::Style::resolveChildAtShadowBoundary): Factor common code for resolving child here from resolveShadowTree. (WebCore::Style::resolveShadowTree): We don't need StyleResolverParentPusher because shadow tree uses different style resolver anyway. (WebCore::Style::resolveSlotAssignees): This needs to call renderTreePosition.invalidateNextSibling() if there is a renderer already. Achieve this by calling the new common function resolveChildAtShadowBoundary. 2015-11-18 Jer Noble WebGL slow video to texture https://bugs.webkit.org/show_bug.cgi?id=129626 Reviewed by Dean Jackson. Support a direct GPU-to-GPU copy of video textures. Add a new AVPlayerItemVideoOutput which, when lazily-created, will emit CVPixelBuffers which are guaranteed to be compatible with OpenGL framebuffers. Then, use a CVOpenGLTextureCache object to convert those CVPixelBuffers to OpenGL textures. Once the video frame is in an OpenGL texture, use an OpenGL framebuffer to copy the underlying video texture memory to the destination texture. The copy step uses glTexImage2D, which requires format and type parameters, so change the signature of copyVideoTextureToPlatformTexture() to pass those parameters in. * html/HTMLVideoElement.cpp: (WebCore::HTMLVideoElement::copyVideoTextureToPlatformTexture): Changed signature. * html/HTMLVideoElement.h: * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::texImage2D): Changed signature. * platform/graphics/MediaPlayer.cpp: (WebCore::MediaPlayer::copyVideoTextureToPlatformTexture): Changed signature. * platform/graphics/MediaPlayer.h: * platform/graphics/MediaPlayerPrivate.h: (WebCore::MediaPlayerPrivateInterface::copyVideoTextureToPlatformTexture): Changed signature. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::createOpenGLVideoOutput): Create an OpenGL-compatible AVPlayerItemVideoOutput. (WebCore::MediaPlayerPrivateAVFoundationObjC::destroyOpenGLVideoOutput): Destroy same. (WebCore::MediaPlayerPrivateAVFoundationObjC::updateLastOpenGLImage): Cache the current frame, if available. (WebCore::MediaPlayerPrivateAVFoundationObjC::copyVideoTextureToPlatformTexture): Convert the current frame to a texture, and use that texture to render into the destination texture. 2015-11-18 Jiewen Tan [WK1] Crash loading Blink layout test fast/dom/Window/property-access-on-cached-window-after-frame-removed.html https://bugs.webkit.org/show_bug.cgi?id=150198 Reviewed by Brent Fulgham. Test: fast/dom/Window/property-access-on-cached-window-after-frame-removed.html Properties of a contentWindow could be accessed even if the frame who owns the window is detached. Therefore, check whether the document loader is still alive before using it. * page/PerformanceTiming.cpp: (WebCore::PerformanceTiming::monotonicTimeToIntegerMilliseconds): 2015-11-18 Eric Carlson MediaStream: Implement MediaDevices.getSupportedConstraints https://bugs.webkit.org/show_bug.cgi?id=151394 Reviewed by Brent Fulgham. Test: fast/mediastream/MediaDevices-getSupportedConstraints.html * CMakeLists.txt: Add MediaTrackSupportedConstraints and JSMediaTrackSupportedConstraintsCustom. * DerivedSources.make: Ditto. * Modules/mediastream/MediaDevices.cpp: (WebCore::MediaDevices::getSupportedConstraints): New. * Modules/mediastream/MediaDevices.h: * Modules/mediastream/MediaDevices.idl: * Modules/mediastream/MediaTrackSupportedConstraints.h: Added. Wrapper around a RealtimeMediaSourceSupportedConstraints. (WebCore::MediaTrackSupportedConstraints::create): (WebCore::MediaTrackSupportedConstraints::supportsWidth): (WebCore::MediaTrackSupportedConstraints::supportsHeight): (WebCore::MediaTrackSupportedConstraints::supportsAspectRatio): (WebCore::MediaTrackSupportedConstraints::supportsFrameRate): (WebCore::MediaTrackSupportedConstraints::supportsFacingMode): (WebCore::MediaTrackSupportedConstraints::supportsVolume): (WebCore::MediaTrackSupportedConstraints::supportsSampleRate): (WebCore::MediaTrackSupportedConstraints::supportsSampleSize): (WebCore::MediaTrackSupportedConstraints::supportsEchoCancellation): (WebCore::MediaTrackSupportedConstraints::supportsDeviceId): (WebCore::MediaTrackSupportedConstraints::supportsGroupId): (WebCore::MediaTrackSupportedConstraints::MediaTrackSupportedConstraints): * Modules/mediastream/MediaTrackSupportedConstraints.idl: Added. * WebCore.xcodeproj/project.pbxproj: Add JSMediaTrackSupportedConstraintsCustom.cpp, RealtimeMediaSourceSupportedConstraints.h, and MediaTrackSupportedConstraints.*. A MediaTrackSupportedConstraints only contains the properties supported by the currently available capture devices, so implement getOwnPropertySlot and getOwnPropertyNames so we don't have to declare any attributes in the idl file. * bindings/js/JSMediaTrackSupportedConstraintsCustom.cpp: Added. (WebCore::JSMediaTrackSupportedConstraints::getOwnPropertySlotDelegate): (WebCore::JSMediaTrackSupportedConstraints::getOwnPropertyNames): * platform/mediastream/RealtimeMediaSourceCenter.h: * platform/mediastream/RealtimeMediaSourceSupportedConstraints.h: Added. (WebCore::RealtimeMediaSourceSupportedConstraints::RealtimeMediaSourceSupportedConstraints): (WebCore::RealtimeMediaSourceSupportedConstraints::supportsWidth): (WebCore::RealtimeMediaSourceSupportedConstraints::setSupportsWidth): (WebCore::RealtimeMediaSourceSupportedConstraints::supportsHeight): (WebCore::RealtimeMediaSourceSupportedConstraints::setSupportsHeight): (WebCore::RealtimeMediaSourceSupportedConstraints::supportsAspectRatio): (WebCore::RealtimeMediaSourceSupportedConstraints::setSupportsAspectRatio): (WebCore::RealtimeMediaSourceSupportedConstraints::supportsFrameRate): (WebCore::RealtimeMediaSourceSupportedConstraints::setSupportsFrameRate): (WebCore::RealtimeMediaSourceSupportedConstraints::supportsFacingMode): (WebCore::RealtimeMediaSourceSupportedConstraints::setSupportsFacingMode): (WebCore::RealtimeMediaSourceSupportedConstraints::supportsVolume): (WebCore::RealtimeMediaSourceSupportedConstraints::setSupportsVolume): (WebCore::RealtimeMediaSourceSupportedConstraints::supportsSampleRate): (WebCore::RealtimeMediaSourceSupportedConstraints::setSupportsSampleRate): (WebCore::RealtimeMediaSourceSupportedConstraints::supportsSampleSize): (WebCore::RealtimeMediaSourceSupportedConstraints::setSupportsSampleSize): (WebCore::RealtimeMediaSourceSupportedConstraints::supportsEchoCancellation): (WebCore::RealtimeMediaSourceSupportedConstraints::setSupportsEchoCancellation): (WebCore::RealtimeMediaSourceSupportedConstraints::supportsDeviceId): (WebCore::RealtimeMediaSourceSupportedConstraints::setSupportsDeviceId): (WebCore::RealtimeMediaSourceSupportedConstraints::supportsGroupId): (WebCore::RealtimeMediaSourceSupportedConstraints::setSupportsGroupId): * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp: (WebCore::RealtimeMediaSourceCenterMac::RealtimeMediaSourceCenterMac): Initialize supported constraints. * platform/mediastream/mac/RealtimeMediaSourceCenterMac.h: * platform/mock/MockRealtimeMediaSource.cpp: Delete some dead code. * platform/mock/MockRealtimeMediaSourceCenter.cpp: (WebCore::MockRealtimeMediaSourceCenter::MockRealtimeMediaSourceCenter): Initialize supported constraints. * platform/mock/MockRealtimeMediaSourceCenter.h: 2015-11-18 Alex Christensen Progress towards implementing Downloads with NETWORK_SESSION https://bugs.webkit.org/show_bug.cgi?id=151414 Reviewed begrudgingly by Brady Eidson. There is no change in behavior except that SessionIDs are sent across IPC and passed as parameters, and they are not used yet. * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::continueAfterContentPolicy): Removed an unused default. Compiler warnings will let us know if we add an unhandled case to this switch. * loader/EmptyClients.h: * loader/FrameLoaderClient.h: Pass SessionIDs around. 2015-11-18 Andreas Kling ResourceUsageOverlay should have better accounting for reclaimable memory. Reviewed by Anders Carlsson. Add code to inspect the purgeable state of VM regions when traversing the web process VM map, and track reclaimable regions of memory separately. Memory categories that have some amount of reclaimable memory are now displayed with the reclaimable amount in brackets, e.g "123.45 MB [56.78MB]" * page/ResourceUsageOverlay.h: * page/cocoa/ResourceUsageOverlayCocoa.mm: (WebCore::ResourceUsageOverlay::platformDraw): (WebCore::TagInfo::TagInfo): (WebCore::pagesPerVMTag): (WebCore::runSamplerThread): (WebCore::dirtyPagesPerVMTag): Deleted. 2015-11-18 Joseph Pecoraro Web Inspector: Client Blocked Resource Requests causes Crash under InspectorPageAgent::cachedResource https://bugs.webkit.org/show_bug.cgi?id=151398 Reviewed by Brian Burg. Test: inspector/network/client-blocked-load.html * inspector/InspectorPageAgent.cpp: (WebCore::InspectorPageAgent::cachedResource): Gracefully handle null request. * loader/cache/CachedResourceLoader.cpp: (WebCore::CachedResourceLoader::cachedResource): ASSERT if someone tried to pass a null URL. 2015-11-18 Joseph Pecoraro Web Inspector: Timeline Recording across page navigations behaves poorly https://bugs.webkit.org/show_bug.cgi?id=151112 Reviewed by Timothy Hatcher. * inspector/InspectorPageAgent.cpp: (WebCore::InspectorPageAgent::frameStartedLoading): Deleted. Don't reset the execution stopwatch on page navigation. If a timeline is actively being recorded on the frontend then all new timestamps suddenly downshifted towards zero introduces bad data. 2015-11-18 Daniel Bates [iOS] ASSERTION FAILED: temporaryFilePath.last() == '/' in WebCore::openTemporaryFile() https://bugs.webkit.org/show_bug.cgi?id=151392 Reviewed by Alexey Proskuryakov. Workaround where confstr(_CS_DARWIN_USER_TEMP_DIR, ..., ...) retrieves the path to the user temporary directory without a trailing slash in the iOS simulator. * platform/mac/FileSystemMac.mm: (WebCore::openTemporaryFile): Add a path separator (/) between the directory path and filename. 2015-11-18 Chris Dumez Null dereference in Performance::Performance(WebCore::Frame*) https://bugs.webkit.org/show_bug.cgi?id=151390 Reviewed by Brady Eidson. Based on the stack trace, it appears the DocumentLoader can be null when constructing the Performance object. This patch thus adds a null check before trying to dereference it. No new tests, was not able to reproduce. * page/DOMWindow.cpp: (WebCore::DOMWindow::navigator): (WebCore::DOMWindow::performance): * page/Performance.cpp: (WebCore::Performance::Performance): (WebCore::Performance::scriptExecutionContext): * page/Performance.h: 2015-11-18 Per Arne Vollan [WinCairo][MediaFoundation] The main thread can sometimes be blocked forever when ending a media session. https://bugs.webkit.org/show_bug.cgi?id=151387 Reviewed by Alex Christensen. This happens because the main thread is waiting for the sample scheduler thread to finish, but sometimes it never does. This can be resolved by emptying the scheduler's sample queue before requesting the scheduler thread to finish. This will make sure the scheduler thread returns to its main loop quickly, and can handle the termination request. * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp: (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::stopScheduler): 2015-11-18 Adam Bergkvist WebRTC: Initial testing of updated RTCPeerConnection API https://bugs.webkit.org/show_bug.cgi?id=151304 Reviewed by Eric Carlson. Add an empty implementation of MediaEndpointPeerConnection which realizes the PeerConnectionBackend interface. This makes it possible to construct an RTCPeerConnection and do initial testing. Tests: fast/mediastream/RTCPeerConnection-overloaded-operations-params.html fast/mediastream/RTCPeerConnection-overloaded-operations.html Also unskip three existing RTCPeerConnection tests on GTK. * CMakeLists.txt: * Modules/mediastream/MediaEndpointPeerConnection.cpp: Added. (WebCore::createMediaEndpointPeerConnection): (WebCore::MediaEndpointPeerConnection::MediaEndpointPeerConnection): (WebCore::MediaEndpointPeerConnection::createOffer): (WebCore::MediaEndpointPeerConnection::createAnswer): (WebCore::MediaEndpointPeerConnection::setLocalDescription): (WebCore::MediaEndpointPeerConnection::localDescription): (WebCore::MediaEndpointPeerConnection::currentLocalDescription): (WebCore::MediaEndpointPeerConnection::pendingLocalDescription): (WebCore::MediaEndpointPeerConnection::setRemoteDescription): (WebCore::MediaEndpointPeerConnection::remoteDescription): (WebCore::MediaEndpointPeerConnection::currentRemoteDescription): (WebCore::MediaEndpointPeerConnection::pendingRemoteDescription): (WebCore::MediaEndpointPeerConnection::setConfiguration): (WebCore::MediaEndpointPeerConnection::addIceCandidate): (WebCore::MediaEndpointPeerConnection::getStats): (WebCore::MediaEndpointPeerConnection::stop): (WebCore::MediaEndpointPeerConnection::markAsNeedingNegotiation): * Modules/mediastream/MediaEndpointPeerConnection.h: Added. * WebCore.xcodeproj/project.pbxproj: 2015-11-18 Alejandro G. Castro [Cairo] SolidStroke broken in drawLine after r191658 https://bugs.webkit.org/show_bug.cgi?id=151385 Reviewed by Carlos Garcia Campos. Fix the drawLine function after r191658, we have to make sure the color is set when line is SolidStroke. * platform/graphics/cairo/GraphicsContextCairo.cpp: (WebCore::GraphicsContext::drawLine): 2015-11-18 Javier Fernandez [CSS Grid Layout] inline margins not honored when not using stretch in row-axis alignment https://bugs.webkit.org/show_bug.cgi?id=151323 Reviewed by Sergio Villar Senin. There are some situations where we avoid to compute the inline-axis margins when computing the logical width of a box. One of those situations is when we have set an override width; this only affects for now to flex and grid items. We also follow this approach when setting the logical width based on the restrictions of 'auto' value in the 'min-width' property. This behavior is not correct, since there is no reason to avoid computing this margins, in the general case. I think this logic was designed as an optimization for flexbox, which was already computing the margins by its own, but it's not applicable in the general case, so grid needs these margins to be computed properly. For the shrink-to-fit behavior we can add some grid related logic to the already defined RenderBox function "sizesLogicalWidthToFitContent", so we avoid the override width. Tests: fast/css-grid-layout/grid-item-auto-sized-align-justify-margin-border-padding.html fast/css-grid-layout/min-width-height-auto-and-margins.html * rendering/RenderBox.cpp: (WebCore::RenderBox::computeLogicalWidthInRegion): (WebCore::RenderBox::sizesLogicalWidthToFitContent): * rendering/RenderGrid.cpp: (WebCore::defaultAlignmentChangedFromStretchInRowAxis): (WebCore::selfAlignmentChangedFromStretchInRowAxis): (WebCore::RenderGrid::styleDidChange): (WebCore::RenderGrid::applyStretchAlignmentToChildIfNeeded): (WebCore::selfAlignmentChangedFromStretchInColumnAxis): Deleted. (WebCore::RenderGrid::computeMarginLogicalHeightForChild): Deleted. (WebCore::RenderGrid::availableAlignmentSpaceForChildBeforeStretching): Deleted. 2015-11-18 Aaron Chu AX: Shadow DOM video player controls menus need aria-owns on the trigger buttons https://bugs.webkit.org/show_bug.cgi?id=127065 Reviewed by Darin Adler. Test: media/accessibility-closed-captions-has-aria-owns.html * Modules/mediacontrols/mediaControlsApple.js: (Controller.prototype.createControls): (Controller.prototype.buildCaptionMenu): * Modules/mediacontrols/mediaControlsBase.js: (Controller.prototype.createControls): (Controller.prototype.buildCaptionMenu): 2015-11-17 Carlos Garcia Campos Null dereference loading Blink layout test editing/execCommand/indent-button-crash.html https://bugs.webkit.org/show_bug.cgi?id=151187 Reviewed by Darin Adler. This is a merge of Blink r174671: https://codereview.chromium.org/291143002 Fixes imported/blink/editing/execCommand/indent-button-crash.html. * editing/ApplyBlockElementCommand.cpp: (WebCore::ApplyBlockElementCommand::doApply): 2015-11-17 Carlos Garcia Campos REGRESSION(r192459): [GTK] User agent string is broken after r192459 https://bugs.webkit.org/show_bug.cgi?id=151347 Reviewed by Žan Doberšek. Remove the incorrect macro and simply use the given values USER_AGENT_GTK_MAJOR_VERSION and USER_AGENT_GTK_MINOR_VERSION that are now strings. * platform/gtk/UserAgentGtk.cpp: (WebCore::versionForUAString): (WebCore::buildUserAgentString): 2015-11-17 Zalan Bujtas Simple line layout: Add letter-spacing support. https://bugs.webkit.org/show_bug.cgi?id=151362 Reviewed by Antti Koivisto. This enables us to use simple line layout on letter-spacing content. (fixme: webkit.org/b/151368 -> Repaint rect is not computed correctly when negative letter-spacing applied) Test: fast/text/simple-line-letterspacing.html * rendering/SimpleLineLayout.cpp: (WebCore::SimpleLineLayout::canUseForStyle): * rendering/SimpleLineLayoutFunctions.cpp: (WebCore::SimpleLineLayout::paintFlow): RenderLineBoxList tests vertical intersection only. * rendering/SimpleLineLayoutTextFragmentIterator.cpp: (WebCore::SimpleLineLayout::TextFragmentIterator::runWidth): 2015-11-17 Per Arne Vollan [WinCairo][MediaFoundation] Current playback time is not shown. https://bugs.webkit.org/show_bug.cgi?id=151357 Reviewed by Alex Christensen. We need to implement the currentTime() method. * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp: (WebCore::MediaPlayerPrivateMediaFoundation::durationDouble): (WebCore::MediaPlayerPrivateMediaFoundation::currentTime): (WebCore::MediaPlayerPrivateMediaFoundation::paused): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::paintCurrentFrame): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::currentTime): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::isActive): * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h: 2015-11-17 Zalan Bujtas Split SimpleLineLayout::canUseFor into canUseForStyle and canUseForFontAndText. https://bugs.webkit.org/show_bug.cgi?id=151338 Reviewed by Myles C. Maxfield. No change in functionality. * rendering/SimpleLineLayout.cpp: (WebCore::SimpleLineLayout::canUseForFontAndText): (WebCore::SimpleLineLayout::canUseForStyle): (WebCore::SimpleLineLayout::canUseFor): 2015-11-17 Brady Eidson Modern IDB: Support IDBObjectStore.indexNames. https://bugs.webkit.org/show_bug.cgi?id=151341 Reviewed by Alex Christensen. No new tests (Covered by existing storage/indexeddb/modern/objectstore-attributes.html). * Modules/indexeddb/client/IDBObjectStoreImpl.cpp: (WebCore::IDBClient::IDBObjectStore::indexNames): * Modules/indexeddb/shared/IDBObjectStoreInfo.cpp: (WebCore::IDBObjectStoreInfo::indexNames): * Modules/indexeddb/shared/IDBObjectStoreInfo.h: 2015-11-17 Sergio Villar Senin ASSERTION FAILED: contentSize >= 0 in WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax https://bugs.webkit.org/show_bug.cgi?id=151025 Reviewed by Darin Adler. Negative margins could make RenderFlexibleBox compute negative intrinsic sizes. Clamp intrinsic sizes to 0. Test: css3/flexbox/negative-margins-assert.html * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::computeIntrinsicLogicalWidths): 2015-11-17 Sergio Villar Senin [css-grid] Fix alignment with gutters and negative free spaces https://bugs.webkit.org/show_bug.cgi?id=151307 Reviewed by Zalan Bujtas. This is a regression caused by r192154. The problem was that the free space was not properly computed when the grid container was narrower than the track sizes + gutters size for a given axis. The culprit was an unneeded clamp to 0 which was polluting the freeSpace computation as the track sizing algorithm works perfectly OK with negative freeSpace values. * rendering/RenderGrid.cpp: (WebCore::RenderGrid::computeTrackSizesForDirection): 2015-11-17 Carlos Garcia Campos [GStreamer] Use RunLoop instead of GMainLoop in AudioFileReaderGStreamer https://bugs.webkit.org/show_bug.cgi?id=151256 Reviewed by Žan Doberšek. Use RunLoop instead of the platform specific code. The AudioBus can be created from any thread, so we create a helper thread to ensure we don't use the main RunLoop. This patch also includes some code cleanups: - Uses smart pointers when possible. - Fixes uninitialized members in constructors. - Makes private members private. - Uses lambdas instead of static non-members functions. - nullptr instead of 0 in some places. * platform/audio/gstreamer/AudioFileReaderGStreamer.cpp: (WebCore::AudioFileReader::createWeakPtr): (WebCore::AudioFileReader::deinterleavePadAddedCallback): (WebCore::AudioFileReader::deinterleaveReadyCallback): (WebCore::AudioFileReader::decodebinPadAddedCallback): (WebCore::AudioFileReader::AudioFileReader): (WebCore::AudioFileReader::~AudioFileReader): (WebCore::AudioFileReader::handleSample): (WebCore::AudioFileReader::handleMessage): (WebCore::AudioFileReader::handleNewDeinterleavePad): (WebCore::AudioFileReader::deinterleavePadsConfigured): (WebCore::AudioFileReader::plugDeinterleave): (WebCore::AudioFileReader::decodeAudioForBusCreation): (WebCore::AudioFileReader::createBus): (WebCore::createBusFromAudioFile): (WebCore::createBusFromInMemoryAudioFile): (WebCore::onAppsinkPullRequiredCallback): Deleted. (WebCore::messageCallback): Deleted. (WebCore::onGStreamerDeinterleavePadAddedCallback): Deleted. (WebCore::onGStreamerDeinterleaveReadyCallback): Deleted. (WebCore::onGStreamerDecodebinPadAddedCallback): Deleted. * platform/graphics/gstreamer/GRefPtrGStreamer.cpp: (WTF::adoptGRef): (WTF::refGPtr): (WTF::derefGPtr): * platform/graphics/gstreamer/GRefPtrGStreamer.h: 2015-11-16 Eric Carlson [MediaStream] VideoTrack should respond to MediaStreamTrack state changes https://bugs.webkit.org/show_bug.cgi?id=151299 Reviewed by Jer Noble. Test: fast/mediastream/MediaStream-video-element-track-stop.html * Modules/mediastream/MediaStreamTrack.cpp: (WebCore::MediaStreamTrack::ended): Check m_ended. (WebCore::MediaStreamTrack::stopProducingData): Set m_ended before telling private track to stop so we won't fire an 'ended' event. (WebCore::MediaStreamTrack::trackEnded): Set m_ended, add comments from spec. * Modules/mediastream/MediaStreamTrack.h: * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::mediaPlayerTimeChanged): Live streams have infinite duration, not indefinite. * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::platformLayer): Return NULL when displayMode is None. (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentDisplayMode): Calculate current displayMode based on MediaStream state. (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateDisplayMode): Renamed from setPausedImageVisible, use m_displayMode. Don't start/stop clock, it makes more sense to do that in play and pause. (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::play): Start clock. (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::pause): Stop clock. (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentReadyState): Call updateDisplayMode. (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::activeStatusChanged): Ditto. (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateIntrinsicSize): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::createPreviewLayers): Always try to create both layers if necessary. (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::renderingModeChanged): New, update displayMode and call back to the media element. (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::characteristicsChanged): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateTracks): Get rid of some unused locals. React to a change in the enabled video track. (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::paintCurrentFrameInContext): Paint black when the active video track is disabled. (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setPausedImageVisible): Deleted. * platform/mediastream/MediaStreamPrivate.cpp: (WebCore::MediaStreamPrivate::updateActiveState): Split the logic of updating the active video track out into updateActiveVideoTrack. (WebCore::MediaStreamPrivate::hasVideo): Check for track.ended. (WebCore::MediaStreamPrivate::hasAudio): Ditto. (WebCore::MediaStreamPrivate::paintCurrentFrameInContext): Don't call the source directly. (WebCore::MediaStreamPrivate::updateActiveVideoTrack): New. (WebCore::MediaStreamPrivate::trackEnabledChanged): Call updateActiveVideoTrack. (WebCore::MediaStreamPrivate::trackEnded): new. * platform/mediastream/MediaStreamPrivate.h: * platform/mediastream/MediaStreamTrackPrivate.cpp: (WebCore::MediaStreamTrackPrivate::setEnabled): Call observers if enabled state changes. (WebCore::MediaStreamTrackPrivate::endTrack): Call observers. (WebCore::MediaStreamTrackPrivate::paintCurrentFrameInContext): New. (WebCore::MediaStreamTrackPrivate::preventSourceFromStopping): Add comments. * platform/mediastream/MediaStreamTrackPrivate.h: * platform/mock/MockRealtimeVideoSource.cpp: (WebCore::MockRealtimeVideoSource::paintCurrentFrameInContext): Remove a commented-out line. 2015-11-16 Pranjal Jumde Fixes the buffer-overflow when reading characters from textRun https://bugs.webkit.org/attachment.cgi?bugid=151055 Reviewed by Brent Fulgham. * platform/graphics/FontCascade.cpp 2015-11-16 Brady Eidson Modern IDB:Make in-memory ObjectStore cursors work. https://bugs.webkit.org/show_bug.cgi?id=151196 Reviewed by Darin Adler. Tests: storage/indexeddb/modern/cursor-2.html storage/indexeddb/modern/cursor-3.html storage/indexeddb/modern/cursor-4.html storage/indexeddb/modern/cursor-5.html storage/indexeddb/modern/cursor-6.html storage/indexeddb/modern/cursor-7.html storage/indexeddb/modern/cursor-8.html storage/indexeddb/modern/objectstore-cursor-advance-failures.html storage/indexeddb/modern/objectstore-cursor-continue-failures.html Object store cursors directly hold on to a std::set<>::iterator to act as the cursor. The object store tells all of its cursors when it is cleared or records are deleted so the cursors can invalidate their iterators as needed. In case of such invalidation, the cursor hangs on to the current key value so it can pick up where it left off in case it is iterated. * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * Modules/indexeddb/IDBGetResult.h: (WebCore::IDBGetResult::isolatedCopy): * Modules/indexeddb/IDBKeyRangeData.cpp: (WebCore::IDBKeyRangeData::containsKey): (WebCore::IDBKeyRangeData::loggingString): * Modules/indexeddb/IDBKeyRangeData.h: * Modules/indexeddb/client/IDBAnyImpl.cpp: (WebCore::IDBClient::IDBAny::modernIDBCursor): * Modules/indexeddb/client/IDBCursorImpl.cpp: (WebCore::IDBClient::IDBCursor::update): (WebCore::IDBClient::IDBCursor::advance): (WebCore::IDBClient::IDBCursor::continueFunction): (WebCore::IDBClient::IDBCursor::setGetResult): * Modules/indexeddb/client/IDBCursorImpl.h: * Modules/indexeddb/client/IDBRequestImpl.cpp: (WebCore::IDBClient::IDBRequest::dispatchEvent): (WebCore::IDBClient::IDBRequest::didOpenOrIterateCursor): * Modules/indexeddb/client/IDBRequestImpl.h: (WebCore::IDBClient::IDBRequest::pendingCursor): * Modules/indexeddb/client/IDBTransactionImpl.cpp: (WebCore::IDBClient::IDBTransaction::addRequest): Deleted. * Modules/indexeddb/client/TransactionOperation.cpp: (WebCore::IDBClient::TransactionOperation::TransactionOperation): * Modules/indexeddb/client/TransactionOperation.h: (WebCore::IDBClient::TransactionOperation::cursorIdentifier): * Modules/indexeddb/server/IDBBackingStore.h: * Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp: (WebCore::IDBServer::MemoryBackingStoreTransaction::objectStoreCleared): (WebCore::IDBServer::MemoryBackingStoreTransaction::abort): * Modules/indexeddb/server/MemoryBackingStoreTransaction.h: * Modules/indexeddb/server/MemoryCursor.cpp: Added. (WebCore::IDBServer::cursorMap): (WebCore::IDBServer::MemoryCursor::MemoryCursor): (WebCore::IDBServer::MemoryCursor::~MemoryCursor): (WebCore::IDBServer::MemoryCursor::cursorForIdentifier): * Modules/indexeddb/server/MemoryCursor.h: Added. * Modules/indexeddb/server/MemoryIDBBackingStore.cpp: (WebCore::IDBServer::MemoryIDBBackingStore::openCursor): (WebCore::IDBServer::MemoryIDBBackingStore::iterateCursor): * Modules/indexeddb/server/MemoryIDBBackingStore.h: * Modules/indexeddb/server/MemoryObjectStore.cpp: (WebCore::IDBServer::MemoryObjectStore::clear): (WebCore::IDBServer::MemoryObjectStore::replaceKeyValueStore): (WebCore::IDBServer::MemoryObjectStore::deleteRecord): (WebCore::IDBServer::MemoryObjectStore::addRecord): (WebCore::IDBServer::MemoryObjectStore::updateCursorsForPutRecord): (WebCore::IDBServer::MemoryObjectStore::updateCursorsForDeleteRecord): (WebCore::IDBServer::MemoryObjectStore::maybeOpenCursor): * Modules/indexeddb/server/MemoryObjectStore.h: (WebCore::IDBServer::MemoryObjectStore::orderedKeys): * Modules/indexeddb/server/MemoryObjectStoreCursor.cpp: Added. (WebCore::IDBServer::MemoryObjectStoreCursor::create): (WebCore::IDBServer::MemoryObjectStoreCursor::MemoryObjectStoreCursor): (WebCore::IDBServer::MemoryObjectStoreCursor::objectStoreCleared): (WebCore::IDBServer::MemoryObjectStoreCursor::keyDeleted): (WebCore::IDBServer::MemoryObjectStoreCursor::keyAdded): (WebCore::IDBServer::MemoryObjectStoreCursor::setFirstInRemainingRange): (WebCore::IDBServer::MemoryObjectStoreCursor::firstForwardIteratorInRemainingRange): (WebCore::IDBServer::MemoryObjectStoreCursor::firstReverseIteratorInRemainingRange): (WebCore::IDBServer::MemoryObjectStoreCursor::currentData): (WebCore::IDBServer::MemoryObjectStoreCursor::incrementForwardIterator): (WebCore::IDBServer::MemoryObjectStoreCursor::incrementReverseIterator): (WebCore::IDBServer::MemoryObjectStoreCursor::hasValidPosition): (WebCore::IDBServer::MemoryObjectStoreCursor::iterate): * Modules/indexeddb/server/MemoryObjectStoreCursor.h: Added. * Modules/indexeddb/server/UniqueIDBDatabase.cpp: (WebCore::IDBServer::UniqueIDBDatabase::iterateCursor): (WebCore::IDBServer::UniqueIDBDatabase::performIterateCursor): * Modules/indexeddb/server/UniqueIDBDatabase.h: * Modules/indexeddb/shared/IDBCursorInfo.h: (WebCore::IDBCursorInfo::range): * Modules/indexeddb/shared/IDBRequestData.cpp: (WebCore::IDBRequestData::IDBRequestData): (WebCore::IDBRequestData::cursorIdentifier): * Modules/indexeddb/shared/IDBRequestData.h: 2015-11-16 Anders Carlsson Add identifier strings for a bunch of context menu items https://bugs.webkit.org/show_bug.cgi?id=151272 Reviewed by Dan Bernstein. Have NSMenuItem conform to NSUserInterfaceItemIdentification. * platform/spi/mac/NSMenuSPI.h: 2015-11-16 Jiewen Tan Null-pointer dereference in WebCore::firstEditablePositionAfterPositionInRoot https://bugs.webkit.org/show_bug.cgi?id=151288 Reviewed by Darin Adler. Some problematic organization of body element could cause problems to JustifyRight and Indent commnads. Tests: editing/execCommand/justify-right-then-indent-with-problematic-body.html editing/execCommand/justify-right-with-problematic-body.html * editing/CompositeEditCommand.cpp: (WebCore::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary): Assertion at l1017 is not held anymore with the testcase: editing/execCommand/justify-right-with-problematic-body.html. Therefore, change it to an if statement. Also, add a guardance before calling insertNewDefaultParagraphElementAt() as insertNodeAt() requires an editable position. (WebCore::CompositeEditCommand::moveParagraphWithClones): Add a guardance before calling insertNodeAt() as it requires an editable position. * editing/htmlediting.cpp: (WebCore::firstEditablePositionAfterPositionInRoot): (WebCore::lastEditablePositionBeforePositionInRoot): 2015-11-16 Simon Fraser Sort the Xcode project files. * WebCore.xcodeproj/project.pbxproj: 2015-11-16 Sebastian Dröge WebRTC: Expose RTCPeerConnectionInternals functions to JS builtins. https://bugs.webkit.org/show_bug.cgi?id=151302 Reviewed by Youenn Fablet. * bindings/js/JSDOMWindowBase.cpp: (WebCore::JSDOMWindowBase::finishCreation): Expose RTCPeerConnectionInternals functions to JS builtins. 2015-11-16 Xabier Rodriguez Calvar [Streams API] Update the implementation up to spec of Nov 11 2015 https://bugs.webkit.org/show_bug.cgi?id=151195 Reviewed by Youenn Fablet. Updated the implementation of Readable and Writable Streams to the latest changes in the spec. Main changes are the removal of the error and the state from the reader, readers are not automatically released and then minor or style changes. Implementation is up to date with version https://github.com/whatwg/streams/commit/48c8a3c30ea7e76c5e4eb9f157a438dd755bcc8e. Tests: streams/reference-implementation/readable-stream-templated.html streams/reference-implementation/readable-stream-reader.html * Modules/streams/ReadableStream.js: (getReader): Removed check for locked stream. * Modules/streams/ReadableStreamInternals.js: (privateInitializeReadableStreamReader): Removed setting @error and @state and initialized owner and owner's reader as per spec. (teeReadableStreamPullFunction): Added assertions. (isReadableStreamReader): Added comment about resetting the reader owner to null instead of undefined as a means to distinguish between not having the slot and having it unset. (finishClosingReadableStream): Inline @closeReadableStreamReader as it is used only here now. (readFromReadableStreamReader): Reworked the state and error to use the stream one and changed the conditions to pull again as per spec. (errorReadableStream): Not releasing the reader and removed the reader error and state management. (releaseReadableStreamReader): Deleted. (closeReadableStreamReader): Deleted. * Modules/streams/ReadableStreamReader.js: (cancel): Removed some checks and assertions as per spec. (read): Added check for owner. (releaseLock): No closing the reader and rejecting close promise and unlinking reader and owner instead. * Modules/streams/WritableStream.js: (abort): Style change. * Modules/streams/WritableStreamInternals.js: (writableStreamAdvanceQueue): (closeWritableStream): Used @call instead of @apply. 2015-11-15 Adam Bergkvist WebRTC: Update RTCPeerConnection API and introduce PeerConnectionBackend https://bugs.webkit.org/show_bug.cgi?id=150166 Reviewed by Eric Carlson and Youenn Fablet This change introduces PeerConnectionBackend which is a WebCore interface that allows RTCPeerConnection to have platform abstractions at different levels. For example, the MediaEndpoint interface [1] is a lower level WebRTC backend abstraction where a big part of the WebRTC specification is implemented in WebCore to be reusable. RTCPeerConnectionHandler (in the repo today) is on the other hand a higher level WebRTC backend abstraction where the calls are mostly forwarded directly to the backend. The PeerConnectionBackend interface facilitates both approaches. RTCPeerConnection | (has) | PeerConnectionBackend | | | | (realizes) | MediaEndpointPeerConnection | | (has) | | | MediaEndpoint (platform interface) | | (realizes) RTCPeerHandlerPeerConnection | (has) | RCPeerConnectionHandler (existing platform interface) Notable changes: # Overloaded methods on RTCPeerConnection (Promise + legacy callback signatures) are implemented with JSBuiltins. # "Queued operations" ([1] Section 4.3.1) is implemented in JS bindings with Promises. # New RTCPeerConnection features - add/removeTrack() - pending/currentLocal/RemoteDescription attributes - RTCRtpSender/Receiver # Information carrying objects like RTCSessionDescription and RTCCandidate don't encapsulate a "mirrored" platform object anymore. # Remove RTCPeerConnection specific callback implementations (not used with JS bindings) [1] http://webkit.org/b/150165 [2] https://w3c.github.io/webrtc-pc/archives/20151006/webrtc.html Tests: Mock should be added to test future WebRTC backend abstractions. * CMakeLists.txt: * DerivedSources.make: * Modules/mediastream/PeerConnectionBackend.cpp: Added. (WebCore::createPeerConnectionBackend): * Modules/mediastream/PeerConnectionBackend.h: Added. (WebCore::PeerConnectionBackendClient::~PeerConnectionBackendClient): (WebCore::PeerConnectionBackend::~PeerConnectionBackend): * Modules/mediastream/PeerConnectionStates.h: Added. * Modules/mediastream/RTCConfiguration.cpp: Added. (WebCore::validateIceServerURL): (WebCore::parseIceServer): (WebCore::RTCConfiguration::create): (WebCore::RTCConfiguration::RTCConfiguration): (WebCore::RTCConfiguration::initialize): * Modules/mediastream/RTCConfiguration.h: (WebCore::RTCConfiguration::iceTransportPolicy): (WebCore::RTCConfiguration::bundlePolicy): (WebCore::RTCConfiguration::iceServers): (WebCore::RTCConfiguration::create): Deleted. (WebCore::RTCConfiguration::appendServer): Deleted. (WebCore::RTCConfiguration::numberOfServers): Deleted. (WebCore::RTCConfiguration::server): Deleted. (WebCore::RTCConfiguration::iceTransports): Deleted. (WebCore::RTCConfiguration::setIceTransports): Deleted. (WebCore::RTCConfiguration::requestIdentity): Deleted. (WebCore::RTCConfiguration::setRequestIdentity): Deleted. (WebCore::RTCConfiguration::privateConfiguration): Deleted. (WebCore::RTCConfiguration::RTCConfiguration): Deleted. * Modules/mediastream/RTCConfiguration.idl: * Modules/mediastream/RTCIceCandidate.cpp: (WebCore::RTCIceCandidate::create): (WebCore::RTCIceCandidate::RTCIceCandidate): (WebCore::RTCIceCandidate::~RTCIceCandidate): Deleted. (WebCore::RTCIceCandidate::candidate): Deleted. (WebCore::RTCIceCandidate::sdpMid): Deleted. (WebCore::RTCIceCandidate::sdpMLineIndex): Deleted. (WebCore::RTCIceCandidate::descriptor): Deleted. * Modules/mediastream/RTCIceCandidate.h: (WebCore::RTCIceCandidate::~RTCIceCandidate): (WebCore::RTCIceCandidate::candidate): (WebCore::RTCIceCandidate::setCandidate): (WebCore::RTCIceCandidate::sdpMid): (WebCore::RTCIceCandidate::setSdpMid): (WebCore::RTCIceCandidate::sdpMLineIndex): (WebCore::RTCIceCandidate::setSdpMLineIndex): * Modules/mediastream/RTCIceCandidate.idl: * Modules/mediastream/RTCIceCandidateEvent.cpp: (WebCore::RTCIceCandidateEvent::create): (WebCore::RTCIceCandidateEvent::RTCIceCandidateEvent): * Modules/mediastream/RTCIceCandidateEvent.h: * Modules/mediastream/RTCIceServer.h: (WebCore::RTCIceServer::urls): (WebCore::RTCIceServer::credential): (WebCore::RTCIceServer::username): (WebCore::RTCIceServer::RTCIceServer): (WebCore::RTCIceServer::create): Deleted. (WebCore::RTCIceServer::privateServer): Deleted. * Modules/mediastream/RTCOfferAnswerOptions.cpp: (WebCore::RTCOfferAnswerOptions::RTCOfferAnswerOptions): (WebCore::RTCOfferAnswerOptions::initialize): (WebCore::RTCOfferOptions::RTCOfferOptions): (WebCore::RTCOfferOptions::initialize): (WebCore::RTCAnswerOptions::create): (WebCore::RTCAnswerOptions::initialize): (WebCore::RTCOfferAnswerOptions::create): Deleted. * Modules/mediastream/RTCOfferAnswerOptions.h: (WebCore::RTCOfferAnswerOptions::voiceActivityDetection): (WebCore::RTCOfferOptions::offerToReceiveVideo): (WebCore::RTCOfferOptions::offerToReceiveAudio): (WebCore::RTCOfferOptions::iceRestart): (WebCore::RTCAnswerOptions::RTCAnswerOptions): (WebCore::RTCOfferAnswerOptions::requestIdentity): Deleted. (WebCore::RTCOfferAnswerOptions::privateOfferAnswerOptions): Deleted. (WebCore::RTCOfferAnswerOptions::RTCOfferAnswerOptions): Deleted. (WebCore::RTCOfferOptions::voiceActivityDetection): Deleted. (WebCore::RTCOfferOptions::privateOfferOptions): Deleted. (WebCore::RTCOfferOptions::~RTCOfferOptions): Deleted. (WebCore::RTCOfferOptions::RTCOfferOptions): Deleted. * Modules/mediastream/RTCPeerConnection.cpp: (WebCore::RTCPeerConnection::create): (WebCore::RTCPeerConnection::RTCPeerConnection): (WebCore::RTCPeerConnection::getSenders): (WebCore::RTCPeerConnection::getReceivers): (WebCore::RTCPeerConnection::addTrack): (WebCore::RTCPeerConnection::removeTrack): (WebCore::RTCPeerConnection::queuedCreateOffer): (WebCore::RTCPeerConnection::queuedCreateAnswer): (WebCore::RTCPeerConnection::queuedSetLocalDescription): (WebCore::RTCPeerConnection::localDescription): (WebCore::RTCPeerConnection::currentLocalDescription): (WebCore::RTCPeerConnection::pendingLocalDescription): (WebCore::RTCPeerConnection::queuedSetRemoteDescription): (WebCore::RTCPeerConnection::remoteDescription): (WebCore::RTCPeerConnection::currentRemoteDescription): (WebCore::RTCPeerConnection::pendingRemoteDescription): (WebCore::RTCPeerConnection::queuedAddIceCandidate): (WebCore::RTCPeerConnection::signalingState): (WebCore::RTCPeerConnection::iceGatheringState): (WebCore::RTCPeerConnection::iceConnectionState): (WebCore::RTCPeerConnection::setConfiguration): (WebCore::RTCPeerConnection::privateGetStats): (WebCore::RTCPeerConnection::createDataChannel): (WebCore::RTCPeerConnection::close): (WebCore::RTCPeerConnection::stop): (WebCore::RTCPeerConnection::setSignalingState): (WebCore::RTCPeerConnection::updateIceGatheringState): (WebCore::RTCPeerConnection::updateIceConnectionState): (WebCore::RTCPeerConnection::scheduleNegotiationNeededEvent): (WebCore::RTCPeerConnection::fireEvent): (WebCore::validateIceServerURL): Deleted. (WebCore::processIceServer): Deleted. (WebCore::RTCPeerConnection::parseConfiguration): Deleted. (WebCore::RTCPeerConnection::~RTCPeerConnection): Deleted. (WebCore::RTCPeerConnection::createOffer): Deleted. (WebCore::RTCPeerConnection::createAnswer): Deleted. (WebCore::RTCPeerConnection::checkStateForLocalDescription): Deleted. (WebCore::RTCPeerConnection::checkStateForRemoteDescription): Deleted. (WebCore::RTCPeerConnection::setLocalDescription): Deleted. (WebCore::RTCPeerConnection::setRemoteDescription): Deleted. (WebCore::RTCPeerConnection::updateIce): Deleted. (WebCore::RTCPeerConnection::addIceCandidate): Deleted. (WebCore::RTCPeerConnection::addStream): Deleted. (WebCore::RTCPeerConnection::removeStream): Deleted. (WebCore::RTCPeerConnection::getLocalStreams): Deleted. (WebCore::RTCPeerConnection::getRemoteStreams): Deleted. (WebCore::RTCPeerConnection::getStreamById): Deleted. (WebCore::RTCPeerConnection::getStats): Deleted. (WebCore::RTCPeerConnection::hasLocalStreamWithTrackId): Deleted. (WebCore::RTCPeerConnection::createDTMFSender): Deleted. (WebCore::RTCPeerConnection::negotiationNeeded): Deleted. (WebCore::RTCPeerConnection::didGenerateIceCandidate): Deleted. (WebCore::RTCPeerConnection::didChangeSignalingState): Deleted. (WebCore::RTCPeerConnection::didChangeIceGatheringState): Deleted. (WebCore::RTCPeerConnection::didChangeIceConnectionState): Deleted. (WebCore::RTCPeerConnection::didAddRemoteStream): Deleted. (WebCore::RTCPeerConnection::didRemoveRemoteStream): Deleted. (WebCore::RTCPeerConnection::didAddRemoteDataChannel): Deleted. (WebCore::RTCPeerConnection::didAddOrRemoveTrack): Deleted. (WebCore::RTCPeerConnection::changeSignalingState): Deleted. (WebCore::RTCPeerConnection::changeIceGatheringState): Deleted. (WebCore::RTCPeerConnection::changeIceConnectionState): Deleted. (WebCore::RTCPeerConnection::scheduleDispatchEvent): Deleted. (WebCore::RTCPeerConnection::scheduledEventTimerFired): Deleted. * Modules/mediastream/RTCPeerConnection.h: * Modules/mediastream/RTCPeerConnection.idl: * Modules/mediastream/RTCPeerConnection.js: Added. (createOffer): (createAnswer): (setLocalDescription): (setRemoteDescription): (addIceCandidate): (getStats): * Modules/mediastream/RTCPeerConnectionErrorCallback.h: (WebCore::RTCPeerConnectionErrorCallback::~RTCPeerConnectionErrorCallback): Deleted. * Modules/mediastream/RTCPeerConnectionInternals.js: Added. (runNext): (enqueueOperation): (setLocalOrRemoteDescription): (extractCallbackArg): * Modules/mediastream/RTCRtpReceiver.cpp: Added. (WebCore::RTCRtpReceiver::RTCRtpReceiver): * Modules/mediastream/RTCRtpReceiver.h: Added. (WebCore::RTCRtpReceiver::create): * Modules/mediastream/RTCRtpReceiver.idl: Added. * Modules/mediastream/RTCRtpSender.cpp: Added. (WebCore::RTCRtpSender::RTCRtpSender): * Modules/mediastream/RTCRtpSender.h: Added. (WebCore::RTCRtpSender::create): (WebCore::RTCRtpSender::mediaStreamId): * Modules/mediastream/RTCRtpSender.idl: Added. * Modules/mediastream/RTCRtpSenderReceiverBase.h: Added. (WebCore::RTCRtpSenderReceiverBase::~RTCRtpSenderReceiverBase): (WebCore::RTCRtpSenderReceiverBase::track): (WebCore::RTCRtpSenderReceiverBase::RTCRtpSenderReceiverBase): * Modules/mediastream/RTCSessionDescription.cpp: (WebCore::RTCSessionDescription::create): (WebCore::RTCSessionDescription::RTCSessionDescription): (WebCore::RTCSessionDescription::setType): (WebCore::RTCSessionDescription::~RTCSessionDescription): Deleted. (WebCore::RTCSessionDescription::type): Deleted. (WebCore::RTCSessionDescription::sdp): Deleted. (WebCore::RTCSessionDescription::setSdp): Deleted. (WebCore::RTCSessionDescription::descriptor): Deleted. * Modules/mediastream/RTCSessionDescription.h: (WebCore::RTCSessionDescription::~RTCSessionDescription): (WebCore::RTCSessionDescription::type): (WebCore::RTCSessionDescription::sdp): (WebCore::RTCSessionDescription::setSdp): * Modules/mediastream/RTCSessionDescriptionCallback.h: (WebCore::RTCSessionDescriptionCallback::~RTCSessionDescriptionCallback): Deleted. * Modules/mediastream/RTCSessionDescriptionRequestImpl.cpp: Removed. (WebCore::RTCSessionDescriptionRequestImpl::create): Deleted. (WebCore::RTCSessionDescriptionRequestImpl::RTCSessionDescriptionRequestImpl): Deleted. (WebCore::RTCSessionDescriptionRequestImpl::~RTCSessionDescriptionRequestImpl): Deleted. (WebCore::RTCSessionDescriptionRequestImpl::requestSucceeded): Deleted. (WebCore::RTCSessionDescriptionRequestImpl::requestFailed): Deleted. (WebCore::RTCSessionDescriptionRequestImpl::stop): Deleted. (WebCore::RTCSessionDescriptionRequestImpl::activeDOMObjectName): Deleted. (WebCore::RTCSessionDescriptionRequestImpl::canSuspendForPageCache): Deleted. (WebCore::RTCSessionDescriptionRequestImpl::clear): Deleted. * Modules/mediastream/RTCSessionDescriptionRequestImpl.h: Removed. * Modules/mediastream/RTCStatsCallback.h: Removed. (WebCore::RTCStatsCallback::~RTCStatsCallback): Deleted. * Modules/mediastream/RTCStatsCallback.idl: Removed. * Modules/mediastream/RTCStatsRequestImpl.cpp: Removed. (WebCore::RTCStatsRequestImpl::create): Deleted. (WebCore::RTCStatsRequestImpl::RTCStatsRequestImpl): Deleted. (WebCore::RTCStatsRequestImpl::~RTCStatsRequestImpl): Deleted. (WebCore::RTCStatsRequestImpl::createResponse): Deleted. (WebCore::RTCStatsRequestImpl::hasSelector): Deleted. (WebCore::RTCStatsRequestImpl::track): Deleted. (WebCore::RTCStatsRequestImpl::requestSucceeded): Deleted. (WebCore::RTCStatsRequestImpl::requestFailed): Deleted. (WebCore::RTCStatsRequestImpl::stop): Deleted. (WebCore::RTCStatsRequestImpl::activeDOMObjectName): Deleted. (WebCore::RTCStatsRequestImpl::canSuspendForPageCache): Deleted. (WebCore::RTCStatsRequestImpl::clear): Deleted. * Modules/mediastream/RTCStatsRequestImpl.h: Removed. * Modules/mediastream/RTCTrackEvent.cpp: Added. (WebCore::RTCTrackEventInit::RTCTrackEventInit): (WebCore::RTCTrackEvent::create): (WebCore::RTCTrackEvent::RTCTrackEvent): * Modules/mediastream/RTCTrackEvent.h: Added. (WebCore::RTCTrackEvent::receiver): (WebCore::RTCTrackEvent::track): (WebCore::RTCTrackEvent::eventInterface): * Modules/mediastream/RTCTrackEvent.idl: Added. * Modules/mediastream/RTCVoidRequestImpl.cpp: Removed. (WebCore::RTCVoidRequestImpl::create): Deleted. (WebCore::RTCVoidRequestImpl::RTCVoidRequestImpl): Deleted. (WebCore::RTCVoidRequestImpl::~RTCVoidRequestImpl): Deleted. (WebCore::RTCVoidRequestImpl::requestSucceeded): Deleted. (WebCore::RTCVoidRequestImpl::requestFailed): Deleted. (WebCore::RTCVoidRequestImpl::stop): Deleted. (WebCore::RTCVoidRequestImpl::activeDOMObjectName): Deleted. (WebCore::RTCVoidRequestImpl::canSuspendForPageCache): Deleted. (WebCore::RTCVoidRequestImpl::clear): Deleted. * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSDictionary.cpp: (WebCore::JSDictionary::convertValue): * bindings/js/JSDictionary.h: * bindings/js/WebCoreBuiltinNames.h: * bindings/js/WebCoreJSBuiltinInternals.h: (WebCore::JSBuiltinInternalFunctions::JSBuiltinInternalFunctions): (WebCore::JSBuiltinInternalFunctions::rTCPeerConnectionInternals): (WebCore::JSBuiltinInternalFunctions::visit): (WebCore::JSBuiltinInternalFunctions::init): * bindings/js/WebCoreJSBuiltins.cpp: * bindings/js/WebCoreJSBuiltins.h: (WebCore::JSBuiltinFunctions::JSBuiltinFunctions): (WebCore::JSBuiltinFunctions::rTCPeerConnectionBuiltins): (WebCore::JSBuiltinFunctions::rTCPeerConnectionInternalsBuiltins): * dom/EventNames.in: 2015-11-15 David Kilzer REGRESSION (r192404): Fix tvOS and watchOS builds * platform/spi/cocoa/QuartzCoreSPI.h: Add more version checks to fix all the builds. 2015-11-14 Gyuyoung Kim [EFL][GTK] Remove use of String::format() in versionForUAString() https://bugs.webkit.org/show_bug.cgi?id=151250 Reviewed by Darin Adler. As String::format() will be deprecated due to the security problem, reimplement versionForUAString() using a macro. * platform/efl/UserAgentEfl.cpp: (WebCore::versionForUAString): * platform/gtk/UserAgentGtk.cpp: (WebCore::platformVersionForUAString): (WebCore::versionForUAString): 2015-11-14 Antti Koivisto Regression(r188820): Downloads of data URLs is broken https://bugs.webkit.org/show_bug.cgi?id=150900 rdar://problem/23399223 Reviewed by Darin Adler. No test, the current test infrastructure only allows testing policy decisions, not the actual download. * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::continueAfterContentPolicy): Use normal download path for data URLs instead of trying to convert the main resource load. Since we decode data URLs locally there is no associated resource load on WebKit side. 2015-11-14 Nan Wang AX: add a new trait for elements in fieldset on iOS https://bugs.webkit.org/show_bug.cgi?id=151281 Reviewed by Chris Fleizach. Added a new trait for elements in the fieldset, so VoiceOver can speak the legend information for those elements. Test: accessibility/ios-simulator/fieldset-traits.html * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper accessibilityCanFuzzyHitTest]): (-[WebAccessibilityObjectWrapper _accessibilityTableAncestor]): (-[WebAccessibilityObjectWrapper _accessibilityFieldsetAncestor]): (-[WebAccessibilityObjectWrapper _accessibilityTraitsFromAncestors]): 2015-11-13 Commit Queue Unreviewed, rolling out r192445, r192451, and r192452. https://bugs.webkit.org/show_bug.cgi?id=151291 Broke Mavericks build (and thus EWS) (Requested by ap on #webkit). Reverted changesets: "Add identifier strings for a bunch of context menu items" https://bugs.webkit.org/show_bug.cgi?id=151272 http://trac.webkit.org/changeset/192445 "Try to fix the 32-bit build" http://trac.webkit.org/changeset/192451 "Try to fix the 32-bit build" http://trac.webkit.org/changeset/192452 2015-11-13 Anders Carlsson Add identifier strings for a bunch of context menu items https://bugs.webkit.org/show_bug.cgi?id=151272 Reviewed by Dan Bernstein. Have NSMenuItem conform to NSUserInterfaceItemIdentification. * platform/spi/mac/NSMenuSPI.h: 2015-11-13 Zalan Bujtas Always render at least a device pixel line when border/outline width > 0. https://bugs.webkit.org/show_bug.cgi?id=151269 This matches Firefox behaviour. Reviewed by Simon Fraser. Existing test is modified to reflect the new behaviour. * css/StyleBuilderConverter.h: (WebCore::StyleBuilderConverter::convertLineWidth): * rendering/BorderEdge.cpp: (WebCore::BorderEdge::BorderEdge): Deleted. * rendering/BorderEdge.h: 2015-11-13 Per Arne Vollan [WinCairo][MediaFoundation] Video rendered at wrong position. https://bugs.webkit.org/show_bug.cgi?id=151271 Reviewed by Alex Christensen. The source rectangle used when blitting a frame to the graphics context should have offset (0, 0). * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp: (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::paintCurrentFrame): 2015-11-13 Joseph Pecoraro Web Inspector: Provide a way to override the WKWebView remote inspector name https://bugs.webkit.org/show_bug.cgi?id=151075 Reviewed by Tim Horton. * page/Page.cpp: (WebCore::Page::remoteInspectionNameOverride): (WebCore::Page::setRemoteInspectionNameOverride): * page/Page.h: * page/PageDebuggable.cpp: (WebCore::PageDebuggable::name): (WebCore::PageDebuggable::setNameOverride): * page/PageDebuggable.h: 2015-11-13 Jiewen Tan Element::focus() should acquire the ownership of Frame. https://bugs.webkit.org/show_bug.cgi?id=150204 Reviewed by Brent Fulgham. The FrameSelection::setSelection method sometimes releases the last reference to a frame. When this happens, the Element::updateFocusAppearance would attempt to use dereferenced memory. Instead, we should ensure that the Frame lifetime is guaranteed to extend through the duration of the method call. Test: editing/selection/focus-iframe-removal-crash.html * dom/Element.cpp: (WebCore::Element::updateFocusAppearance): 2015-11-13 Sergio Villar Senin [css-grid] Remove unused GridResolvedPosition constructor https://bugs.webkit.org/show_bug.cgi?id=151133 Reviewed by Mario Sanchez Prada. No new tests required, just deleting dead code. * rendering/style/GridResolvedPosition.cpp: (WebCore::GridResolvedPosition::GridResolvedPosition): Deleted. * rendering/style/GridResolvedPosition.h: 2015-11-13 Sergio Villar Senin ASSERTION FAILED: m_isEngaged in WTF::Optional::value https://bugs.webkit.org/show_bug.cgi?id=151094 Reviewed by Darin Adler. That ASSERT was hit because the precondition was incorrectly met, i.e., we're considering that the main axis length was definite when it was actually not. The problem is that to determine whether it was indefinite or not we're using RenderBox::hasDefiniteLogicalHeight() which did not perfectly match RenderBox::computePercentageLogicalHeight() for the case of RenderTables. So computePercentageLogicalHeight() was returning Nullopt (i.e. indefinite) while hasDefiniteLogicalHeight() was returning true (so definite). Some checks were refactored in a helper function to solve the inconsistency so that both functions behave the same way even in this particular situation. Test: css3/flexbox/inline-flex-percentage-height-in-table-crash.html * rendering/RenderBox.cpp: (WebCore::tableCellShouldHaveZeroInitialSize): (WebCore::RenderBox::computePercentageLogicalHeight): (WebCore::percentageLogicalHeightIsResolvable): (WebCore::RenderBox::percentageLogicalHeightIsResolvableFromBlock): * rendering/RenderBox.h: 2015-11-13 Csaba Osztrogonác Unreviewed, really fix the Mac CMake build after r192376. * PlatformMac.cmake: 2015-11-13 Csaba Osztrogonác Unreviewed, fix the Mac CMake build after r192376. * PlatformMac.cmake: 2015-11-12 Tim Horton Follow up to the previous change * platform/spi/cocoa/QuartzCoreSPI.h: Somehow this escaped. 2015-11-12 Tim Horton Try to fix the Watch/TV build * platform/spi/cocoa/QuartzCoreSPI.h: Be more accurate about where we need these. 2015-11-12 Brady Eidson Modern IDB: Pipe through cursor functions from client to server. https://bugs.webkit.org/show_bug.cgi?id=151197 Reviewed by Alex Christensen. Tests: storage/indexeddb/modern/cursor-1.html storage/indexeddb/modern/opencursor-failures.html This patch implements most IDBCursor considerations at the IDL level, as well as pipes the appropriate messages through from client to server. All operations currently end in errors. Bug 151196 will fix that by making cursors functional. * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * Modules/indexeddb/IDBCursor.h: (WebCore::IDBCursor::isKeyCursor): Deleted. * Modules/indexeddb/IDBCursorWithValue.h: * Modules/indexeddb/IDBGetResult.h: * Modules/indexeddb/IDBKeyData.h: (WebCore::IDBKeyData::string): (WebCore::IDBKeyData::date): (WebCore::IDBKeyData::number): (WebCore::IDBKeyData::array): * Modules/indexeddb/IndexedDB.h: * Modules/indexeddb/client/IDBAnyImpl.cpp: (WebCore::IDBClient::IDBAny::IDBAny): (WebCore::IDBClient::IDBAny::idbCursor): (WebCore::IDBClient::IDBAny::idbCursorWithValue): (WebCore::IDBClient::IDBAny::idbIndex): (WebCore::IDBClient::IDBAny::idbObjectStore): (WebCore::IDBClient::IDBAny::modernIDBCursor): * Modules/indexeddb/client/IDBAnyImpl.h: (WebCore::IDBClient::IDBAny::create): * Modules/indexeddb/client/IDBConnectionToServer.cpp: (WebCore::IDBClient::IDBConnectionToServer::openCursor): (WebCore::IDBClient::IDBConnectionToServer::didOpenCursor): (WebCore::IDBClient::IDBConnectionToServer::iterateCursor): (WebCore::IDBClient::IDBConnectionToServer::didIterateCursor): * Modules/indexeddb/client/IDBConnectionToServer.h: * Modules/indexeddb/client/IDBConnectionToServerDelegate.h: * Modules/indexeddb/client/IDBCursorImpl.cpp: (WebCore::IDBClient::IDBCursor::create): (WebCore::IDBClient::IDBCursor::IDBCursor): (WebCore::IDBClient::IDBCursor::sourcesDeleted): (WebCore::IDBClient::IDBCursor::effectiveObjectStore): (WebCore::IDBClient::IDBCursor::transaction): (WebCore::IDBClient::IDBCursor::direction): (WebCore::IDBClient::IDBCursor::key): (WebCore::IDBClient::IDBCursor::primaryKey): (WebCore::IDBClient::IDBCursor::value): (WebCore::IDBClient::IDBCursor::source): (WebCore::IDBClient::IDBCursor::update): (WebCore::IDBClient::IDBCursor::advance): (WebCore::IDBClient::IDBCursor::continueFunction): (WebCore::IDBClient::IDBCursor::uncheckedIteratorCursor): (WebCore::IDBClient::IDBCursor::deleteFunction): (WebCore::IDBClient::IDBCursor::setGetResult): * Modules/indexeddb/client/IDBCursorImpl.h: (WebCore::IDBClient::IDBCursor::info): (WebCore::IDBClient::IDBCursor::setRequest): (WebCore::IDBClient::IDBCursor::clearRequest): (WebCore::IDBClient::IDBCursor::request): * Modules/indexeddb/client/IDBCursorWithValueImpl.cpp: (WebCore::IDBClient::IDBCursorWithValue::create): (WebCore::IDBClient::IDBCursorWithValue::IDBCursorWithValue): (WebCore::IDBClient::IDBCursorWithValue::~IDBCursorWithValue): * Modules/indexeddb/client/IDBCursorWithValueImpl.h: * Modules/indexeddb/client/IDBIndexImpl.cpp: (WebCore::IDBClient::IDBIndex::openCursor): (WebCore::IDBClient::IDBIndex::openKeyCursor): * Modules/indexeddb/client/IDBIndexImpl.h: (WebCore::IDBClient::IDBIndex::modernObjectStore): (WebCore::IDBClient::IDBIndex::isDeleted): * Modules/indexeddb/client/IDBObjectStoreImpl.cpp: (WebCore::IDBClient::IDBObjectStore::openCursor): (WebCore::IDBClient::IDBObjectStore::deleteFunction): * Modules/indexeddb/client/IDBObjectStoreImpl.h: * Modules/indexeddb/client/IDBRequestImpl.cpp: (WebCore::IDBClient::IDBRequest::create): (WebCore::IDBClient::IDBRequest::IDBRequest): (WebCore::IDBClient::IDBRequest::~IDBRequest): (WebCore::IDBClient::IDBRequest::source): (WebCore::IDBClient::IDBRequest::resultCursor): (WebCore::IDBClient::IDBRequest::willIterateCursor): (WebCore::IDBClient::IDBRequest::didOpenOrIterateCursor): (WebCore::IDBClient::IDBRequest::requestCompleted): * Modules/indexeddb/client/IDBRequestImpl.h: (WebCore::IDBClient::IDBRequest::modernResult): * Modules/indexeddb/client/IDBTransactionImpl.cpp: (WebCore::IDBClient::IDBTransaction::requestOpenCursor): (WebCore::IDBClient::IDBTransaction::doRequestOpenCursor): (WebCore::IDBClient::IDBTransaction::openCursorOnServer): (WebCore::IDBClient::IDBTransaction::didOpenCursorOnServer): (WebCore::IDBClient::IDBTransaction::iterateCursor): (WebCore::IDBClient::IDBTransaction::iterateCursorOnServer): (WebCore::IDBClient::IDBTransaction::didIterateCursorOnServer): * Modules/indexeddb/client/IDBTransactionImpl.h: * Modules/indexeddb/client/TransactionOperation.h: (WebCore::IDBClient::createTransactionOperation): * Modules/indexeddb/legacy/LegacyCursor.cpp: (WebCore::LegacyCursor::source): * Modules/indexeddb/legacy/LegacyCursor.h: (WebCore::LegacyCursor::continueFunction): Deleted. (WebCore::LegacyCursor::isKeyCursor): Deleted. * Modules/indexeddb/legacy/LegacyCursorWithValue.h: * Modules/indexeddb/server/IDBBackingStore.h: * Modules/indexeddb/server/IDBConnectionToClient.cpp: (WebCore::IDBServer::IDBConnectionToClient::didOpenCursor): (WebCore::IDBServer::IDBConnectionToClient::didIterateCursor): * Modules/indexeddb/server/IDBConnectionToClient.h: * Modules/indexeddb/server/IDBConnectionToClientDelegate.h: * Modules/indexeddb/server/IDBServer.cpp: (WebCore::IDBServer::IDBServer::openCursor): (WebCore::IDBServer::IDBServer::iterateCursor): * Modules/indexeddb/server/IDBServer.h: * Modules/indexeddb/server/MemoryIDBBackingStore.cpp: (WebCore::IDBServer::MemoryIDBBackingStore::openCursor): (WebCore::IDBServer::MemoryIDBBackingStore::iterateCursor): * Modules/indexeddb/server/MemoryIDBBackingStore.h: * Modules/indexeddb/server/UniqueIDBDatabase.cpp: (WebCore::IDBServer::UniqueIDBDatabase::openCursor): (WebCore::IDBServer::UniqueIDBDatabase::performOpenCursor): (WebCore::IDBServer::UniqueIDBDatabase::didPerformOpenCursor): (WebCore::IDBServer::UniqueIDBDatabase::iterateCursor): (WebCore::IDBServer::UniqueIDBDatabase::performIterateCursor): (WebCore::IDBServer::UniqueIDBDatabase::didPerformIterateCursor): * Modules/indexeddb/server/UniqueIDBDatabase.h: * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp: (WebCore::IDBServer::UniqueIDBDatabaseTransaction::deleteRecord): (WebCore::IDBServer::UniqueIDBDatabaseTransaction::openCursor): (WebCore::IDBServer::UniqueIDBDatabaseTransaction::iterateCursor): * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h: * Modules/indexeddb/shared/IDBCursorInfo.cpp: Added. (WebCore::IDBCursorInfo::objectStoreCursor): (WebCore::IDBCursorInfo::indexCursor): (WebCore::IDBCursorInfo::IDBCursorInfo): (WebCore::IDBCursorInfo::isDirectionForward): (WebCore::IDBCursorInfo::isolatedCopy): * Modules/indexeddb/shared/IDBCursorInfo.h: Added. (WebCore::IDBCursorInfo::identifier): (WebCore::IDBCursorInfo::sourceIdentifier): (WebCore::IDBCursorInfo::cursorSource): (WebCore::IDBCursorInfo::cursorDirection): (WebCore::IDBCursorInfo::cursorType): * Modules/indexeddb/shared/IDBResultData.cpp: (WebCore::IDBResultData::openCursorSuccess): (WebCore::IDBResultData::iterateCursorSuccess): * Modules/indexeddb/shared/IDBResultData.h: * Modules/indexeddb/shared/InProcessIDBServer.cpp: (WebCore::InProcessIDBServer::didOpenCursor): (WebCore::InProcessIDBServer::didIterateCursor): (WebCore::InProcessIDBServer::openCursor): (WebCore::InProcessIDBServer::iterateCursor): * Modules/indexeddb/shared/InProcessIDBServer.h: * bindings/js/IDBBindingUtilities.cpp: (WebCore::idbKeyDataToJSValue): * bindings/js/IDBBindingUtilities.h: * platform/CrossThreadCopier.cpp: (WebCore::IDBCursorInfo>::copy): * platform/CrossThreadCopier.h: 2015-11-12 Anders Carlsson Delete PlatformMenuDescription.h https://bugs.webkit.org/show_bug.cgi?id=151229 Reviewed by Beth Dakin. * WebCore.vcxproj/WebCore.vcxproj: * WebCore.vcxproj/WebCore.vcxproj.filters: * WebCore.xcodeproj/project.pbxproj: * page/ContextMenuClient.h: * platform/ContextMenu.h: * platform/ContextMenuItem.h: * platform/PlatformMenuDescription.h: Removed. 2015-11-12 Anders Carlsson ContextMenuAction and WebMenuItemTag shouldn't have to be in sync https://bugs.webkit.org/show_bug.cgi?id=151226 Reviewed by Tim Horton. * page/ContextMenuController.cpp: * platform/ContextMenuItem.h: Remove now unneeded comments. Also, remove ContextMenuItemTagOpenLinkInThisWindow since it wasn't used by any of our remaining ports. 2015-11-12 Zalan Bujtas Ignore visited background color when deciding if the input renderer needs to be painted natively. https://bugs.webkit.org/show_bug.cgi?id=151211 rdar://problem/21449823 Reviewed by Antti Koivisto. Test: fast/css/pseudo-visited-background-color-on-input.html * rendering/RenderTheme.cpp: (WebCore::RenderTheme::isControlStyled): * rendering/style/RenderStyle.h: 2015-11-12 David Hyatt Tatechuyoko shrink-to-fit breaks after changing color, background-color or text-decoration https://bugs.webkit.org/show_bug.cgi?id=151218 Reviewed by Myles Maxfield. Added fast/text/text-combine-shrink-on-color-change.html * rendering/RenderCombineText.cpp: (WebCore::RenderCombineText::styleDidChange): 2015-11-12 Anders Carlsson Use ContextMenuItemTagNoAction instead of ContextMenuItemCustomTagNoAction https://bugs.webkit.org/show_bug.cgi?id=151222 Reviewed by Joseph Pecoraro. * bindings/js/JSInspectorFrontendHostCustom.cpp: (WebCore::populateContextMenuItems): * page/ContextMenuController.cpp: (WebCore::ContextMenuController::checkOrEnableIfNeeded): Deleted. * platform/ContextMenuItem.h: 2015-11-12 Myles C. Maxfield [Cocoa] Font fallback is not language-sensitive https://bugs.webkit.org/show_bug.cgi?id=147390 Reviewed by Dean Jackson. Test: fast/text/fallback-language-han-2.html * platform/graphics/cocoa/FontCacheCoreText.cpp: (WebCore::FontCache::systemFallbackForCharacters): 2015-11-12 Anders Carlsson ContextMenuController::contextMenuItemSelected only needs the action and title, not the full item https://bugs.webkit.org/show_bug.cgi?id=151217 Reviewed by Joseph Pecoraro. * inspector/InspectorFrontendHost.cpp: * page/ContextMenuController.cpp: (WebCore::ContextMenuController::contextMenuItemSelected): * page/ContextMenuController.h: * page/ContextMenuProvider.h: 2015-11-12 Anders Carlsson Remove an unused function https://bugs.webkit.org/show_bug.cgi?id=151215 Reviewed by Joseph Pecoraro. * loader/EmptyClients.h: * page/ContextMenuClient.h: * page/ContextMenuController.cpp: (WebCore::ContextMenuController::contextMenuItemSelected): Deleted. 2015-11-11 Anders Carlsson Enable cross-platform context menus by default https://bugs.webkit.org/show_bug.cgi?id=151173 Reviewed by Tim Horton. * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSInspectorFrontendHostCustom.cpp: (WebCore::JSInspectorFrontendHost::showContextMenu): * page/ContextMenuController.cpp: (WebCore::ContextMenuController::addInspectElementItem): Deleted. * platform/ContextMenu.cpp: * platform/ContextMenu.h: * platform/ContextMenuItem.cpp: * platform/ContextMenuItem.h: (WebCore::ContextMenuItem::isNull): Deleted. * platform/mac/ContextMenuItemMac.mm: Removed. (WebCore::menuToArray): Deleted. (WebCore::ContextMenuItem::ContextMenuItem): Deleted. (WebCore::createPlatformMenuItemDescription): Deleted. (WebCore::ContextMenuItem::~ContextMenuItem): Deleted. (WebCore::ContextMenuItem::platformDescription): Deleted. (WebCore::ContextMenuItem::type): Deleted. (WebCore::ContextMenuItem::action): Deleted. (WebCore::ContextMenuItem::title): Deleted. (WebCore::ContextMenuItem::platformSubMenu): Deleted. (WebCore::ContextMenuItem::setType): Deleted. (WebCore::ContextMenuItem::setAction): Deleted. (WebCore::ContextMenuItem::setTitle): Deleted. (WebCore::ContextMenuItem::setSubMenu): Deleted. (WebCore::ContextMenuItem::setChecked): Deleted. (WebCore::ContextMenuItem::setEnabled): Deleted. (WebCore::ContextMenuItem::enabled): Deleted. (WebCore::ContextMenuItem::checked): Deleted. * platform/mac/ContextMenuMac.mm: Removed. (WebCore::ContextMenu::ContextMenu): Deleted. (WebCore::ContextMenu::~ContextMenu): Deleted. (WebCore::ContextMenu::appendItem): Deleted. (WebCore::ContextMenu::insertItem): Deleted. (WebCore::ContextMenu::itemCount): Deleted. (WebCore::ContextMenu::setPlatformDescription): Deleted. (WebCore::ContextMenu::platformDescription): Deleted. (WebCore::ContextMenu::releasePlatformDescription): Deleted. (WebCore::contextMenuItemVector): Deleted. (WebCore::platformMenuDescription): Deleted. 2015-11-12 Myles C. Maxfield [Cocoa] Font fallback is not language-sensitive https://bugs.webkit.org/show_bug.cgi?id=147390 Reviewed by Dean Jackson. This re-applies r190754 in a somewhat more performant way. Test: fast/text/fallback-language-han-2.html * platform/graphics/Font.cpp: (WebCore::CharacterFallbackMapKey::CharacterFallbackMapKey): (WebCore::CharacterFallbackMapKey::operator==): (WebCore::CharacterFallbackMapKeyHash::hash): (WebCore::Font::systemFallbackFontForCharacter): * platform/graphics/cocoa/FontCacheCoreText.cpp: (WebCore::FontCache::systemFallbackForCharacters): 2015-11-11 Jon Honeycutt popstate event should be dispatched asynchronously https://bugs.webkit.org/show_bug.cgi?id=36202 Based on an original patch by Mihai Parparita . Reviewed by Brent Fulgham. Tests: fast/loader/remove-iframe-during-history-navigation-different.html fast/loader/remove-iframe-during-history-navigation-same.html fast/loader/stateobjects/popstate-is-asynchronous.html * dom/Document.cpp: (WebCore::Document::enqueuePopstateEvent): Use enqueueWindowEvent(). 2015-11-12 Csaba Osztrogonác Fix build failure due to missing NeverDestroyed.h include after r192169 https://bugs.webkit.org/show_bug.cgi?id=151186 Reviewed by Darin Adler. * rendering/RenderCombineText.cpp: 2015-11-12 Csaba Osztrogonác Fix build failure due to missing forward declaration of FontVariantSettings after r191968 https://bugs.webkit.org/show_bug.cgi?id=151185 Reviewed by Myles C. Maxfield. * css/CSSFontFaceSource.h: 2015-11-12 Eric Carlson [MediaStream] Reflect media stream tracks as HTMLMediaElement tracks https://bugs.webkit.org/show_bug.cgi?id=151145 Reviewed by Jer Noble. Test: fast/mediastream/MediaStream-video-element.html * WebCore.xcodeproj/project.pbxproj: Add new header files. * html/track/AudioTrack.h: Add comments to clean things up slightly. * html/track/VideoTrack.h: Ditto. Create a AudioTrackPrivateMediaStream or VideoTrackPrivateMediaStream for each track in the MediaStream. * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::load): Call updateTracks. (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::didAddTrack): Ditto. (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::didRemoveTrack): Ditto. (WebCore::updateTracksOfType): New, template function to update audio or video tracks. (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateTracks): New. * platform/mediastream/AudioTrackPrivateMediaStream.h: Added. * platform/mediastream/MediaStreamPrivate.cpp: (WebCore::MediaStreamPrivate::currentFrameImage): Fix a typo, early return if the track is not active OR there is no active video track. * platform/mediastream/MediaStreamPrivate.h: (WebCore::MediaStreamPrivate::activeVideoTrack): Accessor for active video track, if any. * platform/mediastream/VideoTrackPrivateMediaStream.h: Added. * platform/mediastream/mac/AVAudioCaptureSource.mm: (WebCore::AVAudioCaptureSource::updateStates): Set current states. * platform/mediastream/mac/AVMediaCaptureSource.mm: (WebCore::AVMediaCaptureSource::states): Set source ID. (WebCore::AVMediaCaptureSource::capabilities): Set source ID directly. * platform/mediastream/mac/AVVideoCaptureSource.mm: (WebCore::AVVideoCaptureSource::AVVideoCaptureSource): (WebCore::AVVideoCaptureSource::updateStates): Set states here instead of in the constructor. * platform/mock/MockRealtimeMediaSource.cpp: (WebCore::MockRealtimeMediaSource::capabilities): Set source ID directly. * platform/mock/MockRealtimeVideoSource.cpp: (WebCore::MockRealtimeVideoSource::updateStates): Set source type. 2015-11-12 Youenn Fablet XHR abort() event firing does not match spec https://bugs.webkit.org/show_bug.cgi?id=98404 Reviewed by Darin Adler. Introducing explicit sendFlag as in the specification. Previously, sendFlag was computed using !!m_loader. But this does not work well for loadstart events since sendFlag should be true but m_loader is still null at that time. Updated abort event firing test according specification. For instance, compared to previously, the abort event is not fired in DONE state or if sendFlag is not set. Covered by rebased tests. * xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::callReadyStateChangeListener): Compute whether dispatching the load event before calling XHR readystatechange event callback. (WebCore::XMLHttpRequest::setWithCredentials): Replacing m_loader by m_sendFlag to align with the spec. (WebCore::XMLHttpRequest::open): Unsetting m_sendFlag.. (WebCore::XMLHttpRequest::initSend): Replacing m_loader by m_sendFlag to align with the spec. (WebCore::XMLHttpRequest::createRequest): Setting m_sendFlag. (WebCore::XMLHttpRequest::abort): Checking m_sendFlag and updating code to follow the specification. (WebCore::XMLHttpRequest::genericError): Unsetting m_sendFlag. (WebCore::XMLHttpRequest::setRequestHeader): Replacing m_loader by m_sendFlag to align with the spec. (WebCore::XMLHttpRequest::didFinishLoading): Ditto. (WebCore::XMLHttpRequest::didReachTimeout): Ditto. * xml/XMLHttpRequest.h: Added m_sendFlag. 2015-11-12 Carlos Garcia Campos [GStreamer] Use RunLoop::timer in MediaPlayerPrivateGStreamerBase for GL drawing https://bugs.webkit.org/show_bug.cgi?id=151099 Reviewed by Philippe Normand. Instead of the GThreadSafeMainLoopSource. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: (WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase): (WebCore::MediaPlayerPrivateGStreamerBase::repaint): (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint): (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase): Deleted. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h: 2015-11-12 Csaba Osztrogonác Remove ENABLE(SATURATED_LAYOUT_ARITHMETIC) guards https://bugs.webkit.org/show_bug.cgi?id=150972 Reviewed by Darin Adler. * Configurations/FeatureDefines.xcconfig: * platform/LayoutUnit.h: (WebCore::operator*): (WebCore::LayoutUnit::LayoutUnit): Deleted. (WebCore::LayoutUnit::fromFloatCeil): Deleted. (WebCore::LayoutUnit::fromFloatFloor): Deleted. (WebCore::LayoutUnit::fromFloatRound): Deleted. (WebCore::LayoutUnit::ceil): Deleted. (WebCore::LayoutUnit::round): Deleted. (WebCore::LayoutUnit::floor): Deleted. (WebCore::LayoutUnit::setValue): Deleted. (WebCore::operator/): Deleted. (WebCore::operator+): Deleted. (WebCore::operator-): Deleted. (WebCore::operator+=): Deleted. (WebCore::operator-=): Deleted. * rendering/LayoutState.cpp: (WebCore::LayoutState::LayoutState): * rendering/LayoutState.h: (WebCore::LayoutState::LayoutState): * rendering/RenderView.h: 2015-11-11 Chris Dumez Stop passing a PassRefPtr to dispatchEvent() https://bugs.webkit.org/show_bug.cgi?id=151158 Reviewed by Alex Christensen. Stop passing a PassRefPtr to dispatchEvent() because: 1. PassRefPtr is legacy and should no longer be used 2. We don't actually transfer ownership of the Event to the callee Pass a C++ reference instead. 2015-11-11 Chris Dumez Fix leaks in idbKeyFromInspectorObject() https://bugs.webkit.org/show_bug.cgi?id=151179 Reviewed by Brian Burg. Fix leaks in idbKeyFromInspectorObject() that were caused by the NeverDestroyed<> not being marked as static. * inspector/InspectorIndexedDBAgent.cpp: 2015-11-11 Geoffrey Garen Rename handle.*Event to dispatch.*Event https://bugs.webkit.org/show_bug.cgi?id=151168 Reviewed by Chris Dumez. * dom/Document.cpp: (WebCore::Document::implicitClose): * dom/Document.h: * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::DocumentLoader): (WebCore::DocumentLoader::getIconDataForIconURL): (WebCore::DocumentLoader::dispatchOnloadEvents): (WebCore::DocumentLoader::handledOnloadEvents): Deleted. * loader/DocumentLoader.h: (WebCore::DocumentLoader::isClientRedirect): (WebCore::DocumentLoader::setIsClientRedirect): (WebCore::DocumentLoader::wasOnloadDispatched): (WebCore::DocumentLoader::overrideEncoding): (WebCore::DocumentLoader::wasOnloadHandled): Deleted. * loader/EmptyClients.h: * loader/FrameLoader.cpp: (WebCore::FrameLoader::submitForm): (WebCore::FrameLoader::stopLoading): (WebCore::FrameLoader::userAgent): (WebCore::FrameLoader::dispatchOnloadEvents): (WebCore::FrameLoader::frameDetached): (WebCore::FrameLoader::shouldClose): (WebCore::FrameLoader::dispatchUnloadEvents): (WebCore::FrameLoader::dispatchBeforeUnloadEvent): (WebCore::FrameLoader::handledOnloadEvents): Deleted. (WebCore::FrameLoader::handleUnloadEvents): Deleted. (WebCore::FrameLoader::handleBeforeUnloadEvent): Deleted. * loader/FrameLoader.h: * loader/FrameLoaderClient.h: * loader/NavigationScheduler.cpp: (WebCore::NavigationScheduler::mustLockBackForwardList): 2015-11-11 Anders Carlsson Remove more dead code https://bugs.webkit.org/show_bug.cgi?id=151170 Reviewed by Beth Dakin. * platform/ContextMenu.cpp: (WebCore::findItemWithAction): Deleted. (WebCore::ContextMenu::itemWithAction): Deleted. * platform/ContextMenu.h: (WebCore::ContextMenu::itemAtIndex): Deleted. * platform/ContextMenuItem.h: 2015-11-11 Anders Carlsson De-indent ContextMenu.h and ContextMenuItem.h. Rubber-stamped by Andreas Kling. * platform/ContextMenu.h: * platform/ContextMenuItem.h: 2015-11-11 Anders Carlsson Remove ContextMenuWin.cpp and ContextMenuItemWin.cpp https://bugs.webkit.org/show_bug.cgi?id=150467 Reviewed by Beth Dakin. These files are not needed anymore. * PlatformWin.cmake: * WebCore.vcxproj/WebCore.vcxproj: * WebCore.vcxproj/WebCore.vcxproj.filters: * platform/win/ContextMenuItemWin.cpp: Removed. (WebCore::ContextMenuItem::ContextMenuItem): Deleted. (WebCore::ContextMenuItem::platformContextMenuItem): Deleted. * platform/win/ContextMenuWin.cpp: Removed. (WebCore::ContextMenu::ContextMenu): Deleted. (WebCore::ContextMenu::getContextMenuItems): Deleted. (WebCore::ContextMenu::createPlatformContextMenuFromItems): Deleted. (WebCore::ContextMenu::platformContextMenu): Deleted. 2015-11-11 Anders Carlsson Get rid of ContextMenuNone.cpp and ContextMenuItemNone.cpp https://bugs.webkit.org/show_bug.cgi?id=151169 Reviewed by Beth Dakin. * PlatformEfl.cmake: * platform/ContextMenuItemNone.cpp: Removed. (WebCore::ContextMenuItem::platformContextMenuItem): Deleted. * platform/ContextMenuNone.cpp: Removed. (WebCore::ContextMenu::ContextMenu): Deleted. (WebCore::ContextMenu::getContextMenuItems): Deleted. (WebCore::ContextMenu::createPlatformContextMenuFromItems): Deleted. (WebCore::ContextMenu::platformContextMenu): Deleted. 2015-11-11 Anders Carlsson Remove more dead context menu code https://bugs.webkit.org/show_bug.cgi?id=151163 Reviewed by Tim Horton. * loader/EmptyClients.h: * page/ContextMenuClient.h: * page/ContextMenuController.cpp: (WebCore::ContextMenuController::populate): * platform/ContextMenuItem.h: * platform/mac/ContextMenuItemMac.mm: (WebCore::ContextMenuItem::shareMenuItem): Deleted. 2015-11-10 Jon Honeycutt Crash loading Blink layout test fast/parser/strip-script-attrs-on-input.html https://bugs.webkit.org/show_bug.cgi?id=150201 Reviewed by Brent Fulgham. Test: fast/parser/strip-script-attrs-on-input.html * html/parser/HTMLTreeBuilder.cpp: (WebCore::HTMLTreeBuilder::processStartTagForInBody): Get the attribute after calling HTMLConstructionSite::insertSelfClosingHTMLElement(), as this may mutate the token's attributes. 2015-11-11 Xabier Rodriguez Calvar [Streams API] Remove bind usage https://bugs.webkit.org/show_bug.cgi?id=151104 Reviewed by Youenn Fablet. Instead of using bind, an inline error function was created. Internal rework, no tests needed. * Modules/streams/WritableStream.js: (error): (initializeWritableStream): 2015-11-10 Brady Eidson Modern IDB: Make indexes actually index. https://bugs.webkit.org/show_bug.cgi?id=150939 Reviewed by Alex Christensen. Tests: storage/indexeddb/modern/index-1.html storage/indexeddb/modern/index-2.html storage/indexeddb/modern/index-3.html * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * Modules/indexeddb/IDBKeyData.h: (WebCore::IDBKeyData::hash): Deleted. * Modules/indexeddb/IDBKeyRangeData.cpp: (WebCore::IDBKeyRangeData::isExactlyOneKey): * Modules/indexeddb/client/IDBTransactionImpl.cpp: (WebCore::IDBClient::IDBTransaction::didGetRecordOnServer): * Modules/indexeddb/server/IndexValueEntry.cpp: Copied from Source/WebCore/Modules/indexeddb/server/MemoryIndex.cpp. (WebCore::IDBServer::IndexValueEntry::IndexValueEntry): (WebCore::IDBServer::IndexValueEntry::~IndexValueEntry): (WebCore::IDBServer::IndexValueEntry::addKey): (WebCore::IDBServer::IndexValueEntry::removeKey): (WebCore::IDBServer::IndexValueEntry::getLowest): (WebCore::IDBServer::IndexValueEntry::getCount): * Modules/indexeddb/server/IndexValueEntry.h: Copied from Source/WebCore/Modules/indexeddb/server/MemoryIndex.h. * Modules/indexeddb/server/IndexValueStore.cpp: Added. (WebCore::IDBServer::IndexValueStore::IndexValueStore): (WebCore::IDBServer::IndexValueStore::lowestValueForKey): (WebCore::IDBServer::IndexValueStore::countForKey): (WebCore::IDBServer::IndexValueStore::contains): (WebCore::IDBServer::IndexValueStore::addRecord): (WebCore::IDBServer::IndexValueStore::removeRecord): (WebCore::IDBServer::IndexValueStore::removeEntriesWithValueKey): (WebCore::IDBServer::IndexValueStore::lowestKeyWithRecordInRange): * Modules/indexeddb/server/IndexValueStore.h: Copied from Source/WebCore/Modules/indexeddb/server/MemoryIndex.h. * Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp: (WebCore::IDBServer::MemoryBackingStoreTransaction::objectStoreCleared): (WebCore::IDBServer::MemoryBackingStoreTransaction::indexCleared): (WebCore::IDBServer::MemoryBackingStoreTransaction::abort): * Modules/indexeddb/server/MemoryBackingStoreTransaction.h: * Modules/indexeddb/server/MemoryIDBBackingStore.cpp: (WebCore::IDBServer::MemoryIDBBackingStore::addRecord): * Modules/indexeddb/server/MemoryIndex.cpp: (WebCore::IDBServer::MemoryIndex::create): (WebCore::IDBServer::MemoryIndex::MemoryIndex): (WebCore::IDBServer::MemoryIndex::objectStoreCleared): (WebCore::IDBServer::MemoryIndex::replaceIndexValueStore): (WebCore::IDBServer::MemoryIndex::getResultForKeyRange): (WebCore::IDBServer::MemoryIndex::countForKeyRange): (WebCore::IDBServer::MemoryIndex::putIndexKey): (WebCore::IDBServer::MemoryIndex::removeRecord): (WebCore::IDBServer::MemoryIndex::removeEntriesWithValueKey): (WebCore::IDBServer::MemoryIndex::valueForKeyRange): Deleted. * Modules/indexeddb/server/MemoryIndex.h: * Modules/indexeddb/server/MemoryObjectStore.cpp: (WebCore::IDBServer::MemoryObjectStore::createIndex): (WebCore::IDBServer::MemoryObjectStore::clear): (WebCore::IDBServer::MemoryObjectStore::deleteRecord): (WebCore::IDBServer::MemoryObjectStore::addRecord): (WebCore::IDBServer::indexVM): (WebCore::IDBServer::indexGlobalExec): (WebCore::IDBServer::MemoryObjectStore::updateIndexesForDeleteRecord): (WebCore::IDBServer::MemoryObjectStore::updateIndexesForPutRecord): (WebCore::IDBServer::MemoryObjectStore::indexValueForKeyRange): * Modules/indexeddb/server/MemoryObjectStore.h: (WebCore::IDBServer::MemoryObjectStore::writeTransaction): * Modules/indexeddb/shared/IndexKey.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBKeyRangeData.cpp. (WebCore::IndexKey::IndexKey): (WebCore::IndexKey::isolatedCopy): (WebCore::IndexKey::asOneKey): (WebCore::IndexKey::multiEntry): * Modules/indexeddb/shared/IndexKey.h: Added. (WebCore::IndexKey::isNull): * bindings/js/IDBBindingUtilities.cpp: (WebCore::idbValueDataToJSValue): (WebCore::deserializeIDBValueBuffer): (WebCore::idbKeyDataToScriptValue): (WebCore::createKeyPathArray): (WebCore::generateIndexKeyForValue): * bindings/js/IDBBindingUtilities.h: 2015-11-10 Myles C. Maxfield Move locale information into FontDescription https://bugs.webkit.org/show_bug.cgi?id=147457 Reviewed by Andreas Kling. Currently, the "lang" attribute on a node sets locale information in RenderStyle. Font selection is sensitive to this locale information, and occurs deep within platform/ code, far away from RenderStyle. Because every RenderStyle owns a FontDescription, and font selection can consult with FontDescriptions, it makes sense to move the variable from RenderStyle to FontDescription, and provide convenience methods on RenderStyle which inspect its FontDescription for locale information. This patch is in preparation for correctly obeying locale information when performing font fallback. No new tests because there is no behavior change. * css/CSSPropertyNames.in: * css/StyleBuilderCustom.h: (WebCore::StyleBuilderCustom::applyValueWebkitLocale): * platform/graphics/FontCache.h: * platform/graphics/FontDescription.cpp: (WebCore::FontDescription::setLocale): * platform/graphics/FontDescription.h: (WebCore::FontDescription::locale): (WebCore::FontDescription::operator==): (WebCore::FontCascadeDescription::initialLocale): (WebCore::FontDescription::setScript): Deleted. * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::changeRequiresLayout): Deleted. * rendering/style/RenderStyle.h: * rendering/style/StyleRareInheritedData.cpp: (WebCore::StyleRareInheritedData::StyleRareInheritedData): Deleted. (WebCore::StyleRareInheritedData::operator==): Deleted. * rendering/style/StyleRareInheritedData.h: * style/StyleResolveForDocument.cpp: (WebCore::Style::resolveForDocument): 2015-11-10 Gyuyoung Kim [EFL] Support an applicationVersion argument to UserAgentEfl::standardUserAgent() https://bugs.webkit.org/show_bug.cgi?id=151060 Reviewed by Darin Adler. *applicationVersion* was missed to support by r192148. This patch adds it as well as missed Darin comments are fixed. * platform/efl/UserAgentEfl.cpp: (WebCore::platformVersionForUAString): (WebCore::versionForUAString): (WebCore::standardUserAgent): 2015-11-10 Simon Fraser Use different pixel formats for displays that support them https://bugs.webkit.org/show_bug.cgi?id=151122 rdar://problem/22846841 Reviewed by Tim Horton. Add new IOSurface format enum values, and set up the appropriate IOSurfaceCreate() property dictionaries for them. * platform/graphics/cocoa/IOSurface.h: * platform/graphics/cocoa/IOSurface.mm: (IOSurface::IOSurface): * platform/spi/cocoa/IOSurfaceSPI.h: 2015-11-10 Brent Fulgham Crash running webaudio/panner-loop.html https://bugs.webkit.org/show_bug.cgi?id=150200 Reviewed by Jer Noble. Test: webaudio/panner-loop.html This is based on the changes in Blink r164822: https://codereview.chromium.org/130003002 Avoid infinitely recursing on audio nodes by keeping track of which nodes we've already visited. * Modules/webaudio/PannerNode.cpp: (WebCore::PannerNode::pullInputs): Pass set of visited nodes so we don't revisit nodes we've already serviced. (WebCore::PannerNode::notifyAudioSourcesConnectedToNode): Accept visitedNodes argument so we can avoid revisiting nodes. Check if the current node has already been visited before processing it. * Modules/webaudio/PannerNode.h: 2015-11-10 Tim Horton Adopt formal protocols for CA delegates https://bugs.webkit.org/show_bug.cgi?id=151121 Reviewed by Anders Carlsson. * platform/graphics/cocoa/WebActionDisablingCALayerDelegate.h: Note that our WebActionDisablingCALayerDelegate is, in fact, a CALayerDelegate. * platform/spi/cocoa/QuartzCoreSPI.h: Add empty protocol definitions where necessary. * WebCore.xcodeproj/project.pbxproj: * platform/spi/mac/NSAccessibilitySPI.h: Added. * platform/spi/mac/NSApplicationSPI.h: Added. * platform/spi/mac/NSTextFinderSPI.h: Added. * platform/spi/mac/NSViewSPI.h: Added. Split out SPI headers from WebKit2's AppKitSPI.h. Add NSViewSPI to note that NSView is (internally) a CALayerDelegate, which WebHTMLView depends on. 2015-11-10 Zalan Bujtas Continuations with anonymous wrappers inside misplaces child renderers. https://bugs.webkit.org/show_bug.cgi?id=150908 When a child is appended to an inline container and the beforeChild is not a direct child, but it is inside a generated subtree, we need to special case the inline split to form continuation. RenderInline::splitInlines() assumes that beforeChild is always a direct child of the current inline container. However when beforeChild type requires wrapper content (such as table cells), the DOM and the render tree get out of sync. In such cases, we need to ensure that both the beforeChild and its siblings end up in the correct generated block. Reviewed by Darin Adler and David Hyatt. Test: fast/inline/continuation-with-anon-wrappers.html * rendering/RenderInline.cpp: (WebCore::RenderInline::splitInlines): (WebCore::RenderInline::addChildToContinuation): 2015-11-10 Geoffrey Garen alert, confirm, prompt, showModalDialog should be forbidden during page close and navigation https://bugs.webkit.org/show_bug.cgi?id=150980 Reviewed by Chris Dumez. Tests: fast/events/beforeunload-alert.html fast/events/beforeunload-confirm.html fast/events/beforeunload-prompt.html fast/events/beforeunload-showModalDialog.html fast/events/pagehide-alert.html fast/events/pagehide-confirm.html fast/events/pagehide-prompt.html fast/events/pagehide-showModalDialog.html fast/events/unload-alert.html fast/events/unload-confirm.html fast/events/unload-prompt.html fast/events/unload-showModalDialog.html * loader/FrameLoader.cpp: (WebCore::FrameLoader::stopLoading): Factored out a helper function for unload event processing. (WebCore::FrameLoader::handleUnloadEvents): Forbid prompts in unload events just like we do in beforeunload events, and for the same reasons. (WebCore::FrameLoader::handleBeforeUnloadEvent): Updated for renames. * loader/FrameLoader.h: * page/DOMWindow.cpp: (WebCore::DOMWindow::print): (WebCore::DOMWindow::alert): (WebCore::DOMWindow::confirm): (WebCore::DOMWindow::prompt): (WebCore::DOMWindow::showModalDialog): Updated for renames. Refactored some of this code to handle null pages more cleanly. In particular, we sometimes used to treat null page as "everything is permitted" -- but it is best practice in a permissions context to treat lack of information as no permission granted rather than all permissions granted. (I don't know of a way to trigger this condition in practice.) * page/Page.cpp: (WebCore::Page::Page): (WebCore::Page::forbidPrompts): (WebCore::Page::allowPrompts): (WebCore::Page::arePromptsAllowed): Renamed to make these functions reflect their new, broader context. (WebCore::Page::incrementFrameHandlingBeforeUnloadEventCount): Deleted. (WebCore::Page::decrementFrameHandlingBeforeUnloadEventCount): Deleted. (WebCore::Page::isAnyFrameHandlingBeforeUnloadEvent): Deleted. * page/Page.h: 2015-11-09 David Hyatt tate-chu-yoko should shrink to fit when it exceeds the available width. https://bugs.webkit.org/show_bug.cgi?id=151051 Reviewed by Myles Maxfield. Covered by existing tests * rendering/RenderCombineText.cpp: (WebCore::RenderCombineText::combineText): When testing for text-combine, find the font variant that is the best fit, i.e., that exceeds the available width by the smallest amount. Scale that best fit down repeatedly until it fits within the available space. We set a pixel size of 6 as the threshold at which we give up. Also make sure to reset glyphOverflow on each measurement, as this was creating a potential bug both with variant checking and then with scaling, since glyphOverflow isn't reset when width() is invoked. 2015-11-10 Myles C. Maxfield Tatechuyoko text is not vertically centered in its vertical advance https://bugs.webkit.org/show_bug.cgi?id=151074 Reviewed by David Hyatt. During paint time, the run origin of tatechuyoko needs to be adjusted to compensate for the rotation of the writing mode. The calculation which performed this adjustment was incorrect. It is incorrect for two reasons: 1. It used the existing text origin, which had the font's ascent incorporated in it, but did not compensate by either inspecting the overflow bounds' ascent nor the font's ascent proper. 2. It did not distinguish between the overflow bounds' ascent vs. descent. Instead, it added them together and treated both values together. No new tests yet. I need to make a font to test this. * rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::paint): * rendering/RenderCombineText.cpp: (WebCore::RenderCombineText::computeTextOrigin): (WebCore::RenderCombineText::combineText): (WebCore::RenderCombineText::adjustTextOrigin): Deleted. * rendering/RenderCombineText.h: 2015-11-10 Youenn Fablet XMLHttpRequestUpload should support ontimeout event handler https://bugs.webkit.org/show_bug.cgi?id=128531 Reviewed by Darin Adler. Covered by rebased tests. * xml/XMLHttpRequestUpload.idl: Adding ontimeout event handler. 2015-11-10 Zalan Bujtas Force display: block on ::-webkit-media-controls. https://bugs.webkit.org/show_bug.cgi?id=149178 Reviewed by Simon Fraser. This patch ensures that we always have a block level container for media controls so that continuation never needs to split RenderMedia into multiple subtrees. Current inline continuation logic assumes that only inline elements with RenderInline type of renderers participate in continuation. This is mostly the case since other inline renderers such as RenderReplaced, RenderImage, RenderEmbeddedObject etc can't have (accessible) children. (Unlike video::-webkit-media-controls) Test: media/webkit-media-controls-display.html * Modules/mediacontrols/mediaControlsApple.css: (::-webkit-media-controls): * Modules/mediacontrols/mediaControlsiOS.css: (::-webkit-media-controls): * css/mediaControls.css: (::-webkit-media-controls): 2015-11-10 Carlos Garcia Campos [GTK] Use CROSS_PLATFORM_CONTEXT_MENUS https://bugs.webkit.org/show_bug.cgi?id=150642 Reviewed by Martin Robinson. Remove GTK+ implementations of old context menu classes. * PlatformGTK.cmake: * platform/ContextMenuItem.h: * platform/gtk/ContextMenuGtk.cpp: Removed. * platform/gtk/ContextMenuItemGtk.cpp: Removed. 2015-11-10 Xabier Rodriguez Calvar [Streams API] Fix style issues https://bugs.webkit.org/show_bug.cgi?id=151089 Reviewed by Youenn Fablet. Inlined some things, converted var into let and const, removed some undefined parameters and returns, added missing "use strict" clauses and other minor style changes. Internal rework, no new tests needed. * Modules/streams/ReadableStream.js: (initializeReadableStream): * Modules/streams/ReadableStreamController.js: (enqueue): (error): (close): * Modules/streams/ReadableStreamInternals.js: (teeReadableStream): (teeReadableStreamPullFunction): (teeReadableStreamBranch2CancelFunction): (errorReadableStream): (finishClosingReadableStream): (closeReadableStreamReader): (enqueueInReadableStream): (readFromReadableStreamReader): * Modules/streams/ReadableStreamReader.js: (releaseLock): * Modules/streams/StreamInternals.js: (invokeOrNoop): (promiseInvokeOrNoop): (promiseInvokeOrFallbackOrNoop): (validateAndNormalizeQueuingStrategy): (newQueue): (dequeueValue): (enqueueValueWithSize): (peekQueueValue): * Modules/streams/WritableStream.js: (initializeWritableStream): (abort): (close): * Modules/streams/WritableStreamInternals.js: (syncWritableStreamStateWithQueue): (errorWritableStream): (callOrScheduleWritableStreamAdvanceQueue): (writableStreamAdvanceQueue): (closeWritableStream): Deleted. 2015-11-10 Carlos Garcia Campos Unreviewed. Fix scrollbars/custom-scrollbar-appearance-property.html after r191991. Use a similar fix to the mac one. * rendering/RenderThemeGtk.cpp: (WebCore::centerRectVerticallyInParentInputElement): 2015-11-10 Csaba Osztrogonác Unreviewed speculative buildfix after r192200. * platform/mock/MediaPlaybackTargetPickerMock.cpp: (WebCore::MediaPlaybackTargetPickerMock::showPlaybackTargetPicker): 2015-11-10 Xabier Rodriguez Calvar [Streams API] Shield promises when prototype is replaced from a promise https://bugs.webkit.org/show_bug.cgi?id=151033 Reviewed by Darin Adler. Instead of calling @then or @catch, that could have disappeared if the user successfully replaces a promise constructor, we call the methods stored at @Promise.prototype, which are safe as @Promise.prototype.@then.@call and @Promise.prototype.@catch.@call. Test: streams/streams-promises.html, expectations updated. * Modules/streams/ReadableStream.js: (initializeReadableStream): * Modules/streams/ReadableStreamInternals.js: (teeReadableStream): (teeReadableStreamPullFunction): (teeReadableStreamBranch2CancelFunction): (cancelReadableStream): * Modules/streams/WritableStream.js: (initializeWritableStream): (abort): * Modules/streams/WritableStreamInternals.js: (callOrScheduleWritableStreamAdvanceQueue): 2015-11-10 Jon Lee REGRESSION (r189567): Inline controls on Mac are misplaced https://bugs.webkit.org/show_bug.cgi?id=151072 Reviewed by Eric Carlson. Test: media/controls/fullscreen-button-inline-layout.html For a certain range of video widths, r189567 caused the timeline track to be too large, pushing the buttons on the right side of the inline controls out of the rect bounds. The fix is to set min-width to 0. The test added checks to see that the right edge of the fullscreen button is within the rect bounds. * Modules/mediacontrols/mediaControlsApple.css: (audio::-webkit-media-controls-timeline-container): Add min-width. (audio::-webkit-media-controls-panel .thumbnail-track): Ditto. Fly-by fix of height rule. 2015-11-09 Eric Carlson [Mac] Add a mock AppleTV device for testing https://bugs.webkit.org/show_bug.cgi?id=148912 Reviewed by Tim Horton. No new tests, updated media/controls/airplay-picker.html. * Modules/mediasession/WebMediaSessionManager.cpp: (WebCore::WebMediaSessionManager::setMockMediaPlaybackTargetPickerEnabled): New, enable or disable the mock picker. (WebCore::WebMediaSessionManager::setMockMediaPlaybackTargetPickerState): New, set mock picker state. (WebCore::WebMediaSessionManager::mockPicker): New. (WebCore::WebMediaSessionManager::targetPicker): Return the platform or mock picker, as per settings. (WebCore::webMediaSessionManagerOverride): Deleted. (WebCore::WebMediaSessionManager::shared): Deleted. (WebCore::WebMediaSessionManager::setWebMediaSessionManagerOverride): Deleted. * Modules/mediasession/WebMediaSessionManager.h: * WebCore.xcodeproj/project.pbxproj: Add MediaPlaybackTargetPickerMock.* and MediaPlaybackTargetMock.*. * page/ChromeClient.h: add setMockMediaPlaybackTargetPickerEnabled and setMockMediaPlaybackTargetPickerState. * page/Page.cpp: (WebCore::Page::playbackTargetPickerClientStateDidChange): (WebCore::Page::setMockMediaPlaybackTargetPickerEnabled): New. (WebCore::Page::setMockMediaPlaybackTargetPickerState): New. (WebCore::Page::setPlaybackTarget): * page/Page.h: * platform/graphics/MediaPlaybackTarget.h: (WebCore::noMediaPlaybackTargetContext): (WebCore::MediaPlaybackTarget::~MediaPlaybackTarget): (WebCore::MediaPlaybackTarget::deviceName): (WebCore::MediaPlaybackTarget::MediaPlaybackTarget): * platform/graphics/MediaPlaybackTargetContext.h: Make a class instead of a struct. (WebCore::MediaPlaybackTargetContext::MediaPlaybackTargetContext): (WebCore::MediaPlaybackTargetContext::type): (WebCore::MediaPlaybackTargetContext::mockDeviceName): (WebCore::MediaPlaybackTargetContext::mockState): (WebCore::MediaPlaybackTargetContext::avOutputContext): (WebCore::MediaPlaybackTargetContext::encodingRequiresPlatformData): * platform/graphics/MediaPlaybackTargetPicker.cpp: Move much of the code from MediaPlaybackTargetMac.mm here so it can be the base class. (WebCore::MediaPlaybackTargetPicker::MediaPlaybackTargetPicker): (WebCore::MediaPlaybackTargetPicker::~MediaPlaybackTargetPicker): (WebCore::MediaPlaybackTargetPicker::pendingActionTimerFired): (WebCore::MediaPlaybackTargetPicker::addPendingAction): (WebCore::MediaPlaybackTargetPicker::showPlaybackTargetPicker): * platform/graphics/MediaPlaybackTargetPicker.h: (WebCore::MediaPlaybackTargetPicker::availableDevicesDidChange): (WebCore::MediaPlaybackTargetPicker::currentDeviceDidChange): (WebCore::MediaPlaybackTargetPicker::client): (WebCore::MediaPlaybackTargetPicker::setClient): * platform/graphics/avfoundation/MediaPlaybackTargetMac.h: (WebCore::MediaPlaybackTargetMac::outputContext): (WebCore::MediaPlaybackTargetMac::targetType): Deleted. * platform/graphics/avfoundation/MediaPlaybackTargetMac.mm: (WebCore::MediaPlaybackTargetMac::targetContext): (WebCore::MediaPlaybackTargetMac::hasActiveRoute): (WebCore::MediaPlaybackTargetMac::deviceName): * platform/graphics/avfoundation/WebMediaSessionManagerMac.cpp: (WebCore::WebMediaSessionManager::shared): Renamed from platformManager. (WebCore::WebMediaSessionManagerMac::platformPicker): Renamed from targetPicker. (WebCore::WebMediaSessionManager::platformManager): Deleted. (WebCore::WebMediaSessionManagerMac::targetPicker): Deleted. * platform/graphics/avfoundation/WebMediaSessionManagerMac.h: * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h: * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm: (WebCore::MediaPlaybackTargetPickerMac::MediaPlaybackTargetPickerMac): (WebCore::MediaPlaybackTargetPickerMac::~MediaPlaybackTargetPickerMac): (WebCore::MediaPlaybackTargetPickerMac::externalOutputDeviceAvailable): (WebCore::MediaPlaybackTargetPickerMac::playbackTarget): (WebCore::MediaPlaybackTargetPickerMac::devicePicker): (WebCore::MediaPlaybackTargetPickerMac::showPlaybackTargetPicker): (WebCore::MediaPlaybackTargetPickerMac::startingMonitoringPlaybackTargets): (WebCore::MediaPlaybackTargetPickerMac::pendingActionTimerFired): Deleted. (WebCore::MediaPlaybackTargetPickerMac::availableDevicesDidChange): Deleted. (WebCore::MediaPlaybackTargetPickerMac::addPendingAction): Deleted. (WebCore::MediaPlaybackTargetPickerMac::currentDeviceDidChange): Deleted. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::isCurrentPlaybackTargetWireless): Add support for mock target. (WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessPlaybackTargetName): Ditto. (WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessPlaybackTarget): Ditto. (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldPlayToPlaybackTarget): Ditto. * platform/mock/MediaPlaybackTargetMock.cpp: Added. (WebCore::MediaPlaybackTargetMock::create): (WebCore::MediaPlaybackTargetMock::MediaPlaybackTargetMock): (WebCore::MediaPlaybackTargetMock::~MediaPlaybackTargetMock): (WebCore::MediaPlaybackTargetMock::targetContext): (WebCore::toMediaPlaybackTargetMock): * platform/mock/MediaPlaybackTargetMock.h: Added. * platform/mock/MediaPlaybackTargetPickerMock.cpp: Added. (WebCore::MediaPlaybackTargetPickerMock::create): (WebCore::MediaPlaybackTargetPickerMock::MediaPlaybackTargetPickerMock): (WebCore::MediaPlaybackTargetPickerMock::~MediaPlaybackTargetPickerMock): (WebCore::MediaPlaybackTargetPickerMock::externalOutputDeviceAvailable): (WebCore::MediaPlaybackTargetPickerMock::playbackTarget): (WebCore::MediaPlaybackTargetPickerMock::timerFired): (WebCore::MediaPlaybackTargetPickerMock::showPlaybackTargetPicker): (WebCore::MediaPlaybackTargetPickerMock::startingMonitoringPlaybackTargets): (WebCore::MediaPlaybackTargetPickerMock::stopMonitoringPlaybackTargets): (WebCore::MediaPlaybackTargetPickerMock::invalidatePlaybackTargets): (WebCore::MediaPlaybackTargetPickerMock::setState): * platform/mock/MediaPlaybackTargetPickerMock.h: Added. * testing/Internals.cpp: (WebCore::Internals::Internals): (WebCore::Internals::setMockMediaPlaybackTargetPickerEnabled): (WebCore::Internals::setMockMediaPlaybackTargetPickerState): * testing/Internals.h: * testing/Internals.idl: 2015-11-09 Wenson Hsieh Unreviewed, fix the windows build Update the signature of scrollableAreaBoundingBox, changed by r192193. * platform/win/PopupMenuWin.cpp: (WebCore::PopupMenuWin::scrollableAreaBoundingBox): * platform/win/PopupMenuWin.h: 2015-11-09 Simon Fraser Allow iOS to create linearRGB colorspaces https://bugs.webkit.org/show_bug.cgi?id=151059 Reviewed by Tim Horton. Remove iOS #ifdefs around code that creates linearized RGB colorspaces, as used by SVG filters. Blending doesn't actually work correctly, but there's no reason to #ifdef differently here. * platform/graphics/cg/GraphicsContextCG.cpp: * platform/graphics/mac/GraphicsContextMac.mm: (WebCore::linearRGBColorSpaceRef): 2015-11-09 Wenson Hsieh Sometimes unable to scroll fixed div when the body is scrollable https://bugs.webkit.org/show_bug.cgi?id=151015 Reviewed by Simon Fraser. Currently, if we scroll a page containing a fixed scrollable area, the non-fast-scrollable region corresponding to a fixed area will not move down to reflect its new bounds in absolute coordinates, making it impossible to scroll position: fixed overflow elements when the body's scroll position changes. To fix this, we inflate the non-fast-scrollable region corresponding to scrollable position: fixed elements such that their regions encompass the area, relative to the page, wherein the fixed element may lie when the page is scrolled by any amount within its scroll limits. We also optimize the non-fast-scrollable regions emitted by elements that handle wheel events. Currently, if a fixed element also has a wheel event handler, we take the entire document's rect to be non-fast-scrollable. This patch changes this region to behave the same way as fixed scrollable elements above. This patch also folds some common logic used to accomplish this into FrameView for use by RenderLayerCompositor and RenderView. Test: tiled-drawing/scrolling/non-fast-region/fixed-div-in-scrollable-page.html * page/FrameView.cpp: (WebCore::FrameView::fixedScrollableAreaBoundsInflatedForScrolling): (WebCore::FrameView::scrollOffsetRespectingCustomFixedPosition): * page/FrameView.h: * page/scrolling/ScrollingCoordinator.cpp: (WebCore::ScrollingCoordinator::absoluteNonFastScrollableRegionForFrame): * platform/ScrollableArea.h: (WebCore::ScrollableArea::scrollableAreaBoundingBox): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::scrollableAreaBoundingBox): * rendering/RenderLayer.h: * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::computeExtent): (WebCore::fixedPositionOffset): Deleted. * rendering/RenderView.cpp: (WebCore::RenderView::mapLocalToContainer): (WebCore::RenderView::pushMappingToContainer): (WebCore::RenderView::mapAbsoluteToLocalPoint): (WebCore::RenderView::computeRectForRepaint): (WebCore::fixedPositionOffset): Deleted. 2015-11-09 Ryan Haddad Unreviewed, rolling out r192181. This change causes asserts on mac-wk1 debug testers Reverted changeset: "Fixed crash loading Mozilla layout test editor/libeditor/crashtests/431086-1.xhtml." https://bugs.webkit.org/show_bug.cgi?id=150252 http://trac.webkit.org/changeset/192181 2015-11-09 Jiewen Tan Crash when right clicking in input box with -webkit-user-select: none https://bugs.webkit.org/show_bug.cgi?id=145981 Reviewed by Enrica Casucci. Test: editing/selection/minimal-user-select-crash.html * editing/Editor.cpp: (WebCore::Editor::hasBidiSelection): Visible position cannot be created because of the style that doesn't allow the selection. 2015-11-09 Joseph Pecoraro Web Inspector: $0 stops working after navigating to a different domain https://bugs.webkit.org/show_bug.cgi?id=147962 Reviewed by Brian Burg. Test: http/tests/inspector/console/cross-domain-inspected-node-access.html The inspector backend injects the CommandLineAPI Source with a corresponding CommandLineAPIHost into each execution context created by the page (main frame, sub frames, etc). When creating the JSValue wrapper for the CommandLineAPIHost using the generated toJS(...) DOM bindings, we were using the cached CommandLineAPIHost wrapper values in the single DOMWrapperWorld shared across all frames. This meant that the first time the wrapper was needed it was created in context A. But when needed for context B it was using the wrapper created in context A. Using this wrapper in context B was producing unexpected cross-origin warnings. The solution taken here, is to create a new JSValue wrapper for the CommandLineAPIHost per execution context. This way each time the CommandLineAPIHost wrapper is used in a frame, it is using the one created for that frame. The C++ host object being wrapped has a lifetime equivalent to the Page. It does not change in this patch. The wrapper values are cleared on page navigation or when the page is closed, and will be garbage collected. * WebCore.vcxproj/WebCore.vcxproj: * WebCore.vcxproj/WebCore.vcxproj.filters: * ForwardingHeaders/inspector/PerGlobalObjectWrapperWorld.h: Added. New forwarding header. * inspector/CommandLineAPIHost.h: * inspector/CommandLineAPIHost.cpp: (WebCore::CommandLineAPIHost::CommandLineAPIHost): (WebCore::CommandLineAPIHost::wrapper): Cached JSValue wrappers per GlobalObject. (WebCore::CommandLineAPIHost::clearAllWrappers): Clear any wrappers we have, including the $0 value itself which we weren't explicitly clearing previously. * inspector/CommandLineAPIModule.cpp: (WebCore::CommandLineAPIModule::host): Simplify creating the wrapper. * inspector/WebInjectedScriptManager.h: * inspector/WebInjectedScriptManager.cpp: (WebCore::WebInjectedScriptManager::discardInjectedScripts): When the main frame window object clears, also clear the CommandLineAPI wrappers we may have created. Also take this opportunity to clear any $0 value that may have pointed to a value in the previous page. 2015-11-09 Per Arne Vollan [WinCairo][Video][MediaFoundation] Video should be rendered in provided graphics context. https://bugs.webkit.org/show_bug.cgi?id=150941 Reviewed by Brent Fulgham. On WinCairo, we currently render video in a child window of the main browser window. This makes it difficult to render things on top of the video, like video controls and context menus. We should render the video in the graphics context provided by the paint method. This is done by implementing a custom EVR (Enhanced Video Renderer) presenter for Media Foundation. * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp: (MFCreateMediaType): (WebCore::MediaPlayerPrivateMediaFoundation::MediaPlayerPrivateMediaFoundation): (WebCore::MediaPlayerPrivateMediaFoundation::registerMediaEngine): (WebCore::MediaPlayerPrivateMediaFoundation::isAvailable): (WebCore::MediaPlayerPrivateMediaFoundation::setSize): (WebCore::MediaPlayerPrivateMediaFoundation::paint): (WebCore::MediaPlayerPrivateMediaFoundation::createSession): (WebCore::MediaPlayerPrivateMediaFoundation::endGetEvent): (WebCore::MediaPlayerPrivateMediaFoundation::createVideoWindow): (WebCore::MediaPlayerPrivateMediaFoundation::destroyVideoWindow): (WebCore::MediaPlayerPrivateMediaFoundation::invalidateFrameView): (WebCore::MediaPlayerPrivateMediaFoundation::addListener): (WebCore::MediaPlayerPrivateMediaFoundation::createOutputNode): (WebCore::MediaPlayerPrivateMediaFoundation::onTopologySet): (WebCore::MediaPlayerPrivateMediaFoundation::AsyncCallback::onMediaPlayerDeleted): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::CustomVideoPresenter): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::~CustomVideoPresenter): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::QueryInterface): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::AddRef): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::Release): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::OnClockStart): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::OnClockStop): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::OnClockPause): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::OnClockRestart): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::OnClockSetRate): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::ProcessMessage): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetCurrentMediaType): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetDeviceID): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::InitServicePointers): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::ReleaseServicePointers): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetService): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::ActivateObject): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::DetachObject): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::ShutdownObject): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::SetVideoWindow): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetVideoWindow): (WebCore::setMixerSourceRect): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::SetVideoPosition): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetVideoPosition): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::RepaintVideo): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::Invoke): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::onMediaPlayerDeleted): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::paintCurrentFrame): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::isActive): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::configureMixer): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::flush): (WebCore::areMediaTypesEqual): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::setMediaType): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::checkShutdown): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::renegotiateMediaType): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::processInputNotify): (WebCore::MFOffsetToFloat): (WebCore::MakeOffset): (WebCore::MakeArea): (WebCore::validateVideoArea): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::beginStreaming): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::endStreaming): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::checkEndOfStream): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::isMediaTypeSupported): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::createOptimalVideoType): (WebCore::correctAspectRatio): (WebCore::GetVideoDisplayArea): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::calculateOutputRectangle): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::processOutputLoop): (WebCore::setDesiredSampleTime): (WebCore::clearDesiredSampleTime): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::processOutput): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::deliverSample): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::trackSample): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::releaseResources): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::onSampleFree): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::notifyEvent): (WebCore::MediaPlayerPrivateMediaFoundation::VideoSamplePool::getSample): (WebCore::MediaPlayerPrivateMediaFoundation::VideoSamplePool::returnSample): (WebCore::MediaPlayerPrivateMediaFoundation::VideoSamplePool::areSamplesPending): (WebCore::MediaPlayerPrivateMediaFoundation::VideoSamplePool::initialize): (WebCore::MediaPlayerPrivateMediaFoundation::VideoSamplePool::clear): (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::setFrameRate): (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::startScheduler): (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::stopScheduler): (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::flush): (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::scheduleSample): (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::processSamplesInQueue): (WebCore::MFTimeToMilliseconds): (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::processSample): (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::schedulerThreadProc): (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::schedulerThreadProcPrivate): (WebCore::findAdapter): (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::Direct3DPresenter): (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::~Direct3DPresenter): (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::getService): (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::checkFormat): (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::setVideoWindow): (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::setDestinationRect): (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::createVideoSamples): (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::releaseResources): (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::checkDeviceState): (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::presentSample): (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::paintCurrentFrame): (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::initializeD3D): (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::createD3DDevice): (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::createD3DSample): (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::presentSwapChain): (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::getSwapChainPresentParameters): (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::updateDestRect): * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h: (WebCore::MediaPlayerPrivateMediaFoundation::VideoSamplePool::VideoSamplePool): (WebCore::MediaPlayerPrivateMediaFoundation::VideoSamplePool::~VideoSamplePool): (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::VideoScheduler): (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::~VideoScheduler): (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::setPresenter): (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::setClockRate): (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::lastSampleTime): (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::frameDuration): (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::getVideoWindow): (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::getDestinationRect): (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::refreshRate): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetItem): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetItemType): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::CompareItem): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::Compare): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetUINT32): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetUINT64): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetDouble): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetGUID): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetStringLength): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetString): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetAllocatedString): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetBlobSize): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetBlob): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetAllocatedBlob): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetUnknown): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::SetItem): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::DeleteItem): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::DeleteAllItems): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::SetUINT32): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::SetUINT64): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::SetDouble): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::SetGUID): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::SetString): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::SetBlob): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::SetUnknown): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::LockStore): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::UnlockStore): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetCount): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetItemByIndex): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::CopyAllItems): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetNativeVideoSize): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetIdealVideoSize): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::SetAspectRatioMode): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetAspectRatioMode): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetCurrentImage): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::SetBorderColor): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetBorderColor): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::SetRenderingPrefs): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetRenderingPrefs): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::SetFullscreen): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetFullscreen): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetParameters): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::isScrubbing): 2015-11-09 Alex Christensen XHR timeouts should not fire if there is an immediate network error. https://bugs.webkit.org/show_bug.cgi?id=150577 Reviewed by Darin Adler. This fixes flakiness of http/tests/contentextensions/async-xhr-onerror.html since r191077. * xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::createRequest): (WebCore::XMLHttpRequest::internalAbort): (WebCore::XMLHttpRequest::didFinishLoading): If the timeout timer has been started and we are going to immediately report a network error, then stop the timeout timer. The timeout timer sometimes fired before the network error timer if it was a very short timeout (such as 1ms). Also checks to isActive before calling stop on a timer are not necessary. 2015-11-09 Eric Carlson [MediaStream] Add mock audio and video sources https://bugs.webkit.org/show_bug.cgi?id=150997 Reviewed by Jer Noble. Create basic mock audio and video realtime media source classes so we can test MediaStream API without requiring test machines to have audio/video input hardware. No new tests added yet, thoe will follow. No new tests, these changes will allow us to write MediaStream tests. * CMakeLists.txt: Add MockRealtimeAudioSource.cpp, MockRealtimeMediaSource.cpp, and MockRealtimeVideoSource.cpp * PlatformMac.cmake: Add MockRealtimeVideoSourceMac.mm * WebCore.xcodeproj/project.pbxproj: Add new files. * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::createPreviewLayers): Don't set autoresizingMask, it isn't necessary. * platform/mediastream/mac/AVCaptureDeviceManager.mm: (WebCore::refreshCaptureDeviceList): AVCaptureDevice -> getAVCaptureDeviceClass() (WebCore::AVCaptureDeviceManager::bestDeviceForFacingMode): Ditto. (WebCore::AVCaptureDeviceManager::sourceWithUID): Ditto. Mac class implements RealtimeVideoSource::platformLayer, returns a CALayer which uses the GraphicsContext as contents. * platform/mediastream/mac/MockRealtimeVideoSourceMac.h: Added. * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm: Added. (WebCore::MockRealtimeVideoSource::create): (WebCore::MockRealtimeVideoSourceMac::MockRealtimeVideoSourceMac): (WebCore::MockRealtimeVideoSourceMac::platformLayer): (WebCore::MockRealtimeVideoSourceMac::updatePlatformLayer): Mock audio source. Doesn't provide data yet, only provides states and capabilities. * platform/mock/MockRealtimeAudioSource.cpp: Added. (WebCore::MockRealtimeAudioSource::create): (WebCore::MockRealtimeAudioSource::MockRealtimeAudioSource): (WebCore::MockRealtimeAudioSource::updateStates): (WebCore::MockRealtimeAudioSource::initializeCapabilities): * platform/mock/MockRealtimeAudioSource.h: Added. (WebCore::MockRealtimeAudioSource::~MockRealtimeAudioSource): Mock source base class, sets persistent ID and updates states and capabilities. * platform/mock/MockRealtimeMediaSource.cpp: Added. (WebCore::MockRealtimeMediaSource::mockAudioPersistentID): (WebCore::MockRealtimeMediaSource::mockVideoPersistentID): (WebCore::MockRealtimeMediaSource::MockRealtimeMediaSource): (WebCore::MockRealtimeMediaSource::capabilities): (WebCore::MockRealtimeMediaSource::states): * platform/mock/MockRealtimeMediaSource.h: Added. (WebCore::MockRealtimeMediaSource::mockAudioSourcePersistentID): (WebCore::MockRealtimeMediaSource::mockAudioSourceName): (WebCore::MockRealtimeMediaSource::mockVideoSourcePersistentID): (WebCore::MockRealtimeMediaSource::mockVideoSourceName): (WebCore::MockRealtimeMediaSource::trackSourceWithUID): (WebCore::MockRealtimeMediaSource::~MockRealtimeMediaSource): (WebCore::MockRealtimeMediaSource::currentStates): (WebCore::MockRealtimeMediaSource::constraints): Use new mock source classes. Create a new source instance for each request instead of reusing the same sources each time. * platform/mock/MockRealtimeMediaSourceCenter.cpp: (WebCore::mockSourceMap): (WebCore::MockRealtimeMediaSourceCenter::registerMockRealtimeMediaSourceCenter): (WebCore::MockRealtimeMediaSourceCenter::validateRequestConstraints): (WebCore::MockRealtimeMediaSourceCenter::createMediaStream): (WebCore::MockRealtimeMediaSourceCenter::getMediaStreamTrackSources): (WebCore::MockSource::MockSource): Deleted. (WebCore::MockSource::~MockSource): Deleted. (WebCore::MockSource::capabilities): Deleted. (WebCore::MockSource::states): Deleted. (WebCore::mockAudioSourceID): Deleted. (WebCore::mockVideoSourceID): Deleted. (WebCore::initializeMockSources): Deleted. Mock video source. Generate bip-bop inspired frames with burned in state information. * platform/mock/MockRealtimeVideoSource.cpp: Added. (WebCore::MockRealtimeVideoSource::create): (WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource): (WebCore::MockRealtimeVideoSource::startProducingData): (WebCore::MockRealtimeVideoSource::stopProducingData): (WebCore::MockRealtimeVideoSource::elapsedTime): (WebCore::MockRealtimeVideoSource::updateStates): (WebCore::MockRealtimeVideoSource::initializeCapabilities): (WebCore::MockRealtimeVideoSource::setFacingMode): (WebCore::MockRealtimeVideoSource::setFrameRate): (WebCore::MockRealtimeVideoSource::setSize): (WebCore::MockRealtimeVideoSource::drawAnimation): (WebCore::MockRealtimeVideoSource::drawBoxes): (WebCore::MockRealtimeVideoSource::drawText): (WebCore::MockRealtimeVideoSource::generateFrame): (WebCore::MockRealtimeVideoSource::imageBuffer): (WebCore::MockRealtimeVideoSource::paintCurrentFrameInContext): (WebCore::MockRealtimeVideoSource::currentFrameImage): * platform/mock/MockRealtimeVideoSource.h: Added. (WebCore::MockRealtimeVideoSource::~MockRealtimeVideoSource): (WebCore::MockRealtimeVideoSource::size): (WebCore::MockRealtimeVideoSource::updatePlatformLayer): 2015-11-09 Nan Wang AX: Input type: time is not accessible on iOS https://bugs.webkit.org/show_bug.cgi?id=150984 Reviewed by Chris Fleizach. Exposed input type: time as popup button on iOS. Test: accessibility/ios-simulator/input-type-time.html * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::determineAccessibilityRole): 2015-11-09 Jiewen Tan Null dereference loading Blink layout test editing/inserting/insert-html-crash-01.html https://bugs.webkit.org/show_bug.cgi?id=149298 Reviewed by Ryosuke Niwa. The test crashes in the method WebCore::CompositeEditCommand::moveParagraphs() because the other method WebCore::CompositeEditCommand::cleanupAfterDeletion() accidentally deletes the destination node. In WebCore::CompositeEditCommand::cleanupAfterDeletion(), it fails to determine that caretAfterDelete equals to destination as Position::operator==, which is called in VisiblePosition::operator==, only checks the equality of tuple . It is insufficient as a single position can be represented by multiple tuples. Therefore, this change adds Position::equals() to fortify the equal checking of two positions by considering combinations of different tuple representations. Furthermore, it adds VisiblePosition::equals() which considers affinity and call Position::equals() while comparing two visible positions. Test: editing/inserting/insert-html-crash-01.html * dom/Position.cpp: (WebCore::Position::equals): * dom/Position.h: * editing/CompositeEditCommand.cpp: (WebCore::CompositeEditCommand::cleanupAfterDeletion): Replace operator== with VisiblePosition::equals() to tackle the test case. * editing/VisiblePosition.cpp: (WebCore::VisiblePosition::equals): * editing/VisiblePosition.h: 2015-11-09 Myles C. Maxfield Some style changes cause tatechuyoko to be drawn off center https://bugs.webkit.org/show_bug.cgi?id=150986 Reviewed by Darin Adler. Layouts should be idempotent. In particular, during layout, an element should not rely on a previous call to styleDidChange() with a sufficiently high StyleDifference. RenderCombineText was assuming that, if a layout occurs, a previous call to styleDidChange() would have reset the renderedText. However, an ancestor element might cause the RenderCombineText to re-combine when it is already combined. Therefore, the recombination should fully uncombine before recombining. Test: fast/text/text-combine-style-change-extra-layout.html * rendering/RenderCombineText.cpp: (WebCore::RenderCombineText::combineText): Fully uncombine before recombining. 2015-11-09 Brent Fulgham [Win] Recognize context flush as an event that requires an update https://bugs.webkit.org/show_bug.cgi?id=151001 Reviewed by Simon Fraser. * platform/graphics/ca/win/WKCACFViewLayerTreeHost.cpp: (WebCore::WKCACFViewLayerTreeHost::flushContext): Mark view as needing an update when flushing so internal drawing code will do the paint. * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::paintIntoLayer): Skip WK2 assert that does not apply to Windows drawing path. 2015-11-09 Brady Eidson Modern IDB: Refactor memory objectstore/transaction interation. https://bugs.webkit.org/show_bug.cgi?id=151014 Reviewed by Darin Adler. No new tests (Refactor, no change in behavior). * Modules/indexeddb/server/IDBBackingStore.h: * Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp: (WebCore::IDBServer::MemoryBackingStoreTransaction::recordValueChanged): (WebCore::IDBServer::MemoryBackingStoreTransaction::abort): * Modules/indexeddb/server/MemoryBackingStoreTransaction.h: * Modules/indexeddb/server/MemoryIDBBackingStore.cpp: (WebCore::IDBServer::MemoryIDBBackingStore::addRecord): (WebCore::IDBServer::MemoryIDBBackingStore::putRecord): Deleted. Renamed to addRecord. * Modules/indexeddb/server/MemoryIDBBackingStore.h: * Modules/indexeddb/server/MemoryObjectStore.cpp: (WebCore::IDBServer::MemoryObjectStore::deleteRecord): (WebCore::IDBServer::MemoryObjectStore::addRecord): (WebCore::IDBServer::MemoryObjectStore::putRecord): Deleted. Renamed to addRecord. (WebCore::IDBServer::MemoryObjectStore::setKeyValue): Deleted. Folded into addRecord. * Modules/indexeddb/server/MemoryObjectStore.h: * Modules/indexeddb/server/UniqueIDBDatabase.cpp: (WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd): 2015-11-09 Said Abou-Hallawa REGRESSION (r190883): Error calculating the tile size for an SVG with no intrinsic size but with large floating intrinsic ratio https://bugs.webkit.org/show_bug.cgi?id=150904 Reviewed by Darin Adler. This patch addresses two issues. The first one is a regression from r190883 which was rolling out r184895. There was a missing if-statement in RenderBoxModelObject::calculateImageIntrinsicDimension(). We should return it back. But this if-statement is an optimization; if we hit it we should return the image resolvedSize. But we should also return the same result if we call resolveAgainstIntrinsicWidthOrHeightAndRatio(). We had a bug in resolving the intrinsic size of an image using a large intrinsic ratio. We need to do the calculation in LayoutUnits always. Using float calculations and then casting the output to an integer results in significant truncation if the intrinsic ratio is large. Test: fast/backgrounds/background-image-large-float-intrinsic-ratio.html * rendering/RenderBoxModelObject.cpp: (WebCore::resolveWidthForRatio): (WebCore::resolveHeightForRatio): (WebCore::resolveAgainstIntrinsicWidthOrHeightAndRatio): (WebCore::resolveAgainstIntrinsicRatio): Resolve the image size using its intrinsic ratio in LayoutUnits. (WebCore::RenderBoxModelObject::calculateImageIntrinsicDimensions): Put back an if-statement which was missing from rolling out r184895 2015-11-09 Youenn Fablet [Streams API] Activate assertions https://bugs.webkit.org/show_bug.cgi?id=151021 Reviewed by Darin Adler. Activating assertions in streams API. Fixing a bug in ReadableStream implementation: when pull promise is rejected, the readable stream may already be errored by some other means. Covered by existing test sets in Debug builds. * Modules/streams/ReadableStreamInternals.js: (teeReadableStream): (teeReadableStreamPullFunction): (errorReadableStream): (requestReadableStreamPull): (finishClosingReadableStream): (closeReadableStream): (enqueueInReadableStream): (readFromReadableStreamReader): * Modules/streams/ReadableStreamReader.js: (cancel): * Modules/streams/StreamInternals.js: (peekQueueValue): * Modules/streams/WritableStream.js: (write): (state): * Modules/streams/WritableStreamInternals.js: (syncWritableStreamStateWithQueue): (closeWritableStream): Deleted. 2015-11-09 Xabier Rodriguez Calvar [Streams API] Shield implementation from mangling then and catch promise methods https://bugs.webkit.org/show_bug.cgi?id=150934 Reviewed by Youenn Fablet. This is a first step to get streams code shielded from user replacing the then and catch methods in our promises. We use newly introduced @then and @catch prototype internal slots and that should solve a lot of use cases. Test: streams/streams-promises.html. * Modules/streams/ReadableStream.js: (initializeReadableStream): * Modules/streams/ReadableStreamInternals.js: (teeReadableStream): (teeReadableStreamPullFunction): (cancelReadableStream): * Modules/streams/WritableStream.js: (initializeWritableStream): (abort): * Modules/streams/WritableStreamInternals.js: (callOrScheduleWritableStreamAdvanceQueue): 2015-11-09 Manuel Rego Casasnovas [css-grid] Refactor cachedGridCoordinate() to cachedGridSpan() https://bugs.webkit.org/show_bug.cgi?id=151017 Reviewed by Sergio Villar Senin. We were using cachedGridCoordinate() in lots of places and checking the direction just in the next line. Creating a generic function to do this. No new tests, no behavior change. * rendering/RenderGrid.cpp: (WebCore::RenderGrid::computeUsedBreadthOfGridTracks): (WebCore::GridItemWithSpan::GridItemWithSpan): (WebCore::GridItemWithSpan::span): (WebCore::GridItemWithSpan::operator<): (WebCore::RenderGrid::spanningItemCrossesFlexibleSizedTracks): (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions): (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForNonSpanningItems): (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForItems): (WebCore::RenderGrid::cachedGridSpan): (WebCore::RenderGrid::gridAreaBreadthForChild): (WebCore::RenderGrid::gridAreaBreadthForChildIncludingAlignmentOffsets): (WebCore::RenderGrid::columnAxisOffsetForChild): (WebCore::RenderGrid::rowAxisOffsetForChild): (WebCore::GridItemWithSpan::gridItem): Deleted. (WebCore::RenderGrid::populateGridPositions): Deleted. * rendering/RenderGrid.h: 2015-11-09 Youenn Fablet JS Built-ins functions should be able to assert https://bugs.webkit.org/show_bug.cgi?id=150333 Reviewed by Yusuke Suzuki. * Modules/streams/ReadableStreamInternals.js: (privateInitializeReadableStreamReader): Activating an @assert. 2015-11-02 Sergio Villar Senin [css-grid] Improve grid container sizing with size constraints and intrinsic sizes https://bugs.webkit.org/show_bug.cgi?id=150679 Reviewed by Darin Adler. The grid container stores from now on its min-content and max-content block sizes in order to be able to properly compute its intrinsic size. It has to redefine computeIntrinsicLogicalContentHeightUsing() because the behavior of grid is different to "normal" blocks: - the min-content size is the sum of the grid container's track sizes in the appropiate axis when the grid is sized under a min-content constraint. - the max-content size is the sum of the grid container's track sizes in the appropiate axis when the grid is sized under a max-content constraint. - the auto block size is the max-content size. A nice side effect is that we can now properly detect whether the grid has a definite size on a given axis or not. Tests: fast/css-grid-layout/absolute-positioning-definite-sizes.html fast/css-grid-layout/flex-and-intrinsic-sizes.html fast/css-grid-layout/maximize-tracks-definite-indefinite-height.html fast/css-grid-layout/maximize-tracks-definite-indefinite-width.html * rendering/RenderBox.h: made computeIntrinsicLogicalContentHeightUsing() virtual. * rendering/RenderGrid.cpp: (WebCore::RenderGrid::GridSizingData::GridSizingData): (WebCore::RenderGrid::GridSizingData::freeSpaceForDirection): (WebCore::RenderGrid::GridSizingData::setFreeSpaceForDirection): (WebCore::RenderGrid::computeTrackBasedLogicalHeight): (WebCore::RenderGrid::computeTrackSizesForDirection): (WebCore::RenderGrid::layoutBlock): (WebCore::RenderGrid::computeIntrinsicLogicalWidths): (WebCore::RenderGrid::computeIntrinsicLogicalHeight): (WebCore::RenderGrid::computeIntrinsicLogicalContentHeightUsing): (WebCore::RenderGrid::computeUsedBreadthOfGridTracks): (WebCore::RenderGrid::distributeSpaceToTracks): (WebCore::RenderGrid::tracksAreWiderThanMinTrackBreadth): (WebCore::RenderGrid::applyStretchAlignmentToTracksIfNeeded): (WebCore::RenderGrid::layoutGridItems): (WebCore::RenderGrid::populateGridPositions): (WebCore::RenderGrid::gridElementIsShrinkToFit): Deleted. * rendering/RenderGrid.h: 2015-11-05 Sergio Villar Senin [css-grid] Grid placement conflict handling https://bugs.webkit.org/show_bug.cgi?id=150891 Reviewed by Darin Adler. If the placement for a grid item contains two lines, and the start line is further end-ward than the end line, swap the two lines. If the start line is equal to the end line, remove the end line. Test: fast/css-grid-layout/swap-lines-if-start-is-further-endward-than-end-line.html * rendering/style/GridResolvedPosition.cpp: (WebCore::resolveNamedGridLinePositionFromStyle): (WebCore::resolveGridPositionFromStyle): (WebCore::GridResolvedPosition::GridResolvedPosition): (WebCore::GridResolvedPosition::resolveGridPositionsFromStyle): (WebCore::adjustGridPositionForSide): Deleted. * rendering/style/GridResolvedPosition.h: (WebCore::GridResolvedPosition::prev): 2015-11-08 Gyuyoung Kim [EFL] Add UserAgentEFl.cpp|h https://bugs.webkit.org/show_bug.cgi?id=151007 Reviewed by Darin Adler. As other ports EFL port starts to have UserAgentEfl class in order to support more detailed UA. No new tests, no behavior change. * PlatformEfl.cmake: * platform/efl/UserAgentEfl.cpp: Added. (WebCore::platformForUAString): (WebCore::platformVersionForUAString): (WebCore::versionForUAString): (WebCore::standardUserAgent): * platform/efl/UserAgentEfl.h: Added. 2015-11-08 David Kilzer REGRESSION (r192140): Windows build broke after removing ColorSpace argument to all drawing calls Unreviewed attempt to fix the Windows build. * platform/graphics/ca/win/PlatformCALayerWin.cpp: (PlatformCALayerWin::drawTextAtPoint): * platform/graphics/win/ImageCGWin.cpp: (WebCore::BitmapImage::drawFrameMatchingSourceSize): * rendering/RenderThemeWin.cpp: (WebCore::RenderThemeWin::paintSearchFieldCancelButton): (WebCore::RenderThemeWin::paintSearchFieldResultsDecorationPart): (WebCore::RenderThemeWin::paintSearchFieldResultsButton): 2015-11-08 Youenn Fablet generate-js-builtins.js should support @internal annotation https://bugs.webkit.org/show_bug.cgi?id=150929 Reviewed by Darin Adler. No change in behavior. * Modules/streams/ReadableStreamInternals.js: Renamed @internals to @internal. * Modules/streams/StreamInternals.js: Ditto. * Modules/streams/WritableStreamInternals.js: Ditto. 2015-11-07 Simon Fraser Remove ColorSpace argument to all the drawing calls https://bugs.webkit.org/show_bug.cgi?id=150967 Reviewed by Darin Adler. Since the -webkit-color-correction CSS property was removed in r188202, and ColorSpaceDeviceRGB and ColorSpaceSRGB are functionally equivalent, we can remove all the ColorSpace arguments passed to drawing functions, and remove RenderStyle::colorSpace(), which was hardcoded to return ColorSpaceSRGB. Fill and stroke ColorSpaces are also remove from graphics state, simplifying color save/restore. * bindings/scripts/CodeGeneratorObjC.pm: (GenerateImplementation): * css/CSSFilterImageValue.cpp: (WebCore::CSSFilterImageValue::image): * editing/FrameSelection.cpp: (WebCore::CaretBase::paintCaret): * editing/cocoa/HTMLConverter.mm: (_platformColor): * html/HTMLCanvasElement.cpp: (WebCore::HTMLCanvasElement::paint): * html/canvas/CanvasRenderingContext2D.cpp: (WebCore::CanvasRenderingContext2D::clearRect): (WebCore::CanvasRenderingContext2D::applyShadow): (WebCore::CanvasRenderingContext2D::drawImage): (WebCore::CanvasRenderingContext2D::compositeBuffer): (WebCore::drawImageToContext): (WebCore::CanvasRenderingContext2D::fullCanvasCompositedDrawImage): (WebCore::CanvasRenderingContext2D::drawTextInternal): * html/canvas/CanvasRenderingContext2D.h: * html/canvas/CanvasStyle.cpp: (WebCore::CanvasStyle::applyStrokeColor): (WebCore::CanvasStyle::applyFillColor): * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::drawImageIntoBuffer): * page/DebugPageOverlays.cpp: (WebCore::RegionOverlay::drawRect): * page/FrameView.cpp: (WebCore::FrameView::paintScrollCorner): (WebCore::FrameView::paintScrollbar): (WebCore::FrameView::paintContents): * page/PrintContext.cpp: (WebCore::PrintContext::spoolAllPagesWithBoundaries): * platform/ScrollView.cpp: (WebCore::ScrollView::paintPanScrollIcon): * platform/ScrollbarTheme.h: (WebCore::ScrollbarTheme::defaultPaintScrollCorner): * platform/ScrollbarThemeComposite.cpp: (WebCore::ScrollbarThemeComposite::paintScrollCorner): (WebCore::ScrollbarThemeComposite::paintOverhangAreas): * platform/Theme.cpp: (WebCore::Theme::drawNamedImage): * platform/cocoa/ThemeCocoa.cpp: (WebCore::ThemeCocoa::drawNamedImage): * platform/graphics/BitmapImage.cpp: (WebCore::BitmapImage::drawPattern): * platform/graphics/BitmapImage.h: * platform/graphics/Color.h: * platform/graphics/CrossfadeGeneratedImage.cpp: (WebCore::drawCrossfadeSubimage): (WebCore::CrossfadeGeneratedImage::draw): (WebCore::CrossfadeGeneratedImage::drawPattern): * platform/graphics/CrossfadeGeneratedImage.h: * platform/graphics/GeneratedImage.h: * platform/graphics/GradientImage.cpp: (WebCore::GradientImage::draw): (WebCore::GradientImage::drawPattern): * platform/graphics/GradientImage.h: * platform/graphics/GraphicsContext.cpp: (WebCore::GraphicsContext::drawRaisedEllipse): (WebCore::GraphicsContext::setStrokeColor): (WebCore::GraphicsContext::setShadow): (WebCore::GraphicsContext::setLegacyShadow): (WebCore::GraphicsContext::getShadow): (WebCore::GraphicsContext::setFillColor): (WebCore::GraphicsContext::drawImage): (WebCore::GraphicsContext::drawTiledImage): (WebCore::GraphicsContext::drawImageBuffer): (WebCore::GraphicsContext::fillRect): (WebCore::GraphicsContext::fillRoundedRect): (WebCore::GraphicsContext::fillRectWithRoundedHole): (WebCore::GraphicsContext::clearShadow): Deleted. * platform/graphics/GraphicsContext.h: (WebCore::GraphicsContext::strokeColorSpace): Deleted. (WebCore::GraphicsContext::fillColorSpace): Deleted. * platform/graphics/Image.cpp: (WebCore::Image::fillWithSolidColor): (WebCore::Image::drawTiled): * platform/graphics/Image.h: (WebCore::Image::drawFrameMatchingSourceSize): * platform/graphics/ImageBuffer.h: (WebCore::ImageBuffer::create): * platform/graphics/NamedImageGeneratedImage.cpp: (WebCore::NamedImageGeneratedImage::draw): (WebCore::NamedImageGeneratedImage::drawPattern): * platform/graphics/NamedImageGeneratedImage.h: * platform/graphics/ShadowBlur.cpp: (WebCore::ScratchBuffer::setCachedShadowValues): (WebCore::ScratchBuffer::setCachedInsetShadowValues): (WebCore::ShadowBlur::ShadowBlur): (WebCore::ShadowBlur::setShadowValues): (WebCore::ShadowBlur::drawShadowBuffer): (WebCore::ShadowBlur::drawRectShadowWithoutTiling): (WebCore::ShadowBlur::drawInsetShadowWithoutTiling): (WebCore::ShadowBlur::drawInsetShadowWithTiling): (WebCore::ShadowBlur::drawRectShadowWithTiling): (WebCore::ShadowBlur::drawLayerPieces): (WebCore::ShadowBlur::blurAndColorShadowBuffer): (WebCore::ShadowBlur::beginShadowLayer): (WebCore::ShadowBlur::endShadowLayer): * platform/graphics/ShadowBlur.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer): (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput): * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::setContentsToImage): Deleted. * platform/graphics/ca/TileGrid.cpp: (WebCore::TileGrid::platformCALayerPaintContents): * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp: (PlatformCALayerWinInternal::drawRepaintCounters): * platform/graphics/cairo/BitmapImageCairo.cpp: (WebCore::BitmapImage::draw): * platform/graphics/cairo/GraphicsContextCairo.cpp: (WebCore::GraphicsContext::fillRect): (WebCore::GraphicsContext::setPlatformFillColor): (WebCore::GraphicsContext::setPlatformStrokeColor): (WebCore::GraphicsContext::setPlatformShadow): (WebCore::GraphicsContext::platformFillRoundedRect): (WebCore::GraphicsContext::fillRectWithRoundedHole): (WebCore::GraphicsContext::drawPattern): * platform/graphics/cairo/ImageBufferCairo.cpp: (WebCore::ImageBuffer::draw): (WebCore::ImageBuffer::drawPattern): * platform/graphics/cairo/ImageCairo.cpp: (WebCore::Image::drawPattern): * platform/graphics/cg/BitmapImageCG.cpp: (WebCore::BitmapImage::draw): * platform/graphics/cg/ColorCG.cpp: (WebCore::leakCGColor): (WebCore::cachedCGColor): * platform/graphics/cg/GraphicsContext3DCG.cpp: (WebCore::GraphicsContext3D::paintToCanvas): * platform/graphics/cg/GraphicsContextCG.cpp: (WebCore::setCGFillColor): (WebCore::setCGStrokeColor): (WebCore::GraphicsContext::platformInit): (WebCore::GraphicsContext::drawNativeImage): (WebCore::GraphicsContext::drawPattern): (WebCore::GraphicsContext::drawRect): (WebCore::GraphicsContext::drawLine): (WebCore::GraphicsContext::applyFillPattern): (WebCore::GraphicsContext::fillRect): (WebCore::GraphicsContext::platformFillRoundedRect): (WebCore::GraphicsContext::fillRectWithRoundedHole): (WebCore::GraphicsContext::setPlatformShadow): (WebCore::GraphicsContext::drawLinesForText): (WebCore::GraphicsContext::setPlatformStrokeColor): (WebCore::GraphicsContext::setPlatformFillColor): (WebCore::sRGBColorSpaceRef): Deleted. * platform/graphics/cg/ImageBufferCG.cpp: (WebCore::ImageBuffer::copyImage): (WebCore::ImageBuffer::draw): (WebCore::ImageBuffer::drawPattern): * platform/graphics/cg/ImageCG.cpp: (WebCore::Image::drawPattern): (WebCore::Image::imageWithColorSpace): Deleted. * platform/graphics/cg/PDFDocumentImage.cpp: (WebCore::PDFDocumentImage::draw): * platform/graphics/cg/PDFDocumentImage.h: * platform/graphics/cocoa/FontCascadeCocoa.mm: (WebCore::FontCascade::drawGlyphs): * platform/graphics/filters/FEBlend.cpp: (WebCore::FEBlend::platformApplySoftware): * platform/graphics/filters/FEColorMatrix.cpp: (WebCore::FEColorMatrix::platformApplySoftware): * platform/graphics/filters/FEComposite.cpp: (WebCore::FEComposite::platformApplySoftware): * platform/graphics/filters/FEDropShadow.cpp: (WebCore::FEDropShadow::platformApplySoftware): * platform/graphics/filters/FEFlood.cpp: (WebCore::FEFlood::platformApplySoftware): * platform/graphics/filters/FEMerge.cpp: (WebCore::FEMerge::platformApplySoftware): * platform/graphics/filters/FEOffset.cpp: (WebCore::FEOffset::platformApplySoftware): * platform/graphics/filters/FETile.cpp: (WebCore::FETile::platformApplySoftware): * platform/graphics/filters/SourceAlpha.cpp: (WebCore::SourceAlpha::platformApplySoftware): * platform/graphics/filters/SourceGraphic.cpp: (WebCore::SourceGraphic::platformApplySoftware): * platform/graphics/ios/IconIOS.mm: (WebCore::Icon::paint): * platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp: * platform/graphics/texmap/coordinated/UpdateAtlas.cpp: * platform/graphics/win/FontCGWin.cpp: (WebCore::FontCascade::drawGlyphs): * platform/graphics/win/GraphicsContextCGWin.cpp: (WebCore::GraphicsContext::drawFocusRing): * platform/graphics/win/ImageCGWin.cpp: (WebCore::BitmapImage::getHBITMAPOfSize): (WebCore::BitmapImage::drawFrameMatchingSourceSize): * platform/graphics/win/ImageCairoWin.cpp: (WebCore::BitmapImage::getHBITMAPOfSize): (WebCore::BitmapImage::drawFrameMatchingSourceSize): * platform/ios/LegacyTileCache.mm: (WebCore::LegacyTileCache::drawLayer): * platform/ios/LegacyTileGridTile.mm: (WebCore::LegacyTileGridTile::showBorder): * platform/ios/WebVideoFullscreenControllerAVKit.mm: (WebVideoFullscreenControllerContext::didSetupFullscreen): * platform/mac/DragImageMac.mm: (WebCore::drawAtPoint): * platform/mac/ScrollbarThemeMac.mm: (WebCore::ScrollbarThemeMac::setUpOverhangAreaBackground): * platform/mac/ThemeMac.mm: (WebCore::ThemeMac::drawCellOrFocusRingWithViewIntoContext): * platform/mediastream/MediaStreamPrivate.cpp: (WebCore::MediaStreamPrivate::paintCurrentFrameInContext): * platform/mock/ScrollbarThemeMock.cpp: (WebCore::ScrollbarThemeMock::paintTrackBackground): (WebCore::ScrollbarThemeMock::paintThumb): * platform/win/DragImageWin.cpp: (WebCore::createDragImageForLink): * platform/win/PopupMenuWin.cpp: (WebCore::PopupMenuWin::paint): * platform/win/WebCoreTextRenderer.cpp: (WebCore::doDrawTextAtPoint): * rendering/EllipsisBox.cpp: (WebCore::EllipsisBox::paint): (WebCore::EllipsisBox::paintSelection): * rendering/FilterEffectRenderer.cpp: (WebCore::FilterEffectRendererHelper::applyFilterEffect): * rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::paintSelection): (WebCore::InlineTextBox::paintCompositionBackground): (WebCore::InlineTextBox::paintDecoration): (WebCore::InlineTextBox::paintTextMatchMarker): (WebCore::InlineTextBox::paintCompositionUnderline): * rendering/RenderBlock.cpp: (WebCore::RenderBlock::blockSelectionGap): (WebCore::RenderBlock::logicalLeftSelectionGap): (WebCore::RenderBlock::logicalRightSelectionGap): * rendering/RenderBox.cpp: (WebCore::RenderBox::paintClippingMask): * rendering/RenderBoxModelObject.cpp: (WebCore::applyBoxShadowForBackground): (WebCore::RenderBoxModelObject::paintFillLayerExtended): (WebCore::RenderBoxModelObject::paintBorder): (WebCore::RenderBoxModelObject::drawBoxSideFromPath): (WebCore::RenderBoxModelObject::paintBoxShadow): * rendering/RenderDetailsMarker.cpp: (WebCore::RenderDetailsMarker::paint): * rendering/RenderElement.cpp: (WebCore::RenderElement::drawLineForBoxSide): (WebCore::RenderElement::paintOutline): * rendering/RenderEmbeddedObject.cpp: (WebCore::RenderEmbeddedObject::paintSnapshotImage): (WebCore::RenderEmbeddedObject::paintReplaced): * rendering/RenderFileUploadControl.cpp: (WebCore::RenderFileUploadControl::paintObject): * rendering/RenderFrameSet.cpp: (WebCore::RenderFrameSet::paintColumnBorder): (WebCore::RenderFrameSet::paintRowBorder): * rendering/RenderImage.cpp: (WebCore::RenderImage::paintReplaced): (WebCore::RenderImage::paintIntoRect): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::beginTransparencyLayers): (WebCore::RenderLayer::paintScrollCorner): (WebCore::RenderLayer::drawPlatformResizerImage): (WebCore::RenderLayer::paintResizer): * rendering/RenderListBox.cpp: (WebCore::RenderListBox::paintItemForeground): (WebCore::RenderListBox::paintItemBackground): * rendering/RenderListMarker.cpp: (WebCore::RenderListMarker::paint): * rendering/RenderReplaced.cpp: (WebCore::RenderReplaced::paint): * rendering/RenderScrollbarTheme.cpp: (WebCore::RenderScrollbarTheme::paintScrollCorner): * rendering/RenderSnapshottedPlugIn.cpp: (WebCore::RenderSnapshottedPlugIn::paintSnapshot): * rendering/RenderTheme.cpp: (WebCore::RenderTheme::paintSliderTicks): * rendering/RenderThemeIOS.mm: (WebCore::drawAxialGradient): (WebCore::drawRadialGradient): (WebCore::RenderThemeIOS::paintCheckboxDecorations): (WebCore::RenderThemeIOS::paintRadioDecorations): (WebCore::RenderThemeIOS::paintMenuListButtonDecorations): (WebCore::RenderThemeIOS::paintSliderTrack): (WebCore::RenderThemeIOS::paintProgressBar): (WebCore::RenderThemeIOS::paintFileUploadIconDecorations): * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::paintProgressBar): (WebCore::RenderThemeMac::paintMenuListButtonDecorations): (WebCore::RenderThemeMac::paintSnapshottedPluginOverlay): (WebCore::titleTextColorForAttachment): (WebCore::AttachmentLayout::layOutSubtitle): (WebCore::paintAttachmentIconBackground): (WebCore::paintAttachmentTitleBackground): (WebCore::paintAttachmentProgress): * rendering/RenderView.cpp: (WebCore::RenderView::paint): (WebCore::RenderView::paintBoxDecorations): * rendering/RenderWidget.cpp: (WebCore::RenderWidget::paint): * rendering/RootInlineBox.cpp: (WebCore::RootInlineBox::lineSelectionGap): * rendering/SimpleLineLayoutFunctions.cpp: (WebCore::SimpleLineLayout::paintDebugBorders): * rendering/TextPaintStyle.cpp: (WebCore::TextPaintStyle::TextPaintStyle): (WebCore::adjustColorForVisibilityOnBackground): (WebCore::computeTextPaintStyle): (WebCore::updateGraphicsContext): * rendering/TextPaintStyle.h: (WebCore::TextPaintStyle::TextPaintStyle): * rendering/TextPainter.cpp: (WebCore::ShadowApplier::ShadowApplier): (WebCore::paintTextWithShadows): * rendering/mathml/RenderMathMLBlock.cpp: (WebCore::RenderMathMLBlock::paint): * rendering/mathml/RenderMathMLFraction.cpp: (WebCore::RenderMathMLFraction::paint): * rendering/mathml/RenderMathMLMenclose.cpp: (WebCore::RenderMathMLMenclose::paint): * rendering/mathml/RenderMathMLOperator.cpp: (WebCore::RenderMathMLOperator::paint): * rendering/mathml/RenderMathMLRadicalOperator.cpp: (WebCore::RenderMathMLRadicalOperator::paint): * rendering/mathml/RenderMathMLRoot.cpp: (WebCore::RenderMathMLRoot::paint): * rendering/shapes/Shape.cpp: (WebCore::Shape::createRasterShape): * rendering/style/NinePieceImage.cpp: (WebCore::NinePieceImage::paint): * rendering/style/RenderStyle.h: * rendering/svg/RenderSVGImage.cpp: (WebCore::RenderSVGImage::paintForeground): * rendering/svg/RenderSVGPath.cpp: (WebCore::useStrokeStyleToFill): * rendering/svg/RenderSVGResourceFilter.cpp: (WebCore::RenderSVGResourceFilter::postApplyResource): * rendering/svg/RenderSVGResourceSolidColor.cpp: (WebCore::RenderSVGResourceSolidColor::applyResource): * rendering/svg/SVGInlineTextBox.cpp: (WebCore::SVGInlineTextBox::paintSelectionBackground): * rendering/svg/SVGRenderingContext.cpp: (WebCore::SVGRenderingContext::prepareToRenderSVGContent): (WebCore::SVGRenderingContext::bufferForeground): * svg/SVGAnimatedColor.cpp: (WebCore::SVGAnimatedColorAnimator::calculateAnimatedValue): * svg/graphics/SVGImage.cpp: (WebCore::SVGImage::drawForContainer): (WebCore::SVGImage::nativeImageForCurrentFrame): (WebCore::SVGImage::drawPatternForContainer): (WebCore::SVGImage::draw): * svg/graphics/SVGImage.h: * svg/graphics/SVGImageForContainer.cpp: (WebCore::SVGImageForContainer::draw): (WebCore::SVGImageForContainer::drawPattern): * svg/graphics/SVGImageForContainer.h: * svg/graphics/filters/SVGFEImage.cpp: (WebCore::FEImage::platformApplySoftware): * testing/MockPageOverlayClient.cpp: (WebCore::MockPageOverlayClient::drawRect): 2015-11-07 Simon Fraser Use ColorSpaceSRGB for image buffers everywhere https://bugs.webkit.org/show_bug.cgi?id=150990 Reviewed by Zalan Bujtas. ColorSpaceSRGB and ColorSpaceDeviceRGB are equivalent now, so convert code that creates image buffers tagged with ColorSpaceDeviceRGB to use ColorSpaceSRGB. * platform/graphics/GraphicsContext.cpp: (WebCore::GraphicsContext::createCompatibleBuffer): * platform/graphics/ImageBuffer.h: (WebCore::ImageBuffer::create): * platform/graphics/cg/BitmapImageCG.cpp: (WebCore::BitmapImage::checkForSolidColor): * platform/graphics/cg/ColorCG.cpp: (WebCore::Color::Color): * platform/graphics/cg/GraphicsContextCG.cpp: (WebCore::sRGBColorSpaceRef): Deleted. * platform/graphics/cg/ImageBufferCG.cpp: (WebCore::ImageBuffer::putByteArray): * platform/graphics/cocoa/IOSurface.mm: (IOSurface::createFromImage): * platform/graphics/filters/FEFlood.h: * platform/graphics/filters/FETile.cpp: (WebCore::FETile::platformApplySoftware): * platform/graphics/filters/FilterEffect.cpp: (WebCore::FilterEffect::FilterEffect): * platform/graphics/filters/SourceGraphic.h: (WebCore::SourceGraphic::SourceGraphic): * rendering/FilterEffectRenderer.cpp: (WebCore::FilterEffectRenderer::build): (WebCore::FilterEffectRenderer::apply): * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::paintProgressBar): * rendering/svg/RenderSVGResourceClipper.cpp: (WebCore::RenderSVGResourceClipper::applyClippingToContext): * rendering/svg/RenderSVGResourceFilter.cpp: (WebCore::RenderSVGResourceFilter::buildPrimitives): * rendering/svg/RenderSVGResourceGradient.cpp: (WebCore::createMaskAndSwapContextForTextGradient): * rendering/svg/RenderSVGResourceMasker.cpp: (WebCore::RenderSVGResourceMasker::applyResource): * rendering/svg/RenderSVGResourcePattern.cpp: (WebCore::RenderSVGResourcePattern::createTileImage): * svg/graphics/SVGImage.cpp: (WebCore::SVGImage::drawPatternForContainer): * svg/graphics/filters/SVGFEImage.cpp: (WebCore::FEImage::platformApplySoftware): 2015-11-07 Zalan Bujtas Crash when subtree layout is set on FrameView while auto size mode is enabled. https://bugs.webkit.org/show_bug.cgi?id=150995 rdar://problem/22785262 Reviewed by Beth Dakin. Autosizing initiates multiple synchronous layouts to calculate preferred view width for current content. FrameView::autoSizeIfEnabled() is called from FrameView::layout() while we are in InPreLayout state. It is safe to do during full layout. However, since we setup the subtree state just before the autoSizeIfEnabled() call, reentering it with a newly issued layout confuses SubtreeLayoutStateMaintainer. This patch reverses the order of autoSizeIfEnabled() call and the subtree layout state setup. It also ensures that the first layout requested by autoSizeIfEnabled() always runs on the whole tree. Test: fast/dynamic/crash-subtree-layout-when-auto-size-enabled.html * page/FrameView.cpp: (WebCore::FrameView::layout): (WebCore::FrameView::convertSubtreeLayoutToFullLayout): (WebCore::FrameView::scheduleRelayout): (WebCore::FrameView::scheduleRelayoutOfSubtree): (WebCore::FrameView::autoSizeIfEnabled): * page/FrameView.h: * testing/Internals.cpp: (WebCore::Internals::enableAutoSizeMode): * testing/Internals.h: * testing/Internals.idl: 2015-11-07 Chris Dumez embed element without src and type attributes should represent nothing https://bugs.webkit.org/show_bug.cgi?id=148853 Reviewed by Zalan Bujtas. As per the HTML specification, an embed element without src and type attributes should represent nothing: https://html.spec.whatwg.org/multipage/embedded-content.html#the-embed-element This patch fixes the issue by making sure we don't construct a renderer for such embed elements. The new behavior is consistent with Firefox but differs from Chrome. No new tests, already covered by existing tests. * html/HTMLEmbedElement.cpp: (WebCore::HTMLEmbedElement::rendererIsNeeded): 2015-11-07 Michael Catanzaro Node.h:392:12: warning: 'this' pointer cannot be null in well-defined C++ code https://bugs.webkit.org/show_bug.cgi?id=150996 Reviewed by Andreas Kling. Remove ASSERT(this) statement that is triggering hundreds of warnings from Clang. * dom/Node.h: (WebCore::Node::document): 2015-11-07 Michael Catanzaro Unreviewed, fix GTK build after r191981 * html/HTMLFormControlElement.cpp: 2015-11-06 Scott Valentine Allow an optional hash algorithm to be passed to generateKey for RSA keys. https://bugs.webkit.org/show_bug.cgi?id=144938 Reviewed by Alexey Proskuryakov. Test: crypto/subtle/rsa-export-generated-keys.html This changeset allows an optional hash parameter to be passed to the generate key function for RSA type keys. Previously, there was no way to export generated keys, as no hash function could be associated with the key (required for JWK). The current WebCrypto API draft requires the hash function to be specified in the algorithm object passed to generateKey (http://www.w3.org/TR/WebCryptoAPI 20.4), however, they were made optional in this implementation to maintain compatiblity. * bindings/js/JSCryptoAlgorithmDictionary.cpp: (WebCore::getHashAlgorithm): (WebCore::createHmacParams): (WebCore::createHmacKeyParams): (WebCore::createRsaKeyGenParams): (WebCore::createRsaOaepParams): (WebCore::createRsaSsaParams): (WebCore::JSCryptoAlgorithmDictionary::createParametersForImportKey): Deleted. * bindings/js/SerializedScriptValue.cpp: (WebCore::CloneDeserializer::readRSAKey): * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp: (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::generateKey): (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::importKey): * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp: (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::generateKey): (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey): * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp: (WebCore::CryptoAlgorithmRSA_OAEP::generateKey): (WebCore::CryptoAlgorithmRSA_OAEP::importKey): * crypto/gnutls/CryptoKeyRSAGnuTLS.cpp: (WebCore::CryptoKeyRSA::CryptoKeyRSA): (WebCore::CryptoKeyRSA::create): (WebCore::CryptoKeyRSA::generatePair): (WebCore::CryptoKeyRSA::restrictToHash): Deleted. * crypto/keys/CryptoKeyRSA.h: * crypto/mac/CryptoKeyRSAMac.cpp: (WebCore::CryptoKeyRSA::CryptoKeyRSA): (WebCore::CryptoKeyRSA::create): (WebCore::CryptoKeyRSA::generatePair): (WebCore::CryptoKeyRSA::restrictToHash): Deleted. * crypto/parameters/CryptoAlgorithmRsaKeyGenParams.h: 2015-11-06 Wenson Hsieh Scrolling iframe inside scrollable div does not work with trackpad https://bugs.webkit.org/show_bug.cgi?id=150168 Reviewed by Brent Fulgham. When scrolling in an iframe nested under an overflow scrolling region, EventHandler::platformPrepareForWheelEvents fails to compute the correct scrollableArea, using the overflow div's scrollable area instead of the iframe's view. This causes the latching algorithm to bail out of handling the wheel event. To avoid this, we special-case the decision to compute the scrollableArea from the scrollableContainer if we are attempting to scroll in an iframe. Test: fast/scrolling/latching/scroll-iframe-in-overflow.html * page/mac/EventHandlerMac.mm: (WebCore::EventHandler::platformPrepareForWheelEvents): 2015-11-06 Brady Eidson Modern IDB: Make the result data for a "get" request be an IDBGetResult. https://bugs.webkit.org/show_bug.cgi?id=150985 Reviewed by Alex Christensen. No new tests (Refactor, no change in behavior). * Modules/indexeddb/IDBGetResult.h: (WebCore::IDBGetResult::IDBGetResult): (WebCore::IDBGetResult::dataFromBuffer): (WebCore::IDBGetResult::isolatedCopy): * Modules/indexeddb/client/IDBTransactionImpl.cpp: (WebCore::IDBClient::IDBTransaction::didGetRecordOnServer): * Modules/indexeddb/legacy/IDBTransactionBackendOperations.cpp: (WebCore::GetOperation::perform): * Modules/indexeddb/server/IDBBackingStore.h: * Modules/indexeddb/server/MemoryIDBBackingStore.cpp: (WebCore::IDBServer::MemoryIDBBackingStore::getIndexRecord): * Modules/indexeddb/server/MemoryIDBBackingStore.h: * Modules/indexeddb/server/MemoryIndex.cpp: (WebCore::IDBServer::MemoryIndex::valueForKeyRange): * Modules/indexeddb/server/MemoryIndex.h: * Modules/indexeddb/server/MemoryObjectStore.cpp: (WebCore::IDBServer::MemoryObjectStore::indexValueForKeyRange): * Modules/indexeddb/server/MemoryObjectStore.h: * Modules/indexeddb/server/UniqueIDBDatabase.cpp: (WebCore::IDBServer::UniqueIDBDatabase::storeCallback): (WebCore::IDBServer::UniqueIDBDatabase::getRecord): (WebCore::IDBServer::UniqueIDBDatabase::performGetIndexRecord): (WebCore::IDBServer::UniqueIDBDatabase::didPerformGetRecord): (WebCore::IDBServer::UniqueIDBDatabase::performGetResultCallback): (WebCore::IDBServer::UniqueIDBDatabase::performValueDataCallback): Deleted. * Modules/indexeddb/server/UniqueIDBDatabase.h: * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp: (WebCore::IDBServer::UniqueIDBDatabaseTransaction::getRecord): * Modules/indexeddb/shared/IDBResultData.cpp: (WebCore::IDBResultData::IDBResultData): (WebCore::IDBResultData::getRecordSuccess): (WebCore::IDBResultData::getResult): * Modules/indexeddb/shared/IDBResultData.h: (WebCore::IDBResultData::resultData): Deleted. 2015-11-06 Chris Dumez Remove unused HTMLFormControlsCollection::namedItem() https://bugs.webkit.org/show_bug.cgi?id=150975 Reviewed by Andreas Kling. Remove unused HTMLFormControlsCollection::namedItem(). JSHTMLFormControlsCollection::namedItem() calls namedItems() on the implementation object, not namedItem() because it returns a RadioNodeList when there are several matches. * html/HTMLFormControlsCollection.cpp: (WebCore::firstNamedItem): Deleted. (WebCore::HTMLFormControlsCollection::namedItem): Deleted. * html/HTMLFormControlsCollection.h: 2015-11-06 Myles C. Maxfield REGRESSION(r182286): Tatechuyoko following ruby is drawn too far to the right https://bugs.webkit.org/show_bug.cgi?id=150923 Reviewed by Zalan Bujtas. Ever since r182286, expansion opportunities in justified ruby were moved to their neighboring elements (thereby forbidding trailing nor leading expansions inside ruby). However, when the neighboring element is tatechuyoko, we will erroneously honor the expansion opportunity inside the tatechuyoko, thereby moving it horizontally. Tatechuyoko should never have expansion opportunities inside it. Test: fast/text/ruby-justify-tatechuyoko.html * rendering/RenderBlockLineLayout.cpp: (WebCore::expansionBehaviorForInlineTextBox): 2015-11-06 Mario Sanchez Prada Layout Test accessibility/win/linked-elements.html is crashing on win debug https://bugs.webkit.org/show_bug.cgi?id=150944 Reviewed by Chris Fleizach. Be more precise ASSERTing on textUnderElement, only checking that the render tree is stable before using TextIteraror when in 'IncludeAllChildren' mode. * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::textUnderElement): 2015-11-06 Carlos Garcia Campos [GStreamer] Use MainThreadNotifier to send notifications to main thread in WebKitWebSourceGStreamer https://bugs.webkit.org/show_bug.cgi?id=150890 Reviewed by Žan Doberšek. Instead of the GThreadSafeMainLoopSources. * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp: (webKitWebSrcStop): (webKitWebSrcChangeState): (webKitWebSrcNeedData): (webKitWebSrcEnoughData): (webKitWebSrcSeek): (StreamingClient::handleResponseReceived): (StreamingClient::handleDataReceived): (StreamingClient::handleNotifyFinished): (webKitWebSrcFinalize): Deleted. (webKitWebSrcSetProperty): Deleted. (webKitWebSrcGetProperty): Deleted. (webKitWebSrcSetExtraHeader): Deleted. (webKitWebSrcStart): Deleted. (webKitWebSrcGetProtocols): Deleted. (webKitWebSrcGetUri): Deleted. (webKitWebSrcSetUri): Deleted. (webKitWebSrcUriHandlerInit): Deleted. 2015-11-06 Carlos Garcia Campos [GStreamer] Use MainThreadNotifier to send notifications to main thread in TrackPrivateGStreamer https://bugs.webkit.org/show_bug.cgi?id=150889 Reviewed by Žan Doberšek. Instead of the GThreadSafeMainLoopSources. * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp: (WebCore::InbandTextTrackPrivateGStreamer::InbandTextTrackPrivateGStreamer): (WebCore::InbandTextTrackPrivateGStreamer::handleSample): (WebCore::InbandTextTrackPrivateGStreamer::streamChanged): * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.h: * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp: (WebCore::TrackPrivateBaseGStreamer::TrackPrivateBaseGStreamer): (WebCore::TrackPrivateBaseGStreamer::disconnect): (WebCore::TrackPrivateBaseGStreamer::activeChangedCallback): (WebCore::TrackPrivateBaseGStreamer::tagsChangedCallback): (WebCore::TrackPrivateBaseGStreamer::tagsChanged): (WebCore::TrackPrivateBaseGStreamer::~TrackPrivateBaseGStreamer): Deleted. (WebCore::TrackPrivateBaseGStreamer::notifyTrackOfActiveChanged): Deleted. * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h: 2015-11-06 Csaba Osztrogonác Suppress deprecated-declarations warning in WebCore/platform/URL.cpp https://bugs.webkit.org/show_bug.cgi?id=150803 Reviewed by Alexey Proskuryakov. * platform/URL.cpp: (WebCore::appendEncodedHostname): 2015-11-06 Carlos Garcia Campos [GStreamer] Do not use GThreadSafeMainLoopSource to send notifications to the main thread in MediaPlayerPrivateGStreamer https://bugs.webkit.org/show_bug.cgi?id=150888 Reviewed by Žan Doberšek. Analyzing how the main loop sources were used in GST code I've noticed that in most of the cases they are used to send notifications to the main thread. The way it works in those cases is that some state is updated in whatever thread and we notify the main thread to use the new state. There's no data passed to the main thread, they are just notifications. I've also noticed that we are not doing this exactly as expected in several of those cases. GThreadSafeMainLoopSource cancels the current source when a new one is scheduled, and that was done this way because previous code in GST using GSources directly did it that way. But that's not what we want, if there's a notification pending, since the state is updated, we can just wait for it to happen instead of cancelling and scheduling a new one. I've also noticed that in most of the cases where we schedule notifications to the main thread, we can be already in the main thread, so we could avoid the schedule entirely. We can use RunLoop::dispatch() to send notifications to the main thread, but there's no way to cancel those tasks. This patch adds a new helper class MainThreadNotifier that uses an enum of flags to handle different kind of notifications. It uses RunLoop::dispatch() to send notifications to the main thread, but only if there isn't one pending for the given type. This patch also makes signal callbacks static members to be able to make the private methods actually private. * platform/graphics/gstreamer/MainThreadNotifier.h: Added. (WebCore::MainThreadNotifier::MainThreadNotifier): (WebCore::MainThreadNotifier::notify): (WebCore::MainThreadNotifier::cancelPendingNotifications): (WebCore::MainThreadNotifier::addPendingNotification): (WebCore::MainThreadNotifier::removePendingNotification): * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::setAudioStreamPropertiesCallback): (WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer): (WebCore::MediaPlayerPrivateGStreamer::videoChangedCallback): (WebCore::MediaPlayerPrivateGStreamer::videoSinkCapsChangedCallback): (WebCore::MediaPlayerPrivateGStreamer::audioChangedCallback): (WebCore::MediaPlayerPrivateGStreamer::textChangedCallback): (WebCore::MediaPlayerPrivateGStreamer::newTextSampleCallback): (WebCore::MediaPlayerPrivateGStreamer::sourceChangedCallback): (WebCore::MediaPlayerPrivateGStreamer::createAudioSink): (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin): (WebCore::MediaPlayerPrivateGStreamer::setAudioStreamProperties): Deleted. (WebCore::MediaPlayerPrivateGStreamer::registerMediaEngine): Deleted. (WebCore::initializeGStreamerAndRegisterWebKitElements): Deleted. (WebCore::MediaPlayerPrivateGStreamer::load): Deleted. (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo): Deleted. (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfAudio): Deleted. (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfText): Deleted. (WebCore::MediaPlayerPrivateGStreamer::canSaveMediaData): Deleted. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase): (WebCore::MediaPlayerPrivateGStreamerBase::volumeChangedCallback): (WebCore::MediaPlayerPrivateGStreamerBase::muteChangedCallback): (WebCore::MediaPlayerPrivateGStreamerBase::repaintCallback): (WebCore::MediaPlayerPrivateGStreamerBase::drawCallback): (WebCore::MediaPlayerPrivateGStreamerBase::createVideoSink): (WebCore::MediaPlayerPrivateGStreamerBase::setStreamVolumeElement): (WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase): Deleted. (WebCore::MediaPlayerPrivateGStreamerBase::setPipeline): Deleted. (WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage): Deleted. (WebCore::MediaPlayerPrivateGStreamerBase::muted): Deleted. (WebCore::MediaPlayerPrivateGStreamerBase::updateTexture): Deleted. (WebCore::MediaPlayerPrivateGStreamerBase::droppedFrameCount): Deleted. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h: (WebCore::MediaPlayerPrivateGStreamerBase::setVisible): Deleted. 2015-11-06 Yoav Weiss Expose HTMLImageElement sizes attribute in IDL https://bugs.webkit.org/show_bug.cgi?id=150230 Reviewed by Darin Adler. No new tests, but fixed test expectations for exposed interfaces. * html/HTMLImageElement.idl: Make sure that `sizes` is exposed as an IDL attribute, to ensure proper feature detection of sizes support. 2015-11-05 Carlos Garcia Campos [GStreamer] Use RunLoop::Timer instead of GMainLoopSource in video sink https://bugs.webkit.org/show_bug.cgi?id=150807 Reviewed by Žan Doberšek. Since we always wait until the sample is actually rendered we don't really need either a thread safe main loop source, nor cancelling if already requested and other things GMainLoopSource does. This adds a helper class VideoRenderRequestScheduler to use the RunLoop::Timer. All the logic to syncronize between threads has been moved to this helper class too. * platform/graphics/gstreamer/VideoSinkGStreamer.cpp: (VideoRenderRequestScheduler::VideoRenderRequestScheduler): (VideoRenderRequestScheduler::start): (VideoRenderRequestScheduler::stop): (VideoRenderRequestScheduler::requestRender): (VideoRenderRequestScheduler::isUnlocked): (VideoRenderRequestScheduler::render): (_WebKitVideoSinkPrivate::_WebKitVideoSinkPrivate): (webkitVideoSinkRepaintRequested): (webkitVideoSinkRender): (webkitVideoSinkUnlock): (webkitVideoSinkUnlockStop): (webkitVideoSinkStop): (webkitVideoSinkStart): (_WebKitVideoSinkPrivate::~_WebKitVideoSinkPrivate): Deleted. (webkitVideoSinkTimeoutCallback): Deleted. (unlockSampleMutex): Deleted. 2015-11-05 Nikos Andronikos Add runtime and compile time flags for enabling Web Animations API and model. https://bugs.webkit.org/show_bug.cgi?id=150914 Reviewed by Benjamin Poulain. Add ENABLE_WEB_ANIMATIONS compile time flag, runtime flag webAnimationsEnabled and Expose WK2 preference for runtime flag. * Configurations/FeatureDefines.xcconfig: * bindings/generic/RuntimeEnabledFeatures.cpp: (WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures): * bindings/generic/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::setWebAnimationsEnabled): (WebCore::RuntimeEnabledFeatures::webAnimationsEnabled): 2015-11-05 Commit Queue Unreviewed, rolling out r192089. https://bugs.webkit.org/show_bug.cgi?id=150966 This change broke an existing layout test on Yosemite and Mavericks (Requested by ryanhaddad on #webkit). Reverted changeset: "Preview on apple.com/contact with all text selected shows a map" https://bugs.webkit.org/show_bug.cgi?id=150963 http://trac.webkit.org/changeset/192089 2015-11-05 Tim Horton Preview on apple.com/contact with all text selected shows a map https://bugs.webkit.org/show_bug.cgi?id=150963 Reviewed by Beth Dakin. * editing/mac/DictionaryLookup.h: * editing/mac/DictionaryLookup.mm: (WebCore::DictionaryLookup::rangeForSelection): If the range that Lookup decides to use doesn't intersect the hit point, just ignore Lookup. (WebCore::DictionaryLookup::rangeAtHitTestResult): If the selection-based Lookup fails to find a usable result, fall back to looking around the hit point. 2015-11-05 Brady Eidson Modern IDB: Implement IDBIndex get/getKey/count requests. https://bugs.webkit.org/show_bug.cgi?id=150910 Reviewed by Alex Christensen. Tests: storage/indexeddb/modern/index-get-count-basic.html storage/indexeddb/modern/index-get-count-failures.html * Modules/indexeddb/IndexedDB.h: * Modules/indexeddb/client/IDBAnyImpl.cpp: (WebCore::IDBClient::IDBAny::IDBAny): (WebCore::IDBClient::IDBAny::modernIDBIndex): * Modules/indexeddb/client/IDBAnyImpl.h: (WebCore::IDBClient::IDBAny::create): (WebCore::IDBClient::IDBAny::createUndefined): * Modules/indexeddb/client/IDBIndexImpl.cpp: (WebCore::IDBClient::IDBIndex::count): (WebCore::IDBClient::IDBIndex::doCount): (WebCore::IDBClient::IDBIndex::get): (WebCore::IDBClient::IDBIndex::doGet): (WebCore::IDBClient::IDBIndex::getKey): (WebCore::IDBClient::IDBIndex::doGetKey): * Modules/indexeddb/client/IDBIndexImpl.h: (WebCore::IDBClient::IDBIndex::info): * Modules/indexeddb/client/IDBObjectStoreImpl.h: (WebCore::IDBClient::IDBObjectStore::isDeleted): (WebCore::IDBClient::IDBObjectStore::modernTransaction): * Modules/indexeddb/client/IDBRequestImpl.cpp: (WebCore::IDBClient::IDBRequest::createCount): (WebCore::IDBClient::IDBRequest::createGet): (WebCore::IDBClient::IDBRequest::IDBRequest): (WebCore::IDBClient::IDBRequest::sourceObjectStoreIdentifier): (WebCore::IDBClient::IDBRequest::sourceIndexIdentifier): (WebCore::IDBClient::IDBRequest::requestedIndexRecordType): (WebCore::IDBClient::IDBRequest::setResultToUndefined): * Modules/indexeddb/client/IDBRequestImpl.h: * Modules/indexeddb/client/IDBTransactionImpl.cpp: (WebCore::IDBClient::IDBTransaction::requestGetValue): (WebCore::IDBClient::IDBTransaction::requestGetKey): (WebCore::IDBClient::IDBTransaction::didGetRecordOnServer): (WebCore::IDBClient::IDBTransaction::requestCount): * Modules/indexeddb/client/IDBTransactionImpl.h: * Modules/indexeddb/client/TransactionOperation.cpp: (WebCore::IDBClient::TransactionOperation::TransactionOperation): * Modules/indexeddb/client/TransactionOperation.h: (WebCore::IDBClient::TransactionOperation::indexIdentifier): (WebCore::IDBClient::TransactionOperation::indexRecordType): * Modules/indexeddb/server/IDBBackingStore.h: * Modules/indexeddb/server/MemoryIDBBackingStore.cpp: (WebCore::IDBServer::MemoryIDBBackingStore::getRecord): (WebCore::IDBServer::MemoryIDBBackingStore::getIndexRecord): (WebCore::IDBServer::MemoryIDBBackingStore::getCount): * Modules/indexeddb/server/MemoryIDBBackingStore.h: * Modules/indexeddb/server/MemoryIndex.cpp: (WebCore::IDBServer::MemoryIndex::valueForKeyRange): (WebCore::IDBServer::MemoryIndex::countForKeyRange): * Modules/indexeddb/server/MemoryIndex.h: * Modules/indexeddb/server/MemoryObjectStore.cpp: (WebCore::IDBServer::MemoryObjectStore::createIndex): (WebCore::IDBServer::MemoryObjectStore::countForKeyRange): (WebCore::IDBServer::MemoryObjectStore::indexValueForKeyRange): * Modules/indexeddb/server/MemoryObjectStore.h: * Modules/indexeddb/server/UniqueIDBDatabase.cpp: (WebCore::IDBServer::UniqueIDBDatabase::getRecord): (WebCore::IDBServer::UniqueIDBDatabase::performGetIndexRecord): (WebCore::IDBServer::UniqueIDBDatabase::getCount): (WebCore::IDBServer::UniqueIDBDatabase::performGetCount): (WebCore::IDBServer::UniqueIDBDatabase::performGetRecord): Deleted. * Modules/indexeddb/server/UniqueIDBDatabase.h: * Modules/indexeddb/shared/IDBRequestData.cpp: (WebCore::IDBRequestData::IDBRequestData): (WebCore::IDBRequestData::objectStoreIdentifier): (WebCore::IDBRequestData::indexIdentifier): (WebCore::IDBRequestData::indexRecordType): * Modules/indexeddb/shared/IDBRequestData.h: 2015-11-05 Zhuo Li Rename the variable to avoid conflict between the variable and the parameter. https://bugs.webkit.org/show_bug.cgi?id=150019. Reviewed by Dan Bernstein. * platform/cocoa/SearchPopupMenuCocoa.mm: (WebCore::typeCheckedRecentSearchesRemovingRecentSearchesAddedAfterDate): Rename `date` to `dateAdded` so that it does not have the same name as the parameter passed in. 2015-11-05 Joseph Pecoraro Web Inspector: Clean up InjectedScript uses https://bugs.webkit.org/show_bug.cgi?id=150921 Reviewed by Timothy Hatcher. * inspector/CommandLineAPIModule.cpp: (WebCore::CommandLineAPIModule::injectIfNeeded): (WebCore::CommandLineAPIModule::CommandLineAPIModule): * inspector/CommandLineAPIModule.h: * inspector/WebInjectedScriptManager.cpp: (WebCore::WebInjectedScriptManager::didCreateInjectedScript): * inspector/WebInjectedScriptManager.h: 2015-11-05 Joseph Pecoraro Web Inspector: Put ScriptDebugServer into InspectorEnvironment and cleanup duplicate references https://bugs.webkit.org/show_bug.cgi?id=150869 Reviewed by Brian Burg. Refactoring covered by existing tests. * WebCore.xcodeproj/project.pbxproj: Privately export PageScriptDebuggerAgent.h due to InspectorController.h needing it. * inspector/InspectorController.h: * inspector/InspectorController.cpp: (WebCore::InspectorController::InspectorController): (WebCore::InspectorController::scriptDebugServer): Own the PageScriptDebugServer. * inspector/WorkerInspectorController.h: * inspector/WorkerInspectorController.cpp: (WebCore::WorkerInspectorController::WorkerInspectorController): (WebCore::WorkerInspectorController::scriptDebugServer): Own the WorkerScriptDebugServer. (WebCore::WorkerInspectorController::vm): Use the VM accessed through the worker global object. * inspector/InspectorWebAgentBase.h: (WebCore::InspectorAgentBase::InspectorAgentBase): Given Web agents a m_environment convenience to access the InspectorEnvironment. * inspector/InspectorNetworkAgent.cpp: (WebCore::InspectorNetworkAgent::timestamp): * inspector/InspectorPageAgent.cpp: (WebCore::InspectorPageAgent::timestamp): (WebCore::InspectorPageAgent::enable): (WebCore::InspectorPageAgent::frameStartedLoading): * inspector/InspectorTimelineAgent.cpp: (WebCore::InspectorTimelineAgent::didCreateFrontendAndBackend): (WebCore::InspectorTimelineAgent::willDestroyFrontendAndBackend): (WebCore::InspectorTimelineAgent::internalStart): (WebCore::InspectorTimelineAgent::internalStop): (WebCore::InspectorTimelineAgent::timestamp): (WebCore::InspectorTimelineAgent::startFromConsole): (WebCore::InspectorTimelineAgent::willCallFunction): (WebCore::InspectorTimelineAgent::willEvaluateScript): (WebCore::InspectorTimelineAgent::setPageScriptDebugServer): Deleted. * inspector/InspectorTimelineAgent.h: Use the InspectorEnvironment for VM / ScriptDebugServer. * inspector/PageDebuggerAgent.cpp: (WebCore::PageDebuggerAgent::PageDebuggerAgent): Deleted. (WebCore::PageDebuggerAgent::scriptDebugServer): Deleted. * inspector/PageDebuggerAgent.h: * inspector/PageRuntimeAgent.cpp: (WebCore::PageRuntimeAgent::globalVM): Deleted. * inspector/PageRuntimeAgent.h: * inspector/WorkerDebuggerAgent.h: * inspector/WorkerRuntimeAgent.cpp: (WebCore::WorkerRuntimeAgent::globalVM): Deleted. * inspector/WorkerRuntimeAgent.h: * inspector/WorkerDebuggerAgent.cpp: (WebCore::WorkerDebuggerAgent::WorkerDebuggerAgent): Deleted. (WebCore::WorkerDebuggerAgent::scriptDebugServer): Deleted. Remove now unnecessary subclass code. (WebCore::WorkerDebuggerAgent::interruptAndDispatchInspectorCommands): One more special case for accessing Worker properties from the ScriptDebugServer. 2015-11-05 Xabier Rodriguez Calvar [Streams API] Shield implementation from user mangling Promise.reject and resolve methods https://bugs.webkit.org/show_bug.cgi?id=150895 Reviewed by Youenn Fablet. Replace all calls to @Promise.resolve and @Promise.reject with their internal slot counterparts. This way we ensure that if the user replaces those constructor methods, our implementation still works. Test: streams/streams-promises.html. * Modules/streams/ReadableStream.js: (initializeReadableStream): (cancel): * Modules/streams/ReadableStreamInternals.js: (privateInitializeReadableStreamReader): (cancelReadableStream): (readFromReadableStreamReader): * Modules/streams/ReadableStreamReader.js: (cancel): (read): (closed): * Modules/streams/StreamInternals.js: (promiseInvokeOrNoop): (promiseInvokeOrFallbackOrNoop): * Modules/streams/WritableStream.js: (initializeWritableStream): (abort): (close): (write): (closed): (ready): 2015-11-05 Andreas Kling Give ResourceUsageOverlay a stacked chart for dirty memory per category. Reviewed by Antti Koivisto. Refactored the data gathering to operate on "memory categories", a memory category is at the top level a VM tag, e.g the VM tag for our bmalloc allocator. It can in turn have sub-categories, e.g one for the GC heap, which allocates all of its blocks through bmalloc and thus end up in the same tag. Each category also has a hard-coded color, which is used consistently in labels and charts. Also went back to drawing everything with CGContext directly instead of GraphicsContext since the latter is not thread safe. * page/ResourceUsageOverlay.h: * page/cocoa/ResourceUsageOverlayCocoa.mm: (-[WebOverlayLayer drawInContext:]): (WebCore::RingBuffer::last): (WebCore::MemoryCategoryInfo::MemoryCategoryInfo): (WebCore::ResourceUsageData::ResourceUsageData): (WebCore::showText): (WebCore::drawGraphLabel): (WebCore::drawCpuHistory): (WebCore::drawGCHistory): (WebCore::drawMemHistory): (WebCore::drawSlice): (WebCore::drawMemoryPie): (WebCore::ResourceUsageOverlay::platformDraw): (WebCore::categoryForVMTag): (WebCore::runSamplerThread): (WebCore::drawPlate): Deleted. (WebCore::fontCascade): Deleted. (WebCore::ResourceUsageOverlay::draw): Deleted. 2015-11-05 Simon Fraser Having page overlays causes iframe to get composited https://bugs.webkit.org/show_bug.cgi?id=150920 Reviewed by Tim Horton. When deciding whether to enable compositing for a subframe, don't consult the main frame's overlay count. Only do that for the main frame. (WebCore::RenderLayerCompositor::updateCompositingLayers): 2015-11-05 Manuel Rego Casasnovas [css-grid] Support positioned grid children https://bugs.webkit.org/show_bug.cgi?id=150837 Reviewed by Darin Adler. According to the spec positioned grid children have a special behavior described at: https://drafts.csswg.org/css-grid/#abspos The idea is that for positioned children the containing block will correspond to the padding edges of the grid container, unless the grid placement properties are defined. This not only affects to positioned grid items (direct children) but also to any descendant where the containing block is the grid container. In order to manage this special behavior, the patch is overriding RenderBlock::layoutPositionedObject() to calculate the position and size depending on the grid-placement properties. RenderBox class has some changes to calculate the containing block width and height for positioned objects (using the override value). And also to compute their static position. Finally, the positioned items are not taken into account in all the different grid methods, in order that they do not interfere the layout of the grid as stated in the spec. Tests: fast/css-grid-layout/absolute-positioning-grid-container-containing-block.html fast/css-grid-layout/absolute-positioning-grid-container-parent.html fast/css-grid-layout/grid-positioned-items-background.html fast/css-grid-layout/grid-positioned-items-implicit-grid-line.html fast/css-grid-layout/grid-positioned-items-implicit-grid.html fast/css-grid-layout/grid-positioned-items-unknown-named-grid-line.html fast/css-grid-layout/grid-sizing-positioned-items.html fast/css-grid-layout/positioned-grid-items-should-not-create-implicit-tracks.html fast/css-grid-layout/positioned-grid-items-should-not-take-up-space.html * rendering/OrderIterator.cpp: (WebCore::OrderIterator::next): Fix method to avoid issues if no items are added to the iterator. * rendering/RenderBlock.h: Mark layoutPositionedObject() as virtual. * rendering/RenderBox.cpp: Add new maps for inline/block extra offsets. (WebCore::RenderBox::~RenderBox): Clear the new maps. (WebCore::RenderBox::extraInlineOffset): Extra offset that we need to apply to positioned grid children due to the grid placement properties. (WebCore::RenderBox::extraBlockOffset): Ditto. (WebCore::RenderBox::setExtraInlineOffset): (WebCore::RenderBox::setExtraBlockOffset): (WebCore::RenderBox::clearExtraInlineAndBlockOffests): (WebCore::RenderBox::containingBlockLogicalWidthForPositioned): Use the override containing block if any. (WebCore::RenderBox::containingBlockLogicalHeightForPositioned): Ditto. (WebCore::RenderBox::computePositionedLogicalWidth): Add the extra offset if it's a positioned element. (WebCore::RenderBox::computePositionedLogicalHeight): Ditto. * rendering/RenderBox.h: (WebCore::RenderBox::scrollbarLogicalWidth): Add utility method. * rendering/RenderGrid.cpp: (WebCore::RenderGrid::layoutBlock): Clear grid after layout positioned objects instead of at the end of layoutGridItems(). (WebCore::RenderGrid::placeItemsOnGrid): Ignore positioned items. (WebCore::RenderGrid::populateExplicitGridAndOrderIterator): Ditto. (WebCore::RenderGrid::layoutGridItems): Ditto. (WebCore::RenderGrid::prepareChildForPositionedLayout): Set static position for positioned items. (WebCore::RenderGrid::layoutPositionedObject): Calculate position and size for positioned children. (WebCore::RenderGrid::offsetAndBreadthForPositionedChild): Calculate extra offset and breadth for positioned children. * rendering/RenderGrid.h: * rendering/style/GridResolvedPosition.cpp: (WebCore::GridResolvedPosition::isNonExistentNamedLineOrArea): Make it a public static method. (WebCore::GridUnresolvedSpan::adjustGridPositionsFromStyle): Fix calls to isNonExistentNamedLineOrArea(). (WebCore::resolveGridPositionFromStyle): Ditto. * rendering/style/GridResolvedPosition.h: Make isNonExistentNamedLineOrArea() public. 2015-11-04 Jiewen Tan Null dereference loading Blink layout test editing/execCommand/delete-hidden-crash.html https://bugs.webkit.org/show_bug.cgi?id=149289 Reviewed by Enrica Casucci. This is a merge of Blink r176497: https://codereview.chromium.org/340713003 It ensures the start & end positions in DeleteSelectionCommand::initializePositionData are editable. Test: editing/execCommand/delete-hidden-crash.html * editing/DeleteSelectionCommand.cpp: (WebCore::DeleteSelectionCommand::initializePositionData): * editing/Editor.cpp: (WebCore::Editor::advanceToNextMisspelling): * editing/htmlediting.cpp: (WebCore::firstEditablePositionAfterPositionInRoot): (WebCore::lastEditablePositionBeforePositionInRoot): These two functions don't make any sense to return VisiblePosition. Change them to return Position instead. Since there is a viable conversion from Position to VisiblePosition. It should not change the behavior of any other components depending on it. * editing/htmlediting.h: 2015-11-03 Myles C. Maxfield Ruby base ending in tatechuyoko forces a line break before the tatechuyoko https://bugs.webkit.org/show_bug.cgi?id=150883 Reviewed by Darin Adler. Asking the width of a 0-length tatechuyoko should return 0. Test: fast/text/ruby-tatechuyoko.html * rendering/RenderCombineText.cpp: (WebCore::RenderCombineText::width): 2015-11-04 Tim Horton Update the name of a Mail class that we hardcode https://bugs.webkit.org/show_bug.cgi?id=150879 Reviewed by Alexey Proskuryakov. * editing/cocoa/HTMLConverter.mm: (_WebMessageDocumentClass): 2015-11-04 Eric Carlson [MediaStream] A RealtimeMediaSource should begin producing data automatically https://bugs.webkit.org/show_bug.cgi?id=150851 rdar://problem/23380636 A RealtimeMediaSource should be producing data unless it is muted, which is not under the control of the application, so a local source should begin producing data as soon as it is added to a stream. Remove "producing data" and "enabled" observer callbacks because they don't provide anything that the "muted" callback already provides. Reviewed by Jer Noble. * Modules/mediastream/MediaStreamTrack.cpp: (WebCore::MediaStreamTrack::trackProducingDataChanged): Deleted. * Modules/mediastream/MediaStreamTrack.h: * Modules/mediastream/UserMediaRequest.cpp: (WebCore::UserMediaRequest::didCreateStream): Tell sources to begin producing data. * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::load): Don't call stream->startProducingData, it isn't necessary. (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setReadyState): Call characteristicsChanged when the readyState changes. * platform/mediastream/MediaStreamPrivate.cpp: (WebCore::MediaStreamPrivate::trackProducingDataChanged): Deleted. * platform/mediastream/MediaStreamPrivate.h: * platform/mediastream/MediaStreamTrackPrivate.cpp: (WebCore::MediaStreamTrackPrivate::sourceProducingDataChanged): Deleted. (WebCore::MediaStreamTrackPrivate::sourceEnabledChanged): Deleted. * platform/mediastream/MediaStreamTrackPrivate.h: * platform/mediastream/RealtimeMediaSource.cpp: (WebCore::RealtimeMediaSource::isProducingDataDidChange): Deleted. (WebCore::RealtimeMediaSource::setEnabled): Deleted. * platform/mediastream/RealtimeMediaSource.h: * platform/mediastream/mac/AVAudioCaptureSource.mm: (WebCore::AVAudioCaptureSource::captureOutputDidOutputSampleBufferFromConnection): !enabled() -> muted(). * platform/mediastream/mac/AVMediaCaptureSource.mm: (WebCore::AVMediaCaptureSource::captureSessionIsRunningDidChange): Don't call isProducingDataDidChange.. * platform/mediastream/mac/AVVideoCaptureSource.mm: (WebCore::AVVideoCaptureSource::processNewFrame): !enabled() -> muted(). 2015-11-04 Jer Noble [iOS]