2016-05-10 Zalan Bujtas REGRESSION (r193610): Drop down menu doesn’t expand at allofbach.com https://bugs.webkit.org/show_bug.cgi?id=157445 Reviewed by Simon Fraser. When we don't run transitions (becasuse of to/from 'auto' values) we should also not report the 'from' value and behave as if we finished the transition already. Test: fast/animation/height-auto-transition-computed-value.html * page/animation/KeyframeAnimation.cpp: (WebCore::KeyframeAnimation::fetchIntervalEndpointsForProperty): This is a revert of looping the 'to' value back to the first keyframe when reverse animation is at the start value (last keyframe). * platform/Length.cpp: (WebCore::blend): 2016-05-09 Dean Jackson [iOS] elements when we're in RTL mode. This means drawing the button with the drop-down arrow on the left side, and the button text right-aligned. Test: fast/forms/select-non-native-rendering-direction.html plus a bunch of other ones that needed rebaselining. * rendering/RenderThemeIOS.mm: Rename MenuListButtonPaddingRight to MenuListButtonPaddingAfter. (WebCore::RenderThemeIOS::popupInternalPaddingBox): Handle both directions. (WebCore::adjustInputElementButtonStyle): (WebCore::RenderThemeIOS::paintMenuListButtonDecorations): Handle drawing in RTL mode. 2016-05-10 Youenn Fablet NodeList should be iterable https://bugs.webkit.org/show_bug.cgi?id=131443 Reviewed by Darin Adler. Test: fast/dom/nodeListIterator.html Updating JSKeyValueIterator to support map and set iterators, depending on the signature of the result type of DOMClass::Iterator::next method. Symbol.iterator method is made the same as values method for set iterators. Adding support for NodeList. Updating FontFaceSet to take benefit of that. * bindings/js/JSDOMBinding.h: (WebCore::jsPair):. * bindings/js/JSKeyValueIterator.h: (WebCore::IteratorInspector::decltype): IteratorInspector detects whether the iterator is a set or map iterator. (WebCore::IteratorInspector::test): (WebCore::fillForEachArgumentsWithIteratorValue): Specializing according set/map iterator. (WebCore::iteratorValueToJS): Ditto. (WebCore::keyValueIteratorForEach): (WebCore::JSKeyValueIterator::next): * bindings/scripts/CodeGeneratorJS.pm: (GenerateImplementationIterableFunctions): Removed the line forbidding set iterators. Making Symbol.iterator function equal to values for set iterators. * bindings/scripts/test/JS/JSTestNode.cpp: Rebasing with set iterator functions. * bindings/scripts/test/JS/JSTestObj.cpp: Rebasing according updated function names. * bindings/scripts/test/TestNode.idl: Making TestNode set iterable. * css/FontFaceSet.cpp: (WebCore::FontFaceSet::Iterator::next): Refactoring to make it a set iterator. * css/FontFaceSet.h: * css/FontFaceSet.idl: * dom/NodeList.h: Making NodeList iterable. (WebCore::NodeList::Iterator::Iterator): (WebCore::NodeList::Iterator::next): (WebCore::NodeList::createIterator): * dom/NodeList.idl: 2016-05-09 Sergio Villar Senin [css-grid] Implement auto-repeat computation https://bugs.webkit.org/show_bug.cgi?id=157473 Reviewed by Darin Adler. We added support for parsing and style for the new auto-repeat syntax. This patch actually implements the feature by computing the number of auto-repeat tracks that will be part of the explicit grid depending on the available size on the corresponding axis. Note that we still do not drop the empty tracks, i.e., auto-fit will work exactly as auto-fill until the empty track removal is implemented. Some test results are not totally correct yet because we need to add the line names to the computed style. As that requires a rather large piece of code it will be done in a follow up patch. Track sizes are correct though. Tests: fast/css-grid-layout/grid-auto-fill-columns.html fast/css-grid-layout/grid-auto-fill-rows.html fast/css-grid-layout/grid-change-auto-repeat-tracks.html fast/css-grid-layout/mozilla/grid-repeat-auto-fill-fit-001.html fast/css-grid-layout/mozilla/grid-repeat-auto-fill-fit-002.html fast/css-grid-layout/mozilla/grid-repeat-auto-fill-fit-003.html fast/css-grid-layout/mozilla/grid-repeat-auto-fill-fit-004.html fast/css-grid-layout/mozilla/grid-repeat-auto-fill-fit-005.html * css/CSSParser.cpp: (WebCore::CSSParser::parseGridTrackRepeatFunction): Add the CSSAutoRepeatValue directly instead of adding the track size. * css/StyleBuilderCustom.h: Store the insertion point in style. * rendering/RenderGrid.cpp: (WebCore::RenderGrid::guttersSize): Replaced size_t by unsigned. (WebCore::RenderGrid::rawGridTrackSize): New function which retrieves the track size from either explicit (including auto-repeat tracks) or implicit tracks. (WebCore::RenderGrid::gridTrackSize): Use rawGridTrackSize(). (WebCore::RenderGrid::computeAutoRepeatTracksCount): This is the core of the patch. This method computes the number of auto-repeat tracks that fits on the available size for a given axis (or 1 if that's indefinite). * rendering/RenderGrid.h: 2016-05-09 Alex Christensen Fix GTK build after r200607 * Modules/notifications/Notification.h: dir and replaceId are used in WebNotificationManager with NOTIFICATIONS and with LEGACY_NOTIFICATIONS 2016-05-09 Simon Fraser Fix the Windows build after r200602, and do some minor tidyup. * platform/graphics/ca/PlatformCALayer.h: * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm: (PlatformCALayerCocoa::contentsHidden): * platform/graphics/ca/win/PlatformCALayerWin.cpp: (PlatformCALayerWin::contentsHidden): (PlatformCALayerWin::setContentsHidden): * platform/graphics/ca/win/PlatformCALayerWin.h: 2016-05-09 Darin Adler Change Notification constructor to take an IDL dictionary instead of a WebCore::Dictionary https://bugs.webkit.org/show_bug.cgi?id=157466 Reviewed by Alex Christensen. * Modules/notifications/Notification.cpp: Got rid of unneeded includes. (WebCore::Notification::Notification): Deleted the unused default constructor. Changed NotificationCenter argument to be reference rather than PassRefPtr. Changed one of the ScriptExecutionContext arguments to be a Document since the code relies on that already. Used the lambda form of timer creation instead of the class member form. Added a FIXME about when m_notificationCenter can be null. (WebCore::Notification::create): Changed NotificationCenter argument to be reference rather than PassRefPtr. Changed options argument to be Options rather than Dictionary. (WebCore::directionString): Added. Helper because the class still wants to store the direction as a string, at least for now. (WebCore::Notification::show): Streamlined the code a bit. (WebCore::Notification::taskTimerFired): Deleted. Not needed now that we use a lambda inside the constructor. (WebCore::Notification::permission): Removed unneeded const from return type. (WebCore::Notification::permissionString): Ditto. * Modules/notifications/Notification.h: Used pragma once, updated for changes above. Removed a number of unused functions, including cancel, setIconURL, setLang, stopLoadingIcon, detachPresenter, setBody, startLoadingIcon, finishLoadingIcon, and taskTimerFired. * Modules/notifications/Notification.idl: Add NotificationOptions and pass it instead of Dictionary to the constructor. Note that this is only a subset of what is currently specified in the Notifications API document. The latest document specifies a much more complex feature with lots more options. * Modules/notifications/NotificationCenter.cpp: (WebCore::NotificationCenter::createNotification): Pass a reference rather than a pointer to this. * Modules/notifications/NotificationClient.h: Use pragma once. Removed unneeded includes and forward declarations. Fixed #if to be easier to read. * bindings/js/JSDOMConvert.h: Reworked the convert functions to use Converter and DefaultConverter structs so we can do partial specialization in the future and so we can get custom types for optional values. Used this to make an optional String just be a null String, so it won't try to use Optional instead. Might get more complex latter when we add support for nullable. * bindings/scripts/CodeGeneratorJS.pm: (GenerateEnumerationImplementationContent): Generate a blank line to make the output slightly clearer. Tweaked a comment. (GenerateDefaultValue): Added. Converts the default syntax from IDL into the syntax needed in C++ code. (GenerateDefaultValueWithLeadingComma): Added. Helper for use below. (GenerateDictionaryImplementationContent): Use GenerateDefaultValue and GenerateDefaultValueWithLeadingComma to make default values. (GenerateParametersCheck): Use GenerateDefaultValue here in the enumeration code path. This is a step in the direction of being able to make the whole thing more generic in the future. * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp: * bindings/scripts/test/GObject/WebKitDOMTestObj.h: * bindings/scripts/test/JS/JSTestObj.cpp: * bindings/scripts/test/ObjC/DOMTestObj.h: * bindings/scripts/test/ObjC/DOMTestObj.mm: Regenerated. * bindings/scripts/test/TestObj.idl: Simplified and extended some of the test cases to cover more combinations of the dictionary and enumeration support. 2016-05-09 Brady Eidson Modern IDB: Have server database connections remember the OpenDB request that spawned them. https://bugs.webkit.org/show_bug.cgi?id=157498 Reviewed by Tim Horton. No new tests (No testable change in behavior, debug only for now). * Modules/indexeddb/server/UniqueIDBDatabase.cpp: (WebCore::IDBServer::UniqueIDBDatabase::performCurrentOpenOperation): * Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp: (WebCore::IDBServer::UniqueIDBDatabaseConnection::create): (WebCore::IDBServer::UniqueIDBDatabaseConnection::UniqueIDBDatabaseConnection): (WebCore::IDBServer::UniqueIDBDatabaseConnection::connectionClosedFromClient): (WebCore::IDBServer::UniqueIDBDatabaseConnection::didFireVersionChangeEvent): (WebCore::IDBServer::UniqueIDBDatabaseConnection::createVersionChangeTransaction): (WebCore::IDBServer::UniqueIDBDatabaseConnection::establishTransaction): (WebCore::IDBServer::UniqueIDBDatabaseConnection::didAbortTransaction): (WebCore::IDBServer::UniqueIDBDatabaseConnection::didCommitTransaction): * Modules/indexeddb/server/UniqueIDBDatabaseConnection.h: (WebCore::IDBServer::UniqueIDBDatabaseConnection::openRequestIdentifier): 2016-05-09 Simon Fraser [iOS] visibility:hidden -webkit-overflow-scrolling: touch divs can interfere with page scrolling https://bugs.webkit.org/show_bug.cgi?id=157496 Reviewed by Tim Horton. UIScrollViews are constructed in the UI process for visibility:hidden scrollable elements with -webkit-overflow-scrolling: touch, and these intercept user events when they should not. Fix by propagating a "contentsHidden" flag from the web process which is used to turn off user interaction on these views. Test: fast/scrolling/ios/touch-scroll-visibility-hidden.html * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::updateContentsVisibility): We have to tell the scrolling layer if we have visibility:hidden. * platform/graphics/ca/PlatformCALayer.h: * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h: * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm: (PlatformCALayerCocoa::contentsHidden): (PlatformCALayerCocoa::setContentsHidden): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateAfterDescendants): 2016-05-09 Myles C. Maxfield Web Font is downloaded even when all the characters in the document are outside its unicode-range https://bugs.webkit.org/show_bug.cgi?id=42154 Reviewed by Darin Adler. Fonts are requested in two stages: - For a given font family, all the relevant @font-face rules are consulted. We build up a mapping of unicode-range -> Font object. This result is cached. - Then, when we have the mapping, we look up the character we are trying to render to find the appropriate Font object. However, we are not supposed to create any Font objects (because that causes a download to be triggered) until we consult with the character we're trying to render. Therefore, this patch swaps out the Font objects with a FontAccessor. This FontAccessor is essentially a lazily-created Font. When step 2 starts looking up the appropriate character, the FontAccessor will be asked to start the download. Test: fast/text/unicode-range-download.html * css/CSSFontFace.cpp: (WebCore::CSSFontFace::removeClient): as a client from all its CSSFontFaces. * css/CSSFontFaceSet.cpp: (WebCore::CSSFontFaceSet::clear): Clearing the CSSFontFaceSet needs to remove itself as a client from all its CSSFontFaces. * css/CSSSegmentedFontFace.cpp: (WebCore::CSSFontAccessor::create): The lazy Font object. (WebCore::CSSFontAccessor::CSSFontAccessor): Ditto. (WebCore::appendFontWithInvalidUnicodeRangeIfLoading): Appends a FontAccessor. (WebCore::CSSSegmentedFontFace::fontRanges): Create the FontAccessor and use it instead. * platform/graphics/FontCascadeFonts.cpp: (WebCore::FontCascadeFonts::determinePitch): Use the fontForFirstRange() convenience function. (WebCore::glyphPageFromFontRanges): font() may now return nullptr. Update this function to handle that. * platform/graphics/FontRanges.cpp: (WebCore::FontRanges::Range::font): Trigger the lazy initialization. (WebCore::TrivialFontAccessor::create): Used in the case where there is only one font in the Ranges object and it has a full unicode-range. (WebCore::TrivialFontAccessor::TrivialFontAccessor): (WebCore::FontRanges::FontRanges): Use TrivialFontAccessor. (WebCore::FontRanges::glyphDataForCharacter): font() may now return nullptr. Update this function to handle that. This is where the magic happens: this is where we trigger downloads only if the character falls within the unicode-range. (WebCore::FontRanges::fontForFirstRange): Add ASSERT. (WebCore::FontRanges::isLoading): Update to use the new FontAccessor. * platform/graphics/FontRanges.h: Ditto. (WebCore::FontRanges::Range::Range): (WebCore::FontRanges::Range::fontAccessor): (WebCore::FontRanges::appendRange): (WebCore::FontRanges::Range::font): Deleted. * platform/graphics/FontSelector.h: The virtual base class of FontAccessor. This is necessary because it must be shared between platform code and non-platform code. (WebCore::FontAccessor::~FontAccessor): 2016-05-09 Brady Eidson Modern IDB: Prevent the same transaction from being commited/aborted twice. https://bugs.webkit.org/show_bug.cgi?id=157494 Reviewed by Tim Horton. When a page navigates or a worker terminates, in rare cases with specific unfortunate timing, the IDBServer might receive a request to commit/abort a transaction that is already in the process of committing/aborting. By moving transactions that are finishing into their own map we can at least detect this situation and return an error. This seems like an improvement over some mysterious ASSERTs/timeouts. No new tests: While apparent that this is at least partially to blame for some existing timeouts/ASSERTs, I could not nail down a reliable way to reproduce this with a dedicated test. * Modules/indexeddb/server/UniqueIDBDatabase.cpp: (WebCore::IDBServer::UniqueIDBDatabase::~UniqueIDBDatabase): (WebCore::IDBServer::UniqueIDBDatabase::performCurrentDeleteOperation): (WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore): (WebCore::IDBServer::UniqueIDBDatabase::prepareToFinishTransaction): (WebCore::IDBServer::UniqueIDBDatabase::commitTransaction): (WebCore::IDBServer::UniqueIDBDatabase::didPerformCommitTransaction): (WebCore::IDBServer::UniqueIDBDatabase::abortTransaction): (WebCore::IDBServer::UniqueIDBDatabase::didPerformAbortTransaction): (WebCore::IDBServer::UniqueIDBDatabase::hasUnfinishedTransactions): (WebCore::IDBServer::UniqueIDBDatabase::operationAndTransactionTimerFired): (WebCore::IDBServer::UniqueIDBDatabase::takeNextRunnableTransaction): (WebCore::IDBServer::UniqueIDBDatabase::transactionCompleted): Renamed from inProgressTransactionCompleted. (WebCore::IDBServer::UniqueIDBDatabase::inProgressTransactionCompleted): Deleted. * Modules/indexeddb/server/UniqueIDBDatabase.h: 2016-05-09 Tim Horton Draw border and correct icon for placeholder attachments https://bugs.webkit.org/show_bug.cgi?id=157495 rdar://problem/19982510 Reviewed by Anders Carlsson. * Resources/AttachmentPlaceholder.png: Added. * Resources/AttachmentPlaceholder@2x.png: Added. * WebCore.xcodeproj/project.pbxproj: * rendering/RenderThemeMac.mm: (WebCore::attachmentPlaceholderBorderColor): (WebCore::paintAttachmentIconPlaceholder): (WebCore::paintAttachmentProgress): (WebCore::paintAttachmentPlaceholderBorder): (WebCore::RenderThemeMac::paintAttachment): If progress is set, but set to 0, draw a dashed border around the attachment and use the placeholder "download" artwork. 2016-05-09 Ada Chan Introduce WebVideoFullscreenInterfaceMac::isPlayingVideoInEnhancedFullscreen() and use it in WebVideoFullscreenManagerProxy::isPlayingVideoInEnhancedFullscreen() https://bugs.webkit.org/show_bug.cgi?id=157493 Reviewed by Dan Bernstein. * platform/mac/WebVideoFullscreenInterfaceMac.h: * platform/mac/WebVideoFullscreenInterfaceMac.mm: (WebCore::WebVideoFullscreenInterfaceMac::isPlayingVideoInEnhancedFullscreen): 2016-05-09 Simon Fraser Clean up iOS text autosizing code https://bugs.webkit.org/show_bug.cgi?id=157489 Reviewed by Zalan Bujtas. Change the TraverseNextInclusionFunction and HeightTypeTraverseNextInclusionFunction to take references. Use downcast<> more. Whitespace cleanup. * rendering/RenderBlockFlow.cpp: (WebCore::isNonBlocksOrNonFixedHeightListItems): * rendering/RenderElement.cpp: (WebCore::includeNonFixedHeight): * rendering/RenderObject.cpp: (WebCore::RenderObject::traverseNext): * rendering/RenderObject.h: * rendering/TextAutoSizing.cpp: (WebCore::TextAutoSizingValue::adjustNodeSizes): (WebCore::TextAutoSizingValue::reset): 2016-05-09 Anders Carlsson Add injected bundle SPI for getting favicon and touch icon URLs https://bugs.webkit.org/show_bug.cgi?id=157435 Reviewed by Darin Adler. * CMakeLists.txt: Add new files. * WebCore.xcodeproj/project.pbxproj: Add new files. * html/HTMLLinkElement.cpp: (WebCore::HTMLLinkElement::iconType): * html/HTMLLinkElement.h: Rename LinkRelAttribute::IconType to LinkIconType. * html/LinkIconCollector.cpp: Added. (WebCore::iconSize): New helper function that returns the icon size for an icon. (WebCore::compareIcons): Icon comparison function, to be used by for sorting. (LinkIconCollector::iconsOfTypes): Gather the right icons, sort them (descending by size) and return them. * html/LinkIconCollector.h: Added. * html/LinkIconType.h: Move icon type declarations here and arrange them so we can use them in an OptionSet. * html/LinkRelAttribute.cpp: (WebCore::LinkRelAttribute::LinkRelAttribute): * html/LinkRelAttribute.h: * loader/icon/IconController.cpp: (WebCore::iconFromLinkElements): Rename IconType to LinkIconType. 2016-05-06 Simon Fraser [iOS WK2] Font size increases on some pages after navigating then going back https://bugs.webkit.org/show_bug.cgi?id=157441 rdar://problem/22873240 Reviewed by Darin Adler. Sometimes I want to dump ViewportConfigurations from WebKit2 so export dump(). Test: fast/text-autosizing/ios/text-autosizing-after-back.html * page/ViewportConfiguration.h: 2016-05-09 Eric Carlson "Main content" restrictions should not apply to media documents https://bugs.webkit.org/show_bug.cgi?id=157479 Reviewed by Jer Noble. No new tests, this change only applies to media documents in a top level document so it isn't possible to have a layout test. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::HTMLMediaElement): Don't apply restrictions to a media document. 2016-05-09 Dean Jackson Update Picture-in-picture artwork https://bugs.webkit.org/show_bug.cgi?id=157484 Reviewed by Eric Carlson. We have new artwork for the picture-in-picture presentation mode. I also converted it to use SVG (and moved the button style to a more consistent part of the file). * Modules/mediacontrols/mediaControlsApple.css: (video::-webkit-media-controls-panel .picture-in-picture-button): (video::-webkit-media-controls-panel .picture-in-picture-button.return-from-picture-in-picture): (video::-webkit-media-controls-panel .picture-in-picture-button:active): (video::-webkit-media-controls-panel .picture-in-picture-button.return-from-picture-in-picture:active): 2016-05-09 Chris Dumez Optimize [StrictTypeChecking] on IDL operations https://bugs.webkit.org/show_bug.cgi?id=157467 Reviewed by Darin Adler. Optimize [StrictTypeChecking] on IDL operations so that: - Only generate extra code for nullable parameters because for non-nullable parameters, JSXXX::toWrapped() will return null in case of a bad input type. We will then throw a TypeError when null-checking it already. - After the JSValue::isNullOrUndefined() check, avoid calling JSXXX::toWrapped() and set nativeValue to nullptr directly. - Drop the check for JSValue::inherits(JSXXX::info()) and just do a null check on the value returned by JSXXX::toWrapped(). toWrapped() already does a JSValue::inherits(JSXXX::info() check. Since we only call toWrapped() if the JSValue is not null/undefined, a null return value always indicates a bad input type. Also update the TypeError message to be more useful when passing null for non-nullable parameters or assigning null to a non-nullable attribute. The message is now consistent with the one used for strict type checking. No new tests, rebaselined existing tests. * bindings/js/JSDOMBinding.h: * bindings/scripts/CodeGeneratorJS.pm: (GenerateImplementation): (GenerateParametersCheck): * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp: (WebCore::jsTestActiveDOMObjectPrototypeFunctionExcitingFunction): * bindings/scripts/test/JS/JSTestInterface.cpp: (WebCore::setJSTestInterfaceImplementsNode): (WebCore::setJSTestInterfaceSupplementalNode): (WebCore::jsTestInterfacePrototypeFunctionImplementsMethod2): (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod2): * bindings/scripts/test/JS/JSTestObj.cpp: (WebCore::setJSTestObjTestObjAttr): (WebCore::setJSTestObjLenientTestObjAttr): (WebCore::setJSTestObjXMLObjAttr): (WebCore::setJSTestObjTypedArrayAttr): (WebCore::setJSTestObjWithScriptExecutionContextAttribute): (WebCore::setJSTestObjWithScriptStateAttributeRaises): (WebCore::setJSTestObjWithScriptExecutionContextAttributeRaises): (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttribute): (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttributeRaises): (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute): (WebCore::setJSTestObjWithScriptArgumentsAndCallStackAttribute): (WebCore::jsTestObjPrototypeFunctionVoidMethodWithArgs): (WebCore::jsTestObjPrototypeFunctionByteMethodWithArgs): (WebCore::jsTestObjPrototypeFunctionOctetMethodWithArgs): (WebCore::jsTestObjPrototypeFunctionLongMethodWithArgs): (WebCore::jsTestObjPrototypeFunctionObjMethodWithArgs): (WebCore::jsTestObjPrototypeFunctionMethodWithXPathNSResolverParameter): (WebCore::jsTestObjPrototypeFunctionMethodThatRequiresAllArgsAndThrows): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod8): (WebCore::jsTestObjPrototypeFunctionDomStringListFunction): (WebCore::jsTestObjPrototypeFunctionConvert1): (WebCore::jsTestObjPrototypeFunctionStrictFunctionWithSequence): (WebCore::jsTestObjPrototypeFunctionStrictFunctionWithArray): (WebCore::jsTestObjPrototypeFunctionVariadicNodeMethod): (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction2Promise): * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp: (WebCore::constructJSTestOverloadedConstructors1): (WebCore::constructJSTestOverloadedConstructors2): (WebCore::constructJSTestOverloadedConstructors3): * bindings/scripts/test/TestObj.idl: 2016-05-09 Tim Horton Download progress on attachment elements sometimes exceeds element bounds https://bugs.webkit.org/show_bug.cgi?id=157440 Reviewed by Darin Adler. In the case of very large dynamic type sizes, we can overflow the bounds of the attachment. It turns out that we used to limit to one line in many cases anyway, so only wrap if we have only a title and/or icon. This looks better when you have many of the other elements even in non-large-type modes. * rendering/RenderThemeIOS.mm: (WebCore::AttachmentInfo::buildTitleLines): (WebCore::AttachmentInfo::AttachmentInfo): Limit the title to a single line if we have anything other than a title and icon. (WebCore::attachmentBorderPath): (WebCore::paintAttachmentBorder): (WebCore::RenderThemeIOS::paintAttachment): Clip to the border, so that even if somehow we paint outside of the bounds, we don't paint over other parts of the page. 2016-05-09 Ryosuke Niwa REGRESSION (198056): Unable to use edit buttons on WordPress https://bugs.webkit.org/show_bug.cgi?id=157475 Reviewed by Antti Koivisto. Renamed Event.prototype.deepPath() to composedPath() per discussions on https://github.com/whatwg/dom/issues/242 as the old name was not Web compatible. Test: fast/shadow-dom/Extensions-to-Event-Interface.html * dom/Event.cpp: (WebCore::Event::composedPath): Renamed from deepPath. * dom/Event.h: * dom/Event.idl: 2016-05-09 Alex Christensen Don't use DiskCache for media resource loads https://bugs.webkit.org/show_bug.cgi?id=157405 Reviewed by Darin Adler. http/tests/security/video-cross-origin-caching.html was loading from the disk cache. This patch adds an assertion that fires in that test without this fix. * loader/MediaResourceLoader.cpp: (WebCore::MediaResourceLoader::requestResource): * platform/graphics/PlatformMediaResourceLoader.h: * platform/network/ResourceRequestBase.h: (WebCore::ResourceRequestBase::hiddenFromInspector): (WebCore::ResourceRequestBase::setHiddenFromInspector): (WebCore::ResourceRequestBase::requester): (WebCore::ResourceRequestBase::setRequester): * platform/network/cocoa/WebCoreNSURLSession.mm: (-[WebCoreNSURLSessionDataTask _restart]): (-[WebCoreNSURLSessionDataTask resource:receivedResponse:]): 2016-05-09 Ryosuke Niwa Refactor FocusController::findFocusableElementRecursively https://bugs.webkit.org/show_bug.cgi?id=157415 Reviewed by Darin Adler. Refactor FocusController::findFocusableElementRecursively and related functions. Extracted two functions: nextFocusableElementWithinScope and previousFocusableElementWithinScope out of it since they didn't really share any code other than calling findFocusableElement at the beginning. Also renamed internal variant of nextFocusableElement and previousFocusableElement to nextFocusableElementOrScopeOwner and previousFocusableElementOrScopeOwner. It was confusing to have these internal functions in addition to public member functions that are used in Objective-C DOM API. No new tests are added since there should be no behavioral change. * page/FocusController.cpp: (WebCore::FocusController::findFocusableElementDescendingDownIntoFrameDocument): Added a FIXME. (WebCore::FocusController::advanceFocusInDocumentOrder): Use findFocusableElementAcrossFocusScope instead of manually calling findFocusableElementRecursively and findFocusableElementDescendingDownIntoFrameDocument separately. (WebCore::FocusController::findFocusableElementAcrossFocusScope): Now that findFocusableElementWithinScope calls findFocusableElementDescendingDownIntoFrameDocument internally, there is no need to keep around "found" local variable. Introduce a few early exists for a better clarity. (WebCore::FocusController::findFocusableElementWithinScope): Renamed from findFocusableElementRecursively. Also call findFocusableElementDescendingDownIntoFrameDocument here instead of findFocusableElementAcrossFocusScope. (WebCore::FocusController::nextFocusableElementWithinScope): Extracted from findFocusableElementRecursively. (WebCore::FocusController::previousFocusableElementWithinScope): Ditto. (WebCore::FocusController::findFocusableElement): (WebCore::FocusController::nextFocusableElement): Added a FIXME. (WebCore::FocusController::previousFocusableElement): Ditto. (WebCore::FocusController::findFocusableElementOrScopeOwner): Renamed from findFocusableElement for clarity. (WebCore::FocusController::nextFocusableElementOrScopeOwner): Ditto from nextFocusableElement. (WebCore::FocusController::previousFocusableElementOrScopeOwner): Ditto from nextFocusableElement. * page/FocusController.h: 2016-05-09 Manuel Rego Casasnovas [css-grid] Fix static position for positioned grid items https://bugs.webkit.org/show_bug.cgi?id=157417 Reviewed by Darin Adler. The spec was updated to define properly the static position for positioned grid items, but we didn't update the implementation yet: https://drafts.csswg.org/css-grid-1/issues-wd-20150108#issue-1 We were only setting the static position when the start line was not auto. Otherwise we were using the default one which includes the padding. With the spec change we need to set it always, even if the start line is auto. * rendering/RenderGrid.cpp: (WebCore::RenderGrid::layoutPositionedObject): (WebCore::RenderGrid::offsetAndBreadthForPositionedChild): 2016-05-08 Frederic Wang RenderMathMLOperator: refactor management of stretchy data and italic correction https://bugs.webkit.org/show_bug.cgi?id=156913 Reviewed by Darin Adler. No new tests, behavior is not changed. The stretchy data uses a shared space to describe horizontal / vertical directions and unstretched / size variant / glyph assembly. We use a simple struct with some unions to represent it instead of the current implementation with a class. We also modify the signature of some functions to retrieve display operator and stretchy data to use that new structure and prepare the move to a separate MathOperator class. Finally, we introduce some helper functions to easily set the stretchy data. * rendering/mathml/RenderMathMLOperator.cpp: (WebCore::RenderMathMLOperator::computePreferredLogicalWidths): Use the new data members and function signatures. (WebCore::RenderMathMLOperator::setSizeVariant): New helper function to set a size variant. (WebCore::RenderMathMLOperator::setGlyphAssembly): New helper function to set a glyph assembly. (WebCore::RenderMathMLOperator::getGlyphAssemblyFallBack): We change the signature to use a GlyphAssemblyData. (WebCore::RenderMathMLOperator::findDisplayStyleLargeOperator): We rename the function and change its signature to remove the return value. We now also set the italic correction when a display operator is found. (WebCore::RenderMathMLOperator::findStretchyData): We change the signature to introduce a target size and remove the return value. This also does the early return when the base glyph is large enough. (WebCore::RenderMathMLOperator::updateStyle): We use the new data members and function signatures. The check for the base glyph size is now done in findStretchyData, so we just check whether m_stretchType is Unstretched to do an early return. (WebCore::RenderMathMLOperator::firstLineBaseline): We use m_stretchType. (WebCore::RenderMathMLOperator::computeLogicalHeight): Ditto. (WebCore::RenderMathMLOperator::fillWithVerticalExtensionGlyph): Use the new class members. (WebCore::RenderMathMLOperator::fillWithHorizontalExtensionGlyph): Ditto. (WebCore::RenderMathMLOperator::paint): Ditto. (WebCore::RenderMathMLOperator::paintVerticalGlyphAssembly): Ditto. (WebCore::RenderMathMLOperator::paintHorizontalGlyphAssembly): Ditto. (WebCore::RenderMathMLOperator::paintChildren): Ditto. (WebCore::RenderMathMLOperator::trailingSpaceError): Ditto. (WebCore::RenderMathMLOperator::italicCorrection): Moved to RenderMathMLOperator.h. (WebCore::RenderMathMLOperator::getDisplayStyleLargeOperator): Deleted. * rendering/mathml/RenderMathMLOperator.h: (WebCore::RenderMathMLOperator::italicCorrection): We just return m_italicCorrection. (WebCore::RenderMathMLOperator::GlyphAssemblyData::GlyphAssemblyData): New class to store an assembly of GlyphData. (WebCore::RenderMathMLOperator::StretchyData::mode): Deleted. (WebCore::RenderMathMLOperator::StretchyData::variant): Deleted. (WebCore::RenderMathMLOperator::StretchyData::top): Deleted. (WebCore::RenderMathMLOperator::StretchyData::extension): Deleted. (WebCore::RenderMathMLOperator::StretchyData::bottom): Deleted. (WebCore::RenderMathMLOperator::StretchyData::middle): Deleted. (WebCore::RenderMathMLOperator::StretchyData::left): Deleted. (WebCore::RenderMathMLOperator::StretchyData::right): Deleted. (WebCore::RenderMathMLOperator::StretchyData::setNormalMode): Deleted. (WebCore::RenderMathMLOperator::StretchyData::setSizeVariantMode): Deleted. (WebCore::RenderMathMLOperator::StretchyData::setGlyphAssemblyMode): Deleted. (WebCore::RenderMathMLOperator::StretchyData::StretchyData): Deleted. 2016-05-08 Zalan Bujtas iOS selection: Use inflow containing block for positioned
. https://bugs.webkit.org/show_bug.cgi?id=157115 Reviewed by Ryosuke Niwa. Similarly to RenderText, we should just use the inflow containing block for selected
even when it is positioned out of flow. This visually matches Mac OS X behaviour (selection painting does not get extended to the positioned
). Test: fast/text/fixed-positioned-br-crash.html * rendering/RenderLineBreak.cpp: (WebCore::RenderLineBreak::collectSelectionRects): 2016-05-08 Myles C. Maxfield [iOS] Build fix after r200563 Unreviewed. * editing/cocoa/HTMLConverter.mm: (_font): 2016-05-08 Myles C. Maxfield [OS X] Migrate our Font classes entirely off of NSFont https://bugs.webkit.org/show_bug.cgi?id=157464 Reviewed by Darin Adler. Because NSFont and CTFont are toll-free-bridged, we don't need NSFont at all anywhere. No new tests because there is no behavior change. * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (accessibilitySearchCriteriaForSearchPredicateParameterizedAttribute): (textMarkerRangeFromRange): (visiblePositionForStartOfTextMarkerRange): (visiblePositionForEndOfTextMarkerRange): (AXAttributedStringRangeIsValid): (AXAttributeStringSetFont): (CreateCGColorIfDifferent): (AXAttributeStringSetStyle): (textMarkerRangeFromVisiblePositions): * bindings/objc/DOM.mm: (-[DOMElement _font]): * bindings/objc/DOMPrivate.h: * editing/cocoa/HTMLConverter.mm: (_font): (WebCore::editingAttributedStringFromRange): * editing/mac/EditorMac.mm: (WebCore::Editor::fontAttributesForSelectionStart): * platform/graphics/Font.h: (WebCore::Font::getCTFont): (WebCore::Font::getNSFont): Deleted. * platform/graphics/FontPlatformData.h: (WebCore::FontPlatformData::nsFont): Deleted. * platform/graphics/cocoa/FontCocoa.mm: (WebCore::Font::determinePitch): (WebCore::advanceForColorBitmapFont): (WebCore::Font::platformWidthForGlyph): (WebCore::renderingStyle): Deleted. * platform/graphics/cocoa/FontPlatformDataCocoa.mm: 2016-05-08 Chris Dumez [Bindings] Simplify [RequiresExistingAtomicString] IDL extended attribute handling https://bugs.webkit.org/show_bug.cgi?id=157465 Reviewed by Darin Adler. Simplify [RequiresExistingAtomicString] IDL extended attribute handling in the bindings generator. * bindings/scripts/CodeGeneratorJS.pm: (GenerateParametersCheck): Drop code specific to [RequiresExistingAtomicString]. (JSValueToNative): Deal with [RequiresExistingAtomicString] IDL extended attribute, similarly to [AtomicString] and [TreatNullAs]. * bindings/scripts/test/JS/JSTestObj.cpp: * bindings/scripts/test/TestObj.idl: Add bindings test coverage. * dom/DocumentFragment.cpp: (WebCore::DocumentFragment::getElementById): * svg/SVGSVGElement.cpp: (WebCore::SVGSVGElement::getElementById): Add null check for the id parameter. The generated bindings used to do this null check for us but it is no longer the case (to make the bindings generator a bit simpler). This extended attribute is not commonly used and is meant as a micro-optimization for getElementById(). 2016-05-08 David Kilzer Roll out: ThreadSanitizer: Data race and thread leak in WebCore::ScrollingThread::createThreadIfNeeded This reverts commit r200554. This doesn't fix the data race, and the thread leak is a separate issue. * page/scrolling/ScrollingThread.cpp: (WebCore::ScrollingThread::createThreadIfNeeded): Roll out the change. 2016-05-08 Darin Adler Follow-up to that last patch (missed review comments). * page/EventSource.cpp: (WebCore::EventSource::parseEventStream): Pre-increment, not post-increment. (WebCore::EventSource::dispatchMessageEvent): More elegant form without explicit StringView. 2016-05-08 Darin Adler Change EventSource constructor to take an IDL dictionary instead of a WebCore::Dictionary https://bugs.webkit.org/show_bug.cgi?id=157459 Reviewed by Chris Dumez. Patch also includes some updating of EventSource class to modern idioms. * page/EventSource.cpp: (WebCore::EventSource::EventSource): Initialize based on Init. (WebCore::EventSource::create): Take/pass Init instead of Dictionary. * bindings/js/SerializedScriptValue.cpp: (WebCore::CloneSerializer::serialize): Take a StringView instead of a string so callers don't have to allocate a String just to use this. (WebCore::SerializedScriptValue::create): Ditto. * bindings/js/SerializedScriptValue.h: Ditto. * page/EventSource.cpp: Changed defaultReconnectDelay to be a uint64_t instead of an unsigned long long. (WebCore::EventSource::EventSource): Changed constructor to take a struct instead of a Dictionary for eventSourceInit. Also moved initialization of data members to the header and used ASCIILiteral. (WebCore::EventSource::create): Changed type to Init and streamlined code a little bit using auto. (WebCore::EventSource::connect): Used a reference instead of a pointer. Also added a FIXME since I noticed that m_requestInFlight is probably not needed, since it's basically the same thing as "is m_loader null". (WebCore::EventSource::url): Moved to the header and made it inline. (WebCore::EventSource::networkRequestEnded): Removed unneeded check that is already done by all callers and turned it into an assertion. (WebCore::EventSource::withCredentials): Ditto. (WebCore::EventSource::readyState): Ditto. (WebCore::EventSource::responseIsValid): Added. Helper function to make the logic in didReceiveResponse easier to read. Fixed logic to compare MIME type ignoring ASCII case, since that's how MIME types work. (WebCore::EventSource::didReceiveResponse): Use the helper above, and also move the m_eventStreamOrigin set up code into the valid response case, since there is no point doing it if the response is not valid. Also use the early return idiom. (WebCore::EventSource::didReceiveData): Removed the unneeded explicit conversion to StringView here. Also removed a FIXME that I fixed. (WebCore::EventSource::didFinishLoading): Added code to flush the decoder as mentioned in didReceiveData. Added FIXME about peculiar clearing code that exists only here. Removed check for empty receive buffer and data that is not needed since parseEventStream does sufficient checking. (WebCore::EventSource::didFail): Added FIXME because of things that didFinishLoading does that seem equally valuable here. (WebCore::EventSource::parseEventStream): Tweaked types and names of local variables, and changed to use Optional instead of magic number -1. Also added a FIXME about how the buffer type is probably not right since we keep moving the characters in the buffer as we consume the start of it. (WebCore::EventSource::parseEventStreamLine): Refactor and reorganize so this doesn't do so much string allocation and is easier to read (WebCore::EventSource::canSuspendForDocumentSuspension): Tweaked comment. (WebCore::EventSource::dispatchMessageEvent): Renamed this from createMessageEvent, and moved more code in here. We now don't have to allocate a temporary string just to pass it to SerializedScriptValue. * page/EventSource.h: Updated for changes above. Use pragma once. Define and use EventSource::Init struct. Other small cleanup. * page/EventSource.idl: Define EventSourceInit dictionary and use it. Other small cleanup. 2016-05-07 Darin Adler Change HTMLSlotElement::assignedNodes to take a IDL dictionary instead of a WebCore::Dictionary https://bugs.webkit.org/show_bug.cgi?id=157457 Reviewed by Chris Dumez. * html/HTMLSlotElement.cpp: (WebCore::HTMLSlotElement::removedFrom): Fixed typo in comment. (WebCore::HTMLSlotElement::assignedNodes): Renamed assignedNodesForBindings back to this and changed the argument type to Optional instead of Dictionary. Also streamlined the logic a bit. (WebCore::HTMLSlotElement::enqueueSlotChangeEvent): Changed to use a pointer to the enqueued event instead of a boolean. With only a boolean, we could end up clearing the flag in cases where we don't really want to. (WebCore::HTMLSlotElement::dispatchEvent): Ditto. (WebCore::HTMLSlotElement::assignedNodesForBindings): Deleted. * html/HTMLSlotElement.h: Use pragma once. Added AssignedNodeOptions. Changed for the above, including changing the data member. * html/HTMLSlotElement.idl: Removed use of ImplementedAs. Fixed the type of the options dictionary. 2016-05-08 Chris Dumez [Bindings] Add convert<>() template specializations for integer types https://bugs.webkit.org/show_bug.cgi?id=157458 Reviewed by Darin Adler. Add convert<>() template specializations for integer types and use them in the JS bindings. Also, treat non-32bit types the same way as the 32bit ones, allowing the compiler to optimize out branching based on the IntegerConversionConfiguration. * bindings/js/JSCryptoAlgorithmDictionary.cpp: * bindings/js/JSDOMBinding.cpp: (WebCore::enforceRange): (WebCore::toSmallerInt): (WebCore::toSmallerUInt): (WebCore::toInt8EnforceRange): (WebCore::toUInt8EnforceRange): (WebCore::toInt8Clamp): (WebCore::toUInt8Clamp): (WebCore::toInt8): (WebCore::toUInt8): (WebCore::toInt16EnforceRange): (WebCore::toUInt16EnforceRange): (WebCore::toInt16Clamp): (WebCore::toUInt16Clamp): (WebCore::toInt16): (WebCore::toUInt16): (WebCore::toInt32EnforceRange): (WebCore::toInt32Clamp): (WebCore::toUInt32Clamp): (WebCore::toUInt32EnforceRange): (WebCore::toInt64EnforceRange): (WebCore::toUInt64EnforceRange): (WebCore::toInt64Clamp): (WebCore::toUInt64Clamp): (WebCore::toInt64): (WebCore::toUInt64): * bindings/js/JSDOMBinding.h: - Splt some integer conversion functions into 3 Normal / Clamp / Enforce versions, similarly to what was done for 32bit types already. This is so that these can be called from the inline functions in JSDOMConvert.h, allowing the compiler to optimize out the branches. - Get rid of some unnecessary state.hadException() checks. * bindings/js/JSDOMConvert.h: Add convert<> specializations for integer types. * bindings/js/JSNodeFilterCustom.cpp: (WebCore::JSNodeFilter::acceptNode): * bindings/scripts/CodeGenerator.pm: - Add utility function to distinguish integer types. - Have IsNumericType() using the integerType / floatingPointType hashes to avoid duplication. - Stop int / unsigned int from integer types as those are not in Web IDL and they are not used. * bindings/scripts/CodeGeneratorJS.pm: (GetIntegerConversionType): (JSValueToNative): Use convert<>() for converting JSValue to integer types. * bindings/scripts/IDLParser.pm: Stop allowing int / unsigned int types as those are not in Web IDL. * bindings/scripts/test/JS/JSTestEventTarget.cpp: * bindings/scripts/test/JS/JSTestGlobalObject.cpp: * bindings/scripts/test/JS/JSTestObj.cpp: * bindings/scripts/test/JS/JSTestTypedefs.cpp: Rebaseline bindings tests. 2016-05-08 Darin Adler Correct dictionary bindings handling of optional, null, and undefined https://bugs.webkit.org/show_bug.cgi?id=157463 Reviewed by Chris Dumez. * bindings/js/JSDOMBinding.cpp: (WebCore::propertyValue): Deleted. * bindings/js/JSDOMBinding.h: Deleted propertyValue, not all that helpful for now. * bindings/scripts/CodeGeneratorJS.pm: (GenerateDictionaryImplementationContent): Added a new early exit for convert to a dictionary type when the value is undefined or null and all members are either optional or have a default value. This returns the default values for everything without raising an exception. Added checking that requires that the dictionary argument is an object and not a regular expression, since that's also called for in the latest draft of the Web IDL specification. This ends up speeding up the code a bit since we now use JSObject::get for properties instead of JSValue::get. (GenerateParametersCheck): Renamed some local variables. Taught the code that optional dictionaries all have a default value; before it was doing that for the type "Dictionary" but not the real dictionary types (IsDictionaryType). * bindings/scripts/test/JS/JSTestObj.cpp: Regenerated. * css/FontFace.cpp: (WebCore::FontFace::create): Changed argument to be Descriptors instead of Optional. It would have compiled the other way, but there is now no caller that will pass a null. Because the IDL dictionary support was new, this was the only place that was doing it wrong. Good that we "nipped it in the bud" before doing this in more places. * css/FontFace.h: Ditto. 2016-05-08 David Kilzer ThreadSanitizer: Data race and thread leak in WebCore::ScrollingThread::createThreadIfNeeded Reviewed by Darin Adler. Reproduced with multiple existing tests. * page/scrolling/ScrollingThread.cpp: (WebCore::ScrollingThread::createThreadIfNeeded): Use a std::once_flag to initialize Scrolling Thread since this may be called from background threads. 2016-05-08 Darin Adler Try to fix build without rolling out that last change. * bindings/js/JSDOMConvert.h: (WebCore::convert>): Make this an inline. Just call toNativeArray. 2016-05-07 Darin Adler Change MutationObserver::observe to take an IDL dictionary, rather than WebCore::Dictionary https://bugs.webkit.org/show_bug.cgi?id=157456 Reviewed by Chris Dumez. * bindings/js/JSDOMConvert.h: (WebCore::convertOptional): Use a specific Optional null rather than Nullopt so we can compile the ternary operator. (WebCore::convert): Added. (WebCore::convert>): Added. Later we probably need to change convert to use a member function of a class template rather than a function template so we can make partial specialization work and do this just once for all Vector. * bindings/js/JSMutationObserverCustom.cpp: (WebCore::JSMutationObserverOwner::isReachableFromOpaqueRoots): Streamlined code and removed some local variables. Changed to call the new observedNodes rather than getObservedNodes. * bindings/scripts/CodeGeneratorJS.pm: (GenerateDictionaryImplementationContent): Fixed bug where we tried to call the version of the convert function with a default value even when there was none. * bindings/scripts/test/TestObj.idl: Added a test case basically identical to what's needed in MutationObserver.idl. * bindings/scripts/test/JS/JSTestObj.cpp: Regenerated. * dom/MutationObserver.cpp: (WebCore::MutationObserver::observe): Chagned function to take a MutationObserver::Init instead of a Dictionary. (WebCore::MutationObserver::observationStarted): Changed argument type to a reference. (WebCore::MutationObserver::observationEnded): Ditto. (WebCore::MutationObserverMicrotask): Removed unneeded explicit constructor and destructor. (WebCore::queueMutationObserverCompoundMicrotask): Got rid of unnneeded local variable. (WebCore::MutationObserver::observedNodes): Renamed to remove the "get" prefix. * dom/MutationObserver.h: Reduced includes. Added MutationObserver::Init struct and used it for the type of the argument to the observe function. Changed a few argument types and removed unused forward declarations. * dom/MutationObserver.idl: Added MutationObserverInit and used it instead of Dictionary. * dom/MutationObserverRegistration.cpp: (WebCore::MutationObserverRegistration::MutationObserverRegistration): Pass a reference. (WebCore::MutationObserverRegistration::~MutationObserverRegistration): Ditto. 2016-05-07 Chris Dumez Reduce special handling of XPathNSResolver type in the bindings https://bugs.webkit.org/show_bug.cgi?id=157454 Reviewed by Darin Adler. Reduce special handling of XPathNSResolver type in the bindings. * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSBindingsAllInOne.cpp: Add new JSXPathNSResolverCustom.cpp file. * bindings/js/JSDOMStringListCustom.cpp: (WebCore::JSDOMStringList::toWrapped): Take the ExecState by reference instead of pointer. * bindings/js/JSDOMWindowCustom.cpp: (WebCore::JSDOMWindow::toWrapped): Update to take an ExecState& parameter. The bindings now pass an ExecState to all custom toWrapped() methods for consistency and flexibility. * bindings/js/JSDictionary.cpp: (WebCore::JSDictionary::convertValue): Pass an ExecState now that those toWrapped() methods expect it. * bindings/js/JSEventTargetCustom.cpp: (WebCore::JSEventTarget::toWrapped): Update to take an ExecState& parameter. * bindings/js/JSIDBDatabaseCustom.cpp: (WebCore::JSIDBDatabase::transaction): Pass ExecState by reference instead of pointer. * bindings/js/JSMessageEventCustom.cpp: (WebCore::handleInitMessageEvent): Pass ExecState to JSDOMWindow::toWrapped(). * bindings/js/JSXPathNSResolverCustom.cpp: Added. (WebCore::JSXPathNSResolver::toWrapped): Provide a custom implementation of JSXPathNSResolver::toWrapped() instead of having the custom code in the bindings generator. * bindings/scripts/CodeGeneratorJS.pm: (AddIncludesForType): Drop special includes for XPathNSResolver as they are no longer needed. (GenerateHeader): Drop special casing of certain types for generating the toWrapped() declaration by: 1. Relying on GetNativeType() for the return value as certain types return a RefPtr instead of a raw pointer. 2. Adding an extra ExecState parameter when a custom implementation of toWrapped() is provided, given that some of them need it. (GenerateParametersCheck): Drop custom code for XPathNSResolver and use the normal code path for this type now. The custom code now resides in the custom implementation of JSXPathNSResolver::toWrapped(), in custom bindings. (JSValueToNative): - Drop NodeFilter from the nativeType hash map as it was updated to be a callback interface a while back. - Add XPathNSResolver to nativeType hash map so that we now to use a RefPtr<> instead of a raw pointer in the bindings. We should probably add an IDL extended attribute for this at some point. - Drop special casing for DOMStringList which was outdated since there is no toDOMStringList() function. DOMStringList has a custom toWrapped() function instead nowadays so we now call this one instead. We apparently do not have any DOMStringList parameters outside our bindings tests at the moment, which is why no one noticed. - Pass an ExecState to toWrapped() if the interface has the JSCustomToNativeObject IDL extended attribute. * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp: * bindings/scripts/test/GObject/WebKitDOMTestObj.h: * bindings/scripts/test/JS/JSTestObj.cpp: * bindings/scripts/test/ObjC/DOMTestObj.h: * bindings/scripts/test/ObjC/DOMTestObj.mm: * bindings/scripts/test/TestObj.idl: Add bindings test coverage for having an operation with an XPathNSResolver parameter. * dom/Document.idl: * xml/XPathEvaluator.idl: Drop some unnecessary default parameter values. * xml/XPathNSResolver.idl: Add JSCustomToNativeObject IDL extended attribute so that we can provide our own custom implementation of JSXPathNSResolver::toWrapped(), instead of having the custom code in the bindings generator. * dom/Document.cpp: (WebCore::Document::createExpression): (WebCore::Document::evaluate): * dom/Document.h: * inspector/InspectorNodeFinder.cpp: * xml/XPathEvaluator.cpp: (WebCore::XPathEvaluator::createExpression): (WebCore::XPathEvaluator::evaluate): * xml/XPathEvaluator.h: * xml/XPathExpression.cpp: (WebCore::XPathExpression::createExpression): * xml/XPathExpression.h: * xml/XPathParser.cpp: (WebCore::XPath::Parser::Parser): (WebCore::XPath::Parser::parseStatement): * xml/XPathParser.h: Take XPathNSResolver parameter as a Ref&& as this is what the generated bindings now provide us, given that this sometimes have to create a wrapper around a JSObject. 2016-05-07 Darin Adler Fix crash introduced by the last patch. Fix suggested by Chris Dumez. * css/FontFace.cpp: (WebCore::FontFace::FontFace): Roll out incorrect change. Things were getting initialized in the wrong order in a change I had made to the FontFace constructor that takes a CSSFontSelector. 2016-05-07 Chris Dumez Unreviewed, rebaseline bindings tests after r200547. * bindings/scripts/test/JS/JSTestObj.cpp: (WebCore::convert): 2016-05-07 Darin Adler Next step on dictionary bindings, along with other bindings refinements https://bugs.webkit.org/show_bug.cgi?id=157451 Reviewed by Chris Dumez. Converted one dictionary, the one passed to the constructor in FontFace. * WebCore.xcodeproj/project.pbxproj: Updated for name change of JSDOMBuild.h to JSDOMConvert.h and also let Xcode update a file type. * bindings/js/JSDOMBinding.cpp: (WebCore::propertyValue): Added. * bindings/js/JSDOMBinding.h: Use pragma once. Remove unnecessary forward declaration. Move all declarations to the top of the file, separating them from definitions. This is a small step toward better overview of what's in this file and paves the way for future simplifications and improvements we can make after we observe patterns. Also removed a couple unused functions. * bindings/js/JSDOMConvert.h: Renamed from JSDOMBuild.h. Renamed function templates from build to convert. Added convertOptional. * bindings/js/ReadableStreamController.cpp: (WebCore::callFunction): Use auto and remove some unneeded namespacing. (WebCore::ReadableStreamController::invoke): Ditto. Also remove use of helper function getPropertyFromObject, since this was the only call site and it was not very helpful. (WebCore::ReadableStreamController::isControlledReadableStreamLocked): Ditto. (WebCore::createReadableStream): Ditto. (WebCore::getReadableStreamReader): Ditto. * bindings/scripts/CodeGeneratorJS.pm: (GenerateEnumerationImplementationContent): Updated for name change from build to convert and JSDOMBuild.h to JSDOMConvert.h. (GenerateDictionaryImplementationContent): Ditto. Also added code to handle optional and added explicit exception checking, using local variables. Not clear longer term if the local variable approach is OK since this will unnecessarily change types like const String& to String. (GenerateParametersCheck): Removed local variable $optional and use $parameter->isOptional directly consistently. This is slightly clearer because the old code used a mix of the two, and also is a better pattern for when we refactor this into smaller functions. Note that this function name is not good any more--this is a lot more then parameter checks. (GetNativeType): Return appropriate name for dictionary types. (JSValueToNative): Updated for name change from build to convert and JSDOMBuild.h to JSDOMConvert.h. * bindings/scripts/test/JS/JSTestObj.cpp: * bindings/scripts/test/JS/JSTestTypedefs.cpp: Regenerated results. * bindings/scripts/test/TestObj.idl: Added another dictionary test case, just a copy of the current state of the one in FontFace.idl. * css/CSSFontFace.cpp: (WebCore::CSSFontFace::setUnicodeRange): Update for simplified UnicodeRange struct. (WebCore::CSSFontFace::setFeatureSettings): Fix to correctly handle being called with "normal". Also fix so it doesn't call fontPropertyChanged if nothing changed. Also got rid of return value, which had no real value: it was returning false for some bad inputs, but others would just lead to assertions, and the real reason this was OK is that this function is only passed known-valid values. * css/CSSFontFace.h: Used prama once. Tweaked formatting. Removed return value from the setFeatureSettings function. Changed UnicodeRange to be struct with public data members instead a struct with a constructor and getter functions. * css/CSSFontSelector.cpp: (WebCore::CSSFontSelector::addFontFaceRule): Updated since setFeatureSettings no longer has a boolean return value. * css/CSSSegmentedFontFace.cpp: (WebCore::appendFontWithInvalidUnicodeRangeIfLoading): Updated for simplified UnicodeRange struct. * css/FontFace.cpp: (WebCore::valueFromDictionary): Deleted. (WebCore::FontFace::create): Updated to take the descriptors as a struct instead of a WebCore::Dictionary. Also made that argument optional as specified in the current specification draft. (WebCore::FontFace::setFeatureSettings): Updated since setFeatureSettings no longer has a boolean return value. (WebCore::FontFace::unicodeRange): Updated for simplified UnicodeRange struct. * css/FontFace.h: Used pragma once. Removed unneeded includes and forward declarations. Derived privately from CSSFontFace::Client. Added a FontFace::Descriptors struct and used it as an argument to the create function as described above. * css/FontFace.idl: Added FontFaceDescriptors and changed the argument to the constructor to be an optional FontFaceDescriptors instead of a Dictionary. 2016-05-07 Youenn Fablet Rework FontFace promise attribute handling https://bugs.webkit.org/show_bug.cgi?id=157310 Reviewed by Myles C. Maxfield. Making promise attributes cached attributes, so that they are created only once. They are created in the custom binding code and passed to DOM class as needed. Removed usage of ExecState& from DOM iterators. No change should be visible from user scripts. * Modules/fetch/FetchHeaders.cpp: (WebCore::FetchHeaders::Iterator::next): Removing ExecState parameter. * Modules/fetch/FetchHeaders.h: * bindings/js/JSDOMIterator.h: (WebCore::keyValueIteratorForEach): (WebCore::JSDOMIterator::next): Ditto. * bindings/js/JSDOMPromise.cpp: (WebCore::DeferredWrapper::promise): Removed deferred() and added access to promise directly. * bindings/js/JSDOMPromise.h: * bindings/js/JSFontFaceCustom.cpp: (WebCore::JSFontFace::loaded): Using cached attribute to call FontFace::loaded only once. * bindings/js/JSFontFaceSetCustom.cpp: (WebCore::JSFontFaceSet::ready): Using cached attribute to call FontFaceSet::ready only once. * css/CSSFontFace.cpp: (WebCore::CSSFontFace::wrapper): Removing ExecState parameter. * css/CSSFontFace.h: * css/FontFace.cpp: (WebCore::FontFace::create): Ditto. (WebCore::FontFace::FontFace): Ditto. (WebCore::FontFace::fontStateChanged): Updating promise handling. (WebCore::FontFace::registerLoaded): Resolving/rejecting promise if backing CSSFontFace loading is ended. (WebCore::FontFace::load): Calling backing load. * css/FontFace.h: * css/FontFaceSet.cpp: (WebCore::FontFaceSet::Iterator::next): Removing ExecState parameter. (WebCore::FontFaceSet::load): Removing ExecState and ExceptionCode parameter. (WebCore::FontFaceSet::registerReady): Resolving promise if ready otherwise storing it for resolving it later. (WebCore::FontFaceSet::completedLoading): Resolving promise if any is stored. (WebCore::FontFaceSet::create): Deleted. * css/FontFaceSet.h: * css/FontFaceSet.idl: 2016-05-07 Jeremy Huddleston Sequoia Fix an incorrect usage of OS(DARWIN) with PLATFORM(COCOA) https://bugs.webkit.org/show_bug.cgi?id=157167 Reviewed by Myles C. Maxfield. * platform/graphics/FontPlatformData.h: (WebCore::FontPlatformData::hash): 2016-05-07 Joanmarie Diggs REGRESSION(r196222): [AX][GTK] accessibility/gtk/caret-offsets.html failing https://bugs.webkit.org/show_bug.cgi?id=153956 Reviewed by Chris Fleizach. The reason the test began failing is that it was checking the new caret offset synchronously. For most of the test cases, this was not a problem. But when the caret was moved out of a focused link, the focus change (and associated repainting) delayed the caret-moved event long enough to cause the associated test case to fail. The test now uses shouldBecomeEqualToString() instead of shouldBeEqualToString(). The test also had a supposedly-correct expectation which was wrong: When moving the caret to a valid accessible offset, the caret-moved event should be for that offset. This was not the case for the list item test case because emitTextSelectionChange() was not adjusting the offset for the RenderListMarker, the text of which is exposed as part of the ATK_ROLE_LIST_ITEM object. This bug was also fixed and the test case updated accordingly. No new tests are needed. The previously-failing test is now passing. * editing/atk/FrameSelectionAtk.cpp: (WebCore::emitTextSelectionChange): 2016-05-06 Joseph Pecoraro Rename HitTestRequest DisallowShadowContent to DisallowUserAgentShadowContent https://bugs.webkit.org/show_bug.cgi?id=157447 Reviewed by Ryosuke Niwa. HitTesting is intended to reach nodes inside shadow content. This property on the HitTestRequest is intended to avoid hit testing in UserAgent shadow content. Rename the enum value, and cascading methods for clarity. * html/MediaElementSession.cpp: (WebCore::isMainContent): * page/EventHandler.cpp: (WebCore::EventHandler::eventMayStartDrag): (WebCore::EventHandler::updateSelectionForMouseDrag): (WebCore::EventHandler::hitTestResultAtPoint): (WebCore::EventHandler::handleMousePressEvent): (WebCore::EventHandler::handleMouseDoubleClickEvent): (WebCore::EventHandler::mouseMoved): (WebCore::EventHandler::handleMouseMoveEvent): (WebCore::EventHandler::handleMouseReleaseEvent): (WebCore::EventHandler::handleMouseForceEvent): (WebCore::EventHandler::updateDragAndDrop): (WebCore::EventHandler::isInsideScrollbar): (WebCore::EventHandler::sendContextMenuEvent): (WebCore::EventHandler::sendContextMenuEventForKey): (WebCore::EventHandler::hoverTimerFired): (WebCore::EventHandler::dragSourceEndedAt): (WebCore::EventHandler::handleDrag): (WebCore::EventHandler::dispatchSyntheticTouchEventIfEnabled): * page/EventHandler.h: * page/FocusController.cpp: (WebCore::updateFocusCandidateIfNeeded): * rendering/HitTestRequest.h: (WebCore::HitTestRequest::HitTestRequest): (WebCore::HitTestRequest::disallowsUserAgentShadowContent): (WebCore::HitTestRequest::disallowsShadowContent): Deleted. * rendering/HitTestResult.cpp: (WebCore::HitTestResult::setToNonUserAgentShadowAncestor): (WebCore::HitTestResult::addNodeToRectBasedTestResult): (WebCore::HitTestResult::setToNonShadowAncestor): Deleted. * rendering/HitTestResult.h: * rendering/RenderEmbeddedObject.cpp: (WebCore::RenderEmbeddedObject::isReplacementObscured): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::calculateClipRects): * rendering/svg/RenderSVGResourceClipper.cpp: (WebCore::RenderSVGResourceClipper::hitTestClipContent): * testing/Internals.cpp: (WebCore::Internals::nodesFromRect): 2016-05-06 Joseph Pecoraro Web Inspector: Inspect Element and Element Selection searching should work with Shadow DOM Nodes https://bugs.webkit.org/show_bug.cgi?id=157446 Reviewed by Ryosuke Niwa. * inspector/InspectorDOMAgent.cpp: (WebCore::InspectorDOMAgent::innerParentNode): The Inspector backend was informing the frontend that all ShadowRoots were floating and had no parent. Get the host element for ShadowRoots. * rendering/HitTestResult.cpp: (WebCore::moveOutOfUserAgentShadowTree): (WebCore::HitTestResult::setToNonShadowAncestor): EventHandler::mouseMoved is calling setToNonShadowAncestor before notifying Page::chrome / Inspector about the moused over element. This should be the deepest non-user-agent-shadow node. 2016-05-06 Joseph Pecoraro Web Inspector: Misc CommandLineAPI cleanup https://bugs.webkit.org/show_bug.cgi?id=157450 Reviewed by Ryosuke Niwa. * inspector/CommandLineAPIModuleSource.js: (bind): 2016-05-06 Simon Fraser Enable IOS_TEXT_AUTOSIZING on Mac and make it testable https://bugs.webkit.org/show_bug.cgi?id=157432 rdar://problem/16406720 Reviewed by Dean Jackson. Enable IOS_TEXT_AUTOSIZING on Mac so it can be tested. Make the setTextAutosizingEnabled() Setting work, and plumb it through WK1 and WK2 preferences for WTR and DRT. Make textAutosizingWindowSizeOverride() work, for layout tests. These two settings are shared with TEXT_AUTOSIZING. Add a TextAutosizing log channel, which is useful for generated -expected.html results. Move adjustComputedFontSizesOnBlocks() and related code from RenderObject to RenderElement without changes. An implication of this set of changes is that the way clients enable text autosizing has changed. Previously, they set the "MinimumZoomFontSize" preference to 0. Settings::defaultMinimumZoomFontSize() used to do this in order to enable text autosizing on iPhone only, not iPad. Now the preferred technique is to leave minimumZoomFontSize alone, and to use textAutosizingEnabled() instead. Settings::defaultTextAutosizingEnabled() now does the check for iPhone. UIWebView calls WebKitGetMinimumZoomFontSize() to setup the default minimum font zoom size, which will now always return 15, but had no other code that toggled this. So it's safe to just rely on Settings::defaultTextAutosizingEnabled() doing the right thing for iPhone/iPad. Test: fast/text-autosizing/ios/autosize-width.html * Configurations/FeatureDefines.xcconfig: * dom/Document.cpp: (WebCore::Document::addAutoSizingNode): * page/FrameView.cpp: (WebCore::FrameView::layout): * page/Settings.cpp: (WebCore::Settings::Settings): Deleted. (WebCore::Settings::setTextAutosizingEnabled): Deleted. (WebCore::Settings::setTextAutosizingWindowSizeOverride): Deleted. * page/Settings.h: (WebCore::Settings::textAutosizingEnabled): Deleted. (WebCore::Settings::textAutosizingWindowSizeOverride): Deleted. * page/Settings.in: * page/cocoa/SettingsCocoa.mm: (WebCore::Settings::defaultMinimumZoomFontSize): (WebCore::Settings::defaultTextAutosizingEnabled): * platform/Logging.h: * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::adjustComputedFontSizes): * rendering/RenderElement.cpp: (WebCore::includeNonFixedHeight): (WebCore::RenderElement::adjustComputedFontSizesOnBlocks): (WebCore::RenderElement::resetTextAutosizing): * rendering/RenderElement.h: * rendering/RenderObject.cpp: (WebCore::includeNonFixedHeight): Deleted. (WebCore::RenderObject::adjustComputedFontSizesOnBlocks): Deleted. (WebCore::RenderObject::resetTextAutosizing): Deleted. * rendering/RenderObject.h: * rendering/TextAutoSizing.cpp: (WebCore::TextAutoSizingValue::adjustNodeSizes): * testing/InternalSettings.cpp: (WebCore::InternalSettings::Backup::Backup): (WebCore::InternalSettings::Backup::restoreTo): (WebCore::InternalSettings::setTextAutosizingEnabled): (WebCore::InternalSettings::setTextAutosizingWindowSizeOverride): * testing/InternalSettings.h: 2016-05-06 Joseph Pecoraro Web Inspector: Console: Variables defined with let/const aren't accessible outside of console's scope https://bugs.webkit.org/show_bug.cgi?id=150752 Reviewed by Mark Lam. Test: inspector/runtime/evaluate-CommandLineAPI.html * inspector/CommandLineAPIModuleSource.js: (bind): (this.member.toString): (CommandLineAPI): (CommandLineAPIImpl.prototype): (slice): Deleted. (bound): Deleted. (bound.toString): Deleted. (inScopeVariables): Deleted. (customToStringMethod): Deleted. Simplify now that we don't need to do our own variable shadow checking. 2016-05-06 Tim Horton element should understand UTIs https://bugs.webkit.org/show_bug.cgi?id=157425 Reviewed by Anders Carlsson. UTIs are often much more specific than MIME types, so we should allow clients of to use them to get more accurate icons. Test: fast/attachment/attachment-uti.html * platform/graphics/Icon.h: * platform/graphics/mac/IconMac.mm: (WebCore::Icon::createIconForMIMEType): Deleted. Remove the now-unused createIconForMIMEType. * platform/network/mac/UTIUtilities.h: * platform/network/mac/UTIUtilities.mm: (WebCore::isDeclaredUTI): Expose UTTypeIsDeclared as isDeclaredUTI. * rendering/RenderThemeIOS.mm: (WebCore::iconForAttachment): * rendering/RenderThemeMac.mm: (WebCore::iconForAttachment): If the attachment's type is a UTI, request the icon for it directly. If it's a MIME type, convert to a UTI before requesting. 2016-05-06 Chris Dumez Clean up converting from JSValue to float / double in the bindings generator https://bugs.webkit.org/show_bug.cgi?id=157407 Reviewed by Darin Adler. Clean up converting from JSValue to float / double in the bindings generator: - Handle all aspects of converting to float / double inside JSValueToNative() instead of relying partly on the call sites. - Add a build<>() template function to JSDOMBuild.h that is now called from the bindings to convert to float / double and deal with non-finite values. - Provide a better message with the TypeError that is thrown for non-finite values. No new tests, rebaselined existing tests. * bindings/js/JSDOMBinding.cpp: (WebCore::throwSequenceTypeError): (WebCore::throwNonFiniteTypeError): * bindings/js/JSDOMBinding.h: * bindings/js/JSDOMBuild.h: (WebCore::build): * bindings/scripts/CodeGenerator.pm: (IsFloatingPointType): * bindings/scripts/CodeGeneratorJS.pm: (JSValueToNative): (GenerateImplementation): Deleted. (GenerateParametersCheck): Deleted. (GenerateReturnParameters): Deleted. * bindings/scripts/test/JS/JSTestObj.cpp: (WebCore::setJSTestObjStrictFloat): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalDoubleIsNaN): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalFloatIsNaN): (WebCore::jsTestObjPrototypeFunctionStrictFunction): (WebCore::jsTestObjPrototypeFunctionVariadicDoubleMethod): (WebCore::jsTestObjPrototypeFunctionAny): (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgumentPromise): (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction1Promise): * bindings/scripts/test/JS/JSTestTypedefs.cpp: (WebCore::jsTestTypedefsPrototypeFunctionSetShadow): 2016-05-06 Dean Jackson Regions, Shapes and Tracks don't need runtime features https://bugs.webkit.org/show_bug.cgi?id=157426 Reviewed by Simon Fraser. The following RuntimeEnabledFeatures can be removed since we have no need to disable them (they are stable and have shipped for a while): - CSS Regions - CSS Shapes - Media tracks * bindings/generic/RuntimeEnabledFeatures.cpp: (WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures): Deleted. * bindings/generic/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::setCSSShapesEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::cssShapesEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::setCSSRegionsEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::cssRegionsEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::setCSSCompositingEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::cssCompositingEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::webkitVideoTrackEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::setWebkitVideoTrackEnabled): Deleted. * css/CSSParser.cpp: (WebCore::isSimpleLengthPropertyID): (WebCore::isValidKeywordPropertyAndValue): (WebCore::CSSParser::parseValue): (WebCore::CSSParser::parseFillProperty): (WebCore::CSSParser::createRegionRule): (WebCore::CSSParserContext::CSSParserContext): Deleted. (WebCore::operator==): Deleted. (WebCore::CSSParser::parseShapeProperty): Deleted. (WebCore::CSSParser::cssRegionsEnabled): Deleted. (WebCore::CSSParser::cssCompositingEnabled): Deleted. (WebCore::CSSParser::parseFlowThread): Deleted. (WebCore::CSSParser::parseRegionThread): Deleted. * css/CSSParser.h: * css/CSSParserMode.h: * dom/Document.cpp: (WebCore::Document::webkitGetNamedFlows): (WebCore::Document::cssRegionsEnabled): Deleted. (WebCore::Document::cssCompositingEnabled): Deleted. * dom/Document.h: * dom/Element.cpp: (WebCore::Element::unregisterNamedFlowContentElement): (WebCore::Element::webkitRegionOverset): (WebCore::Element::webkitGetRegionFlowRanges): Deleted. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::scheduleDelayedAction): (WebCore::HTMLMediaElement::pendingActionTimerFired): (WebCore::HTMLMediaElement::prepareForLoad): (WebCore::HTMLMediaElement::loadInternal): (WebCore::HTMLMediaElement::setReadyState): (WebCore::HTMLMediaElement::playbackProgressTimerFired): (WebCore::HTMLMediaElement::mediaPlayerTimeChanged): (WebCore::HTMLMediaElement::userCancelledLoad): (WebCore::HTMLMediaElement::setVideoFullscreenLayer): (WebCore::HTMLMediaElement::hasClosedCaptions): (WebCore::HTMLMediaElement::setClosedCaptionsVisible): (WebCore::HTMLMediaElement::configureTextTrackDisplay): (WebCore::HTMLMediaElement::finishParsingChildren): Deleted. (WebCore::HTMLMediaElement::audioTrackEnabledChanged): Deleted. (WebCore::HTMLMediaElement::videoTrackSelectedChanged): Deleted. (WebCore::HTMLMediaElement::mediaPlayerDidAddAudioTrack): Deleted. (WebCore::HTMLMediaElement::mediaPlayerDidAddTextTrack): Deleted. (WebCore::HTMLMediaElement::mediaPlayerDidAddVideoTrack): Deleted. (WebCore::HTMLMediaElement::addAudioTrack): Deleted. (WebCore::HTMLMediaElement::addTextTrack): Deleted. (WebCore::HTMLMediaElement::addVideoTrack): Deleted. (WebCore::HTMLMediaElement::removeAudioTrack): Deleted. (WebCore::HTMLMediaElement::removeTextTrack): Deleted. (WebCore::HTMLMediaElement::removeVideoTrack): Deleted. (WebCore::HTMLMediaElement::audioTracks): Deleted. (WebCore::HTMLMediaElement::textTracks): Deleted. (WebCore::HTMLMediaElement::videoTracks): Deleted. (WebCore::HTMLMediaElement::didAddTextTrack): Deleted. (WebCore::HTMLMediaElement::didRemoveTextTrack): Deleted. * html/HTMLTrackElement.cpp: (WebCore::HTMLTrackElement::parseAttribute): (WebCore::HTMLTrackElement::scheduleLoad): Deleted. (WebCore::HTMLTrackElement::canLoadURL): Deleted. * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::createRenderNamedFlowFragmentIfNeeded): * testing/InternalSettings.cpp: (WebCore::InternalSettings::Backup::Backup): (WebCore::InternalSettings::Backup::restoreTo): Deleted. (WebCore::InternalSettings::setCSSShapesEnabled): Deleted. * testing/InternalSettings.h: * testing/InternalSettings.idl: 2016-05-06 Brady Eidson Modern IDB (Workers): Start running a lot of the workers tests. https://bugs.webkit.org/show_bug.cgi?id=157424 Reviewed by Sam Weinig. No new tests (Covered by enabling a whole bunch of existing tests). * Modules/indexeddb/IDBDatabase.cpp: (WebCore::IDBDatabase::stop): Call removeAllEventListeners() to clean up the Worker VM before it shuts down. * Modules/indexeddb/IDBRequest.cpp: (WebCore::IDBRequest::stop): Call removeAllEventListeners() * Modules/indexeddb/IDBTransaction.cpp: (WebCore::IDBTransaction::IDBTransaction): Initialize with the correct VM. (WebCore::IDBTransaction::stop): Call removeAllEventListeners() (WebCore::IDBTransaction::operationDidComplete): * Modules/indexeddb/client/IDBConnectionProxy.cpp: (WebCore::IDBClient::IDBConnectionProxy::takeIDBOpenDBRequest): (WebCore::IDBClient::IDBConnectionProxy::completeOpenDBRequest): Don't take the request from the map, but rather let the request take itself from its appropriate thread. * Modules/indexeddb/client/IDBConnectionProxy.h: * Modules/indexeddb/client/TransactionOperation.h: (WebCore::IDBClient::TransactionOperation::completed): Rework clearing out the completion handler, as the handler itself might hold the last reference to `this`. * page/SecurityOrigin.h: (WebCore::SecurityOrigin::hasUniversalAccess): * workers/WorkerGlobalScope.cpp: (WebCore::WorkerGlobalScope::WorkerGlobalScope): If the parent context's SecurityOrigin had universal access, grant it to this one. 2016-05-06 Ryosuke Niwa FKA: No way to get focus from DOM to shadow DOM components (Was: HTML5 media controls not keyboard accessible) https://bugs.webkit.org/show_bug.cgi?id=117857 Reviewed by Jer Noble. The bug was caused by hasCustomFocusLogic returning true on media elements. Fix the bug by removing this function so that FocusController will walk into the shadow tree of media elements to look for focusable elements. This will allow AT such as Voice Over to iterate through controls. We don't seem to draw focus rings inside the media elements but that could be tweaked in a separate patch. Test: media/tab-focus-inside-media-elements.html * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::hasCustomFocusLogic): Deleted. * html/HTMLMediaElement.h: 2016-05-06 Anders Carlsson Tidy up the LinkRelAttribute code https://bugs.webkit.org/show_bug.cgi?id=157429 Reviewed by Sam Weinig. Get rid of IconURL.h and move the IconType enumeration inside LinkRelAttribute. Remove the InvalidIcon enum declaration and use WTF::Optional instead. * WebCore.xcodeproj/project.pbxproj: * dom/IconURL.h: Removed. * html/HTMLLinkElement.cpp: (WebCore::HTMLLinkElement::iconType): (WebCore::HTMLLinkElement::addSubresourceAttributeURLs): * html/HTMLLinkElement.h: * html/LinkRelAttribute.cpp: (WebCore::LinkRelAttribute::LinkRelAttribute): * html/LinkRelAttribute.h: * html/parser/HTMLPreloadScanner.cpp: (WebCore::TokenPreloadScanner::StartTagScanner::relAttributeIsStyleSheet): * loader/FrameLoader.h: * loader/FrameLoaderClient.h: * loader/icon/IconController.cpp: (WebCore::iconFromLinkElements): 2016-05-06 Jer Noble Muted media elements should be allowed to autoplay, even if RequireUserGestureForAudioRateChange is set. https://bugs.webkit.org/show_bug.cgi?id=157404 Reviewed by Eric Carlson. Test: media/audio-playback-restriction-play-muted.html Add element.muted() as a critera of whether playback is permitted when RequireUserGestureForAudioRateChange is set. Also, make sure to re-evaluate whether the element should be playing when muted is changed without a user gesture. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::setMuted): * html/MediaElementSession.cpp: (WebCore::MediaElementSession::playbackPermitted): 2016-05-06 Brent Fulgham Don't use invalidated ResourceLoadStatistics iterators https://bugs.webkit.org/show_bug.cgi?id=157412 Reviewed by Chris Dumez. ResourceLoadObserver::logFrameNavigation was using references bound to the 'value' member of iterators from the ResourceLoadStatistics HashMap. When new entries were added, these iterators were invalidated causing the references to refer to invalid memory. Renamed 'resourceStatisticsForPrimaryDomain' to 'ensureResourceStatisticsForPrimaryDomain' to clarify that it may mutate the underlying HashMap, thereby invalidating any existing iterators. * loader/ResourceLoadObserver.cpp: (WebCore::ResourceLoadObserver::logFrameNavigation): Protect against HashMap elements being copied/moved when new intries are added. * loader/ResourceLoadStatisticsStore.cpp: (WebCore::ResourceLoadStatisticsStore::setResourceStatisticsForPrimaryDomain): Added. * loader/ResourceLoadStatisticsStore.h: 2016-05-06 Manuel Rego Casasnovas [css-grid] Unprefix CSS Grid Layout properties https://bugs.webkit.org/show_bug.cgi?id=157137 Reviewed by Simon Fraser. Remove "-webkit" prefix from all the grid layout properties, including the display value. Update the source code to remove the prefix where it was used too. * css/CSSComputedStyleDeclaration.cpp: (WebCore::isLayoutDependent): (WebCore::ComputedStyleExtractor::propertyValue): * css/CSSParser.cpp: (WebCore::isSimpleLengthPropertyID): (WebCore::isValidKeywordPropertyAndValue): (WebCore::CSSParser::parseValue): (WebCore::CSSParser::parseGridGapShorthand): (WebCore::CSSParser::parseGridTemplateRowsAndAreasAndColumns): (WebCore::CSSParser::parseGridTemplateShorthand): (WebCore::CSSParser::parseGridShorthand): (WebCore::CSSParser::parseGridAreaShorthand): * css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): * css/CSSPropertyNames.in: * css/CSSValueKeywords.in: * css/StyleBuilderCustom.h: (WebCore::StyleBuilderCustom::applyInitialGridTemplateAreas): (WebCore::StyleBuilderCustom::applyInheritGridTemplateAreas): (WebCore::StyleBuilderCustom::applyValueGridTemplateAreas): (WebCore::StyleBuilderCustom::applyInitialGridTemplateColumns): (WebCore::StyleBuilderCustom::applyInheritGridTemplateColumns): (WebCore::StyleBuilderCustom::applyValueGridTemplateColumns): (WebCore::StyleBuilderCustom::applyInitialGridTemplateRows): (WebCore::StyleBuilderCustom::applyInheritGridTemplateRows): (WebCore::StyleBuilderCustom::applyValueGridTemplateRows): * css/StyleProperties.cpp: (WebCore::StyleProperties::getPropertyValue): 2016-05-06 Nan Wang AX: element should have a replacement character https://bugs.webkit.org/show_bug.cgi?id=157406 Reviewed by Chris Fleizach. Make sure attachment element is considered as a replaced node. Test: accessibility/mac/attachment-element-replacement-character.html * editing/TextIterator.cpp: (WebCore::isRendererReplacedElement): 2016-05-06 Nan Wang AX: String for document range is empty if end visible position anchors to a ignored replaced node https://bugs.webkit.org/show_bug.cgi?id=157403 Reviewed by Chris Fleizach. The CharacterOffset that is converted from VisiblePositon is wrong when the VisiblePostion anchors to an ignored replaced node. Fixed it by adjusting the offset of the CharacterOffset correctly in such case. Test: accessibility/mac/text-marker-string-for-document-end-replaced-node.html * accessibility/AXObjectCache.cpp: (WebCore::characterOffsetsInOrder): (WebCore::AXObjectCache::characterOffsetFromVisiblePosition): (WebCore::AXObjectCache::accessibilityObjectForTextMarkerData): 2016-05-05 David Kilzer [iOS] WebCore does not need to link to CoreAudio, GraphicsServices, SystemConfiguration frameworks Reviewed by Gavin Barraclough. * Configurations/WebCore.xcconfig: (OTHER_LDFLAGS_BASE_ios): Remove "-framework GraphicsServices". (OTHER_LDFLAGS_PLATFORM[sdk=macosx*]): Add "-framework CoreAudio" and "-framework SystemConfiguration". * WebCore.xcodeproj/project.pbxproj: Remove CoreAudio.framework and SystemConfiguration.framework from the project file. 2016-05-05 Brady Eidson Modern IDB (Workers): Get everything to the right threads. https://bugs.webkit.org/show_bug.cgi?id=157398 Reviewed by Alex Christensen. No new tests (No current change in behavior, will be tested as bug 149953 is resolved, enabling IDB in workers). * dom/ScriptExecutionContext.h: (WebCore::ScriptExecutionContext::postCrossThreadTask): Add a helper to post a CrossThreadTask to a context. * Modules/indexeddb/client/IDBConnectionProxy.cpp: (WebCore::IDBClient::performCallbackOnCorrectThread): Helper to perform an IDB callback on either the main thread or Worker thread as necessary. (WebCore::IDBClient::IDBConnectionProxy::openDatabase): (WebCore::IDBClient::IDBConnectionProxy::deleteDatabase): (WebCore::IDBClient::IDBConnectionProxy::completeOpenDBRequest): (WebCore::IDBClient::IDBConnectionProxy::createObjectStore): (WebCore::IDBClient::IDBConnectionProxy::deleteObjectStore): (WebCore::IDBClient::IDBConnectionProxy::clearObjectStore): (WebCore::IDBClient::IDBConnectionProxy::createIndex): (WebCore::IDBClient::IDBConnectionProxy::deleteIndex): (WebCore::IDBClient::IDBConnectionProxy::putOrAdd): (WebCore::IDBClient::IDBConnectionProxy::getRecord): (WebCore::IDBClient::IDBConnectionProxy::getCount): (WebCore::IDBClient::IDBConnectionProxy::deleteRecord): (WebCore::IDBClient::IDBConnectionProxy::openCursor): (WebCore::IDBClient::IDBConnectionProxy::iterateCursor): (WebCore::IDBClient::IDBConnectionProxy::completeOperation): (WebCore::IDBClient::IDBConnectionProxy::abortOpenAndUpgradeNeeded): (WebCore::IDBClient::IDBConnectionProxy::fireVersionChangeEvent): (WebCore::IDBClient::IDBConnectionProxy::didFireVersionChangeEvent): (WebCore::IDBClient::IDBConnectionProxy::notifyOpenDBRequestBlocked): (WebCore::IDBClient::IDBConnectionProxy::establishTransaction): (WebCore::IDBClient::IDBConnectionProxy::didStartTransaction): (WebCore::IDBClient::IDBConnectionProxy::commitTransaction): (WebCore::IDBClient::IDBConnectionProxy::didCommitTransaction): (WebCore::IDBClient::IDBConnectionProxy::abortTransaction): (WebCore::IDBClient::IDBConnectionProxy::didAbortTransaction): (WebCore::IDBClient::IDBConnectionProxy::didFinishHandlingVersionChangeTransaction): (WebCore::IDBClient::IDBConnectionProxy::databaseConnectionClosed): (WebCore::IDBClient::IDBConnectionProxy::scheduleMainThreadTasks): (WebCore::IDBClient::IDBConnectionProxy::handleMainThreadTasks): * Modules/indexeddb/client/IDBConnectionProxy.h: (WebCore::IDBClient::IDBConnectionProxy::callConnectionOnMainThread): Helper to marshall IDB operations from the Worker thread to the main thread. (WebCore::IDBClient::IDBConnectionProxy::postMainThreadTask): * Modules/indexeddb/IDBTransaction.cpp: (WebCore::IDBTransaction::originThreadID): * Modules/indexeddb/IDBTransaction.h: * Modules/indexeddb/client/IDBConnectionToServer.cpp: (WebCore::IDBClient::IDBConnectionToServer::putOrAdd): * Modules/indexeddb/client/IDBConnectionToServer.h: * Modules/indexeddb/client/IDBConnectionToServerDelegate.h: * Modules/indexeddb/client/TransactionOperation.cpp: (WebCore::IDBClient::TransactionOperation::scriptExecutionContext): * Modules/indexeddb/client/TransactionOperation.h: * Modules/indexeddb/shared/IDBResourceIdentifier.cpp: (WebCore::nextClientResourceNumber): * Modules/indexeddb/shared/InProcessIDBServer.cpp: (WebCore::InProcessIDBServer::putOrAdd): * Modules/indexeddb/shared/InProcessIDBServer.h: 2016-05-05 Dean Jackson 4 and 8 digit color attributes should use the crazypants algorithm, not the CSS one. https://bugs.webkit.org/show_bug.cgi?id=157402 Reviewed by Simon Fraser. Noel and Tab from Google alerted me to the fact I broke some legacy HTML color attributes when I added support for 4 and 8 digit hex colors in CSS. The fix is to favor the "crazy" parsing unless we know it is a 3 or 6 digit hex value (in which case we try the CSS algorithm first). Covered by reverting an existing test. * html/HTMLElement.cpp: (WebCore::HTMLElement::addHTMLColorToStyle): 2016-05-05 Brady Eidson Modern IDB (Workers): Remove the need for IDBConnectionProxy to expose its IDBConnectionToServer. https://bugs.webkit.org/show_bug.cgi?id=157394 Reviewed by Alex Christensen. No new tests (No current change in behavior, will be tested as bug 149953 makes progress). * Modules/indexeddb/IDBDatabase.cpp: (WebCore::IDBDatabase::transaction): (WebCore::IDBDatabase::fireVersionChangeEvent): (WebCore::IDBDatabase::dispatchEvent): * Modules/indexeddb/IDBDatabase.h: (WebCore::IDBDatabase::serverConnection): Deleted. * Modules/indexeddb/IDBOpenDBRequest.cpp: (WebCore::IDBOpenDBRequest::requestCompleted): * Modules/indexeddb/IDBRequest.cpp: (WebCore::IDBRequest::IDBRequest): * Modules/indexeddb/IDBTransaction.cpp: (WebCore::IDBTransaction::connectionProxy): (WebCore::IDBTransaction::serverConnection): Deleted. * Modules/indexeddb/IDBTransaction.h: * Modules/indexeddb/client/IDBConnectionProxy.cpp: (WebCore::IDBClient::IDBConnectionProxy::abortOpenAndUpgradeNeeded): (WebCore::IDBClient::IDBConnectionProxy::connectionToServer): Deleted. * Modules/indexeddb/client/IDBConnectionProxy.h: * Modules/indexeddb/client/IDBConnectionToServer.cpp: (WebCore::IDBClient::IDBConnectionToServer::abortOpenAndUpgradeNeeded): * Modules/indexeddb/client/TransactionOperation.h: (WebCore::IDBClient::TransactionOperation::TransactionOperation): * Modules/indexeddb/shared/IDBCursorInfo.cpp: (WebCore::IDBCursorInfo::IDBCursorInfo): * Modules/indexeddb/shared/IDBRequestData.cpp: (WebCore::IDBRequestData::IDBRequestData): * Modules/indexeddb/shared/IDBResourceIdentifier.cpp: (WebCore::IDBResourceIdentifier::IDBResourceIdentifier): * Modules/indexeddb/shared/IDBResourceIdentifier.h: * Modules/indexeddb/shared/IDBTransactionInfo.cpp: (WebCore::IDBTransactionInfo::clientTransaction): * Modules/indexeddb/shared/IDBTransactionInfo.h: 2016-05-05 Commit Queue Unreviewed, rolling out r200479. https://bugs.webkit.org/show_bug.cgi?id=157397 A LayoutTest added with this change is crashing on Mac WK1 test runs. (Requested by ryanhaddad on #webkit). Reverted changeset: "For keyboard users, activating a fragment URL should transfer focus and caret to the destination" https://bugs.webkit.org/show_bug.cgi?id=116046 http://trac.webkit.org/changeset/200479 2016-05-05 Chris Dumez CORS check is sometimes incorrectly failing for media loads https://bugs.webkit.org/show_bug.cgi?id=157370 Reviewed by Alex Christensen. When the media library is issuing a conditional request for a media element that had the 'crossorigin' attribute, we would fail the CORS check and log an error if the server were to respond with a "304 Not Modified" response because the 304 response usually does not have the necessary "Access-Control-Allow-Origin: *" header (At least for Apache) and we cannot use the cached headers either since WebKit does not have them. To work around the problem in the short term, we now drop the conditional headers from the request that the media library is giving us when the media element has the 'crossorigin' attribute set. As a result, the server will never respond with a 304 and we will be able to do a CORS check on the full (e.g. 206) response. In the long term, we need to deal with this better as this means we may sometimes fail to reuse cached data. For now, this is only potentially inefficient in the cases that were broken (i.e. no video would play and we would log an error in the console). Test: http/tests/security/video-cross-origin-caching.html * loader/MediaResourceLoader.cpp: (WebCore::MediaResourceLoader::requestResource): Make the request unconditional if the media element has the 'crossorigin' attribute set. * platform/network/ResourceRequestBase.cpp: (WebCore::ResourceRequestBase::isConditional): (WebCore::ResourceRequestBase::makeUnconditional): When fixing the bug above, I noticed that those method do not do the right thing if the m_httpHeaderFields data member has not been populated yet. m_httpHeaderFields is lazily initialized so we need to call updateResourceRequest() before using it. 2016-05-05 Zalan Bujtas Stop traversing at the container block when computing RTL inline static distance. https://bugs.webkit.org/show_bug.cgi?id=157349 Reviewed by David Hyatt. When computing the inline static distance for a child renderer, we start at its enclosing box and traverse up all the way to the container block. However when the enclosing box is the ancestor of the container block, we should just bail out right away since there's no container to use to adjust the position. Test: fast/multicol/positioned-rtl-column-crash.html * rendering/RenderBox.cpp: (WebCore::computeInlineStaticDistance): 2016-05-05 Ada Chan Add WebKitAdditions extension points in media controls related code in RenderThemeMac https://bugs.webkit.org/show_bug.cgi?id=157390 Reviewed by Anders Carlsson. * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::mediaControlsStyleSheet): (WebCore::RenderThemeMac::mediaControlsScript): 2016-05-05 Jer Noble [WK2] Media controls don't update if controller is created after the interface is created https://bugs.webkit.org/show_bug.cgi?id=157376 Reviewed by Beth Dakin. Add getter methods to WebPlaybackSessionModel so that the model's values can be retrieved if those values were missed before the equivalent WebPlaybackSessionInterface methods were called. This necessatates a bunch of changes in HTMLMediaElement and related classes to change PassRefPtr types to Ref (and one change in TimeRanges itself). WebPlaybackSessionModelMediaElement can implement these new getter methods by querying the values from the HTMLMediaElement, something it was doing already, so most of those changes are simple refactoring. There's no reason any longer for WebVideoFullscreenModel to inherit from WebPlaybackSessionModel, so remove that superclass. In WebPlaybackSessionInterfaceMac, when a new WebPlaybackControlsManager is set, use the new getter methods on WebPlaybackSessionModel to update the values in the manager. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged): (WebCore::HTMLMediaElement::maxBufferedTime): (WebCore::HTMLMediaElement::played): (WebCore::HTMLMediaElement::buffered): Deleted. (WebCore::HTMLMediaElement::seekable): Deleted. * html/HTMLMediaElement.h: * html/MediaController.cpp: (MediaController::buffered): (MediaController::seekable): (MediaController::played): * html/MediaController.h: * html/MediaControllerInterface.h: * html/TimeRanges.cpp: (WebCore::TimeRanges::copy): * html/TimeRanges.h: * platform/cocoa/WebPlaybackSessionModel.h: * platform/cocoa/WebPlaybackSessionModelMediaElement.h: * platform/cocoa/WebPlaybackSessionModelMediaElement.mm: (WebPlaybackSessionModelMediaElement::setWebPlaybackSessionInterface): (WebPlaybackSessionModelMediaElement::updateForEventName): (WebPlaybackSessionModelMediaElement::updateLegibleOptions): (WebPlaybackSessionModelMediaElement::observedEventNames): (WebPlaybackSessionModelMediaElement::eventNameAll): (WebPlaybackSessionModelMediaElement::duration): (WebPlaybackSessionModelMediaElement::currentTime): (WebPlaybackSessionModelMediaElement::bufferedTime): (WebPlaybackSessionModelMediaElement::isPlaying): (WebPlaybackSessionModelMediaElement::playbackRate): (WebPlaybackSessionModelMediaElement::seekableRanges): (WebPlaybackSessionModelMediaElement::canPlayFastReverse): (WebPlaybackSessionModelMediaElement::audioMediaSelectionOptions): (WebPlaybackSessionModelMediaElement::audioMediaSelectedIndex): (WebPlaybackSessionModelMediaElement::legibleMediaSelectionOptions): (WebPlaybackSessionModelMediaElement::legibleMediaSelectedIndex): (WebPlaybackSessionModelMediaElement::externalPlaybackEnabled): (WebPlaybackSessionModelMediaElement::wirelessVideoPlaybackDisabled): * platform/cocoa/WebVideoFullscreenModel.h: * platform/cocoa/WebVideoFullscreenModelVideoElement.h: * platform/cocoa/WebVideoFullscreenModelVideoElement.mm: (WebVideoFullscreenModelVideoElement::requestFullscreenMode): Deleted. (WebVideoFullscreenModelVideoElement::setVideoLayerFrame): Deleted. (WebVideoFullscreenModelVideoElement::setVideoLayerGravity): Deleted. (WebVideoFullscreenModelVideoElement::observedEventNames): Deleted. (WebVideoFullscreenModelVideoElement::eventNameAll): Deleted. (WebVideoFullscreenModelVideoElement::fullscreenModeChanged): Deleted. * platform/ios/WebPlaybackSessionInterfaceAVKit.h: * platform/ios/WebVideoFullscreenControllerAVKit.mm: (WebVideoFullscreenControllerContext::play): Deleted. (WebVideoFullscreenControllerContext::pause): Deleted. (WebVideoFullscreenControllerContext::togglePlayState): Deleted. (WebVideoFullscreenControllerContext::beginScrubbing): Deleted. (WebVideoFullscreenControllerContext::endScrubbing): Deleted. (WebVideoFullscreenControllerContext::seekToTime): Deleted. (WebVideoFullscreenControllerContext::fastSeek): Deleted. (WebVideoFullscreenControllerContext::beginScanningForward): Deleted. (WebVideoFullscreenControllerContext::beginScanningBackward): Deleted. (WebVideoFullscreenControllerContext::endScanning): Deleted. (WebVideoFullscreenControllerContext::selectAudioMediaOption): Deleted. (WebVideoFullscreenControllerContext::selectLegibleMediaOption): Deleted. * platform/ios/WebVideoFullscreenInterfaceAVKit.h: * platform/ios/WebVideoFullscreenInterfaceAVKit.mm: (WebVideoFullscreenInterfaceAVKit::requestHideAndExitFullscreen): (WebVideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason): * platform/mac/WebPlaybackSessionInterfaceMac.mm: (WebCore::timeRangesToArray): (WebCore::WebPlaybackSessionInterfaceMac::setSeekableRanges): (WebCore::WebPlaybackSessionInterfaceMac::setPlayBackControlsManager): * platform/mac/WebVideoFullscreenInterfaceMac.h: 2016-05-05 Brady Eidson Modern IDB (Workers): Move TransactionOperation management from IDBConnectionToServer to IDBConnectionProxy. https://bugs.webkit.org/show_bug.cgi?id=157392 Reviewed by Alex Christensen. No new tests (No current change in behavior, will be tested as bug 149953 makes progress). Set up TransactionOperations on the IDBConnectionProxy instead of the IDBConnectionToServer: * Modules/indexeddb/IDBTransaction.cpp: (WebCore::IDBTransaction::createObjectStoreOnServer): (WebCore::IDBTransaction::createIndexOnServer): (WebCore::IDBTransaction::openCursorOnServer): (WebCore::IDBTransaction::iterateCursorOnServer): (WebCore::IDBTransaction::getRecordOnServer): (WebCore::IDBTransaction::getCountOnServer): (WebCore::IDBTransaction::deleteRecordOnServer): (WebCore::IDBTransaction::clearObjectStoreOnServer): (WebCore::IDBTransaction::putOrAddOnServer): (WebCore::IDBTransaction::deleteObjectStoreOnServer): (WebCore::IDBTransaction::deleteIndexOnServer): IDBConnectionProxy is now the owner of dispatched TransactionOperations: * Modules/indexeddb/client/IDBConnectionProxy.cpp: (WebCore::IDBClient::IDBConnectionProxy::createObjectStore): (WebCore::IDBClient::IDBConnectionProxy::deleteObjectStore): (WebCore::IDBClient::IDBConnectionProxy::clearObjectStore): (WebCore::IDBClient::IDBConnectionProxy::createIndex): (WebCore::IDBClient::IDBConnectionProxy::deleteIndex): (WebCore::IDBClient::IDBConnectionProxy::putOrAdd): (WebCore::IDBClient::IDBConnectionProxy::getRecord): (WebCore::IDBClient::IDBConnectionProxy::getCount): (WebCore::IDBClient::IDBConnectionProxy::deleteRecord): (WebCore::IDBClient::IDBConnectionProxy::openCursor): (WebCore::IDBClient::IDBConnectionProxy::iterateCursor): (WebCore::IDBClient::IDBConnectionProxy::saveOperation): (WebCore::IDBClient::IDBConnectionProxy::completeOperation): * Modules/indexeddb/client/IDBConnectionProxy.h: Proxy this in-and-out calls to the ConnectionProxy: * Modules/indexeddb/client/IDBConnectionToServer.cpp: (WebCore::IDBClient::IDBConnectionToServer::createObjectStore): (WebCore::IDBClient::IDBConnectionToServer::didCreateObjectStore): (WebCore::IDBClient::IDBConnectionToServer::deleteObjectStore): (WebCore::IDBClient::IDBConnectionToServer::didDeleteObjectStore): (WebCore::IDBClient::IDBConnectionToServer::clearObjectStore): (WebCore::IDBClient::IDBConnectionToServer::didClearObjectStore): (WebCore::IDBClient::IDBConnectionToServer::createIndex): (WebCore::IDBClient::IDBConnectionToServer::didCreateIndex): (WebCore::IDBClient::IDBConnectionToServer::deleteIndex): (WebCore::IDBClient::IDBConnectionToServer::didDeleteIndex): (WebCore::IDBClient::IDBConnectionToServer::putOrAdd): (WebCore::IDBClient::IDBConnectionToServer::didPutOrAdd): (WebCore::IDBClient::IDBConnectionToServer::getRecord): (WebCore::IDBClient::IDBConnectionToServer::didGetRecord): (WebCore::IDBClient::IDBConnectionToServer::getCount): (WebCore::IDBClient::IDBConnectionToServer::didGetCount): (WebCore::IDBClient::IDBConnectionToServer::deleteRecord): (WebCore::IDBClient::IDBConnectionToServer::didDeleteRecord): (WebCore::IDBClient::IDBConnectionToServer::openCursor): (WebCore::IDBClient::IDBConnectionToServer::didOpenCursor): (WebCore::IDBClient::IDBConnectionToServer::iterateCursor): (WebCore::IDBClient::IDBConnectionToServer::didIterateCursor): (WebCore::IDBClient::IDBConnectionToServer::saveOperation): Deleted. (WebCore::IDBClient::IDBConnectionToServer::completeOperation): Deleted. * Modules/indexeddb/client/IDBConnectionToServer.h: - Give TransactionOperation a ThreadIdentifier member - Privatize most public methods from TransactionOperation - Make IDBRequestData a friend so it can get at the private methods * Modules/indexeddb/client/TransactionOperation.h: (WebCore::IDBClient::TransactionOperation::~TransactionOperation): (WebCore::IDBClient::TransactionOperation::perform): (WebCore::IDBClient::TransactionOperation::completed): (WebCore::IDBClient::TransactionOperation::originThreadID): (WebCore::IDBClient::TransactionOperation::transactionIdentifier): (WebCore::IDBClient::TransactionOperation::objectStoreIdentifier): (WebCore::IDBClient::TransactionOperation::indexIdentifier): (WebCore::IDBClient::TransactionOperation::cursorIdentifier): (WebCore::IDBClient::TransactionOperation::transaction): (WebCore::IDBClient::TransactionOperation::indexRecordType): 2016-05-05 Zalan Bujtas Do not attempt to compute min/max width. https://bugs.webkit.org/show_bug.cgi?id=157320 Reviewed by David Hyatt. Replaced elements with no intrinsic size (only with ratio) should not call the containing block to compute the min/max width when the containing block's min/max width depends on the children's intrinsic size. It could lead to infinite recursion. Test: fast/replaced/before-content-intrinsic-crash.html * rendering/RenderBox.cpp: (WebCore::RenderBox::computeReplacedLogicalWidthRespectingMinMaxWidth): Unrelated code change. * rendering/RenderImage.cpp: Unrelated code change. (WebCore::RenderImage::RenderImage): Deleted. * rendering/RenderImage.h: * rendering/RenderReplaced.cpp: (WebCore::RenderReplaced::computeReplacedLogicalWidth): 2016-05-04 Brady Eidson Modern IDB: Move all IDB DOM object management from IDBConnectionToServer to IDBConnectionProxy. https://bugs.webkit.org/show_bug.cgi?id=157348 Reviewed by Alex Christensen. No new tests (Refactor, no change in behavior yet). This is in-progress IDB-in-Workers code that is isolated enough to land right now. The goal is to have IDBConnectionToServer be a main-thread-only object, leaving IDBConnectionProxy as the threading bridge between the worker thread and the main thread. As such, IDBConnectionToServer no longer maintains maps of IDB DOM objects, but instead the proxy does and guards that access with locks. No threading changes takes place in this patch but it does scatter some isMainThread() checks and FIXMEs accurately representing where threading changes will take place once I can return to this. * Modules/indexeddb/IDBDatabase.cpp: (WebCore::IDBDatabase::IDBDatabase): (WebCore::IDBDatabase::~IDBDatabase): (WebCore::IDBDatabase::maybeCloseInServer): * Modules/indexeddb/IDBOpenDBRequest.cpp: (WebCore::IDBOpenDBRequest::dispatchEvent): * Modules/indexeddb/IDBTransaction.cpp: (WebCore::IDBTransaction::abortOnServerAndCancelRequests): (WebCore::IDBTransaction::commitOnServer): (WebCore::IDBTransaction::establishOnServer): * Modules/indexeddb/client/IDBConnectionProxy.cpp: (WebCore::IDBClient::IDBConnectionProxy::openDatabase): (WebCore::IDBClient::IDBConnectionProxy::deleteDatabase): (WebCore::IDBClient::IDBConnectionProxy::didOpenDatabase): (WebCore::IDBClient::IDBConnectionProxy::didDeleteDatabase): (WebCore::IDBClient::IDBConnectionProxy::completeOpenDBRequest): (WebCore::IDBClient::IDBConnectionProxy::fireVersionChangeEvent): (WebCore::IDBClient::IDBConnectionProxy::didFireVersionChangeEvent): (WebCore::IDBClient::IDBConnectionProxy::notifyOpenDBRequestBlocked): (WebCore::IDBClient::IDBConnectionProxy::establishTransaction): (WebCore::IDBClient::IDBConnectionProxy::didStartTransaction): (WebCore::IDBClient::IDBConnectionProxy::commitTransaction): (WebCore::IDBClient::IDBConnectionProxy::didCommitTransaction): (WebCore::IDBClient::IDBConnectionProxy::abortTransaction): (WebCore::IDBClient::IDBConnectionProxy::didAbortTransaction): (WebCore::IDBClient::IDBConnectionProxy::hasRecordOfTransaction): (WebCore::IDBClient::IDBConnectionProxy::didFinishHandlingVersionChangeTransaction): (WebCore::IDBClient::IDBConnectionProxy::databaseConnectionClosed): (WebCore::IDBClient::IDBConnectionProxy::registerDatabaseConnection): (WebCore::IDBClient::IDBConnectionProxy::unregisterDatabaseConnection): * Modules/indexeddb/client/IDBConnectionProxy.h: * Modules/indexeddb/client/IDBConnectionToServer.cpp: (WebCore::IDBClient::IDBConnectionToServer::deleteDatabase): (WebCore::IDBClient::IDBConnectionToServer::didDeleteDatabase): (WebCore::IDBClient::IDBConnectionToServer::openDatabase): (WebCore::IDBClient::IDBConnectionToServer::didOpenDatabase): (WebCore::IDBClient::IDBConnectionToServer::establishTransaction): (WebCore::IDBClient::IDBConnectionToServer::commitTransaction): (WebCore::IDBClient::IDBConnectionToServer::didCommitTransaction): (WebCore::IDBClient::IDBConnectionToServer::didFinishHandlingVersionChangeTransaction): (WebCore::IDBClient::IDBConnectionToServer::abortTransaction): (WebCore::IDBClient::IDBConnectionToServer::didAbortTransaction): (WebCore::IDBClient::IDBConnectionToServer::fireVersionChangeEvent): (WebCore::IDBClient::IDBConnectionToServer::didFireVersionChangeEvent): (WebCore::IDBClient::IDBConnectionToServer::didStartTransaction): (WebCore::IDBClient::IDBConnectionToServer::notifyOpenDBRequestBlocked): (WebCore::IDBClient::IDBConnectionToServer::databaseConnectionClosed): (WebCore::IDBClient::IDBConnectionToServer::registerDatabaseConnection): Deleted. (WebCore::IDBClient::IDBConnectionToServer::unregisterDatabaseConnection): Deleted. (WebCore::IDBClient::IDBConnectionToServer::hasRecordOfTransaction): Deleted. * Modules/indexeddb/client/IDBConnectionToServer.h: * Modules/indexeddb/shared/IDBRequestData.cpp: (WebCore::IDBRequestData::IDBRequestData): * Modules/indexeddb/shared/IDBRequestData.h: * Modules/indexeddb/shared/IDBResourceIdentifier.cpp: (WebCore::IDBResourceIdentifier::IDBResourceIdentifier): * Modules/indexeddb/shared/IDBResourceIdentifier.h: 2016-05-04 Brady Eidson Modern IDB: Add isolatedCopy to a few more objects. https://bugs.webkit.org/show_bug.cgi?id=157330 Reviewed by Alex Christensen. No new tests (No current change in behavior, will be tested as bug 149953 makes progress). * Modules/indexeddb/shared/IDBRequestData.cpp: (WebCore::IDBRequestData::IDBRequestData): (WebCore::IDBRequestData::isolatedCopy): * Modules/indexeddb/shared/IDBRequestData.h: * Modules/indexeddb/shared/IDBResultData.cpp: (WebCore::IDBResultData::IDBResultData): (WebCore::IDBResultData::isolatedCopy): * Modules/indexeddb/shared/IDBResultData.h: 2016-05-04 Brady Eidson Modern IDB: Add thread identifiers and assertions to IDB DOM objects. https://bugs.webkit.org/show_bug.cgi?id=157329 Reviewed by Alex Christensen. No new tests (No current change in behavior, will be tested as bug 149953 makes progress). * Modules/indexeddb/IDBCursor.cpp: (WebCore::IDBCursor::IDBCursor): (WebCore::IDBCursor::~IDBCursor): (WebCore::IDBCursor::sourcesDeleted): (WebCore::IDBCursor::transaction): (WebCore::IDBCursor::direction): (WebCore::IDBCursor::update): (WebCore::IDBCursor::advance): (WebCore::IDBCursor::continueFunction): (WebCore::IDBCursor::uncheckedIterateCursor): (WebCore::IDBCursor::deleteFunction): (WebCore::IDBCursor::setGetResult): * Modules/indexeddb/IDBDatabase.cpp: (WebCore::IDBDatabase::~IDBDatabase): (WebCore::IDBDatabase::hasPendingActivity): (WebCore::IDBDatabase::name): (WebCore::IDBDatabase::version): (WebCore::IDBDatabase::objectStoreNames): (WebCore::IDBDatabase::createObjectStore): (WebCore::IDBDatabase::transaction): (WebCore::IDBDatabase::deleteObjectStore): (WebCore::IDBDatabase::close): (WebCore::IDBDatabase::maybeCloseInServer): (WebCore::IDBDatabase::activeDOMObjectName): (WebCore::IDBDatabase::canSuspendForDocumentSuspension): (WebCore::IDBDatabase::stop): (WebCore::IDBDatabase::startVersionChangeTransaction): (WebCore::IDBDatabase::didStartTransaction): (WebCore::IDBDatabase::willCommitTransaction): (WebCore::IDBDatabase::didCommitTransaction): (WebCore::IDBDatabase::willAbortTransaction): (WebCore::IDBDatabase::didAbortTransaction): (WebCore::IDBDatabase::didCommitOrAbortTransaction): (WebCore::IDBDatabase::fireVersionChangeEvent): (WebCore::IDBDatabase::dispatchEvent): (WebCore::IDBDatabase::didCreateIndexInfo): (WebCore::IDBDatabase::didDeleteIndexInfo): * Modules/indexeddb/IDBDatabase.h: (WebCore::IDBDatabase::originThreadID): * Modules/indexeddb/IDBIndex.cpp: (WebCore::IDBIndex::IDBIndex): (WebCore::IDBIndex::~IDBIndex): (WebCore::IDBIndex::name): (WebCore::IDBIndex::objectStore): (WebCore::IDBIndex::keyPath): (WebCore::IDBIndex::unique): (WebCore::IDBIndex::multiEntry): (WebCore::IDBIndex::openCursor): (WebCore::IDBIndex::doCount): (WebCore::IDBIndex::openKeyCursor): (WebCore::IDBIndex::doGet): (WebCore::IDBIndex::doGetKey): (WebCore::IDBIndex::markAsDeleted): * Modules/indexeddb/IDBObjectStore.cpp: (WebCore::IDBObjectStore::IDBObjectStore): (WebCore::IDBObjectStore::~IDBObjectStore): (WebCore::IDBObjectStore::name): (WebCore::IDBObjectStore::keyPath): (WebCore::IDBObjectStore::indexNames): (WebCore::IDBObjectStore::transaction): (WebCore::IDBObjectStore::autoIncrement): (WebCore::IDBObjectStore::openCursor): (WebCore::IDBObjectStore::get): (WebCore::IDBObjectStore::putOrAdd): (WebCore::IDBObjectStore::doDelete): (WebCore::IDBObjectStore::clear): (WebCore::IDBObjectStore::createIndex): (WebCore::IDBObjectStore::index): (WebCore::IDBObjectStore::deleteIndex): (WebCore::IDBObjectStore::doCount): (WebCore::IDBObjectStore::markAsDeleted): (WebCore::IDBObjectStore::rollbackInfoForVersionChangeAbort): * Modules/indexeddb/IDBOpenDBRequest.cpp: (WebCore::IDBOpenDBRequest::~IDBOpenDBRequest): (WebCore::IDBOpenDBRequest::onError): (WebCore::IDBOpenDBRequest::versionChangeTransactionDidFinish): (WebCore::IDBOpenDBRequest::fireSuccessAfterVersionChangeCommit): (WebCore::IDBOpenDBRequest::fireErrorAfterVersionChangeCompletion): (WebCore::IDBOpenDBRequest::dispatchEvent): (WebCore::IDBOpenDBRequest::onSuccess): (WebCore::IDBOpenDBRequest::onUpgradeNeeded): (WebCore::IDBOpenDBRequest::onDeleteDatabaseSuccess): (WebCore::IDBOpenDBRequest::requestCompleted): (WebCore::IDBOpenDBRequest::requestBlocked): * Modules/indexeddb/IDBRequest.cpp: (WebCore::IDBRequest::~IDBRequest): (WebCore::IDBRequest::errorCode): (WebCore::IDBRequest::error): (WebCore::IDBRequest::setSource): (WebCore::IDBRequest::setVersionChangeTransaction): (WebCore::IDBRequest::transaction): (WebCore::IDBRequest::readyState): (WebCore::IDBRequest::sourceObjectStoreIdentifier): (WebCore::IDBRequest::sourceIndexIdentifier): (WebCore::IDBRequest::requestedIndexRecordType): (WebCore::IDBRequest::eventTargetInterface): (WebCore::IDBRequest::activeDOMObjectName): (WebCore::IDBRequest::canSuspendForDocumentSuspension): (WebCore::IDBRequest::hasPendingActivity): (WebCore::IDBRequest::stop): (WebCore::IDBRequest::enqueueEvent): (WebCore::IDBRequest::dispatchEvent): (WebCore::IDBRequest::uncaughtExceptionInEventHandler): (WebCore::IDBRequest::setResult): (WebCore::IDBRequest::setResultToStructuredClone): (WebCore::IDBRequest::clearResult): (WebCore::IDBRequest::setResultToUndefined): (WebCore::IDBRequest::resultCursor): (WebCore::IDBRequest::willIterateCursor): (WebCore::IDBRequest::didOpenOrIterateCursor): (WebCore::IDBRequest::requestCompleted): (WebCore::IDBRequest::onError): (WebCore::IDBRequest::onSuccess): * Modules/indexeddb/IDBRequest.h: (WebCore::IDBRequest::originThreadID): * Modules/indexeddb/IDBTransaction.cpp: (WebCore::IDBTransaction::IDBTransaction): (WebCore::IDBTransaction::~IDBTransaction): (WebCore::IDBTransaction::mode): (WebCore::IDBTransaction::db): (WebCore::IDBTransaction::serverConnection): (WebCore::IDBTransaction::error): (WebCore::IDBTransaction::objectStore): (WebCore::IDBTransaction::abortDueToFailedRequest): (WebCore::IDBTransaction::transitionedToFinishing): (WebCore::IDBTransaction::abort): (WebCore::IDBTransaction::abortOnServerAndCancelRequests): (WebCore::IDBTransaction::activeDOMObjectName): (WebCore::IDBTransaction::canSuspendForDocumentSuspension): (WebCore::IDBTransaction::hasPendingActivity): (WebCore::IDBTransaction::stop): (WebCore::IDBTransaction::isActive): (WebCore::IDBTransaction::isFinishedOrFinishing): (WebCore::IDBTransaction::addRequest): (WebCore::IDBTransaction::removeRequest): (WebCore::IDBTransaction::scheduleOperation): (WebCore::IDBTransaction::scheduleOperationTimer): (WebCore::IDBTransaction::operationTimerFired): (WebCore::IDBTransaction::commit): (WebCore::IDBTransaction::commitOnServer): (WebCore::IDBTransaction::finishAbortOrCommit): (WebCore::IDBTransaction::didStart): (WebCore::IDBTransaction::notifyDidAbort): (WebCore::IDBTransaction::didAbort): (WebCore::IDBTransaction::didCommit): (WebCore::IDBTransaction::fireOnComplete): (WebCore::IDBTransaction::fireOnAbort): (WebCore::IDBTransaction::enqueueEvent): (WebCore::IDBTransaction::dispatchEvent): (WebCore::IDBTransaction::createObjectStore): (WebCore::IDBTransaction::createObjectStoreOnServer): (WebCore::IDBTransaction::didCreateObjectStoreOnServer): (WebCore::IDBTransaction::createIndex): (WebCore::IDBTransaction::createIndexOnServer): (WebCore::IDBTransaction::didCreateIndexOnServer): (WebCore::IDBTransaction::requestOpenCursor): (WebCore::IDBTransaction::doRequestOpenCursor): (WebCore::IDBTransaction::openCursorOnServer): (WebCore::IDBTransaction::didOpenCursorOnServer): (WebCore::IDBTransaction::iterateCursor): (WebCore::IDBTransaction::iterateCursorOnServer): (WebCore::IDBTransaction::didIterateCursorOnServer): (WebCore::IDBTransaction::requestGetRecord): (WebCore::IDBTransaction::requestGetValue): (WebCore::IDBTransaction::requestGetKey): (WebCore::IDBTransaction::requestIndexRecord): (WebCore::IDBTransaction::getRecordOnServer): (WebCore::IDBTransaction::didGetRecordOnServer): (WebCore::IDBTransaction::requestCount): (WebCore::IDBTransaction::getCountOnServer): (WebCore::IDBTransaction::didGetCountOnServer): (WebCore::IDBTransaction::requestDeleteRecord): (WebCore::IDBTransaction::deleteRecordOnServer): (WebCore::IDBTransaction::didDeleteRecordOnServer): (WebCore::IDBTransaction::requestClearObjectStore): (WebCore::IDBTransaction::clearObjectStoreOnServer): (WebCore::IDBTransaction::didClearObjectStoreOnServer): (WebCore::IDBTransaction::requestPutOrAdd): (WebCore::IDBTransaction::putOrAddOnServer): (WebCore::IDBTransaction::didPutOrAddOnServer): (WebCore::IDBTransaction::deleteObjectStore): (WebCore::IDBTransaction::deleteObjectStoreOnServer): (WebCore::IDBTransaction::didDeleteObjectStoreOnServer): (WebCore::IDBTransaction::deleteIndex): (WebCore::IDBTransaction::deleteIndexOnServer): (WebCore::IDBTransaction::didDeleteIndexOnServer): (WebCore::IDBTransaction::operationDidComplete): (WebCore::IDBTransaction::establishOnServer): (WebCore::IDBTransaction::activate): (WebCore::IDBTransaction::deactivate): 2016-05-05 Nan Wang For keyboard users, activating a fragment URL should transfer focus and caret to the destination https://bugs.webkit.org/show_bug.cgi?id=116046 Reviewed by Ryosuke Niwa. Added a sequential focus navigation starting node to document. When TAB or SHIFT-TAB is pressed and there is no focused element, we start searching for next focus candidates at the sequential focus navigation node. Test: fast/events/sequential-focus-navigation-starting-point.html * dom/Document.cpp: (WebCore::Document::removedLastRef): (WebCore::Document::destroyRenderTree): (WebCore::Document::removeFocusedNodeOfSubtree): (WebCore::Document::hoveredElementDidDetach): (WebCore::Document::setFocusedElement): (WebCore::isNodeFrameOrDocument): (WebCore::Document::setFocusNavigationStartingNode): (WebCore::Document::focusNavigationStartingNode): (WebCore::Document::setCSSTarget): (WebCore::Document::nodeChildrenWillBeRemoved): (WebCore::Document::nodeWillBeRemoved): (WebCore::fallbackFocusNavigationStartingNodeAfterRemoval): (WebCore::Document::updateFocusNavigationStartingNodeWithNodeRemoval): (WebCore::Document::textInserted): * dom/Document.h: (WebCore::Document::userActionElements): * page/EventHandler.cpp: (WebCore::EventHandler::handleMousePressEvent): * page/FocusController.cpp: (WebCore::FocusController::advanceFocusInDocumentOrder): * page/FrameView.cpp: (WebCore::FrameView::scrollToAnchor): 2016-05-05 Ryosuke Niwa Another iOS debug build fix after r200464. * dom/EventContext.h: (WebCore::EventContext::isUnreachableNode): 2016-05-05 Ryosuke Niwa iOS debug build fix after r200464. * dom/EventContext.cpp: (WebCore::TouchEventContext::checkReachability): 2016-05-05 Simon Fraser Revert r200390, thus putting r199259 and r200161 and back. * loader/HistoryController.cpp: (WebCore::HistoryController::saveScrollPositionAndViewStateToItem): * page/FrameView.cpp: (WebCore::FrameView::adjustTiledBackingScrollability): * page/Page.h: (WebCore::Page::obscuredInset): (WebCore::Page::setObscuredInset): (WebCore::Page::enclosedInScrollableAncestorView): (WebCore::Page::setEnclosedInScrollableAncestorView): * platform/ScrollView.h: (WebCore::ScrollView::platformObscuredInset): Deleted. (WebCore::ScrollView::platformSetObscuredInset): Deleted. 2016-05-05 Sam Weinig Fix the build. * platform/network/cf/CertificateInfo.h: 2016-05-05 Eric Carlson [iOS] Media information is sometimes not shown in Control Center https://bugs.webkit.org/show_bug.cgi?id=157377 Reviewed by Jer Noble. * platform/audio/ios/MediaSessionManagerIOS.h: * platform/audio/ios/MediaSessionManagerIOS.mm: (WebCore::MediaSessionManageriOS::updateNowPlayingInfo): Store values passed to MPNowPlayingInfoCenter individually instead of in a dictionary. 2016-05-04 Simon Fraser Comments on wired.com are blurry https://bugs.webkit.org/show_bug.cgi?id=148630 rdar://problem/22499655 Reviewed by Tim Horton. Make sure to set -rasterizationScale on TileGrid container layers to avoid blurry layers with some configurations of transforms, perspective and clipping. Test: compositing/contents-scale/rasterization-scale.html * platform/graphics/ca/TileController.cpp: (WebCore::TileController::TileController): Initialize m_deviceScaleFactor before m_tileGrid, because TileGrid's constructor needs to read the device scale. * platform/graphics/ca/TileController.h: * platform/graphics/ca/TileGrid.cpp: (WebCore::TileGrid::TileGrid): Push a contentsScale (which also sets rasterizationScale) onto the tile grid container layer on constructions, and in setScale(). (WebCore::TileGrid::setScale): 2016-05-05 Ryosuke Niwa event.target shouldn't be retargeted as the event bubbles into a slot https://bugs.webkit.org/show_bug.cgi?id=157369 Reviewed by Antti Koivisto. When an event bubbles up from an assigned node to its assigned slot, we shouldn't be adjusting event.target to point to the slot. Since a shadow tree should have access to nodes outside the shadow tree, event.target is accessible inside the shadow tree of such a slot. New behavior matches the behavior of Google Chrome Canary as well as the shadow DOM specification: http://w3c.github.io/webcomponents/spec/shadow/#dfn-retargeting-algorithm Test: fast/shadow-dom/event-inside-slotted-node.html * dom/Event.cpp: (WebCore::Event::deepPath): * dom/EventContext.h: (WebCore::EventContext::isUnreachableNode): Use Node::isUnclosedNode instead of isReachable. (WebCore::EventContext::isReachable): Deleted. * dom/EventPath.cpp: (WebCore::EventPath::EventPath): Don't set the target to the slot when entering a slot. Also moved the code to adjust the target as we exit a shadow tree to the end of the outer loop for clarity. (WebCore::isUnclosedNodeOf): Deleted. Renamed to Node::isUnclosedNode. (WebCore::EventPath::setRelatedTarget): (WebCore::EventPath::computePathUnclosedToTarget): Renamed from computePathDisclosedToTarget. (WebCore::moveOutOfAllShadowRoots): Extracted from RelatedNodeRetargeter::RelatedNodeRetargeter. (WebCore::RelatedNodeRetargeter::RelatedNodeRetargeter): Fixed a bug that we were exiting early without setting m_hasDifferentTreeRoot true when target and relatedNode are disconnected from a document. (WebCore::RelatedNodeRetargeter::currentNode): (WebCore::RelatedNodeRetargeter::checkConsistency): Updated to match the spec with one exception. We don't use null as the adjusted related target when the (original) related target and the target are in two distinct disconnected trees since such a behavior is not Web compatible. This spec bug is tracked by https://github.com/w3c/webcomponents/issues/494 * dom/EventPath.h: (WebCore::EventPath::eventTargetRespectingTargetRules): Returns Node* instead of EventTarget* since we need a Node in RelatedNodeRetargeter::checkConsistency. * dom/Node.cpp: (WebCore::Node::isUnclosedNode): Moved from RelatedNodeRetargeter.cpp * dom/Node.h: 2016-05-02 Sam Weinig On platforms that support it, use a SecTrustRef as the basis of CertificateInfo instead of a chain of SecCertificateRefs. https://bugs.webkit.org/show_bug.cgi?id=157220 Reviewed by Darin Adler. * platform/network/cf/CertificateInfo.h: (WebCore::CertificateInfo::CertificateInfo): (WebCore::CertificateInfo::trust): (WebCore::CertificateInfo::isEmpty): (WebCore::CertificateInfo::setCertificateChain): Deleted. (WebCore::CertificateInfo::certificateChain): Deleted. * platform/network/mac/CertificateInfoMac.mm: (WebCore::CertificateInfo::type): (WebCore::CertificateInfo::certificateChain): (WebCore::CertificateInfo::containsNonRootSHA1SignedCertificate): (WebCore::CertificateInfo::dump): When supported, allow CertificateInfo to contain a SecTrustRef instead of a certificate chain. We keep support for holding on to a certificate chain as well, since there is API that depends on this. * platform/network/cocoa/ResourceResponseCocoa.mm: (WebCore::ResourceResponse::platformCertificateInfo): When supported, use the SecTrustRef from the error instead of extracting it's certificate chain. 2016-05-04 Ada Chan When exiting fullscreen, call a JS method immediately to implement the style changes for the presentation mode change right away https://bugs.webkit.org/show_bug.cgi?id=157359 Reviewed by Eric Carlson. No new tests as this is done to just mitigate a visual glitch. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::exitFullscreen): (WebCore::HTMLMediaElement::updateMediaControlsAfterPresentationModeChange): * html/HTMLMediaElement.h: 2016-05-04 Alex Christensen Blocked redirected main resource requests need descriptive errors https://bugs.webkit.org/show_bug.cgi?id=156828 rdar://problem/25711316 Reviewed by Daniel Bates. Test: http/tests/contentextensions/main-resource-redirect-error.html * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::startLoadingMainResource): Call cancelMainResourceLoad() so that InjectedBundlePage::didFailProvisionalLoadWithErrorForFrame() is called to be consistent with blocked redirected main resource requests. * loader/ResourceLoader.cpp: (WebCore::ResourceLoader::willSendRequestInternal): (WebCore::ResourceLoader::blockedError): (WebCore::ResourceLoader::blockedByContentBlockerError): (WebCore::ResourceLoader::cannotShowURLError): * loader/ResourceLoader.h: Use a blockedByContentBlockerError() instead of a cannotShowURLError() when we blocked the load. 2016-05-05 Zan Dobersek Fix assertions in debug builds for the GTK+ port. Rubber-stamped by Carlos Garcia Campos. * platform/graphics/texmap/TextureMapperGL.cpp: (WebCore::TextureMapperGLData::SharedGLData::currentSharedGLData): Switch back to the find() + add() combo for retrieving the pointer to the SharedGLData object stored for the specific GraphicsContext3D. add() + isNewEntry is causing assertions in debug builds when adding the first entry. 2016-05-05 Carlos Garcia Campos [GStreamer] Adaptive streaming issues https://bugs.webkit.org/show_bug.cgi?id=144040 Reviewed by Philippe Normand. In the case of adaptive streaming, the GST URI downloader object is creating the source object, in our case WebKitWebSrc, without taking its ownership. This is breaking the lifetime of the WebKitWebSrc element. We are using GRefPtr in WebKitWebSrc to ref/unref the object when sending notifications to the main thread, ensuring that the object is not destroyed before the main thread dispatches the message. But our smart pointers are so smart that in case of receiving a floating reference, it's converted to a full reference, so that the first time we try to take a ref of a WebKitWebSrc having a floating reference we are actually taking the ownership instead. When we try to release the reference, we are actuallty destroying the object, something that the actual owner is not expecting and causing runtime critical warnings and very often web process crashes. (WebKitWebProcess:6863): GStreamer-CRITICAL **: Trying to dispose element appsrc1, but it is in READY instead of the NULL state. You need to explicitly set elements to the NULL state before dropping the final reference, to allow them to clean up. This problem may also be caused by a refcounting bug in the application or some element. (WebKitWebProcess:6863): GStreamer-CRITICAL **: gst_uri_handler_get_uri: assertion 'GST_IS_URI_HANDLER(handler)' failed (WebKitWebProcess:6863): GStreamer-CRITICAL **: gst_uri_get_protocol: assertion 'uri != NULL' failed This should be fixed in GST, but we can workaround it in WebKit while it's fixed in GST or to prevent this from happening if other users make the same mistake. The idea is to add a ensureGRef() only available for GRefPtr when using WebKitWebSrc objects that consumes the floating reference if needed before taking the actual reference. * platform/graphics/gstreamer/GRefPtrGStreamer.cpp: (WTF::ensureGRef): Consume the floating ref if needed. * platform/graphics/gstreamer/GRefPtrGStreamer.h: * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp: (webKitWebSrcChangeState): Use ensureGRef(). 2016-05-05 Csaba Osztrogonác [Mac][cmake] Unreviewed speculative buildfix after r200433, just for fun. * PlatformMac.cmake: 2016-05-04 Zan Dobersek [TexMap] Clean up TextureMapperShaderProgram https://bugs.webkit.org/show_bug.cgi?id=157302 Reviewed by Carlos Garcia Campos. Clean up the header and the implementation file of the TextureMapperShaderProgram class. Reference the GraphicsContext3D object through a Ref<>, and have the context() return a reference, not a pointer. Sort the parts of the implementation file into something more sensible. StringBuilder usage in create() is improved. getLocation() only needs to do one lookup in the m_variables map by using ensure(). No new tests -- no change in behavior. * platform/graphics/surfaces/GLTransportSurface.cpp: (WebCore::GLTransportSurface::initializeShaderProgram): * platform/graphics/texmap/TextureMapperGL.cpp: (WebCore::TextureMapperGLData::SharedGLData::getShaderProgram): (WebCore::prepareFilterProgram): * platform/graphics/texmap/TextureMapperShaderProgram.cpp: (WebCore::TextureMapperShaderProgram::create): (WebCore::TextureMapperShaderProgram::TextureMapperShaderProgram): (WebCore::TextureMapperShaderProgram::~TextureMapperShaderProgram): (WebCore::TextureMapperShaderProgram::setMatrix): (WebCore::TextureMapperShaderProgram::getLocation): * platform/graphics/texmap/TextureMapperShaderProgram.h: (WebCore::TextureMapperShaderProgram::context): 2016-05-03 Darin Adler Start on dictionary support for IDL, getting enough to work for one dictionary https://bugs.webkit.org/show_bug.cgi?id=157336 Reviewed by Alex Christensen. * bindings/js/JSDOMBinding.h: Return RefPtr instead of PassRefPtr for the return value of toArrayBufferView. Not only is this the correct modern idiom, it also works properly with auto, and PassRefPtr does not. * bindings/js/JSDOMBuild.h: Added. This has the build function template in it. It's used to build values like dictionaries. We specialize and call the tempate in generated code. This is only the initial simplistic version; will be refining for exception handling, optional handling, default value handling, and lots of other things not yet needed for this first dictionary. * bindings/scripts/CodeGenerator.pm: (ProcessDocument): Handle dictionaries much like how we handle enumerations. (SkipIncludeHeader): Moved small list of special types here from CodeGeneratorJS. (IsDictionaryType): Added. (IsRefPtrType): Make this return 0 for dictionary types. * bindings/scripts/CodeGeneratorJS.pm: (GenerateInterface): Added handling for dictionaries. (SkipIncludeHeader): Deleted. (AddIncludesForType): Call the the SkipIncludeHeader from CodeGenerator.pm directly. (GetNestedClassName): Factored out the work that was previously in GetEnumerationClassName so we could reuse it for dictionaries too. (GetEnumerationClassName): Changed to call GetNestedClassName. (GetEnumerationClassIdentifier): Deleted. Instead of using this, we now use templates so we can use the actual class name. (GenerateEnumerationImplementationContent): Changed parse and expectedEnumerationValues to use function template specialization instead of functions. This cleans up the code a bit and makes it eaiser to use from other templates. Later we may want to merge the parse function template build function template from JSDOMBuild.h. Added specialization of the build function template. (GetDictionaryClassName): Added. Calls GetNestedClassName. (GenerateDictionaryImplementationContent): Added. Generates the build function for each dictionary type. Initial simplistic version to be refined. (GenerateImplementation): Added dictionaries argument and called the GenerateDictionaryImplementationContent function. Also changed many functions to take interface arguments and also removed redundant interfaceName arguments from functions that formerly took both. (GenerateParametersCheck): Updated for changes above. That includes calling the new parse function template. Also changed to use auto and WTFMove, which makes the code both more generic and potentially more efficient and obviates the need for a special case for dictionary types. (GenerateCallbackHeader): Updated for changes above. (GenerateCallbackImplementation): Ditto. (GenerateImplementationFunctionCall): Ditto. (GetNativeTypeFromSignature): Ditto. (GetNativeType): Changed this function to take the interface because that's needed to get the type name right for enumeration types rather than returning "auto". Made that change as well. Moved one type, DOMStringList, into the nativeType hash instead of having explicit code here for it. Didn't add a dictionary type case here yet, but probably will need to do that in the next patch. (ShouldPassWrapperByReference): Pass interface in to GetNativeType. (GetNativeVectorInnerType): Removed unneeded special case for DOMString. (GetNativeTypeForCallbacks): Changed to take the interface. (GetNativeTypeForMemoization): Ditto. (JSValueToNative): Changed expression for Dictionary (the thing I am working to make obsolete) to name the type so it will work with auto. Added a case for dictionary types and updated the case for enumeration types. (NativeToJSValue): Updated to take an interface rather than an interface name, and to pass that along as needed. * bindings/scripts/IDLParser.pm: (Parse): Add dictionaries to a list. (parseDictionary): Put name, extended attributes, and members into the dictionary. (parseDictionaryMembers): Build up a members array. (parseDictionaryMember): Put isOptional, type, name, and default value into the dictionary member. * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp: * bindings/scripts/test/GObject/WebKitDOMTestObj.h: * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp: * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp: * bindings/scripts/test/JS/JSTestEventTarget.cpp: * bindings/scripts/test/JS/JSTestGlobalObject.cpp: * bindings/scripts/test/JS/JSTestInterface.cpp: * bindings/scripts/test/JS/JSTestNamedConstructor.cpp: * bindings/scripts/test/JS/JSTestNode.cpp: * bindings/scripts/test/JS/JSTestNondeterministic.cpp: * bindings/scripts/test/JS/JSTestObj.cpp: * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp: * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp: * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp: * bindings/scripts/test/JS/JSTestTypedefs.cpp: * bindings/scripts/test/ObjC/DOMTestObj.h: * bindings/scripts/test/ObjC/DOMTestObj.mm: Regenerated. * bindings/scripts/test/TestObj.idl: Added some test cases that I was using to get the bindings script to work. Right now this is basically identical to the actual use of this in Element.idl, but over time I will modify it to cover more features of dictionaries. Also fixed some incorrect test cases trying to use the type "bool", which doesn't exist in IDL. * dom/Element.cpp: (WebCore::Element::canHaveUserAgentShadowRoot): Added. The existing code used a combination of a virtual function on HTMLElement and type checking. It's better to just use a virtual function on Element. (WebCore::Element::attachShadow): Updated to take a ShadowRootInit struct instead of a Dictionary. Also tweaked the code in a couple other minor ways. * dom/Element.h: Added the ShadowRootMode enum class and the ShadowRootInit struct, and changed attachShadow to take ShadowRootInit instead of Dictionary. Also added the private canHaveUserAgentShadowRoot virtual function. * dom/Element.idl: Added ShadowRootMode, ShadowRootInit, and used them in as the arguemnt type for attachShadow. * html/HTMLElement.h: Made canHaveUserAgentShadowRoot a private override instead of a public virtual function. 2016-05-04 Eric Carlson [iOS] Playback does not pause when locking screen after playing to AirPlay. https://bugs.webkit.org/show_bug.cgi?id=157366 Reviewed by Dean Jackson. * platform/audio/PlatformMediaSession.cpp: (WebCore::PlatformMediaSession::isPlayingToWirelessPlaybackTargetChanged): Save and restore m_interruptionCount around calling sessionIsPlayingToWirelessPlaybackTargetChanged because it will call beginInterruption if we are already in the background and the counter will get out of sync. 2016-05-04 Daniel Bates CSP: Perform case sensitive match against path portion of source expression URL that ends in '/' https://bugs.webkit.org/show_bug.cgi?id=157275 Reviewed by Darin Adler. Merged from Blink: Perform a case-sensitive prefix match of the path portion a source expression that ends in '/' against the path portion of a request URL as per step 8.5.4 of section Does url match expression in origin with redirect count of the Content Security Policy Level 3 spec., (Editor's Draft, 27 April 2016). * page/csp/ContentSecurityPolicySource.cpp: (WebCore::ContentSecurityPolicySource::pathMatches): 2016-05-04 Aaron Chu AX: Nonfunctional controls appear before every HTML5 video when using VoiceOver https://bugs.webkit.org/show_bug.cgi?id=153089 Reviewed by Dean Jackson. Test: media/video-controls-show-on-kb-or-ax-event.html * Modules/mediacontrols/mediaControlsApple.js: (Controller): (Controller.prototype.createControls): (Controller.prototype.updateControls): (Controller.prototype.handlePlayButtonClicked): (Controller.prototype.setPlaying): (Controller.prototype.showShowControlsButton): (Controller.prototype.showControls): (Controller.prototype.hideControls): * Modules/mediacontrols/mediaControlsiOS.js: (ControllerIOS.prototype.addStartPlaybackControls): (ControllerIOS.prototype.handleStartPlaybackButtonTouchEnd): (ControllerIOS.prototype.showControls): Fix to make sure the showControls button in a media player behaves correctly. 2016-05-04 Dean Jackson Disabling WebGL2 should mean no context is created https://bugs.webkit.org/show_bug.cgi?id=157352 Reviewed by Eric Carlson. If WebGL2 is disabled by the runtime flag, we should not create a context. Test: fast/canvas/webgl/webgl2-runtime-flag.html * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::create): * testing/Internals.cpp: Added some helpers to toggle the runtime setting. (WebCore::Internals::webGL2Enabled): (WebCore::Internals::setWebGL2Enabled): * testing/Internals.h: * testing/Internals.idl: 2016-05-04 Anders Carlsson Add an override point for drawing named images in ThemeCocoa https://bugs.webkit.org/show_bug.cgi?id=157357 rdar://problem/25878445 Reviewed by Dean Jackson. Rename ThemeCocoa.cpp to ThemeCocoa.mm and rearrange the code that draws the wireless-playback image so we can import ThemeCocoaDrawNamedImage.mm below. * WebCore.xcodeproj/project.pbxproj: * platform/cocoa/ThemeCocoa.cpp: (WebCore::fitContextToBox): Deleted. (WebCore::ThemeCocoa::drawNamedImage): Deleted. * platform/cocoa/ThemeCocoa.mm: Renamed from Source/WebCore/platform/cocoa/ThemeCocoa.cpp. (WebCore::fitContextToBox): (WebCore::ThemeCocoa::drawNamedImage): 2016-05-04 Jeremy Jones Don't disconnect WebAVPlayerController from its delegate since there is no way to reconnect it. https://bugs.webkit.org/show_bug.cgi?id=157337 Reviewed by Jer Noble. WebAVPlayerController used to be deleted and recreated each time we begin fullscreen video mode. Since it is now preserved, we shouldn't paritally tear it down in cleanupFullscreen by disconnecting it from its delegate, especially since we have no way to reconnect it. The side effect of leaving it connected is that it can continue to make callbacks during cleanup. Of importance is that it sets the audio and legible media selctions to nil. We don't want to change the selection as a result of teardown. Nil selection is unsupported by WebVideoFullscreenModelVideoElement and causes an assert. This transition to nil selection is now ignored. * platform/ios/WebAVPlayerController.mm: (-[WebAVPlayerController setCurrentAudioMediaSelectionOption:]): (-[WebAVPlayerController setCurrentLegibleMediaSelectionOption:]): * platform/ios/WebVideoFullscreenInterfaceAVKit.mm: (WebVideoFullscreenInterfaceAVKit::cleanupFullscreen): 2016-05-04 Chris Dumez Media elements should not be paused right away when removed from the document https://bugs.webkit.org/show_bug.cgi?id=157347 Reviewed by Alex Christensen. Media elements should not be paused right away when removed from the document. Instead we should allow the task that removed the media element from the document to finish because considering pausing. This avoid inadvertently pausing media elements when the JS merely moves them on the page (e.g. using Node.replaceChild()). Text from the HTML specification: """ When a media element is removed from a Document, the user agent must run the following steps: 1. Await a stable state, allowing the task that removed the media element from the Document to continue. The synchronous section consists of all the remaining steps of this algorithm. (Steps in the synchronous section are marked with ⌛.) 2. ⌛ If the media element is in a Document, abort these steps. 3. ⌛ Run the internal pause steps for the media element. """ c.f. https://html.spec.whatwg.org/multipage/embedded-content.html#htmlmediaelement Test: media/replaceChild-should-not-pause-video.html * dom/GenericEventQueue.cpp: (WebCore::GenericEventQueue::sharedTimerFired): Copy the queue of events before processing it so that we don't fire events that get scheduled by the event handlers as a result of us firing the pending events. Otherwise, we end up firing events synchronously right after they've been queued, which is wrong. This was causing several W3C tests to fail. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::HTMLMediaElement): (WebCore::HTMLMediaElement::pauseAfterDetachedTimerFired): (WebCore::HTMLMediaElement::removedFrom): * html/HTMLMediaElement.h: After the media element gets removed from the document, schedule a 0 timer before pausing the media element, to give the task that removed us a chance to finish. When the timer fires, we check if we were added back into an active document and avoid pausing in such case. 2016-05-04 Filip Pizlo Speed up JSGlobalObject initialization by making some properties lazy https://bugs.webkit.org/show_bug.cgi?id=157045 Reviewed by Keith Miller. No new tests because no change in behavior. This adapts JSHTMLElementCustom.cpp to the new JSWithScope API. Note that this revealed that this was using a curious choice of global object, which may not be right. I decided to do a very literal refactoring that exactly preserves what this code got before, but I added a FIXME to reconsider this later. * bindings/js/JSHTMLElementCustom.cpp: (WebCore::JSHTMLElement::pushEventHandlerScope): 2016-05-04 Manuel Rego Casasnovas [css-grid] Refactor information stored related to column positions https://bugs.webkit.org/show_bug.cgi?id=157342 Reviewed by Darin Adler. In m_columnPositions we were storing position of each column including the alignment offset, always from the logical left, and the border and padding, depending on the direction. This was really confusing as in the case of RTL direction we were adding the offset from the left and the right border and padding. This patches changes it to store always the info from the left, so even in RTL direction we use the left border and padding. This allows us to simplify translateRTLCoordinate() as it doesn't need to care about border and padding anymore. And also to refactor offsetAndBreadthForPositionedChild() which became really complex after adding RTL support. No new tests, no change of behavior. * rendering/RenderGrid.cpp: (WebCore::RenderGrid::offsetAndBreadthForPositionedChild): (WebCore::RenderGrid::populateGridPositions): (WebCore::RenderGrid::translateRTLCoordinate): 2016-05-04 Mark Lam ES6 Function.name inferred from property names of literal objects can break some websites. https://bugs.webkit.org/show_bug.cgi?id=157246 Reviewed by Geoffrey Garen. Test: js/dom/regress-157246.html * bindings/js/JSDOMWindowBase.cpp: (WebCore::JSDOMWindowBase::finishCreation): - Set the needsSiteSpecificQuirks flag in the JSGlobalObject if needed. 2016-05-04 Konstantin Tokarev Deduplicated initializer lists of BitmapImage constructors. https://bugs.webkit.org/show_bug.cgi?id=157249 Reviewed by Darin Adler. No new tests needed. * platform/graphics/BitmapImage.cpp: (WebCore::BitmapImage::BitmapImage): Added new private constructor of BitmapImage for delegation purpose only. * platform/graphics/BitmapImage.h: Use inline initialization for some BitmapImage fields. * platform/graphics/cairo/BitmapImageCairo.cpp: (WebCore::BitmapImage::BitmapImage): Delegate field initialization to new private constructor. * platform/graphics/cg/BitmapImageCG.cpp: (WebCore::BitmapImage::BitmapImage): Ditto. 2016-05-04 Chris Dumez Unreviewed, rolling out r200383 and r200406. Seems to have caused crashes on iOS / ARMv7s Reverted changesets: "Speed up JSGlobalObject initialization by making some properties lazy" https://bugs.webkit.org/show_bug.cgi?id=157045 http://trac.webkit.org/changeset/200383 "REGRESSION(r200383): Setting lazily initialized properties across frame boundaries crashes" https://bugs.webkit.org/show_bug.cgi?id=157333 http://trac.webkit.org/changeset/200406 2016-05-04 Joanmarie Diggs AX: ARIA 'region' role is now a landmark; HTML 'section' element should be a landmark only if named https://bugs.webkit.org/show_bug.cgi?id=157331 Reviewed by Chris Fleizach. The 'region' role is now mapped as a landmark: The WebCore DocumentRegionRole AccessibilityRole has been renamed to LandmarkRegionRole. The AXDocumentRegion subrole has been renamed to AXLandmarkRegion. A 'section' element is mapped to the LandmarkRegionRole if it has an author-provided accessible name via either the aria-label or aria-labelledby attribute. Otherwise, it is mapped as GroupRole with no subrole. Our existing test coverage for exposure of the 'region' role and the 'section' element is sufficient. These tests were updated to reflect the new behavior. Several new test cases were added to cover both sections with accessible names and those without. * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::accessibleNameDerivesFromContent): (WebCore::AccessibilityObject::isLandmark): (WebCore::initializeRoleMap): * accessibility/AccessibilityObject.h: * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored): (WebCore::AccessibilityRenderObject::determineAccessibilityRole): * accessibility/atk/WebKitAccessibleWrapperAtk.cpp: (atkRole): * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper _accessibilityIsLandmarkRole:]): (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]): * accessibility/mac/WebAccessibilityObjectWrapperBase.mm: (-[WebAccessibilityObjectWrapperBase ariaLandmarkRoleDescription]): * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (createAccessibilityRoleMap): (-[WebAccessibilityObjectWrapper subrole]): * platform/LocalizedStrings.cpp: (WebCore::AXARIAContentGroupText): 2016-05-04 Youenn Fablet Clicks inside button elements are sometimes discarded when the mouse moves https://bugs.webkit.org/show_bug.cgi?id=39620 Reviewed by Darin Adler. Test: fast/events/click-over-descendant-elements.html * dom/Node.cpp: (WebCore::ancestor): (WebCore::commonAncestor): Method inspired from http://src.chromium.org/viewvc/blink?view=revision&revision=162081. (WebCore::commonAncestorCrossingShadowBoundary): Helper routine that handles the case of nodes into a shadow node. * dom/Node.h: * page/EventHandler.cpp: (WebCore::EventHandler::handleMouseReleaseEvent): Selecting click event target node according commonAncestorOverShadowBoundary method. (WebCore::EventHandler::targetNodeForClickEvent): Deleted. 2016-05-04 Zan Dobersek Unreviewed, fixing crashing GTK+ tests after r200407. * platform/graphics/texmap/TextureMapperGL.cpp: (WebCore::TextureMapperGLData::SharedGLData::~SharedGLData): Don't use RELEASE_ASSERT. Also fix the actual assertion, checking that any of the values in the map matches the object that's being destroyed, instead of checking the keys. 2016-05-04 Gyuyoung Kim Add WKPreference for SelectionPaintingWithoutSelectionGaps https://bugs.webkit.org/show_bug.cgi?id=156900 Reviewed by Michael Catanzaro. Unlike other browsers WebKit has been drawing selection gaps between render blocks during the text selection. This often cause text selection screen looks messy. This patch adds a setting method to disable the functionality, and EFL port disables it by default. * page/Settings.in: * rendering/RenderBlock.cpp: (WebCore::RenderBlock::shouldPaintSelectionGaps): 2016-05-04 Youenn Fablet Rename JSKeyValueIterator as JSDOMIterator https://bugs.webkit.org/show_bug.cgi?id=157308 Reviewed by Darin Adler. No change of behavior. * bindings/js/JSDOMIterator.h: Renamed from Source/WebCore/bindings/js/JSKeyValueIterator.h. (WebCore::JSDOMIteratorPrototype::create): (WebCore::JSDOMIteratorPrototype::createStructure): (WebCore::JSDOMIteratorPrototype::JSDOMIteratorPrototype): (WebCore::createKeyValueIterator): (WebCore::keyValueIteratorForEach): (WebCore::JSDOMIterator::destroy): (WebCore::JSDOMIterator::next): (WebCore::JSDOMIteratorPrototype::next): (WebCore::JSDOMIteratorPrototype::finishCreation): * bindings/js/JSFontFaceSetCustom.cpp: * bindings/scripts/CodeGeneratorJS.pm: (GenerateImplementationIterableFunctions): * bindings/scripts/test/JS/JSTestObj.cpp: 2016-05-04 Jiewen Tan CrashTracer: [USER] com.apple.WebKit.WebContent at …ple.WebCore: WebCore::EditCommandComposition::unapply + 105 https://bugs.webkit.org/show_bug.cgi?id=157282 Reviewed by Darin Adler. A frame could be destroyed in the middle of executing undo/redo command. Therefore, add an early return. * editing/CompositeEditCommand.cpp: (WebCore::EditCommandComposition::unapply): (WebCore::EditCommandComposition::reapply): 2016-05-04 Zan Dobersek [CoordGraphics] CompositingCoordinator should hande root compositing and view overlay layers separately https://bugs.webkit.org/show_bug.cgi?id=157305 Reviewed by Carlos Garcia Campos. Split out handling of the root compositing and the view overlay layers into two separate methods. Both do nothing if the passed-in layer is the same as the current one. Otherwise, the current one is removed from the tree and the new one added to it. No change in behavior is expected. * platform/graphics/texmap/coordinated/CompositingCoordinator.cpp: (WebCore::CompositingCoordinator::setRootCompositingLayer): (WebCore::CompositingCoordinator::setViewOverlayRootLayer): * platform/graphics/texmap/coordinated/CompositingCoordinator.h: 2016-05-04 Zan Dobersek [TexMap] Clean up TextureMapperGLData, TextureMapperGLData::SharedGLData https://bugs.webkit.org/show_bug.cgi?id=157303 Reviewed by Carlos Garcia Campos. Torch the TextureMapperGLData and TextureMapperGLData::SharedGLData classes into a better form. SharedGLData is now private to the TextureMapperGLData class, but lists that class as a friend. This enables moving the getShaderProgram() method to TextureMapperGLData and removes the need to expose the SharedGLData publicly. SharedGLData also doesn't have to keep a reference to the GraphicsContext3D object. TextureMapperGLData now default-initializes the publicly accessible member variables while making some other members private, not exposing anything that isn't necessary. Usual whitespace cleanup included. More elegant HashMap::ensure() insertions are used where they don't obfuscate object creation. No new tests -- no change in behavior. * platform/graphics/texmap/TextureMapperGL.cpp: (WebCore::TextureMapperGLData::SharedGLData::currentSharedGLData): (WebCore::TextureMapperGLData::SharedGLData::~SharedGLData): (WebCore::TextureMapperGLData::SharedGLData::contextDataMap): (WebCore::TextureMapperGLData::SharedGLData::SharedGLData): (WebCore::TextureMapperGLData::TextureMapperGLData): (WebCore::TextureMapperGLData::~TextureMapperGLData): (WebCore::TextureMapperGLData::initializeStencil): (WebCore::TextureMapperGLData::getStaticVBO): (WebCore::TextureMapperGLData::getShaderProgram): (WebCore::TextureMapperGL::TextureMapperGL): (WebCore::TextureMapperGL::drawBorder): (WebCore::TextureMapperGL::drawTexture): (WebCore::TextureMapperGL::drawSolidColor): (WebCore::TextureMapperGL::drawFiltered): (WebCore::TextureMapperGL::beginClip): (WebCore::TextureMapperGLData::SharedGLData::glContextDataMap): Deleted. (WebCore::TextureMapperGLData::SharedGLData::getShaderProgram): Deleted. (WebCore::TextureMapperGLData::sharedGLData): Deleted. * platform/graphics/texmap/TextureMapperGL.h: 2016-05-03 Chris Dumez Optimize [StrictTypeChecking] on IDL attributes https://bugs.webkit.org/show_bug.cgi?id=157321 Reviewed by Geoffrey Garen. Optimize [StrictTypeChecking] on IDL attributes: - Only generate extra code for nullable attributes because for non-nullable attributes, JSXXX::toWrapped() will return null in case of a bad input type. We will then throw a TypeError when null-checking it already. - After the JSValue::isNullOrUndefined() check, avoid calling JSXXX::toWrapped() and set nativeValue to nullptr directly. - Drop the check for JSValue::inherits(JSXXX::info()) and just do a null check on the value returned by JSXXX::toWrapped(). toWrapped() already does a JSValue::inherits(JSXXX::info() check. Since we only call toWrapped() if the JSValue is not null/undefined, a null return value always indicates a bad input type. * bindings/scripts/CodeGeneratorJS.pm: (GenerateImplementation): * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp: (webkit_dom_test_obj_set_strict_type_checking_attribute): * bindings/scripts/test/JS/JSTestObj.cpp: (WebCore::setJSTestObjStrictTypeCheckingAttribute): * bindings/scripts/test/ObjC/DOMTestObj.mm: (-[DOMTestObj setStrictTypeCheckingAttribute:]): * bindings/scripts/test/TestObj.idl: 2016-05-03 Chris Dumez Unreviewed, rolling out r199259 and r200161. Seems to have caused a ~1.2% PLT regression on iOS Reverted changesets: "[iOS WK2] WKWebViews should consult ancestor UIScrollViews to determine tiling area" https://bugs.webkit.org/show_bug.cgi?id=156429 http://trac.webkit.org/changeset/199259 "[iOS WK2] When determining tile size, check whether ancestor UIScrollViews are actually scrollable" https://bugs.webkit.org/show_bug.cgi?id=157107 http://trac.webkit.org/changeset/200161 2016-05-03 Filip Pizlo Speed up JSGlobalObject initialization by making some properties lazy https://bugs.webkit.org/show_bug.cgi?id=157045 Reviewed by Keith Miller. No new tests because no change in behavior. This adapts JSHTMLElementCustom.cpp to the new JSWithScope API. Note that this revealed that this was using a curious choice of global object, which may not be right. I decided to do a very literal refactoring that exactly preserves what this code got before, but I added a FIXME to reconsider this later. * bindings/js/JSHTMLElementCustom.cpp: (WebCore::JSHTMLElement::pushEventHandlerScope): 2016-05-03 Per Arne Vollan [Win] Remove Windows XP Compatibility Requirements https://bugs.webkit.org/show_bug.cgi?id=152899 Reviewed by Brent Fulgham. Windows XP is not supported anymore, we can remove compatibility workarounds. * platform/text/win/LocaleWin.cpp: (WebCore::extractLanguageCode): (WebCore::LCIDFromLocaleInternal): (WebCore::LCIDFromLocale): (WebCore::removeLastComponent): Deleted. (WebCore::ensureNameToLCIDMap): Deleted. (WebCore::convertLocaleNameToLCID): Deleted. 2016-05-02 Antti Koivisto REGRESSION (r198943): Transitions don't work if they animate display property https://bugs.webkit.org/show_bug.cgi?id=157244 Reviewed by Simon Fraser. Test: transitions/transition-display-property.html * style/RenderTreeUpdater.cpp: (WebCore::RenderTreeUpdater::updateBeforeOrAfterPseudoElement): Call the common function for ::before/::after updates. * style/StyleTreeResolver.cpp: (WebCore::Style::TreeResolver::resolveElement): (WebCore::Style::TreeResolver::createAnimatedElementUpdate): If animation forces render tree reconstruction use the original rather than animated style for update. Because animations are tied to renderers we start them during renderer construction in this case. Factor to a function. (WebCore::Style::elementImplicitVisibility): * style/StyleTreeResolver.h: 2016-05-03 Pranjal Jumde WorkerGlobalScope's self, location and navigator attributes should not be replaceable https://bugs.webkit.org/show_bug.cgi?id=157296 Reviewed by Chris Dumez. Tests: http/tests/workers/location-readonly.html http/tests/workers/navigator-readonly.html http/tests/workers/self-readonly.html * workers/WorkerGlobalScope.idl: The 'self', 'location', and 'navigator' properties of the WorkerGlobalScope must be immutable. See: https://html.spec.whatwg.org/multipage/workers.html#the-workerglobalscope-common-interface 2016-05-03 Chris Dumez Drop some unnecessary exception checking in the generated bindings https://bugs.webkit.org/show_bug.cgi?id=157299 Reviewed by Darin Adler. Drop some unnecessary exception checking in the generated bindings. Only do a check for state->hadException() after converting a JSValue to a native value when necessary. Update JSValueToNative() to indicate the caller if converting to the native value may throw an exception. This gets rid of a lot of unnecessary branching in the bindings. No new tests, no intended web-exposed behavior change. * bindings/scripts/CodeGeneratorJS.pm: (GenerateImplementation): (GenerateParametersCheck): (JSValueToNative): * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp: * bindings/scripts/test/JS/JSTestInterface.cpp: * bindings/scripts/test/JS/JSTestObj.cpp: * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp: 2016-05-03 Brady Eidson Add/refactor isolatedCopy methods for 3 IDB classes. https://bugs.webkit.org/show_bug.cgi?id=157289 Reviewed by Alex Christensen. No new tests (Refactor, no behavior change). In an upcoming, much larger patch, I'll need the ability to directly construct these three objects as isolated copies. This is a nice standalone refactor that enables that ability. * Modules/indexeddb/IDBGetResult.cpp: (WebCore::IDBGetResult::IDBGetResult): (WebCore::IDBGetResult::isolatedCopy): * Modules/indexeddb/IDBGetResult.h: * Modules/indexeddb/IDBKeyData.cpp: (WebCore::IDBKeyData::IDBKeyData): (WebCore::IDBKeyData::isolatedCopy): * Modules/indexeddb/IDBKeyData.h: * Modules/indexeddb/shared/IDBTransactionInfo.cpp: (WebCore::IDBTransactionInfo::IDBTransactionInfo): (WebCore::IDBTransactionInfo::isolatedCopy): * Modules/indexeddb/shared/IDBTransactionInfo.h: 2016-05-03 Joanmarie Diggs [ATK] accessibility/content-editable-as-textarea.html fails https://bugs.webkit.org/show_bug.cgi?id=155353 Reviewed by Darin Adler. The test was timing out because it expected an AXValueChanged notification. In ATK, AXValueChanged notifications are made for widgets which implement the AtkValue interface (sliders, progress bars, etc.). We should be listening for AXTextChanged instead. In addition, for contenteditable elements, we should emit the notification on the element itself. Because we were handling the notification in the same way as native text controls (where the notification we receive from WebCore is for StaticTextRole children), we were attempting to emit the notification from the parent of the contenteditable. Lastly, ATK's AccessibilityUIElement support had a number of unimplemented methods that are being used as part of the previously-failing test. Those methods are now implemented so that the ATK results are much more similar to those on the Mac. No new tests needed. The previously-failing test now passes. * accessibility/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::childrenChanged): * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::isNonNativeTextControl): * accessibility/AccessibilityObject.h: * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::textChanged): * accessibility/atk/AXObjectCacheAtk.cpp: (WebCore::AXObjectCache::nodeTextChangePlatformNotification): 2016-05-02 Sergio Villar Senin [css-grid] Add support for position resolution with auto-repeat tracks https://bugs.webkit.org/show_bug.cgi?id=157260 Reviewed by Darin Adler. This is a generalization of our position resolution code so it now supports every possible type of resolution (definite position, position spans, automatic resolution, named lines resolution, grid areas...) under the presence of auto-repeat tracks, i.e., tracks that are dynamically created by the LayoutGrid depending on the available space and that cannot be directly inferred from the CSS declarations. This means that we need two extra things to resolve positions: - the LayoutGrid needs to provide the number of auto-repeat tracks per axis - a wrapper is needed to hide the eventual presence of auto-repeat tracks (with their line names) from the rest of the resolution code which should remain mostly unchanged. The former is trivial (requires passing a new argument to some functions at the most) but the latter requires a new class called NamedLineCollection. This class allow us to locate and resolve named lines without having to insert the auto-repeat named lines in the already existing data structures. It does it in a very compact representation as it does not duplicate the names for every single repetition. No new tests required as there is no change in behavior because the auto-repeat tracks computation is not implemented yet. Current tests already test this code extensively, and the auto-repeat code paths will be tested later once RenderGrid::computeAutoRepeatTracksCount() is implemented. * rendering/RenderGrid.cpp: (WebCore::RenderGrid::computeAutoRepeatTracksCount): New method with empty implementation. (WebCore::RenderGrid::placeItemsOnGrid): Initialize the auto repeat tracks count. (WebCore::RenderGrid::populateExplicitGridAndOrderIterator): (WebCore::RenderGrid::offsetAndBreadthForPositionedChild): * rendering/RenderGrid.h: * rendering/style/GridPositionsResolver.cpp: (WebCore::directionFromSide): (WebCore::NamedLineCollection::NamedLineCollection): New class which is able to resolve the positions of a given named line in the presence of auto-repeat and "normal" tracks. (WebCore::NamedLineCollection::isValidNamedLineOrArea): Checks whether the given named line is a valid line name or area. (WebCore::NamedLineCollection::hasNamedLines): Checks whether the named line exists in the given axis (either specified by auto-repeat or "normal" tracks). (WebCore::NamedLineCollection::find): Looks for a line number whithin the line numbers where the given named line was found. (WebCore::NamedLineCollection::contains): (WebCore::NamedLineCollection::firstPosition): Returns the first line where the given named line is located. (WebCore::adjustGridPositionsFromStyle): Use NamedLineCollection. (WebCore::GridPositionsResolver::explicitGridColumnCount): Include auto repeat tracks. (WebCore::GridPositionsResolver::explicitGridRowCount): Ditto. (WebCore::explicitGridSizeForSide): Ditto. (WebCore::lookAheadForNamedGridLine): Use NamedLineCollection. (WebCore::lookBackForNamedGridLine): Ditto. (WebCore::resolveNamedGridLinePositionFromStyle): (WebCore::definiteGridSpanWithNamedLineSpanAgainstOpposite): (WebCore::resolveNamedGridLinePositionAgainstOppositePosition): (WebCore::resolveGridPositionAgainstOppositePosition): (WebCore::resolveGridPositionFromStyle): (WebCore::GridPositionsResolver::resolveGridPositionsFromStyle): (WebCore::gridLinesForSide): Deleted. (WebCore::GridPositionsResolver::isNonExistentNamedLineOrArea): Deleted. * rendering/style/GridPositionsResolver.h: 2016-05-03 Carlos Garcia Campos Unreviewed. Fix GObject DOM bindings API break after r200316. webkit_dom_tree_walker_set_current_node no longer raises exceptions after r200316, so mark it accordingly. * bindings/scripts/CodeGeneratorGObject.pm: (FunctionUsedToRaiseException): 2016-05-03 Carlos Garcia Campos [OpenType] OpenTypeVerticalData object should not be created if the font is not OpenType https://bugs.webkit.org/show_bug.cgi?id=157172 Reviewed by Michael Catanzaro. It's a bit weird that the object is always created and has an isOpenType() method to check whether it's an OpenType or not. The caller is always deleting the object when it's not an OpenType, so it would be better if the create method returned nullptr instead of creating the object when the font is not OpenType. * platform/graphics/FontCache.cpp: (WebCore::FontCache::verticalData): Do not use isOpenType(), we can now simply use the return value of OpenTypeVerticalData::create(). * platform/graphics/opentype/OpenTypeVerticalData.cpp: (WebCore::loadHmtxTable): Moved to a helper funtion that returns false if the font is not OpenType. (WebCore::OpenTypeVerticalData::create): Try to load the Hmtx table, and create the object if succeeded or return nullptr otherwise. (WebCore::OpenTypeVerticalData::OpenTypeVerticalData): Receive the advanceWidths as constructor parameter. (WebCore::OpenTypeVerticalData::loadMetrics): Load all other tables. * platform/graphics/opentype/OpenTypeVerticalData.h: (WebCore::OpenTypeVerticalData::isOpenType): Deleted. 2016-05-02 Darin Adler Change IDL enumerations to be nested in their C++ class instead of at WebCore namespace level https://bugs.webkit.org/show_bug.cgi?id=157257 Reviewed by Chris Dumez. Chris and Alex requested this alternate style, where the enum class for each enumeration goes inside the class for the interface the enumeration is used in. Also made a rule that keeps the names short and not redundant with the class name they are nested in. * Modules/fetch/FetchOptions.h: Moved all the enum class types into the struct. * Modules/fetch/FetchRequest.cpp: (WebCore::setReferrerPolicy): Updated. (WebCore::setMode): Ditto. (WebCore::setCredentials): Ditto. (WebCore::setCache): Ditto. (WebCore::setRedirect): Ditto. (WebCore::buildOptions): Ditto. (WebCore::buildHeaders): Ditto. (WebCore::FetchRequest::create): Ditto. * Modules/fetch/FetchRequest.h: Used "using" to repeat the types from FetchOptions here in FetchRequest. That way the generated bindings can find the types, and we don't need to do any trick like [ImplementedAs] in thd IDL to make it work. * Modules/fetch/FetchResponse.cpp: (WebCore::FetchResponse::error): Updated. (WebCore::FetchResponse::redirect): Ditto. (WebCore::FetchResponse::FetchResponse): Ditto. (WebCore::FetchResponse::startFetching): Ditto. * Modules/fetch/FetchResponse.h: Moved enum class into the class. * Modules/mediacontrols/MediaControlsHost.cpp: (WebCore::MediaControlsHost::externalDeviceType): Updated. * Modules/mediacontrols/MediaControlsHost.h: Moved enum classs into the class. * Modules/mediasession/MediaSession.cpp: (WebCore::MediaSession::MediaSession): Updated. * Modules/mediasession/MediaSession.h: Moved enum classs into the class. * Modules/mediasource/MediaSource.cpp: (WebCore::MediaSource::addSourceBuffer): Updated. (WebCore::MediaSource::removeSourceBuffer): Ditto. * Modules/mediasource/MediaSource.h: Moved enum class into the class. * Modules/mediasource/SourceBuffer.cpp: (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveRenderingError): Updated. (WebCore::SourceBuffer::appendError): Ditto. (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample): Ditto. (WebCore::SourceBuffer::textTrackModeChanged): Ditto. * Modules/mediasource/SourceBuffer.h: Removed incorrect forward declaration of EndOfStreamError that also now seems to be unneeded. Moved enum class into the class. * Modules/mediastream/MediaDeviceInfo.cpp: (WebCore::MediaDeviceInfo::MediaDeviceInfo): Updated. (WebCore::MediaDeviceInfo::create): Ditto. * Modules/mediastream/MediaDeviceInfo.h: Moved enum class into the class. * Modules/mediastream/MediaDevicesRequest.cpp: (WebCore::MediaDevicesRequest::didCompleteTrackSourceInfoRequest): Updated. * Modules/mediastream/MediaStreamTrack.cpp: (WebCore::MediaStreamTrack::readyState): Updated. * Modules/mediastream/MediaStreamTrack.h: Moved enum class into the class. * Modules/mediastream/RTCConfiguration.h: Moved enum classes into the class. * Modules/webaudio/AudioContext.h: Moved enum class into the class. * Modules/webaudio/WaveShaperNode.cpp: (WebCore::processorType): Updated. (WebCore::WaveShaperNode::oversample): Ditto. * Modules/webaudio/WaveShaperNode.h: Moved enum class into the class. * bindings/js/JSXMLHttpRequestCustom.cpp: (WebCore::JSXMLHttpRequest::response): Updated. * bindings/scripts/CodeGeneratorJS.pm: (GenerateGetOwnPropertySlotBody): Removed unneeded $interfaceName argument. (GetAttributeGetterName): Ditto. (GetAttributeSetterName): Ditto. (GetFunctionName): Tweaked style. (AttributeShouldBeOnInstanceForCompatibility): Deleted. Was a function that always returned 0. (AttributeShouldBeOnInstance): Removed the call to the function above. (IsClassNameWordBoundary): Added. Helper for function below. (IsPrefixRemovable): Ditto. (GetEnumerationClassName): Added an $interface argument and changed this so it creates a nested name inside the class rather than a top level name for use at the WebCore namespace level. (GetEnumerationClassIdentifier): Added. Calls GetEnumerationClassName and makes a flattened name without "::" that can be used in an identifier. (GenerateEnumerationImplementationContent): Renamed from GetXXX. Added an $interface argument, so it can pass that along to the functions above. (GenerateHeader): Updated to not pass $interfaceName. (GeneratePropertiesHashTable): Ditto. (GenerateOverloadedFunction): Removed unneeded $interfaceName argument. (GenerateImplementation): Updated for changes above. Tweaked formatting. (GenerateFunctionCastedThis): Removed unneeded $interfaceName argument. (GenerateParametersCheck): Ditto. Also streamlined implementation a bit and made the IsEnumType section call the new functions. (GenerateCallbackImplementation): Ditto. (JSValueToNative): Added an $interface argument and pass it along when dealing with enumerations. (GeneratePrototypeDeclaration): Removed unneeded $interfaceName argument. (GenerateConstructorDeclaration): Ditto. (GenerateConstructorDefinitions): Ditto. (GenerateConstructorDefinition): Ditto. (GenerateConstructorHelperMethods): Ditto. * bindings/scripts/test/JS/JSTestObj.cpp: Regenerated. * bindings/scripts/test/TestObj.idl: Added some new enums that test some of the logic above. * crypto/CryptoKey.cpp: (WebCore::CryptoKey::CryptoKey): Updated. (WebCore::CryptoKey::usages): Ditto. * crypto/CryptoKey.h: Moved enum class types inside the CryptoKey class. Added comments about the two similar but distinct types named CryptoKeyUsage and CryptoKey::Usage. * css/FontFace.cpp: (WebCore::FontFace::status): Updated. * css/FontFace.h: Moved enum class into the class. * css/FontFaceSet.cpp: (WebCore::FontFaceSet::status): Updated. * css/FontFaceSet.h: Moved enum class into the class. * dom/Document.cpp: (WebCore::Document::Document): Updated for the name change back from ReferrerHeaderPolicy to ReferrerPolicy. (WebCore::Document::processReferrerPolicy): Ditto. (WebCore::Document::applyContentDispositionAttachmentSandbox): Ditto. * dom/Document.h: More of the same. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::loadInternal): Updated. (WebCore::HTMLMediaElement::textTrackModeChanged): Ditto. (WebCore::HTMLMediaElement::textTrackKindChanged): Ditto. (WebCore::HTMLMediaElement::textTrackAddCues): Ditto. (WebCore::HTMLMediaElement::textTrackAddCue): Ditto. (WebCore::HTMLMediaElement::addTextTrack): Ditto. (WebCore::HTMLMediaElement::configureTextTrackGroup): Ditto. (WebCore::HTMLMediaElement::setSelectedTextTrack): Ditto. (WebCore::HTMLMediaElement::configureTextTracks): Ditto. (WebCore::HTMLMediaElement::hasClosedCaptions): Ditto. (WebCore::HTMLMediaElement::configureTextTrackDisplay): Ditto. (WebCore::HTMLMediaElement::markCaptionAndSubtitleTracksAsUnconfigured): Ditto. (WebCore::toPlatform): Ditto. (WebCore::HTMLMediaElement::outOfBandTrackSources): Ditto. * html/HTMLTrackElement.cpp: (WebCore::HTMLTrackElement::scheduleLoad): Ditto. * html/HTMLVideoElement.h: Moved enum class into class. * html/HTMLVideoElement.idl: Added the missing conditional on VideoPresentationMode, and also moved it to the bottom of the file to work around what is apparently a bug in the IDL parser. * html/canvas/CanvasRenderingContext2D.cpp: (WebCore::toWindRule): Updated. (WebCore::CanvasRenderingContext2D::fill): Ditto. (WebCore::CanvasRenderingContext2D::clip): Ditto. (WebCore::CanvasRenderingContext2D::fillInternal): Ditto. (WebCore::CanvasRenderingContext2D::clipInternal): Ditto. (WebCore::CanvasRenderingContext2D::isPointInPath): Ditto. (WebCore::CanvasRenderingContext2D::isPointInPathInternal): Ditto. (WebCore::smoothingToInterpolationQuality): Ditto. * html/canvas/CanvasRenderingContext2D.h: Moved enum class types into the class. * html/shadow/MediaControlElements.cpp: (WebCore::MediaControlClosedCaptionsTrackListElement::updateDisplay): Updated. (WebCore::MediaControlTextTrackContainerElement::updateDisplay): Ditto. * html/track/InbandTextTrack.cpp: (WebCore::InbandTextTrack::setMode): Updated. (WebCore::toPrivate): Ditto. (WebCore::InbandTextTrack::setModeInternal): Ditto. (WebCore::InbandTextTrack::updateKindFromPrivate): Ditto. * html/track/InbandTextTrack.h: Ditto. * html/track/TextTrack.cpp: (WebCore::TextTrack::TextTrack): Ditto. (WebCore::TextTrack::enabled): Ditto. (WebCore::TextTrack::kindKeyword): Ditto. (WebCore::TextTrack::setKind): Ditto. (WebCore::TextTrack::setKindKeywordIgnoringASCIICase): Ditto. (WebCore::TextTrack::setMode): Ditto. (WebCore::TextTrack::cues): Ditto. (WebCore::TextTrack::activeCues): Ditto. (WebCore::TextTrack::addCue): Ditto. (WebCore::TextTrack::regions): Ditto. (WebCore::TextTrack::isRendered): Ditto. (WebCore::TextTrack::isMainProgramContent): Ditto. (WebCore::TextTrack::containsOnlyForcedSubtitles): Ditto. * html/track/TextTrack.h: Moved enum class types into the class. * html/track/TextTrackCue.cpp: (WebCore::TextTrackCue::dispatchEvent): Updated. (WebCore::TextTrackCue::isActive): Ditto. * loader/FrameNetworkingContext.h: Ditto. * page/CaptionUserPreferences.cpp: (WebCore::CaptionUserPreferences::sortedTrackListForMenu): Ditto. (WebCore::CaptionUserPreferences::textTrackSelectionScore): Ditto. * page/CaptionUserPreferencesMediaAF.cpp: (WebCore::CaptionUserPreferencesMediaAF::textTrackSelectionScore): Ditto. (WebCore::CaptionUserPreferencesMediaAF::sortedTrackListForMenu): Ditto. * page/SecurityPolicy.cpp: (WebCore::SecurityPolicy::generateReferrerHeader): Updated since we changed ReferrerHeaderPolicy back to ReferrerPolicy. * page/SecurityPolicy.h: Ditto. * platform/ReferrerPolicy.h: Changed ReferrerHeaderPolicy name back to ReferrerPolicy now that nesting inside a class eliminated the conflict; still should merge them and that FIXME remains. * platform/cocoa/WebPlaybackSessionModelMediaElement.mm: (WebPlaybackSessionModelMediaElement::updateForEventName): Updated. (WebPlaybackSessionModelMediaElement::updateLegibleOptions): Ditto. * testing/Internals.cpp: (WebCore::toResourceRequestCachePolicy): Updated. (WebCore::Internals::setOverrideCachePolicy): Ditto. (WebCore::toResourceLoadPriority): Ditto. (WebCore::Internals::setOverrideResourceLoadPriority): Ditto. (WebCore::toAutoFillButtonType): Ditto. (WebCore::Internals::setShowAutoFillButton): Ditto. * testing/Internals.h: Moved enum class types into class. * testing/Internals.idl: Removed the "Internals" prefixes we added to resolve ambiguity before. Nesting these in the class now takes care of the ambiguity instead. * xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::responseText): Updated. (WebCore::XMLHttpRequest::didCacheResponseJSON): Ditto. (WebCore::XMLHttpRequest::responseXML): Ditto. (WebCore::XMLHttpRequest::responseBlob): Ditto. (WebCore::XMLHttpRequest::responseArrayBuffer): Ditto. (WebCore::XMLHttpRequest::setResponseType): Ditto. (WebCore::XMLHttpRequest::open): Ditto. (WebCore::shouldDecodeResponse): Ditto. * xml/XMLHttpRequest.h: Moved the enum class into the class. 2016-05-02 Simon Fraser Don't run transitions to/from 'auto' values https://bugs.webkit.org/show_bug.cgi?id=38243 rdar://problem/20904225 Reviewed by Dean Jackson. The specified behavior of transitions and animations is to not animate when either endpoint is 'auto'. Previously, we were treating 'auto' as zero and interpolating, which caused unwanted animations on fandango.com, airbnb.com and others. Fix by having blend() return the from value if progress is 0, otherwise the to value. The isZero() check can be removed, since this was effectively picking up auto value for one endpoint. Tests: transitions/lengthsize-transition-to-from-auto.html transitions/transition-to-from-auto.html * platform/Length.cpp: (WebCore::blend): 2016-05-02 Chris Dumez Indexing CSSStyleDeclaration object with out-of-range index should return undefined https://bugs.webkit.org/show_bug.cgi?id=157283 Reviewed by Darin Adler. Indexing CSSStyleDeclaration object with out-of-range index should return undefined, as per: - http://heycam.github.io/webidl/#idl-indexed-properties - http://heycam.github.io/webidl/#getownproperty-guts WebKit was incorrectly returning the empty string in this case. We however, still return the empty string if calling the indexed property getter via item(), as is expected. The new behavior matches Firefox and the Web IDL specification. Chrome returns the empty string in this case though. Test: fast/dom/indexed-getters-returning-string.html * css/CSSComputedStyleDeclaration.cpp: (WebCore::CSSComputedStyleDeclaration::item): * css/PropertySetCSSStyleDeclaration.cpp: (WebCore::PropertySetCSSStyleDeclaration::item): 2016-05-02 Antoine Quint Specifying a longhand property should not serialize to a shorthand property https://bugs.webkit.org/show_bug.cgi?id=157180 Reviewed by Dean Jackson. Ensure that we don't serialize to a shorthand property when the required longhand components are not specified, per http://www.w3.org/TR/cssom-1/#serialize-a-css-declaration-block. Test: fast/css/no-shorthand-with-incomplete-longhands.html * css/StyleProperties.cpp: (WebCore::StyleProperties::getLayeredShorthandValue): Returning an empty string here means that calling getPropertyValue() with the shorthand property matching the currently processed longhand property in asText() will return an empty string as well and the shorthand property will be disregarded. 2016-05-02 Dean Jackson REGRESSION: Page layout of Manga/Picture books and all Fixed Layout ePubs corrupted https://bugs.webkit.org/show_bug.cgi?id=157292 Reviewed by Tim Horton. The scroll state restoration fixes caused a regression in UIWebViews. Code in UIKit checks for a non-zero page scale in a history item, and r199233 changed the initialization from 0 to 1. * history/HistoryItem.h: Use 0 instead of 1 as the initial m_scale. 2016-05-02 Eric Carlson [Mac] AirPlay fails if target is set before AVPlayer has been created https://bugs.webkit.org/show_bug.cgi?id=157147 Reviewed by Dean Jackson. No new tests, it won't be possible to test this until https://bugs.webkit.org/show_bug.cgi?id=157290 has been fixed. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer): 2016-05-02 Brady Eidson Const-ify some IDB code. https://bugs.webkit.org/show_bug.cgi?id=157287 Reviewed by Alex Christensen. No new tests (Refactor only). * Modules/indexeddb/client/IDBConnectionToServerDelegate.h: * Modules/indexeddb/shared/InProcessIDBServer.cpp: (WebCore::InProcessIDBServer::deleteDatabase): (WebCore::InProcessIDBServer::openDatabase): (WebCore::InProcessIDBServer::abortTransaction): (WebCore::InProcessIDBServer::commitTransaction): (WebCore::InProcessIDBServer::didFinishHandlingVersionChangeTransaction): * Modules/indexeddb/shared/InProcessIDBServer.h: 2016-05-02 Antti Koivisto REGRESSION(r199964): Animation on pseudo elements doesn't trigger if first frame matches the current style https://bugs.webkit.org/show_bug.cgi?id=157284 Reviewed by Simon Fraser. r199964 accidentally changed the logic for computing style change for animations. Test: fast/css/animation-pseudo-style-change.html * style/RenderTreeUpdater.cpp: (WebCore::RenderTreeUpdater::updateBeforeOrAfterPseudoElement): If there is an animated style determine the style change using it rather than the originally resolved style. * style/StyleTreeResolver.cpp: (WebCore::Style::TreeResolver::resolveElement): Here too. 2016-05-02 Brady Eidson Add the ability to accumulate logs for specific logging channels to help diagnose test timeouts. https://bugs.webkit.org/show_bug.cgi?id=157274 Reviewed by Alex Christensen. * platform/Logging.cpp: (WebCore::setLogChannelToAccumulate): Set the given log channel to accumulate logging, and dirty the initializeLoggingChannelsIfNecessary flag. (WebCore::initializeLoggingChannelsIfNecessary): Change from being a one-time-only call to a one-time-for-each-time-somebody-calls-setLogChannelToAccumulate call. * platform/Logging.h: * testing/js/WebCoreTestSupport.cpp: (WebCoreTestSupport::setLogChannelToAccumulate): (WebCoreTestSupport::initializeLoggingChannelsIfNecessary): * testing/js/WebCoreTestSupport.h: 2016-05-02 Simon Fraser Sort the project file. * WebCore.xcodeproj/project.pbxproj: 2016-05-02 Simon Fraser Make Length, LengthSize and LengthPoint blending not use member functions https://bugs.webkit.org/show_bug.cgi?id=157281 Reviewed by Zalan Bujtas. Having blend() be a member function is ambiguous because it's hard to tell which are the 'from' and 'to' values. Fix Length, LengthSize and LengthPoint accordingly. No behavior change. * page/animation/CSSPropertyAnimation.cpp: (WebCore::blendFunc): * platform/Length.cpp: (WebCore::blendMixedTypes): (WebCore::blend): (WebCore::Length::blendMixedTypes): Deleted. * platform/Length.h: (WebCore::Length::blend): Deleted. * platform/LengthPoint.h: (WebCore::blend): (WebCore::LengthPoint::blend): Deleted. * platform/LengthSize.h: (WebCore::blend): (WebCore::LengthSize::blend): Deleted. * platform/graphics/filters/FilterOperation.cpp: (WebCore::BlurFilterOperation::blend): * platform/graphics/transforms/TranslateTransformOperation.cpp: (WebCore::TranslateTransformOperation::blend): * rendering/style/BasicShapes.cpp: (WebCore::BasicShapePolygon::blend): (WebCore::BasicShapeInset::blend): * rendering/style/BasicShapes.h: (WebCore::BasicShapeCenterCoordinate::blend): (WebCore::BasicShapeRadius::blend): 2016-05-02 Simon Fraser Fix shouldUpdateScrollLayerPositionSynchronously() for non-main frames. Remove updatesScrollLayerPositionOnMainThread() https://bugs.webkit.org/show_bug.cgi?id=157277 Reviewed by Dean Jackson, Tim Horton. shouldUpdateScrollLayerPositionSynchronously() gave an answer for the main frame even if called for a subframe. This could have caused scroll snapping, and isRubberBandInProgress() to give wrong answers sometimes. Fix by passing in the FrameView. I was unable to easily come up with a testcase to detect the incorrect behavior. Remove updatesScrollLayerPositionOnMainThread() which is unused by all ports. * page/FrameView.cpp: (WebCore::FrameView::isScrollSnapInProgress): (WebCore::FrameView::shouldUpdateCompositingLayersAfterScrolling): (WebCore::FrameView::isRubberBandInProgress): (WebCore::FrameView::updatesScrollLayerPositionOnMainThread): Deleted. * page/FrameView.h: * page/scrolling/ScrollingCoordinator.cpp: (WebCore::ScrollingCoordinator::updateSynchronousScrollingReasons): (WebCore::ScrollingCoordinator::shouldUpdateScrollLayerPositionSynchronously): * page/scrolling/ScrollingCoordinator.h: * page/scrolling/mac/ScrollingCoordinatorMac.mm: (WebCore::ScrollingCoordinatorMac::updateTiledScrollingIndicator): * platform/ScrollableArea.h: * platform/win/PopupMenuWin.h: * rendering/RenderLayer.cpp: (WebCore::RenderLayer::setupFontSubpixelQuantization): * rendering/RenderLayer.h: * rendering/RenderListBox.h: 2016-05-02 Simon Fraser Add to the Animations log channel output about which properties are being blended https://bugs.webkit.org/show_bug.cgi?id=157271 Reviewed by Dean Jackson. Make the Animations log channel dump information as CSS properties are being blended. Sample output: blending left from 0px to 400px at 0.57 -> 227.76px blending transform from translate(0px, 0px, 0px) to translate(400px, 0px, 0px) at 0.74 -> translate(294.97px, 0px, 0px) This makes it easier to see, for example, transitions to or from "auto" values. * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * page/animation/CSSPropertyAnimation.cpp: (WebCore::PropertyWrapperGetter::value): (WebCore::PropertyWrapperMaybeInvalidColor::value): (WebCore::CSSPropertyAnimationWrapperMap::wrapperForProperty): (WebCore::CSSPropertyAnimation::blendProperties): * platform/Length.cpp: (WebCore::operator<<): * platform/LengthBox.h: * platform/graphics/transforms/IdentityTransformOperation.h: * platform/graphics/transforms/Matrix3DTransformOperation.cpp: (WebCore::Matrix3DTransformOperation::dump): * platform/graphics/transforms/Matrix3DTransformOperation.h: * platform/graphics/transforms/MatrixTransformOperation.cpp: (WebCore::MatrixTransformOperation::dump): * platform/graphics/transforms/MatrixTransformOperation.h: * platform/graphics/transforms/PerspectiveTransformOperation.cpp: (WebCore::PerspectiveTransformOperation::dump): * platform/graphics/transforms/PerspectiveTransformOperation.h: * platform/graphics/transforms/RotateTransformOperation.cpp: (WebCore::RotateTransformOperation::dump): * platform/graphics/transforms/RotateTransformOperation.h: * platform/graphics/transforms/ScaleTransformOperation.cpp: (WebCore::ScaleTransformOperation::dump): * platform/graphics/transforms/ScaleTransformOperation.h: * platform/graphics/transforms/SkewTransformOperation.cpp: (WebCore::SkewTransformOperation::dump): * platform/graphics/transforms/SkewTransformOperation.h: * platform/graphics/transforms/TransformOperation.h: * platform/graphics/transforms/TransformOperations.cpp: (WebCore::operator<<): * platform/graphics/transforms/TransformOperations.h: * platform/graphics/transforms/TranslateTransformOperation.cpp: (WebCore::TranslateTransformOperation::dump): * platform/graphics/transforms/TranslateTransformOperation.h: * rendering/style/NinePieceImage.cpp: (WebCore::operator<<): * rendering/style/NinePieceImage.h: * svg/SVGLength.cpp: (WebCore::operator<<): * svg/SVGLength.h: 2016-05-02 Chris Dumez Modernize HTMLConstructionSite https://bugs.webkit.org/show_bug.cgi?id=157279 Reviewed by Alex Christensen. Modernize HTMLConstructionSite: Use less raw pointers, more auto, more range loops and more nullptr. * dom/ScriptElement.h: * html/parser/HTMLConstructionSite.cpp: (WebCore::setAttributes): (WebCore::shouldUseLengthLimit): (WebCore::executeReparentTask): (WebCore::HTMLConstructionSite::attachLater): (WebCore::HTMLConstructionSite::executeQueuedTasks): (WebCore::HTMLConstructionSite::HTMLConstructionSite): (WebCore::HTMLConstructionSite::takeForm): (WebCore::HTMLConstructionSite::dispatchDocumentElementAvailableIfNeeded): (WebCore::HTMLConstructionSite::insertHTMLHtmlStartTagBeforeHTML): (WebCore::HTMLConstructionSite::mergeAttributesFromTokenIntoElement): (WebCore::HTMLConstructionSite::insertHTMLHtmlStartTagInBody): (WebCore::HTMLConstructionSite::insertHTMLBodyStartTagInBody): (WebCore::HTMLConstructionSite::setDefaultCompatibilityMode): (WebCore::HTMLConstructionSite::setCompatibilityMode): (WebCore::HTMLConstructionSite::finishedParsing): (WebCore::HTMLConstructionSite::insertDoctype): (WebCore::HTMLConstructionSite::insertComment): (WebCore::HTMLConstructionSite::insertCommentOnDocument): (WebCore::HTMLConstructionSite::insertCommentOnHTMLHtmlElement): (WebCore::HTMLConstructionSite::insertHTMLHeadElement): (WebCore::HTMLConstructionSite::insertHTMLBodyElement): (WebCore::HTMLConstructionSite::insertHTMLFormElement): (WebCore::HTMLConstructionSite::insertHTMLElement): (WebCore::HTMLConstructionSite::insertHTMLElementOrFindCustomElementInterface): (WebCore::HTMLConstructionSite::insertCustomElement): (WebCore::HTMLConstructionSite::insertSelfClosingHTMLElement): (WebCore::HTMLConstructionSite::insertFormattingElement): (WebCore::HTMLConstructionSite::insertScriptElement): (WebCore::HTMLConstructionSite::insertForeignElement): (WebCore::HTMLConstructionSite::insertTextNode): (WebCore::HTMLConstructionSite::reparent): (WebCore::HTMLConstructionSite::insertAlreadyParsedChild): (WebCore::HTMLConstructionSite::takeAllChildren): (WebCore::HTMLConstructionSite::createElement): (WebCore::HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface): (WebCore::HTMLConstructionSite::createHTMLElement): (WebCore::HTMLConstructionSite::createElementFromSavedToken): (WebCore::HTMLConstructionSite::indexOfFirstUnopenFormattingElement): (WebCore::HTMLConstructionSite::reconstructTheActiveFormattingElements): (WebCore::HTMLConstructionSite::findFosterSite): (WebCore::HTMLConstructionSite::shouldFosterParent): (WebCore::HTMLConstructionSite::fosterParent): (WebCore::HTMLConstructionSite::~HTMLConstructionSite): Deleted. (WebCore::HTMLConstructionSite::setForm): Deleted. (WebCore::HTMLConstructionSite::setCompatibilityModeFromDoctype): Deleted. (WebCore::HTMLConstructionSite::ownerDocumentForCurrentNode): Deleted. (WebCore::HTMLConstructionSite::generateImpliedEndTagsWithExclusion): Deleted. * html/parser/HTMLConstructionSite.h: (WebCore::HTMLConstructionSite::inQuirksMode): (WebCore::HTMLConstructionSite::isTelephoneNumberParsingEnabled): (WebCore::HTMLConstructionSite::RedirectToFosterParentGuard::RedirectToFosterParentGuard): * html/parser/HTMLElementStack.cpp: (WebCore::HTMLNames::isRootNode): (WebCore::HTMLElementStack::ElementRecord::ElementRecord): (WebCore::HTMLElementStack::ElementRecord::replaceElement): (WebCore::HTMLElementStack::ElementRecord::isAbove): (WebCore::HTMLElementStack::popAll): (WebCore::HTMLElementStack::popUntil): (WebCore::HTMLElementStack::popUntilPopped): (WebCore::HTMLElementStack::pushRootNode): (WebCore::HTMLElementStack::pushHTMLHtmlElement): (WebCore::HTMLElementStack::pushRootNodeCommon): (WebCore::HTMLElementStack::pushHTMLHeadElement): (WebCore::HTMLElementStack::pushHTMLBodyElement): (WebCore::HTMLElementStack::push): (WebCore::HTMLElementStack::insertAbove): (WebCore::HTMLElementStack::removeHTMLHeadElement): (WebCore::HTMLElementStack::remove): (WebCore::HTMLElementStack::contains): (WebCore::inScopeCommon): (WebCore::HTMLElementStack::hasNumberedHeaderElementInScope): (WebCore::HTMLElementStack::inScope): (WebCore::HTMLElementStack::pushCommon): (WebCore::HTMLElementStack::popCommon): (WebCore::HTMLElementStack::removeNonTopCommon): (WebCore::HTMLElementStack::show): (WebCore::HTMLElementStack::hasOnlyOneElement): Deleted. (WebCore::HTMLElementStack::secondElementIsHTMLBodyElement): Deleted. (WebCore::HTMLElementStack::pop): Deleted. (WebCore::HTMLElementStack::popUntilTableScopeMarker): Deleted. (WebCore::HTMLElementStack::oneBelowTop): Deleted. * html/parser/HTMLElementStack.h: (WebCore::HTMLElementStack::ElementRecord::stackItem): (WebCore::HTMLElementStack::ElementRecord::setNext): Deleted. (WebCore::HTMLElementStack::popUntilPopped): Deleted. * html/parser/HTMLFormattingElementList.cpp: (WebCore::HTMLFormattingElementList::contains): (WebCore::HTMLFormattingElementList::swapTo): (WebCore::HTMLFormattingElementList::append): (WebCore::HTMLFormattingElementList::remove): (WebCore::HTMLFormattingElementList::tryToEnsureNoahsArkConditionQuickly): (WebCore::HTMLFormattingElementList::ensureNoahsArkCondition): * html/parser/HTMLFormattingElementList.h: (WebCore::HTMLFormattingElementList::Entry::Entry): (WebCore::HTMLFormattingElementList::Entry::replaceElement): (WebCore::HTMLFormattingElementList::Bookmark::Bookmark): (WebCore::HTMLFormattingElementList::Bookmark::moveToAfter): (WebCore::HTMLFormattingElementList::Bookmark::mark): (WebCore::HTMLFormattingElementList::first): (WebCore::HTMLFormattingElementList::Entry::isMarker): Deleted. (WebCore::HTMLFormattingElementList::Entry::stackItem): Deleted. (WebCore::HTMLFormattingElementList::Entry::operator!=): Deleted. * html/parser/HTMLTreeBuilder.cpp: (WebCore::HTMLTreeBuilder::processDoctypeToken): (WebCore::HTMLTreeBuilder::processCloseWhenNestedTag): (WebCore::HTMLTreeBuilder::processStartTagForInBody): (WebCore::HTMLTreeBuilder::insertGenericHTMLElement): (WebCore::HTMLTreeBuilder::processTemplateStartTag): (WebCore::HTMLTreeBuilder::processStartTagForInTable): (WebCore::HTMLTreeBuilder::processStartTag): (WebCore::HTMLTreeBuilder::processHtmlStartTagForInBody): (WebCore::HTMLTreeBuilder::processAnyOtherEndTagForInBody): (WebCore::HTMLTreeBuilder::callTheAdoptionAgency): (WebCore::HTMLTreeBuilder::processEndTagForInBody): (WebCore::HTMLTreeBuilder::processComment): (WebCore::HTMLTreeBuilder::defaultForBeforeHTML): (WebCore::HTMLTreeBuilder::processStartTagForInHead): (WebCore::HTMLTreeBuilder::processGenericRCDATAStartTag): (WebCore::HTMLTreeBuilder::processGenericRawTextStartTag): (WebCore::HTMLTreeBuilder::processScriptStartTag): (WebCore::HTMLTreeBuilder::processTokenInForeignContent): 2016-05-02 Per Arne Vollan Remove unneeded casts once we upgrade to a version of Visual Studio that is not broken https://bugs.webkit.org/show_bug.cgi?id=121235 Reviewed by Darin Adler. * css/MediaQueryEvaluator.cpp: (WebCore::createFunctionMap): * dom/make_names.pl: (printWrapperFactoryCppFile): * loader/archive/ArchiveFactory.cpp: (WebCore::archiveMIMETypes): * rendering/svg/SVGPathData.cpp: (WebCore::updatePathFromGraphicsElement): 2016-05-02 Anders Carlsson Fix build. * platform/mac/WebPlaybackControlsManager.h: 2016-05-02 Sam Weinig DataDetector underline color should be based on the text color https://bugs.webkit.org/show_bug.cgi?id=157272 Fixes: DataDetectors links should use the default text color for their parent nodes DataDetectors links underline color update Reviewed by Tim Horton. * editing/cocoa/DataDetection.mm: (WebCore::DataDetection::detectContentInRange): When using light links, use the color of the parent element as the text color, and that same color with 20% alpha as the underline color. 2016-05-01 Ryosuke Niwa document.currentScript must be null when we're executing a script inside a shadow tree https://bugs.webkit.org/show_bug.cgi?id=157245 Reviewed by Darin Adler. Fix the bug by not setting currentScript as spec'ed in HTML5 specification: https://html.spec.whatwg.org/multipage/dom.html#dom-document-currentscript https://html.spec.whatwg.org/multipage/scripting.html#execute-the-script-block as of 3dc763829ca1598427b588cf08830c1e2af5a05c New behavior matches that of Google Chrome Canary. Test: fast/shadow-dom/Document-prototype-currentScript.html * dom/CurrentScriptIncrementer.h: (WebCore::CurrentScriptIncrementer::CurrentScriptIncrementer): (WebCore::CurrentScriptIncrementer::~CurrentScriptIncrementer): * dom/ScriptElement.cpp: (WebCore::ScriptElement::executeScript): 2016-04-29 Alex Christensen Do not reuse cache entries with conditional headers https://bugs.webkit.org/show_bug.cgi?id=157205 rdar://problem/25856933 Reviewed by Chris Dumez. Test: http/tests/xmlhttprequest/if-modified-since-0.html * loader/cache/CachedRawResource.cpp: (WebCore::CachedRawResource::canReuse): CachedResourceLoader::determineRevalidationPolicy asserts that the request is not conditional, which means that it does not have any headers like If-Modified-Since. They are usually different, because we put the timestamp in the If-Modified-Since header, so it fails the canReuse test because time has passed since the last If-Modified-Since header was sent. When a user sets the If-Modified-Since manually to something that is constant, we reuse cache entries when we should not. * platform/network/mac/WebCoreResourceHandleAsDelegate.mm: (-[WebCoreResourceHandleAsDelegate connection:didReceiveResponse:]): Set the source so we can use it in Internals. 2016-05-02 Yoav Weiss Speculatively fix the cmake build https://bugs.webkit.org/show_bug.cgi?id=157262 Reviewed by Darin Adler. This patch adds WEB_TIMING build flag guards around calls to DOMWindow()->performance(), in order to make sure builds that have WEB_TIMING disabled (e.g. cmake on Mac) continue to build. No new tests as there's no functional change. * loader/cache/CachedResourceLoader.cpp: (WebCore::CachedResourceLoader::loadDone): 2016-05-02 Daniel Bates CSP: Add workaround for XtraMath https://bugs.webkit.org/show_bug.cgi?id=157252 Reviewed by Andy Estes. * platform/RuntimeApplicationChecks.h: * platform/RuntimeApplicationChecks.mm: (WebCore::IOSApplication::isXtraMath): Added. 2016-05-02 Daniel Bates DatabaseTracker::closeAllDatabases calls Database::close from the wrong thread https://bugs.webkit.org/show_bug.cgi?id=147672 Reviewed by Brady Eidson. Schedule a DatabaseCloseTask when Database::close() is called from a thread other than the database thread as the database thread is responsible for interacting with the database. Currently -[WebDatabaseManager startBackgroundTask] and WebProcess::processWillSuspendImminently() call DatabaseTracker::closeAllDatabases() indirectly and directly, respectively, from a thread other than the database thread. In a debug build, this causes an assertion failure in Database::close(). In a release/production build, this starts a race between the calling thread and the database thread that can lead to a crash. It is the responsibility of the database thread to manage the database. We should ensure that calling Database::close() delegates the responsibility of actually closing the database to the database thread to avoid interfering with the database thread or the need to synchronize access to data structures used by the database thread. * Modules/webdatabase/Database.cpp: (WebCore::Database::interrupt): Added. Turns around and calls SQLiteDatabase::interrupt(). (WebCore::Database::close): Added. Schedules a DatabaseCloseTask to close the database and wait for it to complete if we have not already scheduled closing the database. (WebCore::Database::performClose): Renamed; formerly named close. (WebCore::Database::markAsDeletedAndClose): Extracted logic to schedule a DatabaseCloseTask from here to Database::close() and modified this function to call Database::close(). * Modules/webdatabase/Database.h: * Modules/webdatabase/DatabaseTask.cpp: (WebCore::DatabaseCloseTask::doPerformTask): Call Database::performClose() instead of Database::close() as the latter has been repurposed to schedule closing the database. * Modules/webdatabase/DatabaseThread.cpp: (WebCore::DatabaseThread::databaseThread): Ditto. * Modules/webdatabase/DatabaseTracker.cpp: (WebCore::DatabaseTracker::closeAllDatabases): Added argument currentQueryBehavior (defaults to CurrentQueryBehavior::RunToCompletion - close every database after completion of the current database query, if any). * Modules/webdatabase/DatabaseTracker.h: * platform/sql/SQLiteDatabase.cpp: (WebCore::SQLiteDatabase::interrupt): Added. This is safe to call regardless of the state of the database and thread safe by . * platform/sql/SQLiteDatabase.h: 2016-05-02 Yoav Weiss Move ResourceTiming behind a runtime flag https://bugs.webkit.org/show_bug.cgi?id=157133 Reviewed by Alex Christensen. Move the ResourceTiming API from being behind a build time flag to be behind an off-by-default runtime flag, that can be turned on using internals. Tests: fast/dom/Window/window-properties-performance-resource-timing.html http/tests/performance/performance-resource-timing-entries.html * DerivedSources.make: Added idl files for PerformanceEntry, PerformanceEntryList and PerformanceResourceTiming. * WebCore.xcodeproj/project.pbxproj: Added the various Performance* files to the project. * bindings/generic/RuntimeEnabledFeatures.cpp: Added ResourceTiming as a runtime flag. (WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures): * bindings/generic/RuntimeEnabledFeatures.h: Added ResourceTiming as a runtime flag. (WebCore::RuntimeEnabledFeatures::setResourceTimingEnabled): (WebCore::RuntimeEnabledFeatures::resourceTimingEnabled): * bindings/js/JSPerformanceEntryCustom.cpp: Removed #if for ResourceTiming, and replaced PERFORMANCE_TIMELINE for WEB_TIMING. Added build flag around UserTiming related h files. (WebCore::toJS): Deleted. * dom/EventNames.h: Renamed webkitresourcetimingbufferfull to resourcetimingbufferfull. * loader/DocumentThreadableLoader.cpp: Replace #if for ResourceTiming with runtime flag. (WebCore::DocumentThreadableLoader::loadRequest): * loader/ResourceLoadNotifier.cpp: Replace #if for ResourceTiming with runtime flag. (WebCore::ResourceLoadNotifier::dispatchWillSendRequest): * loader/cache/CachedResourceLoader.cpp: Replace #if for ResourceTiming with runtime flag. (WebCore::CachedResourceLoader::revalidateResource): (WebCore::CachedResourceLoader::loadResource): (WebCore::CachedResourceLoader::storeResourceTimingInitiatorInformation): (WebCore::CachedResourceLoader::loadDone): * loader/cache/CachedResourceLoader.h: Remove #if for ResourceTiming. * page/Performance.cpp: Remove #if for ResourceTiming. (WebCore::Performance::Performance): Removed #if for ResourceTiming related initialization. (WebCore::Performance::webkitGetEntries): Renamed to getEntries. (WebCore::Performance::webkitGetEntriesByType): Renamed to getEntriesByType. (WebCore::Performance::webkitGetEntriesByName): Renamed to getEntriesByName. * page/Performance.h: Remove #if for ResourceTiming. * page/Performance.idl: Replace #if for ResourceTiming with runtime flag. * page/PerformanceEntry.cpp: Remove the PERFORMANCE_TIMELINE build flag. * page/PerformanceEntry.h: Remove the PERFORMANCE_TIMELINE build flag. * page/PerformanceEntry.idl: Replace the PERFORMANCE_TIMELINE build flag with runtime flag. * page/PerformanceEntryList.cpp: Remove the PERFORMANCE_TIMELINE build flag. * page/PerformanceEntryList.h: Remove the PERFORMANCE_TIMELINE build flag. * page/PerformanceEntryList.idl: Replace the PERFORMANCE_TIMELINE build flag with runtime flag. * page/PerformanceResourceTiming.cpp: Remove the RESOURCE_TIMING build flag. * page/PerformanceResourceTiming.h: Remove the RESOURCE_TIMING build flag. * page/PerformanceResourceTiming.idl: Replace the RESOURCE_TIMING build flag with runtime flag. * testing/Internals.cpp: Add a method that enables ResourceTiming. (WebCore::Internals::setResourceTimingSupport): * testing/Internals.h: Add a method that enables ResourceTiming. * testing/Internals.idl: Add a method that enables ResourceTiming. 2016-05-01 Nan Wang AX: Crash at WebCore::AccessibilityObject::getAttribute const + 9 https://bugs.webkit.org/show_bug.cgi?id=157256 Reviewed by Chris Fleizach. When the