2018-02-28 Zalan Bujtas Remove RenderElement::s_affectsParentBlock https://bugs.webkit.org/show_bug.cgi?id=183187 Reviewed by Antti Koivisto. Remove the hack to track floating/out-of-flow changes between styleWillChange and styleDidChange. Covered by existing tests. * rendering/RenderElement.cpp: (WebCore::RenderElement::styleWillChange): (WebCore::RenderElement::styleDidChange): * rendering/RenderElement.h: 2018-02-28 Antti Koivisto Filter attribute selectors with selector filter https://bugs.webkit.org/show_bug.cgi?id=183200 Reviewed by Zalan Bujtas. Currently selector filtering is done based on tags, classes and ids. We should include attributes too. This patch adds filtering based on attribute name (but not content). * css/SelectorFilter.cpp: (WebCore::isExcludedAttribute): Ignore id, class and style attributes. First two are already handled and the last is common but is rarely used in selectors. (WebCore::collectElementIdentifierHashes): Collect attributes. Remove the unnecessary StyledElement casting. (WebCore::collectSimpleSelectorHash): Collect attribute selectors. (WebCore::chooseSelectorHashesForFilter): Pick attributes with high priority for the filter as it is likely a good signal. 2018-02-27 Sergio Villar Senin [WebVR] Convert VRPlatformDisplayInfo into a class https://bugs.webkit.org/show_bug.cgi?id=183162 Reviewed by Žan Doberšek. In preparation for further changes we're transforming the VRPlatformDisplayInfo into a class. All the members are now private and the class provides the needed getters/setters. Apart from that VRDisplayCapabilityFlags is now just an unsigned and the different flags are defined in VRDisplayCapabilityFlag enum. Another cleanup was the removal of VRDisplayCapabilities.cpp as everything can be implemented in the header. * Modules/webvr/VRDisplay.cpp: (WebCore::VRDisplay::VRDisplay): (WebCore::VRDisplay::isConnected const): (WebCore::VRDisplay::stageParameters const): * Modules/webvr/VRDisplayCapabilities.cpp: Removed. * Modules/webvr/VRDisplayCapabilities.h: (WebCore::VRDisplayCapabilities::hasPosition const): (WebCore::VRDisplayCapabilities::hasOrientation const): (WebCore::VRDisplayCapabilities::hasExternalDisplay const): (WebCore::VRDisplayCapabilities::canPresent const): (WebCore::VRDisplayCapabilities::maxLayer const): (WebCore::VRDisplayCapabilities::VRDisplayCapabilities): * Sources.txt: * platform/vr/VRPlatformDisplay.h: (WebCore::VRPlatformDisplayInfo::displayName const): (WebCore::VRPlatformDisplayInfo::setDisplayName): (WebCore::VRPlatformDisplayInfo::isConnected const): (WebCore::VRPlatformDisplayInfo::setIsConnected): (WebCore::VRPlatformDisplayInfo::isMounted const): (WebCore::VRPlatformDisplayInfo::setIsMounted): (WebCore::VRPlatformDisplayInfo::capabilityFlags const): (WebCore::VRPlatformDisplayInfo::setCapabilityFlags): (WebCore::VRPlatformDisplayInfo::displayIdentifier const): (WebCore::VRPlatformDisplayInfo::setDisplayIdentifier): (WebCore::VRPlatformDisplayInfo::eyeTranslation const): (WebCore::VRPlatformDisplayInfo::setEyeTranslation): (WebCore::VRPlatformDisplayInfo::eyeFieldOfView const): (WebCore::VRPlatformDisplayInfo::setEyeFieldOfView): (WebCore::VRPlatformDisplayInfo::renderSize const): (WebCore::VRPlatformDisplayInfo::setRenderSize): (WebCore::VRPlatformDisplayInfo::setPlayAreaBounds): (WebCore::VRPlatformDisplayInfo::playAreaBounds const): (WebCore::VRPlatformDisplayInfo::setSittingToStandingTransform): (WebCore::VRPlatformDisplayInfo::sittingToStandingTransform const): * platform/vr/openvr/VRPlatformDisplayOpenVR.cpp: (WebCore::VRPlatformDisplayOpenVR::VRPlatformDisplayOpenVR): (WebCore::VRPlatformDisplayOpenVR::updateEyeParameters): (WebCore::VRPlatformDisplayOpenVR::updateStageParameters): 2018-02-27 Commit Queue Unreviewed, rolling out r229060. https://bugs.webkit.org/show_bug.cgi?id=183198 This patch causes crashes on two SVG tests (Requested by fredw on #webkit). Reverted changeset: "Relayout frames after AsyncFrameScrolling or FrameFlattening option is changed" https://bugs.webkit.org/show_bug.cgi?id=183081 https://trac.webkit.org/changeset/229060 2018-02-27 Youenn Fablet Do not trigger a service worker match in case of document redirection if it will be already served by AppCache https://bugs.webkit.org/show_bug.cgi?id=183185 Reviewed by Chris Dumez. Disabling service worker matching in case there is a substitute data. Otherwise there is a risk for a double load, substitute data first and the new load triggered if matching a new registration. A future fix should first do service worker registration matching and if there is no registration query appcache. Test: http/tests/appcache/main-resource-redirect-with-sw.html * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::redirectReceived): 2018-02-27 Tim Horton Ensure target triple is propagated correctly to DerivedSources.make https://bugs.webkit.org/show_bug.cgi?id=183189 Reviewed by Dan Bernstein. If we don't propagate the target triple, we can sometimes build with the wrong options enabled. * Configurations/Base.xcconfig: Mentioning LLVM_TARGET_TRIPLE_SUFFIX here is required to get it to be available to scripts. * DerivedSources.make: Propagate the target triple into our compiler invocations. 2018-02-27 Doug Russell AX: Spell check and style attributes should be optional when fetching attributed string https://bugs.webkit.org/show_bug.cgi?id=160744 Reviewed by Chris Fleizach. The overhead of fetching a spell checked attributed string via AX API is substantial. In some cases on the order of 7/8 of the total time spent fetching the string. This change introduces the new attribute AXAttributedStringForTextMarkerRangeWithOptions which accepts an NSDictionary as it's parameter with keys "AXTextMarkerRange" (AXTextMarkerRangeRef) and "AXSpellCheck" (NSNumber(BOOL)). AXAttributedStringForTextMarkerRange will remain unchanged. Tests: accessibility/mac/attributed-string/attributed-string-for-range-with-options.html accessibility/mac/attributed-string/attributed-string-for-range.html * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (AXAttributedStringAppendText): (-[WebAccessibilityObjectWrapper doAXAttributedStringForTextMarkerRange:spellCheck:]): (-[WebAccessibilityObjectWrapper accessibilityParameterizedAttributeNames]): (-[WebAccessibilityObjectWrapper doAXAttributedStringForRange:]): (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]): (-[WebAccessibilityObjectWrapper doAXAttributedStringForTextMarkerRange:]): Deleted. 2018-02-27 Daniel Bates Standardize terminology for marked text https://bugs.webkit.org/show_bug.cgi?id=180999 Reviewed by Zalan Bujtas. The name MarkerSubrange is a misnomer for a data structure that associates a text subrange with a type and optional document marker. In particular, a MarkerSubrange may not always correspond to a document marker. For instance, selected text is represented using a MarkerSubrange that does not have a corresponding document marker. Let's standardize on the phrase "marked text" as the canonical way to describe these tagged text subranges. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::localSelectionRect const): (WebCore::InlineTextBox::MarkedTextStyle::areBackgroundMarkedTextStylesEqual): (WebCore::InlineTextBox::MarkedTextStyle::areForegroundMarkedTextStylesEqual): (WebCore::InlineTextBox::MarkedTextStyle::areDecorationMarkedTextStylesEqual): (WebCore::InlineTextBox::StyledMarkedText::StyledMarkedText): (WebCore::createMarkedTextFromSelectionInBox): (WebCore::InlineTextBox::paint): (WebCore::InlineTextBox::paintPlatformDocumentMarkers): (WebCore::InlineTextBox::paintPlatformDocumentMarker): (WebCore::InlineTextBox::computeStyleForUnmarkedMarkedText const): (WebCore::InlineTextBox::resolveStyleForMarkedText): (WebCore::InlineTextBox::subdivideAndResolveStyle): (WebCore::InlineTextBox::coalesceAdjacentMarkedTexts): (WebCore::InlineTextBox::collectMarkedTextsForDraggedContent): (WebCore::InlineTextBox::collectMarkedTextsForDocumentMarkers): (WebCore::InlineTextBox::paintMarkedTexts): (WebCore::InlineTextBox::paintMarkedTextBackground): (WebCore::InlineTextBox::paintMarkedTextForeground): (WebCore::InlineTextBox::paintMarkedTextDecoration): (WebCore::InlineTextBox::paintCompositionBackground): (WebCore::InlineTextBox::MarkerSubrangeStyle::areBackgroundMarkerSubrangeStylesEqual): Deleted. (WebCore::InlineTextBox::MarkerSubrangeStyle::areForegroundMarkerSubrangeStylesEqual): Deleted. (WebCore::InlineTextBox::MarkerSubrangeStyle::areDecorationMarkerSubrangeStylesEqual): Deleted. (WebCore::InlineTextBox::StyledMarkerSubrange::StyledMarkerSubrange): Deleted. (WebCore::createMarkerSubrangeFromSelectionInBox): Deleted. (WebCore::InlineTextBox::computeStyleForUnmarkedMarkerSubrange const): Deleted. (WebCore::InlineTextBox::resolveStyleForSubrange): Deleted. (WebCore::InlineTextBox::coalesceAdjacentSubranges): Deleted. (WebCore::InlineTextBox::collectSubrangesForDraggedContent): Deleted. (WebCore::InlineTextBox::collectSubrangesForDocumentMarkers): Deleted. (WebCore::InlineTextBox::paintMarkerSubranges): Deleted. (WebCore::InlineTextBox::paintTextSubrangeBackground): Deleted. (WebCore::InlineTextBox::paintTextSubrangeForeground): Deleted. (WebCore::InlineTextBox::paintTextSubrangeDecoration): Deleted. * rendering/InlineTextBox.h: (WebCore::InlineTextBox::paintMarkedTexts): (WebCore::InlineTextBox::paintMarkerSubranges): Deleted. * rendering/MarkedText.cpp: Renamed from Source/WebCore/rendering/MarkerSubrange.cpp. (WebCore::subdivide): * rendering/MarkedText.h: Renamed from Source/WebCore/rendering/MarkerSubrange.h. (WebCore::MarkedText::MarkedText): (WebCore::MarkedText::isEmpty const): (WebCore::MarkedText::operator!= const): (WebCore::MarkedText::operator== const): 2018-02-27 Chris Dumez Unreviewed, roll out r228430. Roll out r228430 now that it is no longer needed after r228852. No new tests, initial fix is still covered by WebKit.RespondToPolicyForNavigationResponseAsynchronously API test. * loader/FrameLoader.cpp: (WebCore::FrameLoader::stopLoading): * loader/NavigationScheduler.cpp: (WebCore::NavigationScheduler::schedule): 2018-02-27 Antoine Quint [Web Animations] Correct implementation of pending tasks and promises https://bugs.webkit.org/show_bug.cgi?id=183161 Reviewed by Dean Jackson. We had an incorrect implementation of the spec due to two misinterpretations. The first one is about pending tasks (play and pause) which the spec says should be performed by "scheduling a task". In WebCore, this means using postTask() on a ScriptExecutionContext, such as Document. One of the big practical changes is that calling play() on an animation correctly sets its startTime to null (unresolved) immediately after the call to play() returns before setting it to a resolved value when the task is performed asynchronously. As a result, the playState is now always accurate. The second one is about promises where new promises need to be created in certain situations called out by the spec. We used to call clear() on them, but this merely resets the fulfillment or rejection state of the promise, while the spec requires a different object to be returned for the promise. We now create our promises using makeUniqueRef<> when new promise objects are expected to be created. This patch also corrects a few smaller bugs and spec compliant issues, called out below, related to pending tasks and promises uncovered while looking at relevant WPT tests. * animation/DocumentTimeline.h: Expose the Document used to create this timeline such that it may be used by WebAnimation objects registered for this timeline when scheduling a task is required via postTask(). * animation/WebAnimation.cpp: (WebCore::WebAnimation::WebAnimation): (WebCore::WebAnimation::setBindingsStartTime): (WebCore::WebAnimation::setCurrentTime): (WebCore::WebAnimation::cancel): Ensure the finished promise has not already been fulfilled before rejecting it. While the spec does not specifically call this out, a promise may not be rejected after being fulfilled, and we would hit an ASSERT if we didn't also check that it was in the correct pending state before attemping to reject it. (WebCore::WebAnimation::resetPendingTasks): (WebCore::WebAnimation::finish): (WebCore::WebAnimation::updateFinishedState): (WebCore::WebAnimation::finishNotificationSteps): (WebCore::WebAnimation::play): We used to only check for a pending pause task before canceling that task, but the spec says to check for either a pending pause or play task (ie. pending()) and to cancel whichever is scheduled. (WebCore::WebAnimation::runPendingPlayTask): We were missing an assertion called out by the spec when running a pending task. (WebCore::WebAnimation::pause): (WebCore::WebAnimation::runPendingPauseTask): (WebCore::WebAnimation::updatePendingTasks): We now use postTask() on the animation's associated timeline's document to schedule pending tasks for which the criteria to run are met, ie. there is an associated timeline. * animation/WebAnimation.h: 2018-02-27 Wenson Hsieh [Extra zoom mode] Implement additional SPI for adjusting viewport shrink-to-fit behavior https://bugs.webkit.org/show_bug.cgi?id=183100 Reviewed by Tim Horton. Introduce new customization options to ViewportConfiguration. The first is m_forceHorizontalShrinkToFit, which (when set to true) forces the viewport to scale using shrink-to-fit heuristics, regardless of whether "shrink-to-fit=no" is specified via viewport parameters or if content width did not exceed minimum layout size. The second is m_viewSize, which reflects the true size of the viewport. See WebKit ChangeLog for more details. Tests: ViewportSizingTests.ForceShrinkToFitViewportOverridesViewportParameters ViewportSizingTests.ShrinkToFitViewportWithMinimumAllowedLayoutWidth * page/ViewportConfiguration.cpp: (WebCore::ViewportConfiguration::ViewportConfiguration): (WebCore::ViewportConfiguration::setMinimumLayoutSize): Plumb the real size of the view alongside the minimum layout size when updating the minimum layout size. (WebCore::ViewportConfiguration::setForceHorizontalShrinkToFit): (WebCore::ViewportConfiguration::shouldIgnoreHorizontalScalingConstraints const): Bail early and return true if forceHorizontalShrinkToFit is set. This forces shrink-to-fit even in cases where "shrink-to-fit" is set to "no", or content dimensions don't exceed layout dimensions. (WebCore::ViewportConfiguration::initialScaleFromSize const): Use view dimensions rather than minimum layout dimensions when computing the initial scale. Minimum layout size is no longer always equal to the size of the view if the client has specified a minimum allowed layout width. As such, when computing the initial scale, to ensure that the content (which was laid out using the minimum layout size) fits within the real viewport, we need to divide real viewport dimensions by content dimensions. (WebCore::ViewportConfiguration::minimumScale const): Similarly, use view size instead of minimum layout size to compute minimum scale. (WebCore::ViewportConfiguration::description const): * page/ViewportConfiguration.h: 2018-02-27 Wenson Hsieh Unreviewed, fix the debug build after r228877. In the case where CAN_DISALLOW_USER_INSTALLED_FONTS is enabled, this function doesn't return anything when allowUserInstalledFonts != AllowUserInstalledFonts::No. Fix the build by moving `return nullptr;` back out of the `#else`. * platform/graphics/cocoa/FontCacheCoreText.cpp: (WebCore::installedFontMandatoryAttributes): 2018-02-27 Milan Crha Potential privacy issue: DNS prefetching can be re-enabled https://bugs.webkit.org/show_bug.cgi?id=182924 Reviewed by Michael Catanzaro. * dom/Document.cpp: (WebCore::Document::parseDNSPrefetchControlHeader): 2018-02-26 Antoine Quint [Web Animations] Implement the procedure to set the target effect of an animation https://bugs.webkit.org/show_bug.cgi?id=183146 Reviewed by Dean Jackson. We only had a partial implementation of setEffect() and we now update it to cover the entire implementation as mandated by the spec. While this doesn't yield any WPT results changes, this patch will help getting a significant number of new PASS results when we get around to implement correct support for async procedures (pending pause/play tasks and promises) in the next patch. * animation/WebAnimation.cpp: (WebCore::WebAnimation::setEffect): 2018-02-26 Antoine Quint [Web Animations] Update the playState implementation https://bugs.webkit.org/show_bug.cgi?id=183145 Reviewed by Dean Jackson. The Web Animations spec has changed since we first implemented the playState property and the "pending" enum value has been dropped since then (there is a separate "pending" property which we also implement). We update our implementation to match the latest spec text. This does not change WPT test results a lot, but this patch will help getting a significant number of new PASS results when we get around to implementing correct support for async procedures (pending pause/play tasks and promises) in a couple of patches. * animation/WebAnimation.cpp: (WebCore::WebAnimation::playState const): * animation/WebAnimation.h: * animation/WebAnimation.idl: 2018-02-27 Wenson Hsieh Address post-review comment after r229049. https://bugs.webkit.org/show_bug.cgi?id=183142 Reviewed by Tim Horton. Wrap a newly added string literal with ASCIILiteral. * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::extraDefaultStyleSheet): 2018-02-26 Mark Lam Modernize FINALIZE_CODE and peer macros to use __VA_ARGS__ arguments. https://bugs.webkit.org/show_bug.cgi?id=183159 Reviewed by Keith Miller. No new tests needed because this is just a refactoring patch. * cssjit/SelectorCompiler.cpp: (WebCore::SelectorCompiler::SelectorCodeGenerator::compile): 2018-02-26 Dan Bernstein Removed references to files that were removed in r228912. * WebCore.xcodeproj/project.pbxproj: Removed references to SourcesIOS.txt and SourcesMac.txt. 2018-02-26 Wenson Hsieh [Extra zoom mode] Tweak UA stylesheet to improve legibility of rendered text https://bugs.webkit.org/show_bug.cgi?id=183142 Reviewed by Tim Horton. Force text-size-adjust and hyphens to be always on in EXTRA_ZOOM_MODE. To accomplish this, we override the extra style sheet in RenderTheme to include these two style rules. * rendering/RenderThemeIOS.h: * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::extraDefaultStyleSheet): 2018-02-26 Don Olmstead Fix WebCore includes within WebKitLegacy https://bugs.webkit.org/show_bug.cgi?id=183147 Reviewed by Tim Horton. No new tests. No change in behavior. * PlatformWin.cmake: * platform/win/GDIUtilities.h: 2018-02-26 Youenn Fablet Add some more release logging related to DocumentWriter::addData crash https://bugs.webkit.org/show_bug.cgi?id=183141 Reviewed by Chris Dumez. No change of behavior. Add some additional release logging to verify whether DocumentWriter::begin was called and exited before updating its state. * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::commitData): * loader/DocumentWriter.cpp: (WebCore::DocumentWriter::begin): * loader/DocumentWriter.h: 2018-02-26 Antoine Quint [Web Animations] Implement the procedure to set the start time https://bugs.webkit.org/show_bug.cgi?id=183137 Reviewed by Dean Jackson. Implement the procedure to set the start time as setBindingsStartTime() and use the setStartTime() method as an internal method to set the m_startTime instance variable and invalidate the timing model rather than run the entire procedure which should only be called when setting the "startTime" property through the JS API. * animation/WebAnimation.cpp: (WebCore::WebAnimation::setTimeline): (WebCore::WebAnimation::setBindingsStartTime): (WebCore::WebAnimation::setStartTime): (WebCore::WebAnimation::silentlySetCurrentTime): (WebCore::WebAnimation::finish): (WebCore::WebAnimation::updateFinishedState): (WebCore::WebAnimation::runPendingPlayTask): (WebCore::WebAnimation::runPendingPauseTask): 2018-02-26 Christopher Reid [Curl] Cookies are not being added to the Cookie field in Request Headers https://bugs.webkit.org/show_bug.cgi?id=183095 Reviewed by Alex Christensen. Populating the Cookie request header field now that cookies are no longer handled in libcurl. * platform/network/curl/CookieJarCurlDatabase.cpp: Renaming the httpOnly variable as its actual use wasn't clear * platform/network/curl/ResourceHandleCurl.cpp: 2018-02-26 Antoine Quint [Web Animations] Ensure setting the hold time invalidates the timing model https://bugs.webkit.org/show_bug.cgi?id=183136 Reviewed by Dean Jackson. We used to always set the m_holdTime member variable directly, but the computation of the currentTime depends on the value of m_holdTime, so setting the hold time should invalidate the timing model as well as setting the m_holdTime member variable. In this patch we add a new setHoldTime() private method that sets the member variable and invalidates the timing model. * animation/WebAnimation.cpp: (WebCore::WebAnimation::setTimeline): (WebCore::WebAnimation::setHoldTime): (WebCore::WebAnimation::silentlySetCurrentTime): (WebCore::WebAnimation::setCurrentTime): (WebCore::WebAnimation::cancel): (WebCore::WebAnimation::finish): (WebCore::WebAnimation::updateFinishedState): (WebCore::WebAnimation::play): (WebCore::WebAnimation::runPendingPlayTask): (WebCore::WebAnimation::pause): (WebCore::WebAnimation::runPendingPauseTask): * animation/WebAnimation.h: 2018-02-26 Youenn Fablet MessagePort is not always destroyed in the right thread https://bugs.webkit.org/show_bug.cgi?id=183053 Reviewed by Chris Dumez. Make existingMessagePortForIdentifier take a lambda so that we hold the lock until there is no longer a need to keep the MessagePort around. This is very time sensitive and does not happen a lot when running WPT tests. Update existing call sites to pass a lambda. * dom/MessagePort.cpp: (WebCore::MessagePort::existingMessagePortForIdentifier): * dom/MessagePort.h: * dom/messageports/MessagePortChannelProviderImpl.cpp: (WebCore::MessagePortChannelProviderImpl::postMessageToRemote): (WebCore::MessagePortChannelProviderImpl::checkProcessLocalPortForActivity): 2018-02-26 Commit Queue Unreviewed, rolling out r226745. https://bugs.webkit.org/show_bug.cgi?id=183132 This is breaking some websites (Requested by youenn on #webkit). Reverted changeset: "Use no-cache fetch mode when loading main documents with location.reload()" https://bugs.webkit.org/show_bug.cgi?id=181285 https://trac.webkit.org/changeset/226745 2018-02-26 Philippe Normand Unreviewed, USE_GSTREAMER_PLAYBIN3 build fix. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h: There is no such ENABLE_GSTREAMER_PLAYBIN3. 2018-02-26 Philippe Normand Unreviewed, manual rollout of r228866 causing EGL_BAD_CONTEXT errors * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: (WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext): Create an EGL display, even in Wayland. 2018-02-21 Sergio Villar Senin [WebVR][OpenVR] Retrieve displayId and the z-depth of eye view frustum https://bugs.webkit.org/show_bug.cgi?id=182999 Reviewed by Žan Doberšek. Retrieve the z-depth of the eye view frustum and the HMD unique id. The unique identifier is generated by the VRPlatormManager whereas we use the default values from the spec for the z-depth (those can be changed by applications later via JavaScript). Once this lands the only remaining data to be retrieved from VR backends for VRDisplay is the pose (getPose() call) and the frame data (getFrameData() call). * Modules/webvr/VRDisplay.cpp: (WebCore::VRDisplay::VRDisplay): (WebCore::VRDisplay::displayId const): Deleted. (WebCore::VRDisplay::displayName const): Deleted. (WebCore::VRDisplay::depthNear const): Deleted. (WebCore::VRDisplay::setDepthNear): Deleted. (WebCore::VRDisplay::depthFar const): Deleted. (WebCore::VRDisplay::setDepthFar): Deleted. * Modules/webvr/VRDisplay.h: (WebCore::VRDisplay::displayId const): Moved implementation from source file. (WebCore::VRDisplay::displayName const): Ditto. (WebCore::VRDisplay::depthNear const): (WebCore::VRDisplay::setDepthNear): (WebCore::VRDisplay::depthFar const): (WebCore::VRDisplay::setDepthFar): * platform/vr/VRManager.cpp: (WebCore::VRManager::generateUniqueDisplayIdentifier): * platform/vr/VRManager.h: * platform/vr/VRPlatformDisplay.h: * platform/vr/openvr/VRPlatformDisplayOpenVR.cpp: (WebCore::VRPlatformDisplayOpenVR::VRPlatformDisplayOpenVR): 2018-02-26 Charlie Turner Fix build error with !LOG_DISABLED https://bugs.webkit.org/show_bug.cgi?id=183049 Reviewed by Philippe Normand. The following error message was being reported when doing a release build with -DLOG_DISABLED=0: ../../Source/WebCore/dom/messageports/MessagePortChannel.cpp: In member function ‘void WebCore::MessagePortChannel::entanglePortWithProcess(const WebCore::MessagePortIdentifier&, WebCore::ProcessIdentifier)’: ../../Source/WebCore/dom/messageports/MessagePortChannel.cpp:85:111: error: ‘logString’ was not declared in this scope LOG(MessagePorts, "MessagePortChannel %s (%p) entangling port %s (that port has %zu messages available)", logString().utf8().data(), this, port.logString().utf8().data(), m_pendingMessages[i].size()); Other uses of logString are guarded by !LOG_DISABLED rather than NDEBUG, which was the cause of this issue. * dom/messageports/MessagePortChannel.h: Guard using !LOG_DISABLED rather than NDEBUG. 2018-02-26 Carlos Garcia Campos [GStreamer] User current executable name instead of g_get_prgname() for gst_init https://bugs.webkit.org/show_bug.cgi?id=183119 Reviewed by Philippe Normand. g_get_prgname() is only set for programs using GOptionContext, calling gtk_init or explicitly calling g_set_prgname(). Use WTF::getCurrentExecutableName() instead. * platform/graphics/gstreamer/GStreamerUtilities.cpp: (WebCore::initializeGStreamer): 2018-02-25 Wenson Hsieh [Extra zoom mode] Disable downloadable binary fonts by default https://bugs.webkit.org/show_bug.cgi?id=183102 Reviewed by Tim Horton. Disable downloadable binary fonts by default in extra zoom mode by making the initial value of `downloadableBinaryFontsEnabled` conditional. Layout tests are not possible at this time; test to be added once layout test support is in place. * page/Settings.yaml: * page/SettingsBase.cpp: (WebCore::SettingsBase::defaultDownloadableBinaryFontsEnabled): * page/SettingsBase.h: 2018-02-25 Chris Dumez Service workers do not work well inside Web.app https://bugs.webkit.org/show_bug.cgi?id=183105 Reviewed by Youenn Fablet. SessionID::defaultSessionID() was hardcoded in the ServiceWorkerThread constructor instead of using the sessionID of the SWServer that created the service worker thread. As a result, when the Service Worker would establish a SWClientConnection to the server, it would use the wrong sessionID and would end up using a different SWServer (Since we have a different SWServer instance per sessionID). As a result, ServiceWorkerRegistration / ServiceWorker objects inside the service worker would not be kept in sync with the server (since they registered themselves with the wrong SWServer). Covered by new API test. * workers/service/ServiceWorkerContextData.cpp: (WebCore::ServiceWorkerContextData::isolatedCopy const): * workers/service/ServiceWorkerContextData.h: (WebCore::ServiceWorkerContextData::encode const): (WebCore::ServiceWorkerContextData::decode): * workers/service/context/ServiceWorkerThread.cpp: (WebCore::ServiceWorkerThread::ServiceWorkerThread): * workers/service/context/ServiceWorkerThreadProxy.cpp: (WebCore::createPageForServiceWorker): (WebCore::ServiceWorkerThreadProxy::ServiceWorkerThreadProxy): * workers/service/server/RegistrationDatabase.cpp: (WebCore::RegistrationDatabase::importRecords): * workers/service/server/RegistrationStore.h: (WebCore::RegistrationStore::server): * workers/service/server/SWServer.cpp: (WebCore::SWServer::updateWorker): * workers/service/server/SWServerWorker.cpp: (WebCore::SWServerWorker::contextData const): 2018-02-24 Fujii Hironori Null-dereference of the second argument `resource` of DocumentLoader::scheduleSubstituteResourceLoad https://bugs.webkit.org/show_bug.cgi?id=182920 Reviewed by Darin Adler. A test case imported/w3c/web-platform-tests/html/browsers/offline/appcache/workers/appcache-worker.html always crashes due to a null-dereference if compiled and optimized by GCC 7.2. The second argument `resource` of DocumentLoader::scheduleSubstituteResourceLoad can be null if the resource can't be found in cache. I guess GCC optimizes inline HashMap::add based on assuming the `resource` never becomes null because its type is SubstituteResource&. This changes introduces a new method DocumentLoader::scheduleCannotShowURLError because it looks tricky to pass a nullptr to the second argument of scheduleSubstituteResourceLoad. No new tests (Covered by existing tests). * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::scheduleCannotShowURLError): Added a new method. * loader/DocumentLoader.h: * loader/appcache/ApplicationCacheHost.cpp: (WebCore::ApplicationCacheHost::maybeLoadResource): Call scheduleCannotShowURLError if the resource not found in the appcache. 2018-02-17 Darin Adler Prepare for ExtendedColor changes (first step) https://bugs.webkit.org/show_bug.cgi?id=182904 Reviewed by Sam Weinig. * css/CSSValuePool.cpp: (WebCore::CSSValuePool::createColorValue): Use HashMap::ensure. (WebCore::CSSValuePool::createFontFamilyValue): Ditto. (WebCore::CSSValuePool::createFontFaceValue): Ditto. * css/parser/CSSParserFastPaths.cpp: (WebCore::CSSParserFastPaths::maybeParseValue): Tightened up the logic a bit. * html/canvas/CanvasRenderingContext2D.cpp: Removed many unneeded includes. * inspector/InspectorCanvas.cpp: (WebCore::InspectorCanvas::recordAction): Updated for Ref instead of RefPtr and to use move semantics. (WebCore::buildArrayForAffineTransform): Return Ref instead of RefPtr. (WebCore::buildArrayForVector): Ditto. (WebCore::InspectorCanvas::buildInitialState): Ditto. Also use auto more. (WebCore::InspectorCanvas::buildAction): Ditto. (WebCore::InspectorCanvas::buildArrayForCanvasGradient): Ditto. (WebCore::InspectorCanvas::buildArrayForCanvasPattern): Ditto. (WebCore::InspectorCanvas::buildArrayForImageData): Ditto. * inspector/InspectorCanvas.h: Updated for the above. Also us "using" instead of typedef and removed unneeded ErrorString typedef and some includes. * page/DragController.cpp: (WebCore::DragController::concludeEditDrag): Use auto and Ref. * platform/DragData.h: Used pragma once and reorganized includes a bit. * platform/graphics/ImageFrame.h: (WebCore::ImageFrame::frameBytes const): Use uint32_t instead of RGBA32 to prepare for removal of the RGBA32 type coming in a future patch. * platform/graphics/ImageSource.cpp: (WebCore::ImageSource::cacheNativeImageAtIndex): Ditto. (WebCore::ImageSource::canUseAsyncDecoding): Ditto. * platform/graphics/cocoa/GraphicsContextCocoa.mm: Tweaked #if for Mac-only code to use PLATFORM(MAC) to be easier to read. (WebCore::GraphicsContext::focusRingColor): Use sRGBColorSpaceRef instead of calling CGColorSpaceCreateWithName each time. * platform/graphics/texmap/TextureMapperFPSCounter.cpp: Added include needed now that it was removed from some header. * platform/graphics/win/GraphicsContextPlatformPrivateDirect2D.h: Use uint32_t instead of RGBA32 to prepare for removal of the RGBA32 type coming in a future patch. * platform/image-decoders/ScalableImageDecoder.cpp: (WebCore::ScalableImageDecoder::frameBytesAtIndex const): Ditto. * platform/image-decoders/cairo/ImageBackingStoreCairo.cpp: (WebCore::ImageBackingStore::image const): Ditto. * platform/image-decoders/gif/GIFImageDecoder.cpp: (WebCore::GIFImageDecoder::haveDecodedRow): Ditto. * platform/image-decoders/jpeg/JPEGImageDecoder.cpp: (WebCore::setPixel): Ditto. (WebCore::JPEGImageDecoder::outputScanlines): Ditto. * platform/image-decoders/png/PNGImageDecoder.cpp: (WebCore::PNGImageDecoder::rowAvailable): Ditto. (WebCore::PNGImageDecoder::frameComplete): Ditto. * platform/image-decoders/webp/WEBPImageDecoder.cpp: (WebCore::WEBPImageDecoder::decodeFrame): Ditto. (WebCore::WEBPImageDecoder::applyPostProcessing): Ditto. * platform/mac/PlatformPasteboardMac.mm: (WebCore::PlatformPasteboard::color): Added comments. * rendering/EllipsisBox.cpp: (WebCore::EllipsisBox::paintSelection): Use Color::isVisible. 2018-02-23 Chris Dumez Crash under SchemeRegistry::shouldTreatURLSchemeAsLocal(WTF::String const&) https://bugs.webkit.org/show_bug.cgi?id=183066 Reviewed by Ryosuke Niwa. SecurityOrigin objects are constructed on various threads. However, someone added a shouldTreatAsPotentiallyTrustworthy() call to the SecurityOrigin constructor which was not thread safe. This is because this function relies on SchemeRegistry::shouldTreatURLSchemeAsSecure() and SchemeRegistry::shouldTreatURLSchemeAsLocal() which were relying on global static HashMaps without locks. Update SecurityOrigin to initialize m_isPotentiallyTrustworthy lazily, to avoid paying initialization cost in the constructor. This is only queries by SecurityContext::isSecureContext(). Make SchemeRegistry::shouldTreatURLSchemeAsLocal() and SchemeRegistry::shouldTreatURLSchemeAsSecure() thread-safe, since they are needed to initialize SecurityOrigin::m_isPotentiallyTrustworthy from various threads. SchemeRegistry::shouldTreatURLSchemeAsSecure() is only called from SecurityOrigin (which requires thread-safety), and getUserMedia() which is not hot code so the extra locking there should not be an issue. SchemeRegistry::shouldTreatURLSchemeAsLocal() is called from SecurityOrigin (which requires thread- safety). It is also called from isQuickLookPreviewURL(), MHTMLArchive::create(), Page::userStyleSheetLocationChanged(), isRemoteWebArchive() and HTMLPlugInImageElement. All these are not hot code so I do not think we need a fast path. * page/SecurityOrigin.cpp: (WebCore::isLoopbackIPAddress): (WebCore::shouldTreatAsPotentiallyTrustworthy): (WebCore::SecurityOrigin::isPotentiallyTrustworthy const): (WebCore::SecurityOrigin::isLocalHostOrLoopbackIPAddress): * page/SecurityOrigin.h: * platform/SchemeRegistry.cpp: (WebCore::localURLSchemesLock): (WebCore::localURLSchemes): (WebCore::secureSchemesLock): (WebCore::secureSchemes): (WebCore::SchemeRegistry::registerURLSchemeAsLocal): (WebCore::SchemeRegistry::removeURLSchemeRegisteredAsLocal): (WebCore::SchemeRegistry::shouldTreatURLSchemeAsLocal): (WebCore::SchemeRegistry::registerURLSchemeAsSecure): (WebCore::SchemeRegistry::shouldTreatURLSchemeAsSecure): * platform/SchemeRegistry.h: 2018-02-23 Christopher Reid [Curl] Cookie Database files are wrongfully getting deleted when the database is opened https://bugs.webkit.org/show_bug.cgi?id=183051 Reviewed by Per Arne Vollan. The file stat logic was backwards causing a wrongful detection of database corruption. Fixed the logic and abstracted these calls to use FileSystem. * platform/network/curl/CookieJarDB.cpp: 2018-02-23 Zalan Bujtas [RenderTreeBuilder] Make RenderTreeBuilder::* classes WTF_MAKE_FAST_ALLOCATED https://bugs.webkit.org/show_bug.cgi?id=183084 Reviewed by Antti Koivisto. * rendering/updating/RenderTreeBuilderBlock.h: * rendering/updating/RenderTreeBuilderBlockFlow.h: * rendering/updating/RenderTreeBuilderContinuation.h: * rendering/updating/RenderTreeBuilderFirstLetter.h: * rendering/updating/RenderTreeBuilderFormControls.h: * rendering/updating/RenderTreeBuilderFullScreen.h: * rendering/updating/RenderTreeBuilderInline.h: * rendering/updating/RenderTreeBuilderList.h: * rendering/updating/RenderTreeBuilderMathML.h: * rendering/updating/RenderTreeBuilderMultiColumn.h: * rendering/updating/RenderTreeBuilderRuby.h: * rendering/updating/RenderTreeBuilderSVG.h: * rendering/updating/RenderTreeBuilderTable.h: * rendering/updating/RenderTreeUpdaterGeneratedContent.h: 2018-02-23 Zalan Bujtas [RenderTreeBuilder] Move RenderFullScreen::createPlaceholder to RenderTreeBuilder https://bugs.webkit.org/show_bug.cgi?id=183027 Reviewed by Antti Koivisto. No change in functionality. * dom/Document.cpp: (WebCore::Document::setFullScreenRenderer): * dom/Document.h: * rendering/RenderFullScreen.cpp: (WebCore::RenderFullScreenPlaceholder::RenderFullScreenPlaceholder): (WebCore::RenderFullScreenPlaceholder::isRenderFullScreenPlaceholder const): (WebCore::RenderFullScreen::wrapNewRenderer): (WebCore::RenderFullScreen::wrapExistingRenderer): (): Deleted. (WebCore::RenderFullScreen::createPlaceholder): Deleted. * rendering/RenderFullScreen.h: * rendering/updating/RenderTreeBuilder.cpp: (WebCore::RenderTreeBuilder::createPlaceholderForFullScreen): * rendering/updating/RenderTreeBuilder.h: * rendering/updating/RenderTreeBuilderFullScreen.cpp: (WebCore::RenderTreeBuilder::FullScreen::createPlaceholder): * rendering/updating/RenderTreeBuilderFullScreen.h: 2018-02-23 Zalan Bujtas [RenderTreeBuilder] Add WARN_UNUSED_RETURN to detach() https://bugs.webkit.org/show_bug.cgi?id=183073 Reviewed by Antti Koivisto. So that we don't destroy a renderer accidentally. * rendering/updating/RenderTreeBuilderBlock.h: * rendering/updating/RenderTreeBuilderRuby.h: * rendering/updating/RenderTreeBuilderSVG.h: 2018-02-22 Antoine Quint REGRESSION (r228445): A big pause button shows over YouTube videos if you tap "Tap To Unmute" on iOS https://bugs.webkit.org/show_bug.cgi?id=183074 Reviewed by Eric Carlson. Test: media/modern-media-controls/start-support/start-support-disable-controls-and-re-enable-post-play.html In the fix for webkit.org/b/182668, we made it so that when the "controls" attribute is absent from a media element we stop listening to the bulk of media events and prevent controls from updating any DOM properties so as to minimize the amount of CPU usage by the Web process. An unfortunate side effect was that, if the media controls were disabled at the time the video starts playing, the StartSupport class would thus not catch the "play" event and would not be able to set the "hasPlayed" property to "true" on the MediaController, which would then prevent the _shouldShowStartButton() from returning "false". As a result, if the "controls" attribute was turned back on after the media started playing, they would default to showing the start button, which would be then in the play state, ie. showing the pause icon. We now set the "hasPlayed" property in the "play" event handler on MediaController, which is always registered regardless of the "controls" attribute setting. We also ensure we invalidate the "showStartButton" property on the media controls when StartSupport is enabled, which is the case when the "controls" attribute is toggled back to "true" from a previous "false" value. * Modules/modern-media-controls/media/media-controller.js: (MediaController.prototype.handleEvent): * Modules/modern-media-controls/media/start-support.js: (StartSupport): (StartSupport.prototype.enable): (StartSupport.prototype.handleEvent): (StartSupport.prototype._updateShowsStartButton): 2018-02-23 Carlos Garcia Campos [GStreamer][MiniBrowser] Honor GStreamer command line parameters in MiniBrowser https://bugs.webkit.org/show_bug.cgi?id=173655 Reviewed by Philippe Normand. Do not assume gst is only used in the WebProcess, the MIMETypeRegistry also uses gst to get the list of supported media types. Move the code to extract gst options from the process command line to a helper function and use it in the UI process to pass the options to the WebProcess, but also in the current process when gst is initialized without providing options. Fixes several unit tests that use MIMETypeRegistry in the UI process. * platform/graphics/gstreamer/GStreamerUtilities.cpp: (WebCore::extractGStreamerOptionsFromCommandLine): Helper to get the gst options from the current process command line. (WebCore::initializeGStreamer): Ensure this is called once. Get the gst options from the given vector or extract it from the command line if not provided. * platform/graphics/gstreamer/GStreamerUtilities.h: * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: (WebCore::MediaPlayerPrivateGStreamerBase::initializeGStreamerAndRegisterWebKitElements): Bring back the gst initialization here. 2018-02-23 Philippe Normand [GStreamer] HTTP totalBytes query returns 0 after seeking (sometimes) https://bugs.webkit.org/show_bug.cgi?id=183002 Reviewed by Xabier Rodriguez-Calvar. * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp: (webkit_web_src_init): Initialize member variables. Also no need to set the appsrc size at that point. (webKitWebSrcStop): There is no need to reset the size when seeking. Size should in most cases represent the Content-Length response attribute, even when seeking. (webKitWebSrcStart): No need to reset the size attribute. (webKitWebSrcQueryWithParent): Let appsrc handle DURATION queries. (CachedResourceStreamingClient::responseReceived): Emit duration notification one time only. 2018-02-23 Philippe Normand [GStreamer] media/video-src-blob-using-open-panel.html crashes in Debug https://bugs.webkit.org/show_bug.cgi?id=183005 Reviewed by Xabier Rodriguez-Calvar. Test: media/video-src-blob-using-open-panel.html * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::convertToInternalProtocol): Also convert blob URIs because they're handled by our httpsrc element. * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp: (webKitWebSrcGetProtocols): Prefix blob URIs too, for consistency purpose. 2018-02-22 Yusuke Suzuki Remove currentTime() / currentTimeMS() https://bugs.webkit.org/show_bug.cgi?id=183052 Reviewed by Mark Lam. * Modules/geolocation/Geolocation.cpp: (WebCore::Geolocation::haveSuitableCachedPosition): * dom/DOMTimeStamp.h: (WebCore::convertSecondsToDOMTimeStamp): * fileapi/File.cpp: (WebCore::File::File): (WebCore::File::lastModified const): * history/HistoryItem.cpp: (WebCore::generateSequenceNumber): * html/BaseDateAndTimeInputType.cpp: (WebCore::BaseDateAndTimeInputType::defaultValueForStepUp const): * html/DateTimeInputType.cpp: (WebCore::DateTimeInputType::defaultValueForStepUp const): * html/MonthInputType.cpp: (WebCore::MonthInputType::defaultValueForStepUp const): * html/TimeInputType.cpp: (WebCore::TimeInputType::defaultValueForStepUp const): * inspector/agents/InspectorNetworkAgent.cpp: (WebCore::InspectorNetworkAgent::willSendRequest): (WebCore::InspectorNetworkAgent::willSendWebSocketHandshakeRequest): * loader/EmptyFrameLoaderClient.h: * loader/FormSubmission.cpp: (WebCore::generateFormDataIdentifier): * loader/FrameLoader.cpp: (WebCore::FrameLoader::clientRedirected): * loader/FrameLoader.h: * loader/FrameLoaderClient.h: * loader/NavigationScheduler.cpp: * page/History.cpp: (WebCore::History::stateObjectAdded): * page/History.h: * page/PageOverlay.cpp: (WebCore::PageOverlay::startFadeAnimation): (WebCore::PageOverlay::fadeAnimationTimerFired): * page/PageOverlay.h: * platform/graphics/cg/GraphicsContextCG.cpp: (WebCore::GraphicsContext::drawNativeImage): * platform/ios/LegacyTileLayerPool.h: * platform/ios/LegacyTileLayerPool.mm: (WebCore::LegacyTileLayerPool::LegacyTileLayerPool): (WebCore::LegacyTileLayerPool::addLayer): (WebCore::LegacyTileLayerPool::decayedCapacity const): (WebCore::LegacyTileLayerPool::prune): * platform/ios/SystemMemoryIOS.cpp: (WebCore::systemMemoryLevel): * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp: * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm: 2018-02-22 Per Arne Vollan The WebContent process should not use NSScreen in the screenDepth implementation. https://bugs.webkit.org/show_bug.cgi?id=183048 Reviewed by Brent Fulgham. NSScreen method calls should be done in the UIProcess, since these calls will communicate with the WindowServer. The screen depth property can be retrieved in the UIProcess, and sent to the WebContent process, where it is cached. Whenever screen properties change, the UIProcess will send the new screen properties to the WebProcess. No new tests, covered by existing tests. * platform/ScreenProperties.h: (WebCore::ScreenProperties::encode const): (WebCore::ScreenProperties::decode): * platform/mac/PlatformScreenMac.mm: (WebCore::getScreenProperties): (WebCore::screenDepth): (WebCore::screenDepthPerComponent): (WebCore::screenRect): (WebCore::screenAvailableRect): 2018-02-22 Zalan Bujtas [RenderTreeBuilder] Rename insertChild() -> attach(), takeChild() -> detach() and removeAndDestroy() -> destroy() https://bugs.webkit.org/show_bug.cgi?id=183061 Reviewed by Ryosuke Niwa. ...and moveChildTo() -> move() (moveChildrenTo() -> moveChildren()), removeFromParentAndDestroyCleaningUpAnonymousWrappers() -> destroyAndCleanUpAnonymousWrappers() No change in functionality. * dom/Document.cpp: (WebCore::Document::destroyRenderTree): (WebCore::Document::setFullScreenRenderer): * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::styleDidChange): * rendering/RenderButton.cpp: (WebCore::RenderButton::setText): * rendering/RenderElement.cpp: (WebCore::RenderElement::didAttachChild): (WebCore::RenderElement::didInsertChild): Deleted. * rendering/RenderElement.h: * rendering/RenderFullScreen.cpp: (WebCore::RenderFullScreen::wrapNewRenderer): (WebCore::RenderFullScreen::wrapExistingRenderer): (WebCore::RenderFullScreen::unwrapRenderer): (WebCore::RenderFullScreen::createPlaceholder): * rendering/RenderMenuList.cpp: (RenderMenuList::didAttachChild): (RenderMenuList::setText): (RenderMenuList::didInsertChild): Deleted. * rendering/RenderMenuList.h: * rendering/RenderQuote.cpp: (WebCore::RenderQuote::updateTextRenderer): * rendering/RenderTextFragment.cpp: (WebCore::RenderTextFragment::setText): * rendering/updating/RenderTreeBuilder.cpp: (WebCore::RenderTreeBuilder::destroy): (WebCore::RenderTreeBuilder::attach): (WebCore::RenderTreeBuilder::attachIgnoringContinuation): (WebCore::RenderTreeBuilder::detach): (WebCore::RenderTreeBuilder::attachToRenderElement): (WebCore::RenderTreeBuilder::attachToRenderElementInternal): (WebCore::RenderTreeBuilder::move): (WebCore::RenderTreeBuilder::moveAllChildren): (WebCore::RenderTreeBuilder::moveChildren): (WebCore::RenderTreeBuilder::moveAllChildrenIncludingFloats): (WebCore::RenderTreeBuilder::makeChildrenNonInline): (WebCore::RenderTreeBuilder::splitAnonymousBoxesAroundChild): (WebCore::RenderTreeBuilder::childFlowStateChangesAndAffectsParentBlock): (WebCore::RenderTreeBuilder::destroyAndCleanUpAnonymousWrappers): (WebCore::RenderTreeBuilder::detachFromRenderGrid): (WebCore::RenderTreeBuilder::detachFromRenderElement): (WebCore::RenderTreeBuilder::attachToRenderGrid): (WebCore::RenderTreeBuilder::removeAndDestroy): Deleted. (WebCore::RenderTreeBuilder::insertChild): Deleted. (WebCore::RenderTreeBuilder::insertChildIgnoringContinuation): Deleted. (WebCore::RenderTreeBuilder::takeChild): Deleted. (WebCore::RenderTreeBuilder::insertChildToRenderElement): Deleted. (WebCore::RenderTreeBuilder::insertChildToRenderElementInternal): Deleted. (WebCore::RenderTreeBuilder::moveChildTo): Deleted. (WebCore::RenderTreeBuilder::moveAllChildrenTo): Deleted. (WebCore::RenderTreeBuilder::moveChildrenTo): Deleted. (WebCore::RenderTreeBuilder::moveAllChildrenIncludingFloatsTo): Deleted. (WebCore::RenderTreeBuilder::removeFromParentAndDestroyCleaningUpAnonymousWrappers): Deleted. (WebCore::RenderTreeBuilder::takeChildFromRenderGrid): Deleted. (WebCore::RenderTreeBuilder::takeChildFromRenderElement): Deleted. (WebCore::RenderTreeBuilder::insertChildToRenderGrid): Deleted. * rendering/updating/RenderTreeBuilder.h: * rendering/updating/RenderTreeBuilderBlock.cpp: (WebCore::RenderTreeBuilder::Block::attach): (WebCore::RenderTreeBuilder::Block::insertChildToContinuation): (WebCore::RenderTreeBuilder::Block::attachIgnoringContinuation): (WebCore::RenderTreeBuilder::Block::removeLeftoverAnonymousBlock): (WebCore::RenderTreeBuilder::Block::detach): (WebCore::RenderTreeBuilder::Block::dropAnonymousBoxChild): (WebCore::RenderTreeBuilder::Block::insertChild): Deleted. (WebCore::RenderTreeBuilder::Block::insertChildIgnoringContinuation): Deleted. (WebCore::RenderTreeBuilder::Block::takeChild): Deleted. * rendering/updating/RenderTreeBuilderBlock.h: * rendering/updating/RenderTreeBuilderBlockFlow.cpp: (WebCore::RenderTreeBuilder::BlockFlow::attach): (WebCore::RenderTreeBuilder::BlockFlow::moveAllChildrenIncludingFloats): (WebCore::RenderTreeBuilder::BlockFlow::insertChild): Deleted. (WebCore::RenderTreeBuilder::BlockFlow::moveAllChildrenIncludingFloatsTo): Deleted. * rendering/updating/RenderTreeBuilderBlockFlow.h: * rendering/updating/RenderTreeBuilderContinuation.cpp: (WebCore::RenderTreeBuilder::Continuation::cleanupOnDestroy): * rendering/updating/RenderTreeBuilderFirstLetter.cpp: (WebCore::RenderTreeBuilder::FirstLetter::cleanupOnDestroy): (WebCore::RenderTreeBuilder::FirstLetter::updateStyle): (WebCore::RenderTreeBuilder::FirstLetter::createRenderers): * rendering/updating/RenderTreeBuilderFormControls.cpp: (WebCore::RenderTreeBuilder::FormControls::attach): (WebCore::RenderTreeBuilder::FormControls::detach): (WebCore::RenderTreeBuilder::FormControls::findOrCreateParentForChild): (WebCore::RenderTreeBuilder::FormControls::insertChild): Deleted. (WebCore::RenderTreeBuilder::FormControls::takeChild): Deleted. * rendering/updating/RenderTreeBuilderFormControls.h: * rendering/updating/RenderTreeBuilderFullScreen.cpp: (WebCore::RenderTreeBuilder::FullScreen::cleanupOnDestroy): * rendering/updating/RenderTreeBuilderInline.cpp: (WebCore::RenderTreeBuilder::Inline::attach): (WebCore::RenderTreeBuilder::Inline::insertChildToContinuation): (WebCore::RenderTreeBuilder::Inline::attachIgnoringContinuation): (WebCore::RenderTreeBuilder::Inline::splitFlow): (WebCore::RenderTreeBuilder::Inline::splitInlines): (WebCore::RenderTreeBuilder::Inline::childBecameNonInline): (WebCore::RenderTreeBuilder::Inline::insertChild): Deleted. (WebCore::RenderTreeBuilder::Inline::insertChildIgnoringContinuation): Deleted. * rendering/updating/RenderTreeBuilderInline.h: * rendering/updating/RenderTreeBuilderList.cpp: (WebCore::RenderTreeBuilder::List::updateItemMarker): * rendering/updating/RenderTreeBuilderMathML.cpp: (WebCore::RenderTreeBuilder::MathML::makeFences): (WebCore::RenderTreeBuilder::MathML::attach): (WebCore::RenderTreeBuilder::MathML::insertChild): Deleted. * rendering/updating/RenderTreeBuilderMathML.h: * rendering/updating/RenderTreeBuilderMultiColumn.cpp: (WebCore::RenderTreeBuilder::MultiColumn::createFragmentedFlow): (WebCore::RenderTreeBuilder::MultiColumn::destroyFragmentedFlow): (WebCore::RenderTreeBuilder::MultiColumn::processPossibleSpannerDescendant): (WebCore::RenderTreeBuilder::MultiColumn::handleSpannerRemoval): * rendering/updating/RenderTreeBuilderRuby.cpp: (WebCore::RenderTreeBuilder::Ruby::moveInlineChildren): (WebCore::RenderTreeBuilder::Ruby::moveBlockChildren): (WebCore::RenderTreeBuilder::Ruby::attach): (WebCore::RenderTreeBuilder::Ruby::findOrCreateParentForChild): (WebCore::RenderTreeBuilder::Ruby::rubyBaseSafe): (WebCore::RenderTreeBuilder::Ruby::detach): (WebCore::RenderTreeBuilder::Ruby::insertChild): Deleted. (WebCore::RenderTreeBuilder::Ruby::takeChild): Deleted. * rendering/updating/RenderTreeBuilderRuby.h: * rendering/updating/RenderTreeBuilderSVG.cpp: (WebCore::RenderTreeBuilder::SVG::attach): (WebCore::RenderTreeBuilder::SVG::detach): (WebCore::RenderTreeBuilder::SVG::insertChild): Deleted. (WebCore::RenderTreeBuilder::SVG::takeChild): Deleted. * rendering/updating/RenderTreeBuilderSVG.h: * rendering/updating/RenderTreeBuilderTable.cpp: (WebCore::RenderTreeBuilder::Table::findOrCreateParentForChild): (WebCore::RenderTreeBuilder::Table::attach): (WebCore::RenderTreeBuilder::Table::collapseAndDestroyAnonymousSiblingRows): (WebCore::RenderTreeBuilder::Table::insertChild): Deleted. * rendering/updating/RenderTreeBuilderTable.h: * rendering/updating/RenderTreeUpdater.cpp: (WebCore::RenderTreeUpdater::createRenderer): (WebCore::RenderTreeUpdater::createTextRenderer): (WebCore::RenderTreeUpdater::tearDownRenderers): (WebCore::RenderTreeUpdater::tearDownTextRenderer): (WebCore::RenderTreeUpdater::tearDownLeftoverPaginationRenderersIfNeeded): * rendering/updating/RenderTreeUpdaterGeneratedContent.cpp: (WebCore::createContentRenderers): 2018-02-22 Chris Dumez ResourceRequestBase::isolatedCopy() fails to isolate copy the cachePartition https://bugs.webkit.org/show_bug.cgi?id=183059 Reviewed by Youenn Fablet. Update ResourceRequestBase::setAsIsolatedCopy() to call isolatedCopy() on the cachePartition as well, given that it is a String and it would not be safe to send it to another thread otherwise. * platform/network/ResourceRequestBase.cpp: (WebCore::ResourceRequestBase::setAsIsolatedCopy): 2018-02-22 Chris Dumez ServiceWorkerContainer::startScriptFetchForJob() fails to isolate copy the registrationKey before passing it to the main thread https://bugs.webkit.org/show_bug.cgi?id=183050 Reviewed by Youenn Fablet. Create an isolated copy of the registrationKey before passing it to the main thread in ServiceWorkerContainer's startScriptFetchForJob() / jobFinishedLoadingScript() / jobFailedLoadingScript(). * workers/service/ServiceWorkerContainer.cpp: (WebCore::ServiceWorkerContainer::startScriptFetchForJob): (WebCore::ServiceWorkerContainer::jobFinishedLoadingScript): (WebCore::ServiceWorkerContainer::jobFailedLoadingScript): 2018-02-22 Chris Dumez ServiceWorkerContainer::scheduleJob() fails to isolate copy the jobData before passing it to the main thread https://bugs.webkit.org/show_bug.cgi?id=183046 Reviewed by Youenn Fablet. Make sure we isolate copy the jobData before passing it to the main thread in ServiceWorkerContainer::scheduleJob(). The jobData contains Strings / URLs so it is not safe to have non-isolated copies of it on various threads. * workers/service/ServiceWorkerContainer.cpp: (WebCore::ServiceWorkerContainer::scheduleJob): 2018-02-22 Basuke Suzuki [Curl] Fix warning on clang. https://bugs.webkit.org/show_bug.cgi?id=182986 Reviewed by Konstantin Tokarev. No new tests because there's no behaviro changes. * platform/network/curl/CurlResourceHandleDelegate.cpp: (WebCore::CurlResourceHandleDelegate::curlDidSendData): (WebCore::CurlResourceHandleDelegate::curlDidReceiveBuffer): (WebCore::CurlResourceHandleDelegate::curlDidFailWithError): * platform/network/curl/CurlResourceHandleDelegate.h: 2018-02-22 Youenn Fablet WorkerCacheStorageConnection::doRemove can assert in case two frames try to delete the same cache at the same time https://bugs.webkit.org/show_bug.cgi?id=183041 Reviewed by Chris Dumez. * Modules/cache/WorkerCacheStorageConnection.cpp: (WebCore::WorkerCacheStorageConnection::doRemove): Update the assertion to accept the case of an already deleted cache, i.e. returned identifer is 0. 2018-02-22 Alejandro G. Castro Remove some code leftovers in LibWebRTCMediaEndpoint and RealtimeOutgoingVideoSource classes https://bugs.webkit.org/show_bug.cgi?id=183031 Reviewed by Youenn Fablet. This include and namespace are not required in the file. Just removing unused code, no tests required. * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp: 2018-02-22 Chris Dumez Document.open() cancels existing provisional load but not navigation policy check https://bugs.webkit.org/show_bug.cgi?id=183012 Reviewed by Alex Christensen. Test: fast/dom/Document/open-with-pending-load-async-policy.html * dom/Document.cpp: (WebCore::Document::open): The existing code was calling FrameLoader::stopAllLoaders() when the loader's state is FrameStateProvisional. The issue is that the FrameLoader's state only gets set to FrameStateProvisional after the policy decision for the navigation is made. This means that we fail to cancel a pending load if is still in the policy decision stage, which can happen when the policy decision is made asynchronously. We now also cancel such pending navigation policy checks as well. * loader/PolicyChecker.cpp: (WebCore::PolicyChecker::checkNavigationPolicy): Make sure the m_delegateIsDecidingNavigationPolicy flag gets reset inside the lambda. Otherwise, it gets reset too early when the policy decision is made asynchronously. 2018-02-22 Youenn Fablet Add release asserts for service worker fetch and postMessage events https://bugs.webkit.org/show_bug.cgi?id=183025 rdar://problem/37765052 Reviewed by Daniel Bates. Add release assertion so that a service worker will only dispatch a message event for clients and service workers with the same origin. No change of behavior. * platform/network/ResourceRequestBase.h: * workers/service/context/ServiceWorkerThread.cpp: (WebCore::ServiceWorkerThread::postMessageToServiceWorker): * workers/service/context/ServiceWorkerThreadProxy.h: 2018-02-22 Miguel Gomez including both gl3.h and gl2.h when USE_OPENGL_ES is enabled https://bugs.webkit.org/show_bug.cgi?id=183008 Reviewed by Michael Catanzaro. Don't include GLES3 headers as we stick to GLES2 API resources. No new tests, no behavior change. * platform/graphics/GLContext.cpp: 2018-02-22 Ms2ger [GTK][WPE] Fix some build errors in service workers code https://bugs.webkit.org/show_bug.cgi?id=182966 Reviewed by Žan Doberšek. No new tests: no change in behavior. * workers/service/ServiceWorkerProvider.h: add missing forward declaration. 2018-02-21 Zalan Bujtas [RenderTreeBuilder] Move RenderObject::insertedInto() mutation logic to RenderTreeBuilder https://bugs.webkit.org/show_bug.cgi?id=183022 Reviewed by Antti Koivisto. No change in functionality. * rendering/RenderObject.cpp: (WebCore::RenderObject::insertedIntoTree): * rendering/updating/RenderTreeBuilder.cpp: (WebCore::RenderTreeBuilder::insertChildToRenderElementInternal): (WebCore::RenderTreeBuilder::moveChildrenTo): (WebCore::RenderTreeBuilder::multiColumnDescendantInserted): Deleted. * rendering/updating/RenderTreeBuilder.h: 2018-02-21 Tim Horton Include all Cocoa sources in all Cocoa platform builds https://bugs.webkit.org/show_bug.cgi?id=183026 Reviewed by Dan Bernstein. Similar to r228571, don't have separate Sources files for iOS and Mac. All sources now have #ifdefs that ensure that only the right ones build on the right platforms. This makes it much easier to reason about what builds where by just looking at the sources. * SourcesCocoa.txt: * SourcesIOS.txt: Removed. * SourcesMac.txt: Removed. * WebCore.xcodeproj/project.pbxproj: * editing/WebContentReader.h: * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h: 2018-02-21 Youenn Fablet Make SubstituteResource take a ResourceResponse r-value https://bugs.webkit.org/show_bug.cgi?id=183020 Reviewed by Alex Christensen. No change of behavior. Make SubstituteResource take a ResourceResponse r-value. Update ArchiveResource accordingly. Take benefit of that in ApplicationCacheResource to set the response source to ApplicationCache before passing it to SubstituteResource constructor. * loader/SubstituteResource.h: (WebCore::SubstituteResource::SubstituteResource): (WebCore::SubstituteResource::resourceResponse): Deleted. * loader/appcache/ApplicationCacheResource.cpp: (WebCore::ApplicationCacheResource::create): (WebCore::ApplicationCacheResource::ApplicationCacheResource): * loader/appcache/ApplicationCacheResource.h: (WebCore::ApplicationCacheResource::create): Deleted. * loader/archive/ArchiveResource.cpp: (WebCore::ArchiveResource::ArchiveResource): 2018-02-21 Zalan Bujtas [RenderTreeBuilder] ::willBeRemoved() does not need RenderTreeBuilder anymore. https://bugs.webkit.org/show_bug.cgi?id=183019 Reviewed by Antti Koivisto. All the willBeDestroyed() mutations have been moved over to RenderTreeBuilder. No change in functionality. * rendering/RenderBlock.cpp: (WebCore::RenderBlock::willBeDestroyed): * rendering/RenderBlock.h: * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::willBeDestroyed): * rendering/RenderBlockFlow.h: * rendering/RenderBox.cpp: (WebCore::RenderBox::willBeDestroyed): * rendering/RenderBox.h: * rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::willBeDestroyed): * rendering/RenderBoxModelObject.h: * rendering/RenderCounter.cpp: (WebCore::RenderCounter::willBeDestroyed): * rendering/RenderCounter.h: * rendering/RenderElement.cpp: (WebCore::RenderElement::willBeDestroyed): * rendering/RenderElement.h: * rendering/RenderEmbeddedObject.cpp: (WebCore::RenderEmbeddedObject::willBeDestroyed): * rendering/RenderEmbeddedObject.h: * rendering/RenderFragmentedFlow.cpp: (WebCore::RenderFragmentedFlow::willBeDestroyed): * rendering/RenderFragmentedFlow.h: * rendering/RenderImage.cpp: (WebCore::RenderImage::willBeDestroyed): * rendering/RenderImage.h: * rendering/RenderInline.cpp: (WebCore::RenderInline::willBeDestroyed): * rendering/RenderInline.h: * rendering/RenderLayerModelObject.cpp: (WebCore::RenderLayerModelObject::willBeDestroyed): * rendering/RenderLayerModelObject.h: * rendering/RenderListBox.cpp: (WebCore::RenderListBox::willBeDestroyed): * rendering/RenderListBox.h: * rendering/RenderListMarker.cpp: (WebCore::RenderListMarker::willBeDestroyed): * rendering/RenderListMarker.h: * rendering/RenderMenuList.cpp: (WebCore::RenderMenuList::willBeDestroyed): * rendering/RenderMenuList.h: * rendering/RenderObject.cpp: (WebCore::RenderObject::willBeDestroyed): (WebCore::RenderObject::destroy): * rendering/RenderObject.h: * rendering/RenderReplaced.cpp: (WebCore::RenderReplaced::willBeDestroyed): * rendering/RenderReplaced.h: * rendering/RenderSearchField.cpp: (WebCore::RenderSearchField::willBeDestroyed): * rendering/RenderSearchField.h: * rendering/RenderSnapshottedPlugIn.cpp: (WebCore::RenderSnapshottedPlugIn::willBeDestroyed): * rendering/RenderSnapshottedPlugIn.h: * rendering/RenderText.cpp: (WebCore::RenderText::willBeDestroyed): * rendering/RenderText.h: * rendering/RenderTextControlMultiLine.cpp: (WebCore::RenderTextControlMultiLine::willBeDestroyed): * rendering/RenderTextControlMultiLine.h: * rendering/RenderVideo.cpp: (WebCore::RenderVideo::willBeDestroyed): * rendering/RenderVideo.h: * rendering/RenderWidget.cpp: (WebCore::RenderWidget::willBeDestroyed): * rendering/RenderWidget.h: * rendering/svg/RenderSVGBlock.cpp: (WebCore::RenderSVGBlock::willBeDestroyed): * rendering/svg/RenderSVGBlock.h: * rendering/svg/RenderSVGImage.cpp: (WebCore::RenderSVGImage::willBeDestroyed): * rendering/svg/RenderSVGImage.h: * rendering/svg/RenderSVGInline.cpp: (WebCore::RenderSVGInline::willBeDestroyed): * rendering/svg/RenderSVGInline.h: * rendering/svg/RenderSVGModelObject.cpp: (WebCore::RenderSVGModelObject::willBeDestroyed): * rendering/svg/RenderSVGModelObject.h: * rendering/svg/RenderSVGResourceContainer.cpp: (WebCore::RenderSVGResourceContainer::willBeDestroyed): * rendering/svg/RenderSVGResourceContainer.h: * rendering/svg/RenderSVGRoot.cpp: (WebCore::RenderSVGRoot::willBeDestroyed): * rendering/svg/RenderSVGRoot.h: * rendering/svg/RenderSVGText.cpp: (WebCore::RenderSVGText::willBeDestroyed): * rendering/svg/RenderSVGText.h: 2018-02-21 Per Arne Vollan The WebContent process should not use NSScreen in the screenAvailableRect/screenRect implementations. https://bugs.webkit.org/show_bug.cgi?id=182855 Reviewed by Brent Fulgham. On macOS, the functions screenAvailableRect and screenRect is implemented using NSScreen, which is communicating with the WindowServer. To avoid this WindowServer communication from the WebContent process when calling screenAvailableRect and screenRect, it is possible to let the UIProcess send a message to the WebContent process whenever there is a change in the display properties, and have the WebContent process cache these display properties. This message should also be sent to a newly started WebContent process. No new tests, covered by existing tests. * WebCore.xcodeproj/project.pbxproj: * platform/PlatformScreen.h: * platform/mac/PlatformScreenMac.mm: (WebCore::getScreenProperties): (WebCore::screenProperties): (WebCore::setScreenProperties): (WebCore::screenRect): (WebCore::screenAvailableRect): * platform/ScreenProperties.h: Added. (WebCore::ScreenProperties::encode const): (WebCore::ScreenProperties::decode): 2018-02-21 Christopher Reid [Curl] Curl Cookie Database File should be configurable using NetworkProcessCreationParameters https://bugs.webkit.org/show_bug.cgi?id=182751 Reviewed by Youenn Fablet. No change in behavior. Adding support to set a custom CookieJar Database. Took CookieJarDB::open() out of its constructor because both the Network and Web process were trying to open the journal files but one process was failing due to a lack of permission. Now the database file is lazily opened and only the Network process will try to open the database. Some cleanup was done to CookieJarDB too. * platform/network/NetworkStorageSession.h: * platform/network/curl/CookieJarDB.cpp: * platform/network/curl/CookieJarDB.h: * platform/network/curl/NetworkStorageSessionCurl.cpp: 2018-02-21 Chris Dumez Regression(r228708): Crash under WebCore::MediaResource::responseReceived(WebCore::CachedResource&, WebCore::ResourceResponse const&) https://bugs.webkit.org/show_bug.cgi?id=183018 Reviewed by Eric Carlson. The fix at r228708 was trying to address the fact that avplayer sometimes deallocates WebCoreNSURLSessionDataTask objects on a non-main thread, which was not safe because its _resource data member needs to be deallocated on the main thread. The issue is that r228708 caused _resource to outlive its WebCoreNSURLSessionDataTask. This is an issue because _resource has a client data member (of type WebCoreNSURLSessionDataTaskClient) which has a raw pointer to the WebCoreNSURLSessionDataTask. This means that the main thread could call methods like responseReceived() on the resource, which would call responseReceived() on the client, which would try to call [WebCoreNSURLSessionDataTask receivedResponse:] with an invalid m_task pointer. To address the issue, I introduced a clearTask() method on WebCoreNSURLSessionDataTaskClient, which gets called from a non-main thread to clear the client's m_task pointer when the task is destroyed on a non-main thread. So that this is safe, every time the client tries to use m_task, we now acquire a lock for thread-safety and do a null-check on m_task. No new tests, no known reproduction case. * platform/graphics/PlatformMediaResourceLoader.h: (WebCore::PlatformMediaResource::client): * platform/network/cocoa/WebCoreNSURLSession.mm: (WebCore::WebCoreNSURLSessionDataTaskClient::clearTask): (WebCore::WebCoreNSURLSessionDataTaskClient::dataSent): (WebCore::WebCoreNSURLSessionDataTaskClient::responseReceived): (WebCore::WebCoreNSURLSessionDataTaskClient::shouldCacheResponse): (WebCore::WebCoreNSURLSessionDataTaskClient::dataReceived): (WebCore::WebCoreNSURLSessionDataTaskClient::redirectReceived): (WebCore::WebCoreNSURLSessionDataTaskClient::accessControlCheckFailed): (WebCore::WebCoreNSURLSessionDataTaskClient::loadFailed): (WebCore::WebCoreNSURLSessionDataTaskClient::loadFinished): (-[WebCoreNSURLSessionDataTask dealloc]): 2018-02-21 Youenn Fablet Move AppCache loading to the NetworkProcess https://bugs.webkit.org/show_bug.cgi?id=178540 Reviewed by Alex Christensen. Covered by existing tests. Use ApplicationResourceLoader for cache entry loading. Remove all ResourceHandle use from ApplicationCacheGroup. Renamed m_loader in m_manifestLoader and added a new m_entryLoader to load cache entries. Updated ApplicationCacheResourceLoader to handle different types of CachedResource. This allows in particular to handle redirections based on the resource type and create the ApplicationCacheResource with the right type. Use Include as credentials mode as per specification. Add a new ApplicationCache ResourceResonse::Source. This allows fixing an assertion and should allow better inspector support if needs be. * inspector/agents/InspectorNetworkAgent.cpp: (WebCore::responseSource): * loader/ResourceLoader.cpp: (WebCore::logResourceResponseSource): * loader/SubstituteResource.h: (WebCore::SubstituteResource::resourceResponse): * loader/appcache/ApplicationCacheGroup.cpp: (WebCore::ApplicationCacheGroup::stopLoading): (WebCore::ApplicationCacheGroup::update): (WebCore::ApplicationCacheGroup::didFinishLoading): (WebCore::ApplicationCacheGroup::didFinishLoadingEntry): (WebCore::ApplicationCacheGroup::didFail): (WebCore::ApplicationCacheGroup::didFailLoadingEntry): (WebCore::ApplicationCacheGroup::checkIfLoadIsComplete): (WebCore::ApplicationCacheGroup::startLoadingEntry): * loader/appcache/ApplicationCacheGroup.h: * loader/appcache/ApplicationCacheResource.cpp: (WebCore::ApplicationCacheResource::ApplicationCacheResource): * loader/appcache/ApplicationCacheResourceLoader.cpp: (WebCore::ApplicationCacheResourceLoader::create): (WebCore::ApplicationCacheResourceLoader::ApplicationCacheResourceLoader): (WebCore::ApplicationCacheResourceLoader::responseReceived): (WebCore::ApplicationCacheResourceLoader::redirectReceived): * loader/appcache/ApplicationCacheResourceLoader.h: * platform/network/ResourceResponseBase.h: * platform/network/cocoa/ResourceResponseCocoa.mm: (WebCore::ResourceResponse::platformCertificateInfo const): * testing/Internals.cpp: (WebCore::responseSourceToString): 2018-02-21 Zalan Bujtas [RenderTreeBuilder] Move RenderBoxModelObject::willBeRemoved() mutation logic to RenderTreeBuilder https://bugs.webkit.org/show_bug.cgi?id=183014 Reviewed by Antti Koivisto. No change in functionality. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::~RenderBoxModelObject): (WebCore::RenderBoxModelObject::willBeDestroyed): (WebCore::RenderBoxModelObject::continuationChainNode const): (): Deleted. (WebCore::RenderBoxModelObject::removeAndDestroyAllContinuations): Deleted. * rendering/RenderBoxModelObject.h: * rendering/updating/RenderTreeBuilder.cpp: (WebCore::RenderTreeBuilder::RenderTreeBuilder): (WebCore::RenderTreeBuilder::removeAndDestroy): * rendering/updating/RenderTreeBuilder.h: (WebCore::RenderTreeBuilder::continuationBuilder): * rendering/updating/RenderTreeBuilderContinuation.cpp: Added. (WebCore::RenderTreeBuilder::Continuation::Continuation): (WebCore::RenderTreeBuilder::Continuation::cleanupOnDestroy): * rendering/updating/RenderTreeBuilderContinuation.h: Added. 2018-02-21 Youenn Fablet ServiceWorkerJob::m_lastResponse is unneeded https://bugs.webkit.org/show_bug.cgi?id=183013 Reviewed by Chris Dumez. Remove this field since not used anywhere. * workers/service/ServiceWorkerJob.cpp: (WebCore::ServiceWorkerJob::didReceiveResponse): * workers/service/ServiceWorkerJob.h: 2018-02-21 Youenn Fablet Use ResourceLoader to load appcache manifest https://bugs.webkit.org/show_bug.cgi?id=182861 Reviewed by Alex Christensen. Covered by updated tests. Add ApplicationCacheResourceLoader to load an ApplicationCacheResource from a ResourceLoader. Make use of it to load the app cache manifest. Future work should load entries using the same loader. Remove manifest handle. Ensure that DocumentLoader does not register the manifest resource loader as its lifetime is handled by its ApplicationCacheGroup. Add a ResourceLoader option to bypass the application cache. Use it for manifest loading. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::addSubresourceLoader): * loader/ResourceLoaderOptions.h: * loader/appcache/ApplicationCacheGroup.cpp: (WebCore::ApplicationCacheGroup::stopLoading): (WebCore::ApplicationCacheGroup::update): (WebCore::ApplicationCacheGroup::createRequest): (WebCore::ApplicationCacheGroup::didReceiveResponseAsync): (WebCore::ApplicationCacheGroup::didReceiveData): (WebCore::ApplicationCacheGroup::didFinishLoading): (WebCore::ApplicationCacheGroup::didFail): (WebCore::ApplicationCacheGroup::didFinishLoadingManifest): (WebCore::ApplicationCacheGroup::checkIfLoadIsComplete): * loader/appcache/ApplicationCacheGroup.h: * loader/appcache/ApplicationCacheHost.cpp: (WebCore::ApplicationCacheHost::maybeLoadResource): (WebCore::ApplicationCacheHost::maybeLoadFallbackForRedirect): (WebCore::ApplicationCacheHost::maybeLoadFallbackForResponse): (WebCore::ApplicationCacheHost::maybeLoadFallbackForError): * loader/appcache/ApplicationCacheResourceLoader.cpp: Added. * loader/appcache/ApplicationCacheResourceLoader.h: Added. 2018-02-21 Don Olmstead [CMake][Win] Use cmakeconfig.h rather than config.h and Platform.h https://bugs.webkit.org/show_bug.cgi?id=182883 Reviewed by Per Arne Vollan. No new tests. No change in behavior. * WebCorePrefix.h: * config.h: * testing/js/WebCoreTestSupportPrefix.h: 2018-02-21 Zalan Bujtas [RenderTreeBuilder] Move RenderView::willBeRemoved() mutation logic to RenderTreeBuilder https://bugs.webkit.org/show_bug.cgi?id=183009 Reviewed by Antti Koivisto. No change in functionality. * dom/Document.cpp: (WebCore::Document::destroyRenderTree): * rendering/RenderView.cpp: (WebCore::RenderView::~RenderView): (WebCore::RenderView::willBeDestroyed): Deleted. * rendering/RenderView.h: 2018-02-21 Michael Catanzaro [GTK] USE_UPOWER causes crashes inside a chroot or on systems with broken dbus/upower https://bugs.webkit.org/show_bug.cgi?id=181825 Reviewed by Carlos Garcia Campos. We could fix this crash, but that would not be good enough, because upower-glib is a synchronous API that wraps D-Bus calls. That's not acceptable for use in the web process. Rewrite LowPowerModeNotifierGLib to use upower's D-Bus API directly, instead. Note that this also enables LowPowerModeNotifier for WPE, since the USE(UPOWER) build flag is no longer needed. * platform/LowPowerModeNotifier.cpp: * platform/LowPowerModeNotifier.h: * platform/glib/LowPowerModeNotifierGLib.cpp: (WebCore::LowPowerModeNotifier::LowPowerModeNotifier): (WebCore::LowPowerModeNotifier::updateWarningLevel): (WebCore::LowPowerModeNotifier::warningLevelChanged): (WebCore::LowPowerModeNotifier::gPropertiesChangedCallback): (WebCore::LowPowerModeNotifier::~LowPowerModeNotifier): (WebCore::LowPowerModeNotifier::updateState): Deleted. (WebCore::LowPowerModeNotifier::warningLevelCallback): Deleted. 2018-02-21 Chris Dumez VTTCue constructor should use 'double' type for startTime / endTime https://bugs.webkit.org/show_bug.cgi?id=182988 Reviewed by Eric Carlson. VTTCue constructor should use 'double' type for startTime / endTime, not 'unrestricted double': - https://w3c.github.io/webvtt/#the-vttcue-interface Otherwise, we end up potentially returning NaN for TextTrackCue.startTime / endTime, even though those correctly use type 'double': - https://html.spec.whatwg.org/multipage/media.html#texttrackcue The new behavior is consistent with Firefox and Chrome. No new tests, updated existing test. * bindings/js/JSDOMConvertNumbers.h: (WebCore::JSConverter::convert): Add assertion to make sure our implementation never tries to return NaN for an IDL attribute of type 'double'. This would be invalid as per Web IDL spec and would crash if the NaN being returned was impure as JSValue could not store it as a double. * html/track/VTTCue.idl: Update constructor parameters to use 'double' type instead of 'unrestricted double', as per: - https://w3c.github.io/webvtt/#the-vttcue-interface 2018-02-21 Zalan Bujtas [RenderTreeBuilder] Move RenderTextFragment::willBeRemoved() mutation logic to RenderTreeBuilder https://bugs.webkit.org/show_bug.cgi?id=182946 Reviewed by Antti Koivisto. No change in functionality. * rendering/RenderTextFragment.cpp: (WebCore::RenderTextFragment::willBeDestroyed): * rendering/updating/RenderTreeBuilder.cpp: (WebCore::RenderTreeBuilder::takeChild): * rendering/updating/RenderTreeBuilderFirstLetter.cpp: (WebCore::RenderTreeBuilder::FirstLetter::cleanupOnRemoval): * rendering/updating/RenderTreeBuilderFirstLetter.h: 2018-02-21 Ms2ger [GCrypt] Remove unsound assertion from CryptoKeyRSA::exportData(). https://bugs.webkit.org/show_bug.cgi?id=183001 Reviewed by Philippe Normand. This function is called from structured cloning, in particular when storing a key in IndexedDB. This would trip the assertion if the key in question is non-exportable. The assertion was copied from the macOS implementation in r172389; it was subsequently removed there in r172898 to handle this case. Test: crypto/subtle/rsa-indexeddb-non-exportable.html * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp: (WebCore::CryptoKeyRSA::exportData const): remove assertion. 2018-02-21 Myles C. Maxfield [Cocoa] Make system-ui obey the user-installed-font policy https://bugs.webkit.org/show_bug.cgi?id=182860 Reviewed by Antti Koivisto. We have a completely different codepath for system-ui which makes it follow the system's font cascade list. This codepath (along with all the other relevant places which create system fonts) needs to obey the AllowUserInstalledFonts enum. This patch is fairly mechanical; we simply are hooking up the flag across SystemFontDatabase. There are a few places which creates system fonts which this patch doesn't touch. This is not a problem because all the remaining places either: 1) Simply pull out some attributes of the font (name, weight, size, etc.) and then throw away the font object itself, or 2) Use the font in an environment where script cannot access the characters rendered (such as DragImages or the fullscreen placeholder view or the inside of the attachment element). Test: fast/text/user-installed-fonts/system-ui.html * platform/graphics/cocoa/FontCacheCoreText.cpp: (WebCore::FontDatabase::collectionForFamily): (WebCore::FontDatabase::fontForPostScriptName): (WebCore::fontWithFamily): (WebCore::installedFontMandatoryAttributes): (WebCore::createSpecificFontForInstalledFonts): * platform/graphics/cocoa/FontCacheCoreText.h: * platform/graphics/cocoa/FontDescriptionCocoa.cpp: (WebCore::SystemFontDatabase::CoreTextCascadeListParameters::operator== const): (WebCore::SystemFontDatabase::CoreTextCascadeListParameters::hash const): (WebCore::SystemFontDatabase::systemFontCascadeList): (WebCore::SystemFontDatabase::removeCascadeList): (WebCore::SystemFontDatabase::computeCascadeList): (WebCore::systemFontParameters): (WebCore::systemFontCascadeList): (WebCore::FontCascadeDescription::effectiveFamilyCount const): (WebCore::FontCascadeDescription::effectiveFamilyAt const): * platform/graphics/ios/FontCacheIOS.mm: (WebCore::platformFontWithFamilySpecialCase): * platform/graphics/mac/FontCacheMac.mm: (WebCore::platformFontWithFamilySpecialCase): 2018-02-21 Chris Dumez Unreviewed attempt to fix build after r228867. * Modules/webvr/VRStageParameters.cpp: 2018-02-21 Philippe Normand [GStreamer] Rewrite purgeInvalid*Tracks methods https://bugs.webkit.org/show_bug.cgi?id=183004 Reviewed by Carlos Garcia Campos. Removing items from a hashmap while iterating is bad. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::purgeInvalidAudioTracks): Safely remove items from the hashmap using removeIf(). (WebCore::MediaPlayerPrivateGStreamer::purgeInvalidVideoTracks): Ditto. (WebCore::MediaPlayerPrivateGStreamer::purgeInvalidTextTracks): Ditto. 2018-02-21 Chris Dumez Unreviewed attempt to fix build after r228867. * Modules/webvr/VRStageParameters.cpp: 2018-02-21 Philippe Normand [GStreamer] Crash in Debug build when purging invalid tracks https://bugs.webkit.org/show_bug.cgi?id=182997 Reviewed by Xabier Rodriguez-Calvar. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::purgeInvalidAudioTracks): Clear the hashmap when there is no valid track left. (WebCore::MediaPlayerPrivateGStreamer::purgeInvalidVideoTracks): Ditto. (WebCore::MediaPlayerPrivateGStreamer::purgeInvalidTextTracks): Ditto. * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp: (WebCore::TrackPrivateBaseGStreamer::getLanguageCode): Demote debugging, this appears too much at least with playbin2. (WebCore::TrackPrivateBaseGStreamer::getTag): Ditto. 2018-02-21 Philippe Normand [GStreamer] We need to adopt GstGlDisplays after GStreamer 1.13.1 https://bugs.webkit.org/show_bug.cgi?id=182996 Reviewed by Xabier Rodriguez-Calvar. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: (WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext): Adopt references when running with GStreamer 1.13.1 to avoid memory leaks. 2018-02-20 Philippe Normand [GTK] Layout test media/track/track-in-band-duplicate-tracks-when-source-changes.html failing since r228617 https://bugs.webkit.org/show_bug.cgi?id=160131 Reviewed by Michael Catanzaro. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfText): We can't assume the pad has a sticky event here like implemented in InbandTextTrackPrivateGStreamer because it might be emitted after the track was created. So fallback to a dummy stream ID like in the Audio and Video tracks. 2018-02-20 Sergio Villar Senin [WebVR][OpenVR] Retrieve stage parameters https://bugs.webkit.org/show_bug.cgi?id=182976 Reviewed by Žan Doberšek. Use OpenVR to retrieve stage parameters, i.e., play area size and the transformation from sitting to standing position. It includes the same fallback used by Firefox to provide sensible values in case we cannot get the required information from the VR SDK (it's quite common not to have defined a play area). * Modules/webvr/VRDisplay.cpp: (WebCore::VRDisplay::stageParameters const): * Modules/webvr/VRDisplay.h: * Modules/webvr/VRStageParameters.cpp: (WebCore::VRStageParameters::VRStageParameters): (WebCore::VRStageParameters::sittingToStandingTransform const): (WebCore::VRStageParameters::sizeX const): (WebCore::VRStageParameters::sizeZ const): * Modules/webvr/VRStageParameters.h: (WebCore::VRStageParameters::create): * platform/vr/VRPlatformDisplay.h: * platform/vr/openvr/VRPlatformDisplayOpenVR.cpp: (WebCore::VRPlatformDisplayOpenVR::VRPlatformDisplayOpenVR): (WebCore::VRPlatformDisplayOpenVR::updateStageParameters): * platform/vr/openvr/VRPlatformDisplayOpenVR.h: 2018-02-21 Philippe Normand [GStreamer] Create a Wayland GL display instead of EGL https://bugs.webkit.org/show_bug.cgi?id=182968 Reviewed by Xabier Rodriguez-Calvar. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: (WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext): Add logging and instantiate a GstDisplayWayland display instead of an EGL display when running under a Wayland compositor. 2018-02-21 Zalan Bujtas [RenderTreeBuilder] Move RenderFullScreen::willBeRemoved() mutation logic to RenderTreeBuilder https://bugs.webkit.org/show_bug.cgi?id=182947 Reviewed by Antti Koivisto. No change in functionality. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * rendering/RenderFullScreen.cpp: (WebCore::RenderFullScreen::willBeDestroyed): * rendering/updating/RenderTreeBuilder.cpp: (WebCore::RenderTreeBuilder::takeChild): * rendering/updating/RenderTreeBuilder.h: (WebCore::RenderTreeBuilder::fullScreenBuilder): * rendering/updating/RenderTreeBuilderFullScreen.cpp: Added. (WebCore::RenderTreeBuilder::FullScreen::FullScreen): (WebCore::RenderTreeBuilder::FullScreen::cleanupOnRemoval): * rendering/updating/RenderTreeBuilderFullScreen.h: Added. * rendering/updating/RenderTreeBuilderMathML.cpp: 2018-02-20 Zalan Bujtas [RenderTreeBuilder] Move RenderListItem::willBeRemoved() mutation logic to RenderTreeBuilder https://bugs.webkit.org/show_bug.cgi?id=182943 Reviewed by Antti Koivisto. We don't need to destroy the marker in RenderListItem::willBeRemoved(), because it gets deleted in RenderTreeBuilder::removeAndDestroy() together with RenderListItem (as long as the marker is the RenderListItem's descendent). Covered by existing tests. * rendering/RenderListItem.cpp: (WebCore::RenderListItem::~RenderListItem): (WebCore::RenderListItem::willBeDestroyed): Deleted. * rendering/RenderListItem.h: 2018-02-20 Nan Wang AX: Keyboard focus not following VoiceOver cursor into web content or within web content. https://bugs.webkit.org/show_bug.cgi?id=182752 Reviewed by Ryosuke Niwa. Call the assistive technology specific method for becoming first responder. Test: accessibility/mac/accessibility-make-first-responder.html * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper _accessibilitySetValue:forAttribute:]): * page/ChromeClient.h: 2018-02-20 Tim Horton Introduce HAVE(IOSURFACE_ACCELERATOR) https://bugs.webkit.org/show_bug.cgi?id=182955 Reviewed by Sam Weinig. No new tests, no change in behavior. Introduce HAVE(IOSURFACE_ACCELERATOR) and guard all uses of IOSurfaceAccelerator behind it. Rename USE(IOSURFACE) to HAVE(IOSURFACE) for accuracy. * page/cocoa/MemoryReleaseCocoa.mm: * platform/graphics/ca/TileController.cpp: * platform/graphics/cg/IOSurfacePool.cpp: * platform/graphics/cg/IOSurfacePool.h: * platform/graphics/cg/ImageBufferCG.cpp: * platform/graphics/cocoa/IOSurface.h: * platform/graphics/cocoa/IOSurface.mm: * platform/graphics/cocoa/IOSurfacePoolCocoa.mm: * platform/graphics/cv/VideoTextureCopierCV.cpp: * platform/graphics/cv/VideoTextureCopierCV.h: 2018-02-20 Chris Dumez Provisional load may get committed before receiving the decidePolicyForNavigationResponse response https://bugs.webkit.org/show_bug.cgi?id=182720 Reviewed by Alex Christensen. Wait for the policy response from the client after receiving a resource response, before sending the NetworkResourceLoader::ContinueDidReceiveResponse IPC back to the NetworkProcess. Otherwise, the network process may start sending us data and we may end up committing the provisional load before receiving the policy decision fron the client. Change is covered by new API test. * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::responseReceived): * loader/NetscapePlugInStreamLoader.cpp: (WebCore::NetscapePlugInStreamLoader::didReceiveResponse): * loader/NetscapePlugInStreamLoader.h: * loader/ResourceLoader.cpp: (WebCore::ResourceLoader::deliverResponseAndData): (WebCore::ResourceLoader::loadDataURL): (WebCore::ResourceLoader::didReceiveResponse): (WebCore::ResourceLoader::didReceiveResponseAsync): * loader/ResourceLoader.h: * loader/SubresourceLoader.cpp: (WebCore::SubresourceLoader::didReceiveResponse): (WebCore::SubresourceLoader::didReceiveResponsePolicy): (WebCore::SubresourceLoader::willCancel): * loader/SubresourceLoader.h: * loader/ios/PreviewLoader.mm: (-[WebPreviewLoader _sendDidReceiveResponseIfNecessary]): 2018-02-20 Chris Dumez Crash under JSC::JSCell::toNumber(JSC::ExecState*) https://bugs.webkit.org/show_bug.cgi?id=182984 Reviewed by Mark Lam. The issue was caused by DOMMatrix attributes potentially returning "impure" NaN values. We would call JSC::jsNumber(double) to construct the JSValue but this is only safe for pure NaN values. Make sure we purify the double returned by the implementation for IDL attributes of type 'unrestricted double' before calling JSC::jsNumber(double). No new tests, extended existing test. * bindings/js/JSDOMConvertNumbers.h: (WebCore::JSConverter::convert): * testing/TypeConversions.h: (WebCore::TypeConversions::testImpureNaNUnrestrictedDouble const): (WebCore::TypeConversions::testImpureNaN2UnrestrictedDouble const): (WebCore::TypeConversions::testQuietNaNUnrestrictedDouble const): * testing/TypeConversions.idl: 2018-02-20 Tim Horton Make more use of USE(OPENGL_ES) where it makes sense https://bugs.webkit.org/show_bug.cgi?id=182957 Reviewed by Dan Bernstein. No new tests, no behavior change. Make use of USE(OPENGL_ES) for CoreVideo functions that differ based on GL availability. Also adjust GraphicsContext3D in the same way. * platform/cocoa/CoreVideoSoftLink.cpp: * platform/cocoa/CoreVideoSoftLink.h: * platform/graphics/GraphicsContext3D.h: * platform/graphics/cv/TextureCacheCV.mm: (WebCore::TextureCacheCV::create): (WebCore::TextureCacheCV::textureFromImage): * platform/graphics/cv/VideoTextureCopierCV.cpp: (WebCore::enumToStringMap): (WebCore::VideoTextureCopierCV::initializeContextObjects): (WebCore::VideoTextureCopierCV::initializeUVContextObjects): (WebCore::VideoTextureCopierCV::copyImageToPlatformTexture): (WebCore::VideoTextureCopierCV::copyVideoTextureToPlatformTexture): 2018-02-20 Nan Wang AX: AOM: Dispatch accessibleclick event https://bugs.webkit.org/show_bug.cgi?id=180898 Reviewed by Ryosuke Niwa. Accessibility events. Spec: https://wicg.github.io/aom/spec/phase2.html This patch allows developers to register event handlers on Elements for custom accessibility events. Accessibility events go through a capturing and bubbling phase just like DOM events, but in the accessibility tree. Implemented "accessibleclick" event. Test: accessibility/mac/AOM-events.html * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::press): (WebCore::AccessibilityObject::dispatchAccessibilityEvent): * accessibility/AccessibilityObject.h: * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper accessibilityPerformAction:]): * dom/Element.idl: * dom/EventDispatcher.cpp: (WebCore::dispatchEventWithType): (WebCore::EventDispatcher::dispatchEvent): * dom/EventDispatcher.h: * dom/EventNames.h: * dom/EventPath.cpp: (WebCore::EventPath::EventPath): * dom/EventPath.h: 2018-02-20 Wenson Hsieh [iOS 11.3 Beta] Can't copy a URL from Safari and paste it into the Gmail app https://bugs.webkit.org/show_bug.cgi?id=182952 Reviewed by Tim Horton. After r220865 refactored the iOS copy codepaths to use NSItemProviders, we stopped writing the URL as plain text to the pasteboard. However, this means clients that only check for "text/plain" (or one of its aliases) on the pasteboard won't read any data on paste. To fix this, we restore the pre-iOS 11.3 behavior of writing both the URL and plain text to the pasteboard. Since we're using item providers, we also ensure that the NSURL is at a higher fidelity than the string to make it clear that the data should be consumed as a URL. This patch also rebaselines an existing drag and drop test to cover this change, and adds a new API test, ActionSheetTests.CopyLinkWritesURLAndPlainText, which simulates copying a link using the share sheet and pasting into a DataTransfer-dumping test harness. * platform/ios/PlatformPasteboardIOS.mm: (WebCore::PlatformPasteboard::write): 2018-02-20 Eric Carlson [iOS] Returning from Auto-PiP causes Safari to be unresponsive https://bugs.webkit.org/show_bug.cgi?id=182977 Reviewed by Jer Noble. Remove the error handling added in r228115, it breaks auto-pip. * platform/ios/VideoFullscreenInterfaceAVKit.mm: (VideoFullscreenInterfaceAVKit::applicationDidBecomeActive): (VideoFullscreenInterfaceAVKit::enterFullscreenStandard): (VideoFullscreenInterfaceAVKit::exitFullscreen): (VideoFullscreenInterfaceAVKit::cleanupFullscreen): (VideoFullscreenInterfaceAVKit::didStartPictureInPicture): (VideoFullscreenInterfaceAVKit::prepareForPictureInPictureStopWithCompletionHandler): (VideoFullscreenInterfaceAVKit::exitFullscreenHandler): (VideoFullscreenInterfaceAVKit::enterFullscreenHandler): 2018-02-20 Jer Noble [EME] Adopt new AVContentKeySession success delegate callback https://bugs.webkit.org/show_bug.cgi?id=182974 Reviewed by Eric Carlson. Store the updateLicenseCallback if the new protocol method is present and supported. * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h: * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm: (-[WebCoreFPSContentKeySessionDelegate contentKeySession:contentKeyRequestDidSucceed:]): (WebCore::CDMInstanceFairPlayStreamingAVFObjC::updateLicense): (WebCore::CDMInstanceFairPlayStreamingAVFObjC::didFailToProvideRequest): (WebCore::CDMInstanceFairPlayStreamingAVFObjC::requestDidSucceed): 2018-02-19 Dean Jackson Handle all writing-modes in downcast https://bugs.webkit.org/show_bug.cgi?id=182949 Reviewed by Myles Maxfield. It appears we forgot to handle the deprecated "lr" writing-mode value. Test: fast/writing-mode/svg-writing-modes.html * css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::operator WritingMode const): 2018-02-20 Zan Dobersek [Cairo] Drop target GraphicsContext usage in Cairo operations https://bugs.webkit.org/show_bug.cgi?id=182964 Reviewed by Carlos Garcia Campos. The GraphicsContext parameters in various Cairo operations are not used anymore, so they can be removed. Callsites are updated to reflect this. * platform/graphics/cairo/CairoOperations.cpp: (WebCore::Cairo::drawShadowLayerBuffer): (WebCore::Cairo::fillShadowBuffer): (WebCore::Cairo::drawPathShadow): (WebCore::Cairo::drawGlyphsShadow): (WebCore::Cairo::fillRect): (WebCore::Cairo::fillRoundedRect): (WebCore::Cairo::fillRectWithRoundedHole): (WebCore::Cairo::fillPath): (WebCore::Cairo::strokeRect): (WebCore::Cairo::strokePath): (WebCore::Cairo::drawGlyphs): (WebCore::Cairo::drawNativeImage): (WebCore::Cairo::drawSurface): * platform/graphics/cairo/CairoOperations.h: * platform/graphics/cairo/FontCairo.cpp: (WebCore::FontCascade::drawGlyphs): * platform/graphics/cairo/GraphicsContextCairo.cpp: (WebCore::GraphicsContext::drawNativeImage): (WebCore::GraphicsContext::fillPath): (WebCore::GraphicsContext::strokePath): (WebCore::GraphicsContext::fillRect): (WebCore::GraphicsContext::strokeRect): (WebCore::GraphicsContext::platformFillRoundedRect): (WebCore::GraphicsContext::fillRectWithRoundedHole): * platform/graphics/cairo/GraphicsContextImplCairo.cpp: (WebCore::GraphicsContextImplCairo::fillRect): (WebCore::GraphicsContextImplCairo::fillRoundedRect): (WebCore::GraphicsContextImplCairo::fillRectWithRoundedHole): (WebCore::GraphicsContextImplCairo::fillPath): (WebCore::GraphicsContextImplCairo::strokeRect): (WebCore::GraphicsContextImplCairo::strokePath): (WebCore::GraphicsContextImplCairo::drawGlyphs): (WebCore::GraphicsContextImplCairo::drawNativeImage): * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp: (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::paintCurrentFrame): 2018-02-20 Sergio Villar Senin [WebVR][OpenVR] Retrieve eye parameters and field of view https://bugs.webkit.org/show_bug.cgi?id=182962 Reviewed by Žan Doberšek. Get the required data from OpenVR to fill in the VREyeParameters and the VRFieldOfView objects. * Modules/webvr/VRDisplay.cpp: Create some attributes in the body of the constructor instead in the member initialization list to avoid calling getDisplayInfo() multiple times. (WebCore::VRDisplay::VRDisplay): (WebCore::VRDisplay::capabilities const): (WebCore::VRDisplay::getEyeParameters const): * Modules/webvr/VRDisplay.h: * Modules/webvr/VREyeParameters.cpp: (WebCore::VREyeParameters::VREyeParameters): Added new attributes to the constructor. (WebCore::VREyeParameters::offset const): Return a Ref instead of a raw pointer. (WebCore::VREyeParameters::renderWidth const): (WebCore::VREyeParameters::renderHeight const): * Modules/webvr/VREyeParameters.h: (WebCore::VREyeParameters::create): * Modules/webvr/VRFieldOfView.cpp: Removed. All the impletementation fits perfectly in the header file. * Modules/webvr/VRFieldOfView.h: (WebCore::VRFieldOfView::create): (WebCore::VRFieldOfView::upDegrees const): (WebCore::VRFieldOfView::rightDegrees const): (WebCore::VRFieldOfView::downDegrees const): (WebCore::VRFieldOfView::leftDegrees const): (WebCore::VRFieldOfView::VRFieldOfView): * Sources.txt: * platform/vr/VRPlatformDisplay.h: Added some more data to the VRPlatformDisplayInfo struct. * platform/vr/openvr/VRPlatformDisplayOpenVR.cpp: (WebCore::VRPlatformDisplayOpenVR::VRPlatformDisplayOpenVR): (WebCore::VRPlatformDisplayOpenVR::computeFieldOfView): Computes the up/down/left/right FOV angles in degrees from the raw project values returned by OpenVR. (WebCore::VRPlatformDisplayOpenVR::updateEyeParameters): Fills in the eye parameter info. (WebCore::VRPlatformDisplayOpenVR::~VRPlatformDisplayOpenVR): * platform/vr/openvr/VRPlatformDisplayOpenVR.h: 2018-02-20 Philippe Normand [GStreamer][MiniBrowser] Honor GStreamer command line parameters in MiniBrowser https://bugs.webkit.org/show_bug.cgi?id=173655 Reviewed by Xabier Rodriguez-Calvar. The FIXME in GStreamerUtilities.cpp asks to pass the command line parameters to the GStreamer initialization function. Based on initial patch by: Vanessa Chipirrás Navalón * Modules/webaudio/AudioContext.cpp: (WebCore::AudioContext::constructCommon): Removes the call to the method that GStreamer initializes. It is no longer necessary. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: (WebCore::MediaPlayerPrivateGStreamerBase::initializeGStreamerAndRegisterWebKitElements): Ditto * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp: (WebCore::initializeGStreamerAndRegisterWebKitMSEElement): Ditto * platform/graphics/gstreamer/GStreamerUtilities.cpp: (WebCore::initializeGStreamer): Receive the GStreamer options and initialize GStreamer. * platform/graphics/gstreamer/GStreamerUtilities.h: Add vector which contains GStreamer options as the input parameter of the initializeGStreamer() method. 2018-02-20 Miguel Gomez [GTK] whatsapp web blurry in some parts, sharp on others https://bugs.webkit.org/show_bug.cgi?id=182673 Reviewed by Carlos Garcia Campos. CoordinatedGraphicsLayer::createBackingStore() uses the scale factor returned by effectiveContentsScale(), which is always 1 if selfOrAncestorHaveNonAffineTransforms() returns true. But this fuction always returns true if the layer has an AnimatedPropertyTransform animation, which means that layers with those animations won't use the appropriate scale factor, causing blurry renderings. This patch removes the animations check, so animated layers properly use the required scale factor. No new tests, no behavior change. * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp: (WebCore::CoordinatedGraphicsLayer::selfOrAncestorHaveNonAffineTransforms): 2018-02-20 Zan Dobersek [Cairo] Leverage ShadowBlur without using scratch buffer, target GraphicsContext https://bugs.webkit.org/show_bug.cgi?id=182958 Reviewed by Carlos Garcia Campos. To allow ShadowBlur usage in different threads, avoid the ShadowBlur class using the scratch buffer internally. The current implementation of that scratch buffer is not thread-safe and its usage in such conditions can lead to crashes. Instead, the new methods use a temporary ImageBuffer object for drawing. This does negate the efficiency of possibly reusing the scratch buffer, but at this point that is not yet the priority. This only affects ports using Cairo for drawing. The added methods don't require a target GraphicsContext object to be passed in, instead they accept buffer draw callbacks that are invoked with the temporary ImageBuffer object containing the rasterized shadow, as well as position and size parameters. The CTM and clip bounds values also have to be passed in manually. In CairoOperations.cpp, the provided callbacks invoke commands that are equivalent in effect to those that would otherwise be invoked on the target GraphicsContext object in the ShadowBlur class. For now, this approach has to avoid the tiling-based drawing of the rectangular shadows in drawRectShadow() and inset shadows in drawInsetShadow(), and instead stick to the non-tiling fallback. While only affecting Cairo-using ports, with some refactoring it should be possible to again leverage the tiling-based approach as well. The beginShadowLayer() and endShadowLayer() functions, which are only used in CairoOperations.cpp, are replaced with the drawShadowLayer() method. This one accepts an additional callback that allows the caller to explicitly draw the shadow shape using the provided shadowing GraphicsContext object. As with the other two new methods, a temporary ImageBuffer object is used, and the buffer draw callback is invoked to allow caller to properly handle the shadowing output. In CairoOperations.cpp, the new ShadowBlur methods are exercised, with direct Cairo operation invocation replacing the GraphicsContext calls otherwise done through ShadowBlur. ShadowState object now also has to track the global alpha and the global composite operator values so that it can properly rasterize the resulting shadow into the final image. No new tests -- no change in behavior. * platform/graphics/ShadowBlur.cpp: (WebCore::ShadowBlur::adjustBlurRadius): (WebCore::ShadowBlur::calculateLayerBoundingRect): (WebCore::ShadowBlur::drawRectShadow): (WebCore::ShadowBlur::drawInsetShadow): (WebCore::ShadowBlur::drawShadowLayer): (WebCore::ShadowBlur::beginShadowLayer): Deleted. (WebCore::ShadowBlur::endShadowLayer): Deleted. * platform/graphics/ShadowBlur.h: * platform/graphics/cairo/CairoOperations.cpp: (WebCore::Cairo::drawShadowLayerBuffer): (WebCore::Cairo::fillShadowBuffer): (WebCore::Cairo::drawPathShadow): (WebCore::Cairo::drawGlyphsShadow): (WebCore::Cairo::ShadowState::ShadowState): (WebCore::Cairo::fillRect): (WebCore::Cairo::fillRoundedRect): (WebCore::Cairo::fillRectWithRoundedHole): (WebCore::Cairo::drawSurface): * platform/graphics/cairo/CairoOperations.h: Default-initialize FillSource::fillRule to RULE_NONZERO. * platform/graphics/cairo/PlatformContextCairo.h: Drop the ShadowBlur.h include, it's moved to CairoOperations.cpp. * rendering/RenderThemeGtk.cpp: Explicitly include the FloatRoundedRect.h header now that it's not included through the ShadowBlur.h header via PlatformContextCairo.h. 2018-02-20 Sergio Villar Senin [WebVR] Use RuntimeEnabledFeatures to enable/disable WebVR https://bugs.webkit.org/show_bug.cgi?id=182961 Reviewed by Xabier Rodriguez-Calvar. The shared feature was properly added to RuntimeEnabledFeatures some time ago but the code was instead using a private method in NavigatorWebVR to temporarily disable it. WebVR is enabled in WebPreferences.yaml for GTK+ & WPE as default experimental feature. * Modules/webvr/NavigatorWebVR.cpp: (WebCore::NavigatorWebVR::getVRDisplays): (WebCore::NavigatorWebVR::vrEnabled): Deleted. 2018-02-19 Antti Koivisto Use selector filter when invalidating descendants https://bugs.webkit.org/show_bug.cgi?id=182839 Reviewed by Zalan Bujtas. We can make descendant invalidation faster by enabling filtering. * css/SelectorFilter.cpp: (WebCore::SelectorFilter::initializeParentStack): Traverse and reverse the ancestor chain, and push it. (WebCore::SelectorFilter::pushParent): (WebCore::SelectorFilter::pushParentInitializingIfNeeded): Add a version of pushParent that can initialize the stack. (WebCore::SelectorFilter::popParent): (WebCore::SelectorFilter::popParentsUntil): Pop until a given parent element. (WebCore::SelectorFilter::pushParentStackFrame): Deleted. (WebCore::SelectorFilter::popParentStackFrame): Deleted. These were the same as push/popParent. * css/SelectorFilter.h: (WebCore::SelectorFilter::popParent): Deleted. * style/StyleInvalidator.cpp: (WebCore::Style::Invalidator::invalidateStyleForDescendants): Use pushParentInitializingIfNeeded. (WebCore::Style::Invalidator::invalidateStyleWithMatchElement): Use selector filter when doing descendant tree invalidation. Make sure to pop it until the parent when reusing. 2018-02-19 Fujii Hironori null m_lastNodeInserted dereference at ReplaceSelectionCommand::InsertedNodes::lastLeafInserted https://bugs.webkit.org/show_bug.cgi?id=161947 Reviewed by Ryosuke Niwa. InsertedNodes happened to be empty if the inserted nodes were removed. Add more checks if InsertedNodes is empty. No new tests (Covered by existing tests). * editing/ReplaceSelectionCommand.cpp: (WebCore::ReplaceSelectionCommand::doApply): Return early if InsertedNodes becomes empty. * editing/ReplaceSelectionCommand.h: (WebCore::ReplaceSelectionCommand::InsertedNodes::isEmpty): New method. (WebCore::ReplaceSelectionCommand::InsertedNodes::lastLeafInserted const): Assert m_lastNodeInserted is not null. (WebCore::ReplaceSelectionCommand::InsertedNodes::pastLastLeaf const): Ditto. 2018-02-19 Said Abou-Hallawa Add SVGPropertyTraits::fromString() to all the SVG animated types https://bugs.webkit.org/show_bug.cgi?id=182901 Reviewed by Dean Jackson. This is a work toward https://bugs.webkit.org/show_bug.cgi?id=168586. The goal is is to templatize the SVGAnimatedType class and to use SVGPropertyTraits methods inside the template functions. * WebCore.xcodeproj/project.pbxproj: Move the enum and the SVGPropertyTraits from SVGMarkerElement.h to SVGMarkerTypes.h. * svg/SVGAngle.h: (WebCore::SVGAngle::SVGAngle): Delete unused constructor and create() method. * svg/SVGAngleValue.h: * svg/SVGAnimateMotionElement.cpp: (WebCore::parsePoint): Deleted. Move this function to SVGParserUtilities.cpp * svg/SVGAnimatedAngle.cpp: (WebCore::SVGAnimatedAngleAnimator::constructFromString): Use SVGPropertyTraits::fromString(). * svg/SVGAnimatedBoolean.cpp: (WebCore::SVGAnimatedBooleanAnimator::constructFromString): Ditto. * svg/SVGAnimatedColor.cpp: (WebCore::SVGAnimatedColorAnimator::constructFromString): Ditto. (WebCore::SVGAnimatedColorAnimator::addAnimatedTypes): Use const. (WebCore::SVGAnimatedColorAnimator::calculateAnimatedValue): Ditto. * svg/SVGAnimatedEnumeration.cpp: (WebCore::SVGAnimatedEnumerationAnimator::constructFromString): Ditto. * svg/SVGAnimatedInteger.cpp: (WebCore::SVGAnimatedIntegerAnimator::constructFromString): Ditto. * svg/SVGAnimatedIntegerOptionalInteger.cpp: (WebCore::SVGAnimatedIntegerOptionalIntegerAnimator::constructFromString): Ditto. * svg/SVGAnimatedLength.cpp: * svg/SVGAnimatedLengthList.cpp: (WebCore::SVGAnimatedLengthListAnimator::constructFromString): Ditto. * svg/SVGAnimatedNumber.cpp: (WebCore::SVGAnimatedNumberAnimator::constructFromString): Ditto (WebCore::parseNumberFromString): * svg/SVGAnimatedNumberList.cpp: (WebCore::SVGAnimatedNumberListAnimator::constructFromString): Ditto. * svg/SVGAnimatedNumberOptionalNumber.cpp: (WebCore::SVGAnimatedNumberOptionalNumberAnimator::constructFromString): Ditto. * svg/SVGAnimatedPath.cpp: (WebCore::SVGAnimatedPathAnimator::constructFromString): Ditto. * svg/SVGAnimatedPointList.cpp: (WebCore::SVGAnimatedPointListAnimator::constructFromString): Ditto. * svg/SVGAnimatedPreserveAspectRatio.cpp: (WebCore::SVGAnimatedPreserveAspectRatioAnimator::constructFromString): Ditto. * svg/SVGAnimatedRect.cpp: (WebCore::SVGAnimatedRectAnimator::constructFromString): Ditto. * svg/SVGAnimatedString.cpp: (WebCore::SVGAnimatedStringAnimator::constructFromString): Ditto. * svg/SVGAnimatedTransformList.cpp: (WebCore::SVGAnimatedTransformListAnimator::constructFromString): Ditto. * svg/SVGLength.h: (WebCore::SVGLength::SVGLength): Delete unused constructor and create() method. * svg/SVGLengthListValues.h: (WebCore::SVGPropertyTraits::fromString): New SVGPropertyTraits method. (WebCore::SVGPropertyTraits::parse): Ditto. * svg/SVGMarkerElement.h: (WebCore::SVGPropertyTraits::highestEnumValue): Deleted. (WebCore::SVGPropertyTraits::toString): Deleted. (WebCore::SVGPropertyTraits::fromString): Deleted. (WebCore::SVGIDLEnumLimits::highestExposedEnumValue): Deleted. (WebCore::SVGPropertyTraits::highestEnumValue): Deleted. (WebCore::SVGPropertyTraits::fromString): Deleted. * svg/SVGMarkerTypes.h: Added. (WebCore::SVGPropertyTraits::highestEnumValue): (WebCore::SVGPropertyTraits::toString): (WebCore::SVGPropertyTraits::fromString): (WebCore::SVGPropertyTraits::highestEnumValue): (WebCore::SVGPropertyTraits::fromString): (WebCore::SVGIDLEnumLimits::highestExposedEnumValue): * svg/SVGMatrix.h: Delete unused constructor and create method. * svg/SVGNumber.h: (WebCore::SVGNumber::SVGNumber): Ditto. * svg/SVGNumberListValues.h: (WebCore::SVGPropertyTraits::fromString): New SVGPropertyTraits method. * svg/SVGParserUtilities.cpp: (WebCore::parsePoint): This is moved from SVGAnimateMotionElement.cpp * svg/SVGParserUtilities.h: * svg/SVGPathByteStream.h: (WebCore::SVGPathByteStream::SVGPathByteStream): (WebCore::SVGPathByteStream::operator=): Add copy and move assignment operators. (WebCore::SVGPathByteStream::copy const): Use the copy assignment. (WebCore::SVGPathByteStream::isEmpty const): Use Data.isEmpty(). (WebCore::SVGPropertyTraits::initialValue): New SVGPropertyTraits method. (WebCore::SVGPropertyTraits::fromString): Ditto. * svg/SVGPathUtilities.cpp: (WebCore::addToSVGPathByteStream): Answer Simon's questions which were added in r190844. * svg/SVGPoint.h: (WebCore::SVGPoint::SVGPoint): Delete unused constructor and create method. * svg/SVGPointListValues.h: (WebCore::SVGPropertyTraits::fromString): New SVGPropertyTraits method. * svg/SVGPolyElement.cpp: (WebCore::SVGPolyElement::parseAttribute): Use the move assignment operator. * svg/SVGPreserveAspectRatio.h: (WebCore::SVGPreserveAspectRatio::SVGPreserveAspectRatio): Delete unused constructor and create method. * svg/SVGPreserveAspectRatioValue.cpp: (WebCore::SVGPreserveAspectRatioValue::SVGPreserveAspectRatioValue): Add new constructor. * svg/SVGPreserveAspectRatioValue.h: (WebCore::SVGPropertyTraits::fromString): New SVGPropertyTraits method. (WebCore::SVGPropertyTraits::toString): Ditto. * svg/SVGRect.h: (WebCore::SVGRect::SVGRect): Delete unused constructor and create method. * svg/SVGRectTraits.h: Removed. * svg/SVGTransform.h: (WebCore::SVGTransform::SVGTransform): Delete unused constructor and create method. * svg/SVGTransformListValues.h: (WebCore::SVGPropertyTraits::fromString): New SVGPropertyTraits method. * svg/properties/SVGPropertyTearOff.h: Delete unused create method. * svg/properties/SVGPropertyTraits.h: New SVGPropertyTraits methods. (WebCore::SVGPropertyTraits::fromString): (WebCore::SVGPropertyTraits::initialValue): (WebCore::SVGPropertyTraits::fromString): (WebCore::SVGPropertyTraits::parse): (WebCore::SVGPropertyTraits::toString): (WebCore::SVGPropertyTraits::fromString): (WebCore::SVGPropertyTraits::fromString): (WebCore::SVGPropertyTraits::parse): (WebCore::SVGPropertyTraits::initialValue): (WebCore::SVGPropertyTraits::fromString): (WebCore::SVGPropertyTraits::parse): (WebCore::SVGPropertyTraits::toString): (WebCore::SVGPropertyTraits::initialValue): (WebCore::SVGPropertyTraits::fromString): (WebCore::SVGPropertyTraits::parse): (WebCore::SVGPropertyTraits::toString): (WebCore::SVGPropertyTraits::fromString): (WebCore::SVGPropertyTraits::parse): (WebCore::SVGPropertyTraits::toString): 2018-02-19 Antoine Quint [Modern Media Controls] Implement a compact set of media controls https://bugs.webkit.org/show_bug.cgi?id=182937 Reviewed by Eric Carlson. We add a new type of media controls used when we need stripped down and compact controls. The new CompactMediaControls only show a play/pause button and an invalid placard and disregard all media events that are not relevant to the display of these controls. To distinguish cases where we need to show compact media controls, we expose a new property on MediaControlsHost called "compactMode". Tests: media/modern-media-controls/compact-media-controls/compact-media-controls-constructor.html media/modern-media-controls/compact-media-controls/compact-media-controls-layout.html * Modules/mediacontrols/MediaControlsHost.cpp: (WebCore::MediaControlsHost::base64StringForIconNameAndType const): (WebCore::MediaControlsHost::compactMode const): * Modules/mediacontrols/MediaControlsHost.h: (WebCore::MediaControlsHost::setSimulateCompactMode): * Modules/mediacontrols/MediaControlsHost.idl: * Modules/modern-media-controls/controls/compact-media-controls.js: Added. (CompactMediaControls.prototype.get scaleFactor): (CompactMediaControls.prototype.set scaleFactor): (CompactMediaControls.prototype.get shouldCenterControlsVertically): (CompactMediaControls.prototype.set shouldCenterControlsVertically): (CompactMediaControls.prototype.get placard): (CompactMediaControls.prototype.set placard): (CompactMediaControls.prototype.layout): (CompactMediaControls.prototype.commitProperty): * Modules/modern-media-controls/controls/icon-service.js: (const.iconService.new.IconService.prototype._fileNameAndPlatformForIconAndLayoutTraits): (const.iconService.new.IconService): * Modules/modern-media-controls/controls/inline-media-controls.js: * Modules/modern-media-controls/controls/layout-item.js: * Modules/modern-media-controls/js-files: * Modules/modern-media-controls/main.js: * Modules/modern-media-controls/media/media-controller.js: (MediaController.prototype.get layoutTraits): (MediaController.prototype._supportingObjectClasses): Compute the set of MediaControllerSupport classes based on the layout traits such that in compact mode we only return PlacardSupport and PlaybackSupport. (MediaController.prototype._updateControlsIfNeeded): (MediaController.prototype._controlsClassForLayoutTraits): (MediaController.prototype._shouldControlsBeAvailable): * Modules/modern-media-controls/media/placard-support.js: (PlacardSupport.prototype.get mediaEvents): Only track the "error" event in compact mode since this is the only relevant placard. * Modules/modern-media-controls/media/playback-support.js: (PlaybackSupport.prototype.syncControl): Only show or hide the play/pause button based on the playback state when in compact mode. (PlaybackSupport): * WebCore.xcodeproj/project.pbxproj: 2018-02-19 Antoine Quint [Web Animations] Make KeyframeEffect target nullable and read-write https://bugs.webkit.org/show_bug.cgi?id=182741 Reviewed by Dean Jackson. We used to completely disregard null targets, for instance not parsing keyframes, but targets can be null and are also supposed to be read-write for KeyframeEffect. We now update the IDL for KeyframeEffect to mark the target property as read-write and update the implementation to correctly handle null targets. This revealed a few issues in our implementation by allowing more WPT tests to run. So we also ensure that: - we don't crash when parsing font-related properties by calling update() on the generated RenderStyle's FontCascade when parsing keyframes. - CSS properties are provided as camel-case and not as hyphenated form - values provided in keyframes dictionaries are only read for valid properties - styles for effect targets are invalidated as soon as the timing model for that animation is changed * animation/KeyframeEffect.idl: * animation/KeyframeEffectReadOnly.cpp: (WebCore::invalidateElement): Add a new utility method to invalidate a given element since we may want to invalidate not only the current target (m_target) but also a previous target. (WebCore::IDLAttributeNameToAnimationPropertyName): Move this function below CSSPropertyIDToIDLAttributeName so that it can call that function. We also check that we reject CSS properties that are not provided in camel-case form (eg. "font-size" vs. "fontSize"). (WebCore::processIterableKeyframes): Only read the JS values if we know that the provided JS property name maps to a valid CSS property. (WebCore::KeyframeEffectReadOnly::processKeyframes): Allow keyframes to be processed even if the effect's target is null. (WebCore::KeyframeEffectReadOnly::setTarget): Notify the animation that the effect target has changed and invalidate the style of the new target and the old targets, if any. We also update the blending keyframes since this task may not have been completed in a previous call to processKeyframes() due to the target being null at that time. (WebCore::KeyframeEffectReadOnly::invalidate): Use the invalidateElement() utility. * animation/KeyframeEffectReadOnly.h: * animation/WebAnimation.cpp: (WebCore::WebAnimation::effectTargetDidChange): This method is called in KeyframeEffectReadOnly::setTarget() to inform the animation of the previous effect target and the new one upon a target change. This allows us to forward this information onto the timeline so that we correctly add or remove the targets from the list of animated elements. * animation/WebAnimation.h: 2018-02-19 Chris Dumez Crash under MIMETypeRegistry::isSupportedJavaScriptMIMEType() https://bugs.webkit.org/show_bug.cgi?id=182927 Reviewed by Antti Koivisto. Make it safe to call MIMETypeRegistry::isSupportedJavaScriptMIMEType() from the non-main thread. It is currently being called from a background thread in the following places: - ServiceWorkerJob::didReceiveResponse() - WorkerGlobalScope::importScripts() These call sites on non-main threads were added recently with the support for service workers. No new tests, already covered by existing tests that flakily experience service worker process crashes. * platform/MIMETypeRegistry.cpp: (WebCore::MIMETypeRegistry::isSupportedJavaScriptMIMEType): 2018-02-19 Dean Jackson SIGFPE @ int WebCore::SVGToOTFFontConverter::scaleUnitsPerEm const + 45 https://bugs.webkit.org/show_bug.cgi?id=182944 Reviewed by Myles Maxfield. Avoid a divide-by-zero. Test: svg/text/font-bad-unitsperem.html * svg/SVGFontFaceElement.cpp: (WebCore::SVGFontFaceElement::unitsPerEm const): 2018-02-19 Tim Horton REGRESSION (r219342): Touch event coordinates and elementFromPoint coordinates differ https://bugs.webkit.org/show_bug.cgi?id=182910 Reviewed by Simon Fraser. We reverted other changes to the definition of client coordinates in r219829 due to compatibility concerns. However, we failed to revert r219342 on trunk, leaving elementFromPoint() using coordinates relative to the layout viewport. Add a currently off-by-default setting to switch on layout-viewport-relative client coordinates and guard the elementFromPoint changes behind it. A future patch should roll r219829 back in also behind this setting, so that everything remains consistent regardless of which coordinate space we choose. * dom/TreeScope.cpp: (WebCore::absolutePointIfNotClipped): * page/Settings.yaml: * rendering/RenderLayer.cpp: (WebCore::RenderLayer::hitTest): 2018-02-19 Eric Carlson [Extra zoom mode] Don't allow PiP media playback https://bugs.webkit.org/show_bug.cgi?id=182930 Reviewed by Andy Estes. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer): Don't call setPIPModeEnabled: if it isn't implemented. (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenMode): Ditto. 2018-02-19 Antoine Quint [Web Animations] Decouple parsing JS keyframes and computing blending keyframes https://bugs.webkit.org/show_bug.cgi?id=182939 Reviewed by Dean Jackson. Move all the code used to create the KeyframeList into a dedicated updateBlendingKeyframes() method. No new tests since this code change has no user-visible impact. * animation/KeyframeEffectReadOnly.cpp: (WebCore::KeyframeEffectReadOnly::processKeyframes): (WebCore::KeyframeEffectReadOnly::updateBlendingKeyframes): * animation/KeyframeEffectReadOnly.h: 2018-02-19 Jer Noble [EME] Add mechanism for MediaKeySession to react to HDCP changes https://bugs.webkit.org/show_bug.cgi?id=182935 Reviewed by Eric Carlson. Add a client callback interface to CDMInterface to allow subclasses to communicate up to MediaKeySEssion. Add a virtual method to CDMInterface to allow it to be notified of HDCP status changes. Override this method in CDMInstanceFairPlayStreamingAVFObjC. Hook up the outputObscuredDueToInsufficientExternalProtectionChanged() methods in both MediaPlayerPrivateAVFoundationObjC and MediaPlayerPrivateMediaSourceAVFObjC to this new CDMInstance method. Add an Internals method to simulate an HDCP error for testing purposes. * Modules/encryptedmedia/MediaKeySession.cpp: (WebCore::MediaKeySession::MediaKeySession): (WebCore::MediaKeySession::~MediaKeySession): (WebCore::MediaKeySession::updateKeyStatuses): * Modules/encryptedmedia/MediaKeySession.h: * platform/encryptedmedia/CDMInstance.h: (WebCore::CDMInstance::setHDCPStatus): (WebCore::CDMInstance::setClient): (WebCore::CDMInstance::clearClient): * platform/graphics/MediaPlayer.cpp: (WebCore::MediaPlayer::beginSimulatedHDCPError): (WebCore::MediaPlayer::endSimulatedHDCPError): * platform/graphics/MediaPlayer.h: * platform/graphics/MediaPlayerPrivate.h: (WebCore::MediaPlayerPrivateInterface::beginSimulatedHDCPError): (WebCore::MediaPlayerPrivateInterface::endSimulatedHDCPError): * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h: * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm: (WebCore::CDMInstanceFairPlayStreamingAVFObjC::setClient): (WebCore::CDMInstanceFairPlayStreamingAVFObjC::clearClient): (WebCore::CDMInstanceFairPlayStreamingAVFObjC::sessionIdentifierChanged): (WebCore::CDMInstanceFairPlayStreamingAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged): * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::outputObscuredDueToInsufficientExternalProtectionChanged): (WebCore::playerKVOProperties): (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]): * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged): * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h: * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: (-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]): (WebCore::SourceBufferPrivateAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged): * testing/Internals.cpp: (WebCore::Internals::beginSimulatedHDCPError): (WebCore::Internals::endSimulatedHDCPError): * testing/Internals.h: * testing/Internals.idl: 2018-02-19 Chris Dumez CrashTracer: com.apple.WebKit.WebContent at WebCore: WebCore::TimerBase::~TimerBase https://bugs.webkit.org/show_bug.cgi?id=182931 Reviewed by Antti Koivisto. Make sure PlatformMediaResource is ThreadSafeRefCounted since it is being used from several threads in WebCoreNSURLSession. Also make sure it is always destroyed on the main thread since it ends up destroying a CachedRawResource object. No new tests, no known reproduction case. * platform/graphics/PlatformMediaResourceLoader.h: * platform/network/cocoa/WebCoreNSURLSession.mm: (-[WebCoreNSURLSessionDataTask dealloc]): 2018-02-19 Zalan Bujtas [RenderTreeBuilder] Rename RenderTreeBuilder::removeAndDestroyChild() -> removeAndDestroy() https://bugs.webkit.org/show_bug.cgi?id=182934 Reviewed by Antti Koivisto. No change in functionality. * dom/Document.cpp: (WebCore::Document::setFullScreenRenderer): * rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::removeAndDestroyAllContinuations): * rendering/RenderButton.cpp: (WebCore::RenderButton::setText): * rendering/RenderFullScreen.cpp: (WebCore::RenderFullScreen::willBeDestroyed): (WebCore::RenderFullScreen::unwrapRenderer): * rendering/RenderListItem.cpp: (WebCore::RenderListItem::willBeDestroyed): * rendering/RenderTextFragment.cpp: (WebCore::RenderTextFragment::willBeDestroyed): (WebCore::RenderTextFragment::setText): * rendering/RenderView.cpp: (WebCore::RenderView::willBeDestroyed): * rendering/updating/RenderTreeBuilder.cpp: (WebCore::RenderTreeBuilder::removeAndDestroy): (WebCore::RenderTreeBuilder::removeFromParentAndDestroyCleaningUpAnonymousWrappers): (WebCore::RenderTreeBuilder::removeAndDestroyChild): Deleted. * rendering/updating/RenderTreeBuilder.h: * rendering/updating/RenderTreeBuilderBlock.cpp: (WebCore::RenderTreeBuilder::Block::takeChild): * rendering/updating/RenderTreeBuilderFirstLetter.cpp: (WebCore::RenderTreeBuilder::FirstLetter::updateStyle): (WebCore::RenderTreeBuilder::FirstLetter::createRenderers): * rendering/updating/RenderTreeBuilderList.cpp: (WebCore::RenderTreeBuilder::List::updateItemMarker): * rendering/updating/RenderTreeBuilderMultiColumn.cpp: (WebCore::RenderTreeBuilder::MultiColumn::destroyFragmentedFlow): (WebCore::RenderTreeBuilder::MultiColumn::handleSpannerRemoval): * rendering/updating/RenderTreeBuilderRuby.cpp: (WebCore::RenderTreeBuilder::Ruby::moveBlockChildren): (WebCore::RenderTreeBuilder::Ruby::takeChild): 2018-02-19 Daniel Bates Do not block authentication challenge to navigated resources https://bugs.webkit.org/show_bug.cgi?id=182807 Reviewed by Brent Fulgham. Blocking the main resource from asking for credentials depending on how it was navigated to could be confusing to a person and breaks web compatibility. Restore the behavior before r224134. * loader/FrameLoader.cpp: (WebCore::FrameLoader::receivedFirstData): * loader/ResourceLoader.cpp: (WebCore::ResourceLoader::init): (WebCore::ResourceLoader::willSendRequestInternal): (WebCore::ResourceLoader::didBlockAuthenticationChallenge): (WebCore::ResourceLoader::isAllowedToAskUserForCredentials const): (WebCore::ResourceLoader::isMixedContent const): Deleted. * loader/ResourceLoader.h: (WebCore::ResourceLoader::wasAuthenticationChallengeBlocked const): (WebCore::ResourceLoader::wasInsecureRequestSeen const): Deleted. 2018-02-17 Antoine Quint [Web Animations] Store all parsed keyframe input information in a single structure https://bugs.webkit.org/show_bug.cgi?id=182903 Reviewed by Dean Jackson. When parsing keyframe input provided through the JS API, we used to create several data structures. During parsing we would create a Vector where we would store the validated values for "offset", "easing" and "composite" as well as CSS properties and CSS values as strings. Then we would create a KeyframeList, a class that pre-dates the work on Web Animations and is used for hardware animations, with RenderStyle objects that are used for CSS property blending at runtime. Once the KeyframeList was created, the Vector was discarded. Since KeyframeList did not know about nullable offsets, timing functions and composite operations, and because we do not with to modify a legacy class that we will eventually remove once all the Web Animations work is complete, we also stored the parsed offsets as m_offsets, the timing functions as m_timingFunctions and the composite operations as m_compositeOperations. In this patch we rename the ProcessedKeyframe structure used temporarily during parsing to ParsedKeyframe and store both the input and processed data related to a given keyframe in that single structure which we keep around as m_parsedKeyframes when we finished processing the keyframes input. This update ParsedKeyframe structure allows to keep around the original nullable offsets, the original CSS properties and CSS values as strings as a HashMap, as well as the CSS properties and CSS values as CSSValue objects using a MutableStyleProperties object. This has the benefit of reducing the number of members, but also pave the way for supporting read-write targets where we will be able to decouple parsing keyframes and creating a KeyframeList, which requires a valid target to create RenderStyle objects used for blending, since the original parsing-time information is now stored. Finally, this allowed getKeyframes() to be more compliant by returning the CSS values as originally provided in the keyframe input with shorthand properties when provided, rather than the long-hands we used to read back through RenderStyle objects. The generated KeyframeList is now stored as m_blendingKeyframes and is only used for the purpose of interfacing with hardware animations and CSS property blending. While ProcessedKeyframe was copyable due to holding only simple types, ParsedKeyframe is not since it uses a Ref to hold the MutableStyleProperties. This uncovered some cases where we copied ProcessedKeyframe objects, we now ensure that the ParsedKeyframe objects are moved instead, which was the correct thing to do all along. * animation/KeyframeEffectReadOnly.cpp: (WebCore::computeMissingKeyframeOffsets): While we used to store std::optional for the computed offset, we now store a simple double, which makes more sense since the computed offset is eventually a fully resolved value after calling computeMissingKeyframeOffsets(). So we now compute the final computed offset without resorting to intermediate nullable computed offsets. (WebCore::processIterableKeyframes): (WebCore::processPropertyIndexedKeyframes): (WebCore::KeyframeEffectReadOnly::KeyframeEffectReadOnly): (WebCore::KeyframeEffectReadOnly::copyPropertiesFromSource): (WebCore::KeyframeEffectReadOnly::getKeyframes): (WebCore::KeyframeEffectReadOnly::processKeyframes): (WebCore::KeyframeEffectReadOnly::computeStackingContextImpact): (WebCore::KeyframeEffectReadOnly::shouldRunAccelerated): (WebCore::KeyframeEffectReadOnly::getAnimatedStyle): (WebCore::KeyframeEffectReadOnly::setAnimatedPropertiesInStyle): (WebCore::KeyframeEffectReadOnly::startOrStopAccelerated): * animation/KeyframeEffectReadOnly.h: (WebCore::KeyframeEffectReadOnly::ParsedKeyframe::ParsedKeyframe): 2018-02-19 Zalan Bujtas [RenderTreeBuilder] Remove redundant RenderObject::removeFromParentAndDestroy https://bugs.webkit.org/show_bug.cgi?id=182926 Reviewed by Antti Koivisto. Call RenderTreeBuilder::removeAndDestroyChild() directly instead. No change in functionality. * dom/Document.cpp: (WebCore::Document::setFullScreenRenderer): * rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::removeAndDestroyAllContinuations): * rendering/RenderButton.cpp: (WebCore::RenderButton::setText): * rendering/RenderFullScreen.cpp: (WebCore::RenderFullScreen::willBeDestroyed): (WebCore::RenderFullScreen::unwrapRenderer): * rendering/RenderListItem.cpp: (WebCore::RenderListItem::willBeDestroyed): * rendering/RenderObject.cpp: (WebCore::RenderObject::removeFromParentAndDestroy): Deleted. * rendering/RenderObject.h: * rendering/RenderTextFragment.cpp: (WebCore::RenderTextFragment::willBeDestroyed): (WebCore::RenderTextFragment::setText): * rendering/updating/RenderTreeBuilder.cpp: (WebCore::RenderTreeBuilder::removeFromParentAndDestroyCleaningUpAnonymousWrappers): * rendering/updating/RenderTreeBuilderBlock.cpp: (WebCore::RenderTreeBuilder::Block::takeChild): * rendering/updating/RenderTreeBuilderList.cpp: (WebCore::RenderTreeBuilder::List::updateItemMarker): * rendering/updating/RenderTreeBuilderMultiColumn.cpp: (WebCore::RenderTreeBuilder::MultiColumn::destroyFragmentedFlow): (WebCore::RenderTreeBuilder::MultiColumn::handleSpannerRemoval): * rendering/updating/RenderTreeBuilderRuby.cpp: (WebCore::RenderTreeBuilder::Ruby::moveBlockChildren): (WebCore::RenderTreeBuilder::Ruby::takeChild): 2018-02-19 Tim Horton Increase text autosizing constants for extra zoom mode https://bugs.webkit.org/show_bug.cgi?id=182919 Reviewed by Wenson Hsieh. * page/Settings.yaml: * page/SettingsBase.cpp: (WebCore::SettingsBase::defaultMinimumZoomFontSize): (WebCore::SettingsBase::defaultOneLineTextMultiplierCoefficient): (WebCore::SettingsBase::defaultMultiLineTextMultiplierCoefficient): (WebCore::SettingsBase::defaultMaxTextAutosizingScaleIncrease): * page/SettingsBase.h: * rendering/RenderBlockFlow.cpp: (WebCore::oneLineTextMultiplier): (WebCore::textMultiplier): (WebCore::RenderBlockFlow::adjustComputedFontSizes): * rendering/TextAutoSizing.cpp: (WebCore::TextAutoSizingValue::adjustTextNodeSizes): Make autosizing constants settings, and change their default values. 2018-02-17 Antoine Quint [Web Animations] Accept null composite modes in keyframes https://bugs.webkit.org/show_bug.cgi?id=182902 Reviewed by Dean Jackson. The Web Animations spec used to specify that that composite modes should be non-null and instead not be provided when specifying keyframes, but now null values are accepted. We update the IDL input types used when parsing keyframes to allow for null values. We had already updated the getKeyframes() output in webkit.org/b/182600. * animation/KeyframeEffectReadOnly.cpp: (WebCore::processIterableKeyframes): (WebCore::processKeyframeLikeObject): (WebCore::processPropertyIndexedKeyframes): * animation/KeyframeEffectReadOnly.h: * animation/KeyframeEffectReadOnly.idl: 2018-02-19 Ms2ger Explicitly qualify some method calls on this in lamdas in Service Worker code. https://bugs.webkit.org/show_bug.cgi?id=182875 Reviewed by Chris Dumez. This is necessary for the code to build with GCC 5. Other code already appears to have been adapted similarly. No change in functionality. * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::redirectReceived): (WebCore::DocumentLoader::startLoadingMainResource): * workers/service/ServiceWorkerContainer.cpp: (WebCore::ServiceWorkerContainer::ready): (WebCore::ServiceWorkerContainer::getRegistration): (WebCore::ServiceWorkerContainer::getRegistrations): (WebCore::ServiceWorkerContainer::didFinishGetRegistrationsRequest): * workers/service/ServiceWorkerGlobalScope.cpp: (WebCore::ServiceWorkerGlobalScope::updateExtendedEventsSet): * workers/service/server/SWServer.cpp: (WebCore::SWServer::claim): (WebCore::SWServer::Connection::resolveRegistrationReadyRequests): * workers/service/server/SWServerRegistration.cpp: (WebCore::SWServerRegistration::updateRegistrationState): (WebCore::SWServerRegistration::setUpdateViaCache): (WebCore::SWServerRegistration::setLastUpdateTime): (WebCore::SWServerRegistration::fireUpdateFoundEvent): * workers/service/server/SWServerWorker.cpp: (WebCore::SWServerWorker::setState): 2018-02-19 Zalan Bujtas [RenderTreeBuilder] Move RenderElement::removeAndDestroyChild() to RenderTreeBuilder https://bugs.webkit.org/show_bug.cgi?id=182915 Reviewed by Antti Koivisto. No change in functionality. * rendering/RenderElement.cpp: (WebCore::RenderElement::removeAndDestroyChild): Deleted. * rendering/RenderElement.h: (WebCore::RenderElement::isChildAllowed const): * rendering/RenderObject.cpp: (WebCore::RenderObject::removeFromParentAndDestroy): * rendering/RenderView.cpp: (WebCore::RenderView::willBeDestroyed): * rendering/updating/RenderTreeBuilder.cpp: (WebCore::RenderTreeBuilder::removeAndDestroyChild): (WebCore::RenderTreeBuilder::removeFromParentAndDestroyCleaningUpAnonymousWrappers): * rendering/updating/RenderTreeBuilder.h: * rendering/updating/RenderTreeBuilderFirstLetter.cpp: (WebCore::RenderTreeBuilder::FirstLetter::updateStyle): (WebCore::RenderTreeBuilder::FirstLetter::createRenderers): 2018-02-12 Sergio Villar Senin [WebVR][OpenVR] Implement getVRDisplays() https://bugs.webkit.org/show_bug.cgi?id=182692 Reviewed by Žan Doberšek. This provides an implementation of Navigator's getVRDisplays() method using OpenVR as backend. It queues several promises in a queue and resolves them all just once. The information retrieved is very minimal for the time being, but this change lays the ground for all the changes that are about to land. The VR code uses a VRManager which is the interface with the platform code and the responsible for instantiating the right platform code. This platform code is currently being implemented using OpenVR but could we also ported in the future to OpenXR or any other VR SDK. * CMakeLists.txt: * Modules/webvr/NavigatorWebVR.cpp: (WebCore::NavigatorWebVR::getVRDisplays): (WebCore::NavigatorWebVR::vrEnabled): * Modules/webvr/NavigatorWebVR.h: * Modules/webvr/VRDisplay.cpp: (WebCore::VRDisplay::create): (WebCore::VRDisplay::VRDisplay): (WebCore::VRDisplay::isConnected const): (WebCore::VRDisplay::displayName const): * Modules/webvr/VRDisplay.h: * Modules/webvr/VRDisplayCapabilities.cpp: (WebCore::VRDisplayCapabilities::VRDisplayCapabilities): (WebCore::VRDisplayCapabilities::hasPosition const): (WebCore::VRDisplayCapabilities::hasOrientation const): (WebCore::VRDisplayCapabilities::hasExternalDisplay const): (WebCore::VRDisplayCapabilities::canPresent const): (WebCore::VRDisplayCapabilities::maxLayer const): * Modules/webvr/VRDisplayCapabilities.h: (WebCore::VRDisplayCapabilities::create): * Sources.txt: * platform/vr/VRManager.cpp: Added. This is the main interface used by bindings code to access VR devices data provided by platform code. (WebCore::VRManager::singleton): (WebCore::VRManager::VRManager): (WebCore::VRManager::~VRManager): (WebCore::VRManager::refreshVRDevices): * platform/vr/VRManager.h: Added. * platform/vr/VRPlatformDisplay.h: Added. Abstraction of a VR display system. To be implemented by backends like OpenVR, OpenXR... * platform/vr/VRPlatformManager.h: Added. Abstraction of the platform specific class which retrieves data from VR devices. To be implemented by backends like OpenVR, OpenXR... * platform/vr/openvr/VRPlatformDisplayOpenVR.cpp: Added. (WebCore::VRPlatformDisplayOpenVR::VRPlatformDisplayOpenVR): * platform/vr/openvr/VRPlatformDisplayOpenVR.h: Added. * platform/vr/openvr/VRPlatformManagerOpenVR.cpp: Added. (WebCore::VRPlatformManagerOpenVR::create): (WebCore::VRPlatformManagerOpenVR::VRPlatformManagerOpenVR): (WebCore::VRPlatformManagerOpenVR::~VRPlatformManagerOpenVR): (WebCore::VRPlatformManagerOpenVR::initOpenVR): * platform/vr/openvr/VRPlatformManagerOpenVR.h: Added. * WebCore.xcodeproj/project.pbxproj: 2018-02-19 Manuel Rego Casasnovas [css-grid] Apply automatic minimum size clamping to spanning items too https://bugs.webkit.org/show_bug.cgi?id=182684 Reviewed by Javier Fernandez. In r225776 we added the conditions from the spec to apply the automatic minimum size clamping when required but only to non-spanning items. See: https://drafts.csswg.org/css-grid/#min-size-auto This patch moves the code from GridTrackSizingAlgorithm::sizeTrackToFitNonSpanningItem() to GridTrackSizingAlgorithmStrategy::minSizeForChild() that way the clamping is applied for both spanning and non-spanning items. This somehow reverts r225776, as it was adding some duplicated code. All the checks to know if we should use that part of the spec were already present in GridTrackSizingAlgorithmStrategy::minSizeForChild(). Apart from using the previous code, there's a new loop to verify that the max track sizing function is fixed for all the tracks of the item. Tests: imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-minimum-size-grid-items-024.html imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-minimum-size-grid-items-025.html * rendering/GridTrackSizingAlgorithm.cpp: (WebCore::GridTrackSizingAlgorithm::sizeTrackToFitNonSpanningItem): (WebCore::GridTrackSizingAlgorithmStrategy::minSizeForChild const): 2018-02-19 Philippe Normand [GTK][GStreamer] Replaying a webm video twice causes the video to stop getting rendered https://bugs.webkit.org/show_bug.cgi?id=176789 Reviewed by Xabier Rodriguez-Calvar. Ensure the wrapped GstGLContext is set when the pipeline goes from READY to PAUSED state. This is a workaround for https://bugzilla.gnome.org/show_bug.cgi?id=757933. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer): Add debug statement. (WebCore::MediaPlayerPrivateGStreamer::readyTimerFired): Ditto. (WebCore::MediaPlayerPrivateGStreamer::changePipelineState): Ensure the wrapped GstGLContext is set when the pipeline goes from READY to PAUSED state. (WebCore::MediaPlayerPrivateGStreamer::didEnd): Add debug statement. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: Change the requestGLContext to be a method instead of a static function. Being a static function was a requirement for the now-removed OpenWebRTC player. (WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage): Add debug statement, fix requestGLContext usage. (WebCore::MediaPlayerPrivateGStreamerBase::requestGLContext): Refactor as method. (WebCore::MediaPlayerPrivateGStreamerBase::flushCurrentBuffer): Fix requestGLContext usage. (WebCore::MediaPlayerPrivateGStreamerBase::createVideoSinkGL): Remove fixed FIXME. (WebCore::MediaPlayerPrivateGStreamerBase::ensureGLVideoSinkContext): Set display and app wrapped contexts on the video sink. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h: 2018-02-19 Xabier Rodriguez Calvar [GStreamer] Crash in WebCore::MediaPlayerRequestInstallMissingPluginsCallback::complete https://bugs.webkit.org/show_bug.cgi?id=166733 Reviewed by Philippe Normand. There are a couple of issues to tackle here. First is handling getting more than one missing plugin installation request at the same time. For this we add the request to a Vector and handle them there. Second is that if the player is dead and we still get the result, bad things happen. For that we "weaked" the pointer capture by the lambda. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer): Handle Vector of callbacks. (WebCore::MediaPlayerPrivateGStreamer::handleMessage): Weak private player pointer and put the callback in the Vector. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: Callback becomes Vector. * platform/graphics/gstreamer/MediaPlayerRequestInstallMissingPluginsCallback.h: (WebCore::MediaPlayerRequestInstallMissingPluginsCallback::create): (WebCore::MediaPlayerRequestInstallMissingPluginsCallback::complete): (WebCore::MediaPlayerRequestInstallMissingPluginsCallback::MediaPlayerRequestInstallMissingPluginsCallback): Callback function is refactored into a "using" type and added self as parameter to the function. 2018-02-19 Philippe Normand [GStreamer] Playbin3 support https://bugs.webkit.org/show_bug.cgi?id=182530 Reviewed by Xabier Rodriguez-Calvar. This patch introduces opt-in support for the playbin3 GStreamer element. This new playback element is still considered experimental but it can still be very useful for media assets containing multiple tracks of the same type. In such scenario audio/video decoders would be created only for the selected tracks whereas playbin2 creates decoder for each track. * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp: Take a weak pointer of the media player instead of playbin and call the player when enabling tracks. Also use the GstStream API instead of inspecting the pad when playbin3 is used. (WebCore::AudioTrackPrivateGStreamer::AudioTrackPrivateGStreamer): (WebCore::AudioTrackPrivateGStreamer::disconnect): (WebCore::AudioTrackPrivateGStreamer::markAsActive): (WebCore::AudioTrackPrivateGStreamer::setEnabled): * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.h: * platform/graphics/gstreamer/GRefPtrGStreamer.cpp: GstStream and GstStreamCollection smart pointer support. (WTF::adoptGRef): (WTF::refGPtr): (WTF::derefGPtr): (WTF::refGPtr): (WTF::derefGPtr): * platform/graphics/gstreamer/GRefPtrGStreamer.h: * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp: Use the GstStream API instead of inspecting the pad when playbin3 is used. (WebCore::InbandTextTrackPrivateGStreamer::InbandTextTrackPrivateGStreamer): (WebCore::InbandTextTrackPrivateGStreamer::disconnect): * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.h: (WebCore::InbandTextTrackPrivateGStreamer::create): * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer): m_{audio,video,text}Tracks are now hashmaps, which is a bit more convenient to use than Vectors. (WebCore::MediaPlayerPrivateGStreamer::updateTracks): Update our tracks implementations depending on the streams stored in the collection. (WebCore::MediaPlayerPrivateGStreamer::enableTrack): Activate the given track. This method is called by the TrackPrivate implementations. (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo): Refactored legacy (playbin2) support for track hashmap storage. (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfAudio): Ditto. (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfText): Ditto. (WebCore::MediaPlayerPrivateGStreamer::newTextSample): Use track hashmap storage. (WebCore::MediaPlayerPrivateGStreamer::handleMessage): React on playbin3 GstStream messages, store the collection provided and activate the given selected streams accordingly. (WebCore::MediaPlayerPrivateGStreamer::purgeInvalidAudioTracks): Invalidate tracks no longer needed. (WebCore::MediaPlayerPrivateGStreamer::purgeInvalidVideoTracks): Ditto. (WebCore::MediaPlayerPrivateGStreamer::purgeInvalidTextTracks): Ditto. (WebCore::MediaPlayerPrivateGStreamer::sourceSetupCallback): Refactoring, use source-setup signal instead of the source property which is not supported in playbin3. (WebCore::MediaPlayerPrivateGStreamer::uriDecodeBinElementAddedCallback): Promoted logging messages, GST_TRACE should be used for very frequent and less interesting messages. (WebCore::MediaPlayerPrivateGStreamer::downloadBufferFileCreatedCallback): Ditto. (WebCore::MediaPlayerPrivateGStreamer::sourceSetup): Called by the source-setup signal handler. (WebCore::MediaPlayerPrivateGStreamer::setDownloadBuffering): Debugging message added. (WebCore::MediaPlayerPrivateGStreamer::setPreload): Ditto. (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin): Create a playbin3 element if USE(GSTREAMER_PLAYBIN3) was enabled and connect to playbin2 signals otherwise. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: (WebCore::MediaPlayerPrivateGStreamer::createWeakPtr): Promoted to public. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h: New StreamCollectionChanged notification type, used the sub-class. * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp: (WebCore::TrackPrivateBaseGStreamer::TrackPrivateBaseGStreamer): Support for GstStream API. (WebCore::TrackPrivateBaseGStreamer::disconnect): Clear GstStream too. (WebCore::TrackPrivateBaseGStreamer::tagsChanged): Get tags from GstStream. (WebCore::TrackPrivateBaseGStreamer::notifyTrackOfActiveChanged): No need to check m_pad twice. (WebCore::TrackPrivateBaseGStreamer::notifyTrackOfTagsChanged): Ditto. * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h: * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp: Take a weak pointer of the media player instead of playbin and call the player when enabling tracks. Also use the GstStream API instead of inspecting the pad when playbin3 is used. (WebCore::VideoTrackPrivateGStreamer::VideoTrackPrivateGStreamer): (WebCore::VideoTrackPrivateGStreamer::disconnect): (WebCore::VideoTrackPrivateGStreamer::markAsActive): (WebCore::VideoTrackPrivateGStreamer::setSelected): * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.h: * platform/graphics/gstreamer/mse/AppendPipeline.cpp: Pass player pointer to track constructor. (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsink): * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp: Source-setup signal handler. (WebCore::MediaPlayerPrivateGStreamerMSE::sourceSetup): * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h: 2018-02-19 Fujii Hironori REGRESSION(r219298): RELEASE_ASSERT(!m_owningPointerForClose) fails in WebCore::IDBServer::UniqueIDBDatabase::scheduleShutdownForClose https://bugs.webkit.org/show_bug.cgi?id=174354 Reviewed by Michael Catanzaro. UniqueIDBDatabase::invokeOperationAndTransactionTimer was called even after m_owningPointerForClose was set in UniqueIDBDatabase::didDeleteBackingStore. No new tests (Covered by existing tests). * Modules/indexeddb/server/UniqueIDBDatabase.cpp: (WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore): Do not start deleting the UniqueIDBDatabase. Just call invokeOperationAndTransactionTimer. (WebCore::IDBServer::UniqueIDBDatabase::invokeOperationAndTransactionTimer): Assert m_owningPointerForClose is null. 2018-02-18 Yoshiaki Jitsukawa Fix build error after r228417 without ACCESSIBILITY https://bugs.webkit.org/show_bug.cgi?id=182914 Reviewed by Chris Fleizach. An inline empty version of AXObjectCache::deferFocusdUIElementChangeIfNeeded() needs to be defined if not HAVE(ACCESSIBILITY). * accessibility/AXObjectCache.h: (WebCore::AXObjectCache::deferFocusedUIElementChangeIfNeeded): 2018-02-18 Zalan Bujtas [RenderTreeBuilder] REGRESSION(r228238) Detach renderer before destroying its subtree. https://bugs.webkit.org/show_bug.cgi?id=182908 Reviewed by Antti Koivisto. Prior to r228238 we first detached the to-be-destroyed renderer and then started nuking its descendants. r228238 changed the order and now the descendants are destroyed while they are still attached to the tree. Apparently some of the takeChild() normalization logic gets triggered now that the renderers still have access to their previous/next siblings. This is unexpected and it shouldn't matter whether the subtree is still attached. Let's revert it to the original order for now (see webkit.org/b/182909). Test: fast/block/crash-when-subtree-is-still-attached.html * rendering/RenderElement.cpp: (WebCore::RenderElement::removeAndDestroyChild): 2018-02-18 Charlie Turner [GStreamer] Push smaller buffers from HTTP source https://bugs.webkit.org/show_bug.cgi?id=182829 Reviewed by Philippe Normand. Split the received buffer into smaller buffers of a size consistent with the basesrc (4KiB). It is important not to push large buffers into the appsrc (where large is relative to the appsrc's configured byte size). If large buffers are pushed, then when they are internally dequeued by the appsrc, the buffering percentage can dramatically plummet due to a large amount of bytes being removed after a push. This can in turn trick the media player into thinking it needs to buffer, and then issuing a spurious set of playing->paused then paused->playing transitions, which by the time the buffering logic completes, data are already available. * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp: (CachedResourceStreamingClient::dataReceived): 2018-02-17 Darin Adler Web Inspector: get rid of remaining uses of OptOutput https://bugs.webkit.org/show_bug.cgi?id=180607 Reviewed by Brian Burg. * inspector/InspectorStyleSheet.cpp: (WebCore::buildSourceRangeObject): Take a const Vector& instead of a Vector*. (WebCore::InspectorStyle::buildObjectForStyle const): Pass lineEndings() instead of lineEndings().get(). (WebCore::InspectorStyle::styleWithProperties const): Ditto. (WebCore::InspectorStyleSheet::buildObjectForSelectorList): Ditto. (WebCore::InspectorStyleSheet::lineEndings const): Return a Vector instead of a std::unique_ptr. (WebCore::InspectorStyleSheetForInlineStyle::lineEndings const): Ditto. * inspector/InspectorStyleSheet.h: Updated for the above. * inspector/agents/InspectorCSSAgent.h: Removed some bogus const. * inspector/agents/InspectorCanvasAgent.cpp: Ditto. * inspector/agents/InspectorCanvasAgent.h: Ditto. * inspector/agents/InspectorDOMDebuggerAgent.cpp: Improved type of global strings so we don't waste space with a pointer to the string. (WebCore::InspectorDOMDebuggerAgent::setEventListenerBreakpoint): Removed explicit creation of String, which was wasteful and unnecessary. (WebCore::InspectorDOMDebuggerAgent::setInstrumentationBreakpoint): Ditto. (WebCore::InspectorDOMDebuggerAgent::removeEventListenerBreakpoint): Ditto. (WebCore::InspectorDOMDebuggerAgent::removeInstrumentationBreakpoint): Ditto. (WebCore::InspectorDOMDebuggerAgent::setXHRBreakpoint): Removed bogus const. * inspector/agents/InspectorDOMDebuggerAgent.h: Removed bogus const and use final instead of override. * inspector/agents/InspectorPageAgent.cpp: Ditto. * inspector/agents/InspectorPageAgent.h: Ditto. 2018-02-16 Zalan Bujtas [RenderTreeBuilder] Cleanup RenderTreeBuilder https://bugs.webkit.org/show_bug.cgi?id=182899 Reviewed by Antti Koivisto. No change in functionality. * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::styleDidChange): * rendering/updating/RenderTreeBuilder.cpp: (WebCore::RenderTreeBuilder::takeChild): (WebCore::RenderTreeBuilder::moveChildTo): (WebCore::RenderTreeBuilder::moveAllChildrenTo): (WebCore::RenderTreeBuilder::moveChildrenTo): (WebCore::RenderTreeBuilder::moveAllChildrenIncludingFloatsTo): (WebCore::RenderTreeBuilder::makeChildrenNonInline): (WebCore::RenderTreeBuilder::splitAnonymousBoxesAroundChild): (WebCore::RenderTreeBuilder::takeChildFromRenderMenuList): Deleted. (WebCore::RenderTreeBuilder::takeChildFromRenderButton): Deleted. * rendering/updating/RenderTreeBuilder.h: (WebCore::RenderTreeBuilder::current): * rendering/updating/RenderTreeBuilderBlock.cpp: (WebCore::RenderTreeBuilder::Block::dropAnonymousBoxChild): * rendering/updating/RenderTreeBuilderBlockFlow.cpp: (WebCore::RenderTreeBuilder::BlockFlow::moveAllChildrenIncludingFloatsTo): * rendering/updating/RenderTreeBuilderFormControls.cpp: (WebCore::RenderTreeBuilder::FormControls::takeChild): * rendering/updating/RenderTreeBuilderFormControls.h: * rendering/updating/RenderTreeBuilderMultiColumn.cpp: (WebCore::RenderTreeBuilder::MultiColumn::createFragmentedFlow): (WebCore::RenderTreeBuilder::MultiColumn::destroyFragmentedFlow): * rendering/updating/RenderTreeBuilderRuby.cpp: (WebCore::RenderTreeBuilder::Ruby::moveInlineChildren): (WebCore::RenderTreeBuilder::Ruby::moveBlockChildren): (WebCore::RenderTreeBuilder::Ruby::takeChild): * rendering/updating/RenderTreeBuilderTable.cpp: (WebCore::RenderTreeBuilder::Table::collapseAndDestroyAnonymousSiblingRows): 2018-02-16 Daniel Bates Remove UTF-32 BOM parsing code https://bugs.webkit.org/show_bug.cgi?id=182900 Reviewed by Alexey Proskuryakov. The UTF-32 encodings were removed from the text codec registry in r224747. So, we no longer need code to parse UTF-32{BE, LE} BOM or encode and decode these variants. * dom/TextDecoder.cpp: (WebCore::codeUnitByteSize): * loader/TextResourceDecoder.cpp: (WebCore::TextResourceDecoder::checkForBOM): (WebCore::TextResourceDecoder::checkForHeadCharset): * platform/text/TextEncoding.cpp: (WebCore::TextEncoding::isNonByteBasedEncoding const): (WebCore::UTF32BigEndianEncoding): Deleted. (WebCore::UTF32LittleEndianEncoding): Deleted. * platform/text/TextEncoding.h: 2018-02-16 Zalan Bujtas [RenderTreeBuilder] Move RenderBoxModelObject::moveChild*() to RenderTreeBuilder https://bugs.webkit.org/show_bug.cgi?id=182896 Reviewed by Antti Koivisto. No change in functionality. * rendering/RenderBlock.h: (WebCore::RenderBlock::moveAllChildrenIncludingFloatsTo): Deleted. * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::styleDidChange): (WebCore::RenderBlockFlow::moveAllChildrenIncludingFloatsTo): Deleted. * rendering/RenderBlockFlow.h: * rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::moveChildTo): Deleted. (WebCore::RenderBoxModelObject::moveChildrenTo): Deleted. (WebCore::RenderBoxModelObject::moveAllChildrenToInternal): Deleted. * rendering/RenderBoxModelObject.h: (WebCore::RenderBoxModelObject::moveChildTo): Deleted. (WebCore::RenderBoxModelObject::moveAllChildrenTo): Deleted. (WebCore::RenderBoxModelObject::moveChildrenTo): Deleted. * rendering/updating/RenderTreeBuilder.cpp: (WebCore::RenderTreeBuilder::moveChildTo): (WebCore::RenderTreeBuilder::moveAllChildrenTo): (WebCore::RenderTreeBuilder::moveChildrenTo): (WebCore::RenderTreeBuilder::moveAllChildrenIncludingFloatsTo): (WebCore::RenderTreeBuilder::makeChildrenNonInline): (WebCore::RenderTreeBuilder::splitAnonymousBoxesAroundChild): * rendering/updating/RenderTreeBuilder.h: * rendering/updating/RenderTreeBuilderBlock.cpp: (WebCore::moveAllChildrenToInternal): (WebCore::RenderTreeBuilder::Block::removeLeftoverAnonymousBlock): (WebCore::RenderTreeBuilder::Block::takeChild): (WebCore::RenderTreeBuilder::Block::dropAnonymousBoxChild): * rendering/updating/RenderTreeBuilderBlockFlow.cpp: (WebCore::RenderTreeBuilder::BlockFlow::moveAllChildrenIncludingFloatsTo): * rendering/updating/RenderTreeBuilderBlockFlow.h: * rendering/updating/RenderTreeBuilderMultiColumn.cpp: (WebCore::RenderTreeBuilder::MultiColumn::createFragmentedFlow): (WebCore::RenderTreeBuilder::MultiColumn::destroyFragmentedFlow): * rendering/updating/RenderTreeBuilderRuby.cpp: (WebCore::RenderTreeBuilder::Ruby::moveInlineChildren): (WebCore::RenderTreeBuilder::Ruby::moveBlockChildren): (WebCore::RenderTreeBuilder::Ruby::takeChild): * rendering/updating/RenderTreeBuilderTable.cpp: (WebCore::RenderTreeBuilder::Table::collapseAndDestroyAnonymousSiblingRows): 2018-02-16 Andy Estes [Cocoa] Stop using non-prefixed vDSP functions in 32-bit builds https://bugs.webkit.org/show_bug.cgi?id=182898 Reviewed by Tim Horton. There's no need to use non-prefixed vDSP function aliases on 32-bit builds. The vDSP-prefixed versions are available on all Cocoa platforms we currently support. * platform/audio/DirectConvolver.cpp: (WebCore::DirectConvolver::process): * platform/audio/VectorMath.cpp: (WebCore::VectorMath::vsmul): (WebCore::VectorMath::vadd): (WebCore::VectorMath::vmul): (WebCore::VectorMath::zvmul): 2018-02-16 Ryan Haddad Unreviewed, rolling out r228575. Introduced LayoutTest crashes under GuardMalloc. Reverted changeset: "Use ResourceLoader to load appcache manifest" https://bugs.webkit.org/show_bug.cgi?id=182861 https://trac.webkit.org/changeset/228575 2018-02-16 Dean Jackson Use OPENGL macros to be more clear about which OpenGL/ES WebGL uses on Cocoa https://bugs.webkit.org/show_bug.cgi?id=182894 Reviewed by Tim Horton. Adjust the places where we check for PLATFORM(MAC) or PLATFORM(IOS) related to WebGL, and instead rely on USE(OPENGL) USE(OPENGL_ES). * CMakeLists.txt: * PlatformGTK.cmake: * platform/graphics/GLContext.cpp: (WebCore::initializeOpenGLShimsIfNeeded): * platform/graphics/GraphicsContext3DPrivate.cpp: * platform/graphics/OpenGLESShims.h: * platform/graphics/cairo/ImageBufferCairo.cpp: * platform/graphics/egl/GLContextEGL.cpp: (WebCore::GLContextEGL::getEGLConfig): (WebCore::GLContextEGL::createContext): (WebCore::GLContextEGL::createSharingContext): * platform/graphics/egl/GLContextEGLWPE.cpp: (WebCore::GLContextEGL::createWPEContext): * platform/graphics/egl/GLContextEGLWayland.cpp: (WebCore::GLContextEGL::createWaylandContext): * platform/graphics/egl/GLContextEGLX11.cpp: (WebCore::GLContextEGL::createPixmapContext): * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: (WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext): * platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp: (WebCore::VideoTextureCopierGStreamer::VideoTextureCopierGStreamer): (WebCore::VideoTextureCopierGStreamer::~VideoTextureCopierGStreamer): (WebCore::VideoTextureCopierGStreamer::copyVideoTextureToPlatformTexture): * platform/graphics/gstreamer/VideoTextureCopierGStreamer.h: * platform/graphics/opengl/Extensions3DOpenGLES.cpp: * platform/graphics/opengl/Extensions3DOpenGLES.h: * platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp: (WebCore::GraphicsContext3D::create): (WebCore::GraphicsContext3D::GraphicsContext3D): (WebCore::GraphicsContext3D::isGLES2Compliant const): * platform/graphics/texmap/GraphicsContext3DTextureMapper.cpp: (WebCore::GraphicsContext3D::create): (WebCore::GraphicsContext3D::GraphicsContext3D): (WebCore::GraphicsContext3D::~GraphicsContext3D): (WebCore::GraphicsContext3D::isGLES2Compliant const): (WebCore::GraphicsContext3D::getExtensions): * platform/graphics/texmap/TextureMapperContextAttributes.cpp: (WebCore::TextureMapperContextAttributes::initialize): * platform/graphics/texmap/TextureMapperGL.cpp: (WebCore::TextureMapperGLData::~TextureMapperGLData): (WebCore::TextureMapperGLData::getVAO): (WebCore::TextureMapperGL::beginPainting): (WebCore::TextureMapperGL::endPainting): * platform/graphics/texmap/TextureMapperGLHeaders.h: * platform/graphics/texmap/TextureMapperShaderProgram.cpp: (WebCore::TextureMapperShaderProgram::create): 2018-02-16 Zalan Bujtas [RenderTreeBuilder] Move RenderElement::insertChildInternal() to RenderTreeBuilder https://bugs.webkit.org/show_bug.cgi?id=182885 Reviewed by Antti Koivisto. No change in functionality. * rendering/RenderElement.cpp: (WebCore::RenderElement::insertChildInternal): Deleted. * rendering/RenderObject.h: * rendering/updating/RenderTreeBuilder.cpp: (WebCore::RenderTreeBuilder::insertChildToRenderElement): 2018-02-16 Youenn Fablet Allow specifying which plug-ins are supported https://bugs.webkit.org/show_bug.cgi?id=182748 Reviewed by Chris Dumez. Tests: http/tests/plugins/nounsupported-plugin.html http/tests/plugins/supported-plugin-all-origin-visibility.html http/tests/plugins/supported-plugin-on-specific-origin.html http/tests/plugins/supported-plugin-origin-specific-visibility.html http/tests/plugins/unsupported-plugin-on-specific-origin.html plugins/unsupported-plugin.html Added support for computing plugin web visibility with the added knowledge of supported plugins. In case of a plugin failing to be created due to being unsupported, update the UI to use mark the plugin as "Unexpected plug in". Added internal API to retrieve the plug-in error description message. * English.lproj/Localizable.strings: * WebCore.xcodeproj/project.pbxproj: * html/HTMLPlugInElement.cpp: (WebCore::HTMLPlugInElement::setReplacement): * html/HTMLPlugInElement.h: * loader/EmptyClients.cpp: * platform/LocalizedStrings.cpp: (WebCore::unsupportedPluginText): * platform/LocalizedStrings.h: * plugins/PluginData.cpp: (WebCore::PluginData::initPlugins): * plugins/PluginData.h: (WebCore::decodePluginNames): (WebCore::encodePluginNames): (WebCore::SupportedPluginNames::decode): (WebCore::SupportedPluginNames::encode const): * plugins/PluginInfoProvider.h: * rendering/RenderEmbeddedObject.cpp: (WebCore::unavailablePluginReplacementText): * rendering/RenderEmbeddedObject.h: (WebCore::RenderEmbeddedObject::pluginReplacementTextIfUnavailable const): * testing/Internals.cpp: (WebCore::Internals::unavailablePluginReplacementText): * testing/Internals.h: * testing/Internals.idl: 2018-02-16 Chris Dumez http/tests/security/http-0.9/xhr-blocked.html is flaky https://bugs.webkit.org/show_bug.cgi?id=182857 Reviewed by Antti Koivisto. WebCoreResourceHandleAsOperationQueueDelegate does not own the messageQueue and the detachHandle function was failing to nullout m_messageQueue when the resourceHandle gets destroyed. This means that callFunctionOnMainThread would sometimes try to append to a dead messageQueue. No new tests, already covered by: http/tests/security/http-0.9/xhr-blocked.html is flaky * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm: (-[WebCoreResourceHandleAsOperationQueueDelegate detachHandle]): 2018-02-16 Antti Koivisto Assert in mixed blend animation https://bugs.webkit.org/show_bug.cgi?id=182887 Reviewed by Zalan Bujtas. Test: fast/css/calc-mixed-blend-crash.html * platform/CalculationValue.cpp: (WebCore::CalcExpressionBlendLength::CalcExpressionBlendLength): Fix mismatch between the type test and the value used. 2018-02-16 Zalan Bujtas [RenderTreeBuilder] Move RenderBlock/RenderInline::addChildIgnoringContinuation() to RenderTreeBuilder https://bugs.webkit.org/show_bug.cgi?id=182876 Reviewed by Antti Koivisto. No change in functionality. * rendering/RenderBlock.cpp: (WebCore::RenderBlock::addChildIgnoringContinuation): Deleted. * rendering/RenderBlock.h: * rendering/RenderElement.cpp: (WebCore::RenderElement::addChildIgnoringContinuation): Deleted. * rendering/RenderElement.h: * rendering/RenderInline.cpp: (WebCore::RenderInline::addChildIgnoringContinuation): Deleted. * rendering/RenderInline.h: * rendering/updating/RenderTreeBuilder.cpp: (WebCore::RenderTreeBuilder::insertChildIgnoringContinuation): (WebCore::RenderTreeBuilder::insertChildToRenderBlockIgnoringContinuation): Deleted. (WebCore::RenderTreeBuilder::insertChildToRenderInlineIgnoringContinuation): Deleted. * rendering/updating/RenderTreeBuilder.h: * rendering/updating/RenderTreeBuilderBlock.cpp: (WebCore::RenderTreeBuilder::Block::insertChildToContinuation): * rendering/updating/RenderTreeBuilderInline.cpp: (WebCore::RenderTreeBuilder::Inline::insertChildToContinuation): (WebCore::RenderTreeBuilder::Inline::splitInlines): 2018-02-16 Basuke Suzuki [Curl] Unify logic of ResourceHandleCurlDelegate into ResourceHandle https://bugs.webkit.org/show_bug.cgi?id=182578 Reconstruct the classes to match Curl port network layer more similar structure with other ports. Move CurlRequest handling into ResourceHandle and makes CurlResourceHandleDelegate simple life cycle. Also its duty is for most of incoming data and event handling from CurRequest. Reviewed by Alex Christensen. No new tests because there's no new behavior. * platform/Curl.cmake: * platform/network/ResourceHandle.h: * platform/network/ResourceHandleInternal.h: (WebCore::ResourceHandleInternal::ResourceHandleInternal): * platform/network/curl/CurlCacheManager.cpp: (WebCore::CurlCacheManager::didReceiveResponse): * platform/network/curl/CurlDownload.cpp: (WebCore::CurlDownload::~CurlDownload): (WebCore::CurlDownload::createCurlRequest): (WebCore::CurlDownload::curlDidReceiveResponse): (WebCore::CurlDownload::curlDidReceiveBuffer): (WebCore::CurlDownload::curlDidComplete): (WebCore::CurlDownload::curlDidFailWithError): (WebCore::CurlDownload::willSendRequest): * platform/network/curl/CurlDownload.h: * platform/network/curl/CurlRequest.cpp: (WebCore::CurlRequest::CurlRequest): (WebCore::CurlRequest::cancel): (WebCore::CurlRequest::callClient): (WebCore::CurlRequest::willSendData): (WebCore::CurlRequest::didReceiveData): (WebCore::CurlRequest::didReceiveDataFromMultipart): (WebCore::CurlRequest::didCompleteTransfer): (WebCore::CurlRequest::invokeDidReceiveResponse): * platform/network/curl/CurlRequest.h: (WebCore::CurlRequest::create): (WebCore::CurlRequest::invalidateClient): (WebCore::CurlRequest::setClient): Deleted. * platform/network/curl/CurlRequestClient.h: * platform/network/curl/CurlResourceHandleDelegate.cpp: Added. (WebCore::CurlResourceHandleDelegate::CurlResourceHandleDelegate): (WebCore::CurlResourceHandleDelegate::ref): (WebCore::CurlResourceHandleDelegate::deref): (WebCore::CurlResourceHandleDelegate::cancelledOrClientless): (WebCore::CurlResourceHandleDelegate::client const): (WebCore::CurlResourceHandleDelegate::d): (WebCore::CurlResourceHandleDelegate::curlDidSendData): (WebCore::handleCookieHeaders): (WebCore::CurlResourceHandleDelegate::curlDidReceiveResponse): (WebCore::CurlResourceHandleDelegate::curlDidReceiveBuffer): (WebCore::CurlResourceHandleDelegate::curlDidComplete): (WebCore::CurlResourceHandleDelegate::curlDidFailWithError): * platform/network/curl/CurlResourceHandleDelegate.h: Added. (WebCore::CurlResourceHandleDelegate::response const): * platform/network/curl/ResourceHandleCurl.cpp: (WebCore::ResourceHandleInternal::~ResourceHandleInternal): (WebCore::ResourceHandle::start): (WebCore::ResourceHandle::cancel): (WebCore::ResourceHandle::cancelledOrClientless): (WebCore::ResourceHandle::createCurlRequest): (WebCore::ResourceHandle::delegate): (WebCore::ResourceHandle::platformSetDefersLoading): (WebCore::ResourceHandle::didReceiveAuthenticationChallenge): (WebCore::ResourceHandle::receivedCredential): (WebCore::ResourceHandle::receivedRequestToContinueWithoutCredential): (WebCore::ResourceHandle::getCredential): (WebCore::ResourceHandle::restartRequestWithCredential): (WebCore::ResourceHandle::platformLoadResourceSynchronously): (WebCore::ResourceHandle::platformContinueSynchronousDidReceiveResponse): (WebCore::ResourceHandle::continueAfterDidReceiveResponse): (WebCore::ResourceHandle::shouldRedirectAsGET): (WebCore::ResourceHandle::willSendRequest): (WebCore::ResourceHandle::continueAfterWillSendRequest): (WebCore::ResourceHandle::handleDataURL): * platform/network/curl/ResourceHandleCurlDelegate.cpp: Removed. * platform/network/curl/ResourceHandleCurlDelegate.h: Removed. 2018-02-16 Youenn Fablet Use ResourceLoader to load appcache manifest https://bugs.webkit.org/show_bug.cgi?id=182861 Reviewed by Alex Christensen. Covered by updated tests. Add ApplicationCacheResourceLoader to load an ApplicationCacheResource from a ResourceLoader. Make use of it to load the app cache manifest. Future work should load entries using the same loader. Remove manifest handle. Ensure that DocumentLoader does not register the manifest resource loader as its lifetime is handled by its ApplicationCacheGroup. Add a ResourceLoader option to bypass the application cache. Use it for manifest loading. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::addSubresourceLoader): * loader/ResourceLoaderOptions.h: * loader/appcache/ApplicationCacheGroup.cpp: (WebCore::ApplicationCacheGroup::stopLoading): (WebCore::ApplicationCacheGroup::update): (WebCore::ApplicationCacheGroup::createRequest): (WebCore::ApplicationCacheGroup::didReceiveResponseAsync): (WebCore::ApplicationCacheGroup::didReceiveData): (WebCore::ApplicationCacheGroup::didFinishLoading): (WebCore::ApplicationCacheGroup::didFail): (WebCore::ApplicationCacheGroup::didFinishLoadingManifest): (WebCore::ApplicationCacheGroup::checkIfLoadIsComplete): * loader/appcache/ApplicationCacheGroup.h: * loader/appcache/ApplicationCacheHost.cpp: (WebCore::ApplicationCacheHost::maybeLoadResource): (WebCore::ApplicationCacheHost::maybeLoadFallbackForRedirect): (WebCore::ApplicationCacheHost::maybeLoadFallbackForResponse): (WebCore::ApplicationCacheHost::maybeLoadFallbackForError): * loader/appcache/ApplicationCacheResourceLoader.cpp: Added. * loader/appcache/ApplicationCacheResourceLoader.h: Added. 2018-02-16 Chris Dumez Crash under WebCore::EventTarget::fireEventListeners https://bugs.webkit.org/show_bug.cgi?id=182880 Reviewed by Youenn Fablet. Make sure the 'ended' event does not get dispatched on a AudioScheduledSourceNode after ActiveDOMObjects have been stopped. Test: webaudio/audiobuffersource-ended-detached-frame.html * Modules/webaudio/AudioScheduledSourceNode.cpp: (WebCore::AudioScheduledSourceNode::finish): 2018-02-16 Jiewen Tan [WebAuthN] Implement PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable() https://bugs.webkit.org/show_bug.cgi?id=182771 Reviewed by Brent Fulgham. This patch implements PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable() per https://www.w3.org/TR/webauthn/#isUserVerifyingPlatformAuthenticatorAvailable with some limitations. In addition, it changes DeferredPromise to DOMPromiseDeferred<> for all CredentialsManagement and WebAuthN API. Test: http/wpt/webauthn/public-key-is-user-verifying-platform-authenticator-available.html * Modules/credentialmanagement/CredentialsContainer.cpp: (WebCore::CredentialsContainer::get): (WebCore::CredentialsContainer::store): (WebCore::CredentialsContainer::isCreate): (WebCore::CredentialsContainer::preventSilentAccess const): * Modules/credentialmanagement/CredentialsContainer.h: * Modules/credentialmanagement/CredentialsMessenger.cpp: (WebCore::CredentialsMessenger::addCreationCompletionHandler): Remove a redundant assertion. (WebCore::CredentialsMessenger::addRequestCompletionHandler): Remove a redundant assertion. (WebCore::CredentialsMessenger::addQueryCompletionHandler): (WebCore::CredentialsMessenger::takeQueryCompletionHandler): * Modules/credentialmanagement/CredentialsMessenger.h: * Modules/webauthn/AuthenticatorManager.cpp: (WebCore::AuthenticatorManagerInternal::initTimeoutTimer): (WebCore::AuthenticatorManager::create const): (WebCore::AuthenticatorManager::discoverFromExternalSource const): (WebCore::AuthenticatorManager::isUserVerifyingPlatformAuthenticatorAvailable const): * Modules/webauthn/AuthenticatorManager.h: * Modules/webauthn/PublicKeyCredential.cpp: (WebCore::PublicKeyCredential::isUserVerifyingPlatformAuthenticatorAvailable): * Modules/webauthn/PublicKeyCredential.h: * testing/MockCredentialsMessenger.cpp: (WebCore::MockCredentialsMessenger::isUserVerifyingPlatformAuthenticatorAvailable): (WebCore::MockCredentialsMessenger::isUserVerifyingPlatformAuthenticatorAvailableReply): * testing/MockCredentialsMessenger.h: * testing/MockCredentialsMessenger.idl: 2018-02-16 Tim Horton Stop using EXCLUDED_SOURCE_FILE_NAMES for touch and gesture files in WebCore https://bugs.webkit.org/show_bug.cgi?id=182866 Reviewed by Daniel Bates. * Configurations/WebCore.xcconfig: These generated files already have ENABLE() flags around them, so there's no reason to exclude them explicitly. 2018-02-16 Chris Dumez Unreviewed, fix iOS build after r228562. * workers/service/server/RegistrationDatabase.cpp: (WebCore::RegistrationDatabase::openSQLiteDatabase): 2018-02-16 Zalan Bujtas [RenderTreeBuilder] Move RenderElement::addChild() to RenderTreeBuilder https://bugs.webkit.org/show_bug.cgi?id=182878 Reviewed by Antti Koivisto. This patch removes the last addChild() related mutation logic from the renderers. No change in functionality. * rendering/RenderElement.cpp: (WebCore::RenderElement::didInsertChild): (WebCore::RenderElement::addChild): Deleted. * rendering/RenderElement.h: (WebCore::RenderElement::isChildAllowed const): * rendering/updating/RenderTreeBuilder.cpp: (WebCore::RenderTreeBuilder::insertChild): (WebCore::RenderTreeBuilder::insertChildToRenderElement): * rendering/updating/RenderTreeBuilder.h: * rendering/updating/RenderTreeBuilderBlock.cpp: (WebCore::RenderTreeBuilder::Block::insertChildIgnoringContinuation): * rendering/updating/RenderTreeBuilderInline.cpp: (WebCore::RenderTreeBuilder::Inline::insertChildIgnoringContinuation): * rendering/updating/RenderTreeBuilderSVG.cpp: (WebCore::RenderTreeBuilder::SVG::insertChild): * rendering/updating/RenderTreeBuilderTable.cpp: (WebCore::RenderTreeBuilder::Table::insertChild): 2018-02-16 Matt Lewis Unreviewed, rolling out r228546. This caused a consistent crash on all macOS WK2 platforms. Reverted changeset: "Web Inspector: get rid of remaining uses of OptOutput" https://bugs.webkit.org/show_bug.cgi?id=180607 https://trac.webkit.org/changeset/228546 2018-02-16 Youenn Fablet Log the error message when failing to open the database https://bugs.webkit.org/show_bug.cgi?id=182795 Unreviewed. Fixing iOS simulator debug build. * workers/service/server/RegistrationDatabase.cpp: (WebCore::RegistrationDatabase::openSQLiteDatabase): 2018-02-16 Fujii Hironori IndexedDB: Several test crash in when destroying a IDBKeyData https://bugs.webkit.org/show_bug.cgi?id=167576 Reviewed by Michael Catanzaro. IDBKeyDataHashTraits::constructDeletedValue is using operator= to assign deletedValue. But, the value is destructed just before calling constructDeletedValue. You can't use operator= for a destructed value. No new tests (Covered by existing tests). * Modules/indexeddb/IDBKeyData.h: (WebCore::IDBKeyDataHashTraits::constructDeletedValue): Construct null value before assigning deletedValue. 2018-02-16 Zalan Bujtas [RenderTreeBuilder] Move RenderBlock/RenderBlockFlow::addChild() to RenderTreeBuilder https://bugs.webkit.org/show_bug.cgi?id=182862 Reviewed by Antti Koivisto. No change in functionality. * rendering/RenderBlock.cpp: (WebCore::RenderBlock::addChild): Deleted. * rendering/RenderBlock.h: * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::addChild): Deleted. * rendering/RenderBlockFlow.h: * rendering/updating/RenderTreeBuilder.cpp: (WebCore::RenderTreeBuilder::insertChild): (WebCore::RenderTreeBuilder::insertChildToRenderBlock): Deleted. (WebCore::RenderTreeBuilder::insertChildToRenderBlockFlow): Deleted. * rendering/updating/RenderTreeBuilder.h: * rendering/updating/RenderTreeBuilderBlockFlow.cpp: (WebCore::RenderTreeBuilder::BlockFlow::insertChild): * rendering/updating/RenderTreeBuilderFormControls.cpp: (WebCore::RenderTreeBuilder::FormControls::findOrCreateParentForChild): * rendering/updating/RenderTreeBuilderMathML.cpp: (WebCore::RenderTreeBuilder::MathML::makeFences): (WebCore::RenderTreeBuilder::MathML::insertChild): * rendering/updating/RenderTreeBuilderMultiColumn.cpp: (WebCore::RenderTreeBuilder::MultiColumn::createFragmentedFlow): (WebCore::RenderTreeBuilder::MultiColumn::processPossibleSpannerDescendant): * rendering/updating/RenderTreeBuilderRuby.cpp: (WebCore::RenderTreeBuilder::Ruby::insertChild): (WebCore::RenderTreeBuilder::Ruby::findOrCreateParentForChild): (WebCore::RenderTreeBuilder::Ruby::rubyBaseSafe): * rendering/updating/RenderTreeBuilderSVG.cpp: (WebCore::RenderTreeBuilder::SVG::insertChild): 2018-02-16 Wenson Hsieh [Extra zoom mode] Add basic support for using date picker UI https://bugs.webkit.org/show_bug.cgi?id=182847 Reviewed by Tim Horton. Add new localized strings for "month", "day" and "year" as they appear in the date picker. * English.lproj/Localizable.strings: * platform/LocalizedStrings.cpp: (WebCore::textInputModeWriteButtonTitle): (WebCore::textInputModeSpeechButtonTitle): (WebCore::datePickerDayLabelTitle): (WebCore::datePickerMonthLabelTitle): (WebCore::datePickerYearLabelTitle): (WebCore::textInputModeWriteButton): Deleted. (WebCore::textInputModeSpeechButton): Deleted. * platform/LocalizedStrings.h: 2018-02-16 Zan Dobersek HarfBuzzFace should operate with a FontPlatformData reference https://bugs.webkit.org/show_bug.cgi?id=182863 Reviewed by Carlos Garcia Campos. Instead of keeping a never-null pointer to FontPlatformData, HarfBuzzFace should operate with a FontPlatformData reference. * platform/graphics/freetype/FontPlatformDataFreeType.cpp: (WebCore::FontPlatformData::harfBuzzFace const): * platform/graphics/harfbuzz/HarfBuzzFace.cpp: (WebCore::HarfBuzzFace::HarfBuzzFace): * platform/graphics/harfbuzz/HarfBuzzFace.h: * platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp: (WebCore::HarfBuzzFace::createFace): (WebCore::HarfBuzzFace::createFont): 2018-02-15 Zalan Bujtas [RenderTreeBuilder] parent.Render*::addChild() cleanup https://bugs.webkit.org/show_bug.cgi?id=182842 Reviewed by Antti Koivisto. No change in functionality. * rendering/updating/RenderTreeBuilderBlock.cpp: (WebCore::RenderTreeBuilder::Block::insertChildIgnoringContinuation): * rendering/updating/RenderTreeBuilderFormControls.cpp: (WebCore::RenderTreeBuilder::FormControls::createInnerRendererIfNeeded): * rendering/updating/RenderTreeBuilderInline.cpp: (WebCore::RenderTreeBuilder::Inline::insertChildIgnoringContinuation): * rendering/updating/RenderTreeBuilderMathML.cpp: (WebCore::RenderTreeBuilder::MathML::makeFences): (WebCore::RenderTreeBuilder::MathML::insertChild): * rendering/updating/RenderTreeBuilderSVG.cpp: (WebCore::RenderTreeBuilder::SVG::insertChild): * rendering/updating/RenderTreeBuilderTable.cpp: (WebCore::RenderTreeBuilder::Table::insertChild): 2018-02-15 Megan Gardner Support scrolling for non-editable web-selection and start autoscroll when near screen edges https://bugs.webkit.org/show_bug.cgi?id=182815 Reviewed by Tim Horton. Adjust the position we are autoscrolling to so that when we are close to an edge, we will start autoscrolling while we are still inside the view. Autoscrolling still happens when you drag past the edge of a view. No new tests (This is difficult to test in this state, but when we switch assistants, test will also be added). * page/EventHandler.h: * page/ios/EventHandlerIOS.mm: (WebCore::EventHandler::startSelectionAutoscroll): (WebCore::EventHandler::cancelSelectionAutoscroll): (WebCore::autoscrollAdjustmentFactorForScreenBoundaries): (WebCore::EventHandler::targetPositionInWindowForSelectionAutoscroll const): (WebCore::EventHandler::startTextAutoscroll): Deleted. (WebCore::EventHandler::cancelTextAutoscroll): Deleted. 2018-02-15 Youenn Fablet Log the error message when failing to open the database https://bugs.webkit.org/show_bug.cgi?id=182795 Reviewed by Chris Dumez. No change of behavior. Print the error message as it does not contain any user private information. * workers/service/server/RegistrationDatabase.cpp: (WebCore::RegistrationDatabase::openSQLiteDatabase): 2018-02-15 Zalan Bujtas [RenderTreeBuilder] Move RenderMenuList::addChild() to RenderTreeBuilder https://bugs.webkit.org/show_bug.cgi?id=182840 Reviewed by Antti Koivisto. No change in functionality. * rendering/RenderMenuList.cpp: (RenderMenuList::didInsertChild): (RenderMenuList::addChild): Deleted. * rendering/RenderMenuList.h: * rendering/updating/RenderTreeBuilder.cpp: (WebCore::RenderTreeBuilder::insertChild): * rendering/updating/RenderTreeBuilderFormControls.cpp: (WebCore::RenderTreeBuilder::FormControls::findOrCreateParentForChild): (WebCore::RenderTreeBuilder::FormControls::insertChild): (WebCore::RenderTreeBuilder::FormControls::createInnerRendererIfNeeded): Deleted. * rendering/updating/RenderTreeBuilderFormControls.h: 2018-02-15 Darin Adler Web Inspector: get rid of remaining uses of OptOutput https://bugs.webkit.org/show_bug.cgi?id=180607 Reviewed by Brian Burg. * inspector/InspectorStyleSheet.cpp: (WebCore::buildSourceRangeObject): Take a const Vector& instead of a Vector*. (WebCore::InspectorStyle::buildObjectForStyle const): Pass lineEndings() instead of lineEndings().get(). (WebCore::InspectorStyle::styleWithProperties const): Ditto. (WebCore::InspectorStyleSheet::buildObjectForSelectorList): Ditto. (WebCore::InspectorStyleSheet::lineEndings const): Return a Vector instead of a std::unique_ptr. (WebCore::InspectorStyleSheetForInlineStyle::lineEndings const): Ditto. * inspector/InspectorStyleSheet.h: Updated for the above. * inspector/agents/InspectorCSSAgent.h: Removed some bogus const. * inspector/agents/InspectorCanvasAgent.cpp: Ditto. * inspector/agents/InspectorCanvasAgent.h: Ditto. * inspector/agents/InspectorDOMDebuggerAgent.cpp: Improved type of global strings so we don't waste space with a pointer to the string. (WebCore::InspectorDOMDebuggerAgent::setEventListenerBreakpoint): Removed explicit creation of String, which was wasteful and unnecessary. (WebCore::InspectorDOMDebuggerAgent::setInstrumentationBreakpoint): Ditto. (WebCore::InspectorDOMDebuggerAgent::removeEventListenerBreakpoint): Ditto. (WebCore::InspectorDOMDebuggerAgent::removeInstrumentationBreakpoint): Ditto. (WebCore::InspectorDOMDebuggerAgent::setXHRBreakpoint): Removed bogus const. * inspector/agents/InspectorDOMDebuggerAgent.h: Removed bogus const and use final instead of override. * inspector/agents/InspectorPageAgent.cpp: Ditto. * inspector/agents/InspectorPageAgent.h: Ditto. 2018-02-15 Chris Dumez Flaky Test: imported/w3c/web-platform-tests/fetch/api/redirect/redirect-to-dataurl-worker.html https://bugs.webkit.org/show_bug.cgi?id=182270 Reviewed by Antti Koivisto. No new tests, already covered by existing tests that crash flakily on the bots. * loader/ThreadableLoaderClientWrapper.h: (WebCore::ThreadableLoaderClientWrapper::ThreadableLoaderClientWrapper): isolate copy the initiator string as this object can be destroyed on a different thread. This was causing the test to flakily crash as well when destroying ThreadLocalData. * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.h: * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm: (scheduledWithCustomRunLoopMode): (-[WebCoreResourceHandleAsOperationQueueDelegate callFunctionOnMainThread:]): Fix thread safety issue in callFunctionOnMainThread. This function is called from a background thread to get to the main thread. However, it relied on m_handle which would get nullified on the main thread by detachHandle when the ResourceHandle is destroyed. Fix the issue by not relying on m_handle anymore. (-[WebCoreResourceHandleAsOperationQueueDelegate initWithHandle:messageQueue:]): (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]): (-[WebCoreResourceHandleAsOperationQueueDelegate connection:canAuthenticateAgainstProtectionSpace:]): (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]): (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willCacheResponse:]): - Go back to using autorelease() instead of get() for the returned objects to match the code pre-r224522. - Dispatch the protectedSelf variables that were added in r227073 to the main thread to make sure we do not get destroyed on the background thread when protectedSelf is the last strong reference to self. Destroying the WebCoreResourceHandleAsOperationQueueDelegate on the background safe is unsafe due to its m_messageQueue data member which contains lambdas that may capture anything. - Add a Lock to protect against detachHandle getting called on the main thread and nulling out m_handle / m_requestResult / m_cachedResponseResult while the background thread may be accessing them. 2018-02-15 Zalan Bujtas [RenderTreeBuilder] Move RenderTableRow::addChild() to RenderTreeBuilder https://bugs.webkit.org/show_bug.cgi?id=182838 Reviewed by Antti Koivisto. No change in functionality. * rendering/RenderTableRow.cpp: (WebCore::RenderTableRow::didInsertTableCell): (WebCore::RenderTableRow::addChild): Deleted. * rendering/RenderTableRow.h: * rendering/updating/RenderTreeBuilder.cpp: (WebCore::RenderTreeBuilder::insertChild): (WebCore::RenderTreeBuilder::insertChildToRenderTableRow): Deleted. * rendering/updating/RenderTreeBuilder.h: * rendering/updating/RenderTreeBuilderTable.cpp: (WebCore::RenderTreeBuilder::Table::insertChild): 2018-02-15 Antoine Quint [Web Animations] Ensure that changing the timing model updates styles synchronously https://bugs.webkit.org/show_bug.cgi?id=182836 Reviewed by Dean Jackson. We did not invalidate the timing model when properties of an effect's timing object changed and even when we did invalidate the timing model, we did not update styles on effect targets synchronously, only scheduling such updates for the next animation frame. In this patch we expose the effect on the timing object such that changing timing properties can notify the effect of a change in the timing model, which can then be forwarded to the animation (which already informs its timeline, if any). Additionally, when an animation's timing model has changed, we now invalidate the effect, which will update styles synchronously. This produces a number of progressions in WPT tests. * animation/AnimationEffectReadOnly.cpp: (WebCore::AnimationEffectReadOnly::AnimationEffectReadOnly): Set the timing object's effect upon effect construction. (WebCore::AnimationEffectReadOnly::~AnimationEffectReadOnly): Set the timing object's effect to null upon effect destruction. (WebCore::AnimationEffectReadOnly::timingDidChange): Notify the animation (if any) that its timing model changed following a change in the timing properties. * animation/AnimationEffectReadOnly.h: Add a new virtual invalidate() method that subclasses can override to implement invalidation behavior when the animation finds out its timing model changed. * animation/AnimationEffectTimingReadOnly.cpp: Notify the effect when a property changes such that it may notify its animation of a timing model change. (WebCore::AnimationEffectTimingReadOnly::propertyDidChange): (WebCore::AnimationEffectTimingReadOnly::setIterationStart): (WebCore::AnimationEffectTimingReadOnly::setIterations): (WebCore::AnimationEffectTimingReadOnly::setBindingsDuration): (WebCore::AnimationEffectTimingReadOnly::setEasing): (WebCore::AnimationEffectTimingReadOnly::setDelay): (WebCore::AnimationEffectTimingReadOnly::setEndDelay): (WebCore::AnimationEffectTimingReadOnly::setFill): (WebCore::AnimationEffectTimingReadOnly::setIterationDuration): (WebCore::AnimationEffectTimingReadOnly::setDirection): * animation/AnimationEffectTimingReadOnly.h: (WebCore::AnimationEffectTimingReadOnly::setEffect): (WebCore::AnimationEffectTimingReadOnly::setBindingsDelay): (WebCore::AnimationEffectTimingReadOnly::setBindingsEndDelay): (WebCore::AnimationEffectTimingReadOnly::setDelay): Deleted. (WebCore::AnimationEffectTimingReadOnly::setEndDelay): Deleted. (WebCore::AnimationEffectTimingReadOnly::setFill): Deleted. (WebCore::AnimationEffectTimingReadOnly::setIterationDuration): Deleted. (WebCore::AnimationEffectTimingReadOnly::setDirection): Deleted. * animation/AnimationTimeline.cpp: Rename animationTimingModelDidChange() to timingModelDidChange() to align it with the new WebAnimation::timingModelDidChange() method. (WebCore::AnimationTimeline::addAnimation): (WebCore::AnimationTimeline::removeAnimation): (WebCore::AnimationTimeline::setCurrentTime): * animation/AnimationTimeline.h: (WebCore::AnimationTimeline::timingModelDidChange): (WebCore::AnimationTimeline::animationTimingModelDidChange): Deleted. * animation/DocumentTimeline.cpp: (WebCore::DocumentTimeline::timingModelDidChange): (WebCore::DocumentTimeline::updateAnimations): (WebCore::DocumentTimeline::animationTimingModelDidChange): Deleted. * animation/DocumentTimeline.h: * animation/KeyframeEffectReadOnly.cpp: (WebCore::KeyframeEffectReadOnly::invalidate): Override the invalidate() method to perform a synchronous style update in order to ensure that timing properties are accounted for right as they change. * animation/KeyframeEffectReadOnly.h: * animation/WebAnimation.cpp: (WebCore::WebAnimation::timingModelDidChange): Invalidate the effect and notify the timeline of a timing model change when an animation is notified that its timing model has changed. (WebCore::WebAnimation::setStartTime): * animation/WebAnimation.h: 2018-02-15 Timothy Horton Fix the build. * platform/ios/KeyEventCodesIOS.h: 2018-02-15 John Wilander Resource Load Statistics: Make sure WebResourceLoadStatisticsStore::mergeWithDataFromDecoder() can ingest older plist versions and not reset the database https://bugs.webkit.org/show_bug.cgi?id=182812 Reviewed by Brent Fulgham. No new tests. Tested manually between versions of Safari. * loader/ResourceLoadStatistics.cpp: (WebCore::ResourceLoadStatistics::decode): Now only expects these fields for model version 11 or higher: - topFrameUniqueRedirectsTo - topFrameUniqueRedirectsFrom - subresourceUniqueRedirectsFrom - timesAccessedAsFirstPartyDueToUserInteraction - timesAccessedAsFirstPartyDueToStorageAccessAPI * loader/ResourceLoadStatistics.h: 2018-02-15 Tim Horton Stop using EXCLUDED_SOURCE_FILE_NAMES for actual source files in WebCore https://bugs.webkit.org/show_bug.cgi?id=182822 Reviewed by Dan Bernstein. It's much easier to reason about things if xcconfigs don't apply extra constraints to which source files actually build on a per-platform basis. We should use #ifs instead like we usually do. * Configurations/WebCore.xcconfig: * Modules/geolocation/ios/GeolocationPositionIOS.mm: * accessibility/ios/AccessibilityObjectIOS.mm: * accessibility/mac/AXObjectCacheMac.mm: * accessibility/mac/AccessibilityObjectMac.mm: * accessibility/mac/WebAccessibilityObjectWrapperMac.h: * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: * dom/DataTransferMac.mm: * editing/ios/DictationCommandIOS.cpp: * editing/ios/DictationCommandIOS.h: * editing/ios/EditorIOS.mm: * editing/ios/WebContentReaderIOS.mm: * editing/mac/EditorMac.mm: * editing/mac/WebContentReaderMac.mm: * page/ios/EventHandlerIOS.mm: * page/ios/FrameIOS.mm: * page/mac/EventHandlerMac.mm: * page/scrolling/ios/ScrollingCoordinatorIOS.h: * page/scrolling/ios/ScrollingCoordinatorIOS.mm: * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm: * platform/ThreadCheck.h: * platform/audio/ios/AudioDestinationIOS.h: * platform/audio/ios/AudioFileReaderIOS.h: * platform/audio/ios/MediaSessionManagerIOS.h: * platform/graphics/ios/DisplayRefreshMonitorIOS.h: * platform/graphics/ios/DisplayRefreshMonitorIOS.mm: * platform/graphics/ios/FontCacheIOS.mm: * platform/graphics/ios/GraphicsContext3DIOS.h: * platform/graphics/ios/IconIOS.mm: * platform/graphics/mac/ColorMac.h: * platform/graphics/mac/ColorMac.mm: * platform/graphics/mac/DisplayRefreshMonitorMac.cpp: * platform/graphics/mac/DisplayRefreshMonitorMac.h: * platform/graphics/mac/IconMac.mm: * platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp: * platform/ios/CursorIOS.cpp: * platform/ios/DeviceMotionClientIOS.h: * platform/ios/DeviceOrientationClientIOS.h: * platform/ios/EventLoopIOS.mm: * platform/ios/KeyEventCodesIOS.h: * platform/ios/LowPowerModeNotifierIOS.mm: * platform/ios/PasteboardIOS.mm: * platform/ios/PlatformEventFactoryIOS.h: * platform/ios/PlatformEventFactoryIOS.mm: * platform/ios/PlatformPasteboardIOS.mm: * platform/ios/PlatformScreenIOS.mm: * platform/ios/PlatformSpeechSynthesizerIOS.mm: * platform/ios/RemoteCommandListenerIOS.h: * platform/ios/RemoteCommandListenerIOS.mm: * platform/ios/SSLKeyGeneratorIOS.cpp: * platform/ios/ScrollAnimatorIOS.h: * platform/ios/ScrollAnimatorIOS.mm: * platform/ios/ScrollViewIOS.mm: * platform/ios/ScrollbarThemeIOS.h: * platform/ios/ScrollbarThemeIOS.mm: * platform/ios/SystemMemoryIOS.cpp: * platform/ios/ThemeIOS.h: * platform/ios/ThemeIOS.mm: * platform/ios/TileControllerMemoryHandlerIOS.cpp: * platform/ios/TileControllerMemoryHandlerIOS.h: * platform/ios/UserAgentIOS.mm: * platform/ios/ValidationBubbleIOS.mm: * platform/ios/WidgetIOS.mm: * platform/mac/CursorMac.mm: * platform/mac/EventLoopMac.mm: * platform/mac/LocalCurrentGraphicsContext.h: * platform/mac/LocalCurrentGraphicsContext.mm: * platform/mac/NSScrollerImpDetails.h: * platform/mac/NSScrollerImpDetails.mm: * platform/mac/PasteboardMac.mm: * platform/mac/PlatformEventFactoryMac.h: * platform/mac/PlatformEventFactoryMac.mm: * platform/mac/PlatformPasteboardMac.mm: * platform/mac/PlatformScreenMac.mm: * platform/mac/PlatformSpeechSynthesizerMac.mm: * platform/mac/SSLKeyGeneratorMac.mm: * platform/mac/ScrollViewMac.mm: * platform/mac/ScrollbarThemeMac.h: * platform/mac/ScrollbarThemeMac.mm: * platform/mac/ThemeMac.h: * platform/mac/ThemeMac.mm: * platform/mac/ThreadCheck.mm: * platform/mac/UserAgentMac.mm: * platform/mac/WebCoreView.h: * platform/mac/WebCoreView.m: * platform/mac/WidgetMac.mm: * platform/mediastream/ios/CoreAudioCaptureSourceIOS.h: * platform/network/ios/NetworkStateNotifierIOS.mm: * platform/network/ios/WebCoreURLResponseIOS.h: * platform/network/ios/WebCoreURLResponseIOS.mm: * platform/network/mac/NetworkStateNotifierMac.cpp: 2018-02-15 Zalan Bujtas [RenderTreeBuilder] Move RenderTableSection::addChild() to RenderTreeBuilder https://bugs.webkit.org/show_bug.cgi?id=182835 Reviewed by Antti Koivisto. No change in functionality. * rendering/RenderTableSection.cpp: (WebCore::RenderTableSection::willInsertTableRow): (WebCore::RenderTableSection::addChild): Deleted. * rendering/RenderTableSection.h: * rendering/updating/RenderTreeBuilder.cpp: (WebCore::RenderTreeBuilder::insertChild): Leftover from r228529. (WebCore::RenderTreeBuilder::insertChildToRenderTable): Deleted. Leftover from r228529. (WebCore::RenderTreeBuilder::insertChildToRenderTableSection): Deleted. * rendering/updating/RenderTreeBuilder.h: * rendering/updating/RenderTreeBuilderTable.cpp: (WebCore::RenderTreeBuilder::Table::insertChild): 2018-02-15 Zalan Bujtas [RenderTreeBuilder] Move RenderTable::addChild() to RenderTreeBuilder https://bugs.webkit.org/show_bug.cgi?id=182832 Reviewed by Antti Koivisto. No change in functionality. * rendering/RenderTable.cpp: (WebCore::RenderTable::willInsertTableColumn): (WebCore::RenderTable::willInsertTableSection): (WebCore::RenderTable::addChild): Deleted. * rendering/RenderTable.h: * rendering/updating/RenderTreeBuilder.cpp: (WebCore::RenderTreeBuilder::insertChild): * rendering/updating/RenderTreeBuilderTable.cpp: (WebCore::RenderTreeBuilder::Table::insertChild): 2018-02-14 Darin Adler Use std::make_unique instead of explicit calls to new and instead of writing create functions https://bugs.webkit.org/show_bug.cgi?id=182821 Reviewed by Anders Carlsson. * loader/LinkLoader.cpp: (WebCore::createLinkPreloadResourceClient): Use std::make_unique insteadof create functions. * loader/LinkPreloadResourceClients.h: Make constructors public, get rid of create functions, make overrides be private and final, get rid of unnecessary public default virtual destructors that the compiler will generate correctly without anything explicit. * platform/encryptedmedia/clearkey/CDMClearKey.cpp: (WebCore::CDMFactoryClearKey::createCDM): Use std::make_unique instead of std::unique_ptr/new. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC): Use std::make_unique instead of calling a create function. * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC): Ditto. * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::MediaPlayerPrivateMediaStreamAVFObjC): Ditto. * platform/graphics/avfoundation/objc/VideoFullscreenLayerManager.h: Made the constructor public and got rid of the create function. * platform/graphics/avfoundation/objc/VideoFullscreenLayerManager.mm: (WebCore::VideoFullscreenLayerManager::create): Deleted. * rendering/GridTrackSizingAlgorithm.cpp: (WebCore::GridTrackSizingAlgorithm::computeFlexFactorUnitSize const): Use std::make_unique instead of std::unique_ptr/new. 2018-02-15 Andy Estes Finish unifying Apple Pay and Payment Request sources https://bugs.webkit.org/show_bug.cgi?id=182831 Reviewed by Keith Miller. * Sources.txt: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: 2018-02-15 Zan Dobersek HarfBuzzFace: rework cache entry reference holding https://bugs.webkit.org/show_bug.cgi?id=182828 Reviewed by Michael Catanzaro. Move the FaceCacheEntry and HarfBuzzFaceCache types into the HarfBuzzFace class as CacheEntry and Cache, respectively. The Cache singleton is also moved there. In the HarfBuzzFace constructor, we now don't increase the CacheEntry reference, but instead just keep a reference to that object through a RefPtr object. We don't need to retrieve the hb_face_t object and the glyph cache HashMap in the constructor anymore, we just retrieve them when necessary through that CacheEntry reference. In the destructor, that RefPtr object is nulled out before the object in Cache is removed if that's where the final reference is kept. * platform/graphics/harfbuzz/HarfBuzzFace.cpp: (WebCore::HarfBuzzFace::CacheEntry::CacheEntry): (WebCore::HarfBuzzFace::CacheEntry::~CacheEntry): (WebCore::HarfBuzzFace::cache): (WebCore::HarfBuzzFace::HarfBuzzFace): (WebCore::HarfBuzzFace::~HarfBuzzFace): (WebCore::HarfBuzzFace::setScriptForVerticalGlyphSubstitution): (WebCore::FaceCacheEntry::create): Deleted. (WebCore::FaceCacheEntry::~FaceCacheEntry): Deleted. (WebCore::FaceCacheEntry::face): Deleted. (WebCore::FaceCacheEntry::glyphCache): Deleted. (WebCore::FaceCacheEntry::FaceCacheEntry): Deleted. (WebCore::harfBuzzFaceCache): Deleted. * platform/graphics/harfbuzz/HarfBuzzFace.h: (WebCore::HarfBuzzFace::CacheEntry::create): (WebCore::HarfBuzzFace::CacheEntry::face): (WebCore::HarfBuzzFace::CacheEntry::glyphCache): * platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp: (WebCore::harfBuzzGetGlyph): (WebCore::HarfBuzzFace::createFont): 2018-02-15 Zan Dobersek FontPlatformData::harfBuzzFace() should return a reference https://bugs.webkit.org/show_bug.cgi?id=182825 Reviewed by Carlos Garcia Campos. Have FontPlatformData::harfBuzzFace() return a reference instead of a pointer, given that the returned HarfBuzzFace object cannot be null. Call-sites of FontPlatformData::harfBuzzFace() are adjusted. OpenTypeMathData constructors are also changed to not rely on preprocessor to correctly position the closing brace. * platform/graphics/FontPlatformData.h: * platform/graphics/freetype/FontPlatformDataFreeType.cpp: (WebCore::FontPlatformData::harfBuzzFace const): * platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp: (WebCore::ComplexTextController::collectComplexTextRunsForCharacters): * platform/graphics/opentype/OpenTypeMathData.cpp: (WebCore::OpenTypeMathData::OpenTypeMathData): 2018-02-15 Jiewen Tan [WebAuthN] Revisit the whole async model of task dispatching, timeout and aborting https://bugs.webkit.org/show_bug.cgi?id=181946 Reviewed by Chris Dumez. This patch changes the original async model from a work queue to IPC between WebProcess and UIProcess. Since all authenticator operations must be handled in the UIProcess due to sandboxing, this message passing IPC async model then surpasses the original multi threading model. To cooperate that, a CredentialsMessenger class is then created and all task dispatching code is moved thre. As an improvement over existing code, static functions from PublicKeyCredential are moved to AuthenticatorManager. AuthenticatorManager is made as a singleton such that when static functions are called, they could reach the CredentialsMessenger to interact with UIProccess. CredentialsMessenger and AuthenticatorManager are separated so later on when other Credential types are created, they can reuse the same IPC messenger. What's more, a mock CredentialsMessenger is then created to mock behaviors of UIProcess for testing purpose. Covered by existing tests. * DerivedSources.make: * Modules/credentialmanagement/BasicCredential.h: * Modules/credentialmanagement/CredentialsContainer.cpp: (WebCore::CredentialsContainer::CredentialsContainer): (WebCore::CredentialsContainer::doesHaveSameOriginAsItsAncestors): (WebCore::CredentialsContainer::get): (WebCore::CredentialsContainer::isCreate): (WebCore::CredentialsContainer::PendingPromise::PendingPromise): Deleted. (WebCore::CredentialsContainer::dispatchTask): Deleted. * Modules/credentialmanagement/CredentialsContainer.h: (WebCore::CredentialsContainer::PendingPromise::create): Deleted. * Modules/credentialmanagement/CredentialsMessenger.cpp: Added. (WebCore::CredentialsMessenger::exceptionReply): (WebCore::CredentialsMessenger::addCreationCompletionHandler): (WebCore::CredentialsMessenger::takeCreationCompletionHandler): (WebCore::CredentialsMessenger::addRequestCompletionHandler): (WebCore::CredentialsMessenger::takeRequestCompletionHandler): (WebCore::CredentialsMessenger::addQueryCompletionHandler): (WebCore::CredentialsMessenger::takeQueryCompletionHandler): (WebCore::getIdFromAttestationObject): * Modules/credentialmanagement/CredentialsMessenger.h: Added. (WebCore::CreationReturnBundle::CreationReturnBundle): (WebCore::AssertionReturnBundle::AssertionReturnBundle): (WebCore::CredentialsMessenger::weakPtrFactory const): * Modules/webauthn/Authenticator.cpp: Removed. * Modules/webauthn/Authenticator.h: Removed. * Modules/webauthn/AuthenticatorManager.cpp: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredential.cpp. (WebCore::AuthenticatorManagerInternal::produceClientDataJson): (WebCore::AuthenticatorManagerInternal::produceClientDataJsonHash): (WebCore::AuthenticatorManagerInternal::initTimer): (WebCore::AuthenticatorManagerInternal::didTimerFire): (WebCore::AuthenticatorManager::singleton): (WebCore::AuthenticatorManager::setMessenger): (WebCore::AuthenticatorManager::create const): (WebCore::AuthenticatorManager::discoverFromExternalSource const): * Modules/webauthn/AuthenticatorManager.h: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.h. * Modules/webauthn/AuthenticatorResponse.h: * Modules/webauthn/PublicKeyCredential.cpp: (WebCore::PublicKeyCredentialInternal::produceClientDataJson): Deleted. (WebCore::PublicKeyCredentialInternal::produceClientDataJsonHash): Deleted. (WebCore::PublicKeyCredentialInternal::getIdFromAttestationObject): Deleted. (WebCore::PublicKeyCredential::collectFromCredentialStore): Deleted. (WebCore::PublicKeyCredential::discoverFromExternalSource): Deleted. (WebCore::PublicKeyCredential::store): Deleted. (WebCore::PublicKeyCredential::create): Deleted. (WebCore::PublicKeyCredential::rawId const): Deleted. (WebCore::PublicKeyCredential::response const): Deleted. * Modules/webauthn/PublicKeyCredential.h: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * testing/Internals.cpp: (WebCore::Internals::Internals): (WebCore::Internals::mockCredentialsMessenger const): * testing/Internals.h: * testing/Internals.idl: * testing/MockCredentialsMessenger.cpp: Added. (WebCore::MockCredentialsMessenger::MockCredentialsMessenger): (WebCore::MockCredentialsMessenger::~MockCredentialsMessenger): (WebCore::MockCredentialsMessenger::setAttestationObject): (WebCore::MockCredentialsMessenger::setAssertionReturnBundle): (WebCore::MockCredentialsMessenger::makeCredential): (WebCore::MockCredentialsMessenger::getAssertion): (WebCore::MockCredentialsMessenger::makeCredentialReply): (WebCore::MockCredentialsMessenger::getAssertionReply): * testing/MockCredentialsMessenger.h: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.h. * testing/MockCredentialsMessenger.idl: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.h. 2018-02-15 Zalan Bujtas [RenderTreeBuilder] Move RenderInline/RenderGrid::addChild() to RenderTreeBuilder https://bugs.webkit.org/show_bug.cgi?id=182819 Reviewed by Antti Koivisto. No change in functionality. * rendering/RenderGrid.cpp: (WebCore::RenderGrid::addChild): Deleted. * rendering/RenderGrid.h: * rendering/RenderInline.cpp: (WebCore::RenderInline::addChild): Deleted. * rendering/RenderInline.h: * rendering/updating/RenderTreeBuilder.cpp: (WebCore::RenderTreeBuilder::insertChild): (WebCore::RenderTreeBuilder::takeChild): Deleted. * rendering/updating/RenderTreeBuilder.h: * rendering/updating/RenderTreeBuilderRuby.cpp: (WebCore::RenderTreeBuilder::Ruby::findOrCreateParentForChild): * rendering/updating/RenderTreeBuilderSVG.cpp: (WebCore::RenderTreeBuilder::SVG::insertChild): 2018-02-15 Antoine Quint [Modern Media Controls] REGRESSION: Inline media controls are not disabled while in fullscreen on iOS https://bugs.webkit.org/show_bug.cgi?id=182830 Reviewed by Eric Carlson. The test media/modern-media-controls/media-controller/ios/media-controller-stop-updates-in-fullscreen.html regressed when fixing webkit.org/b/182668 since we now started only caring about the presence of the "controls" attribute to identify that WebKit media controls should be available. We now have a dedicated _shouldControlsBeAvailable() method which more clearly establishes the conditions under which controls should be available and correctly disables them while in fullscreen on iOS, regardless of the "controls" attribute value. * Modules/modern-media-controls/media/media-controller.js: (MediaController.prototype._shouldControlsBeAvailable): (MediaController.prototype._updateControlsAvailability): 2018-02-15 Matt Lewis Unreviewed, rolling out r228495. This caused mulitple perf tests to fail consistently. Reverted changeset: "Resource Load Statistics: Make sure WebResourceLoadStatisticsStore::mergeWithDataFromDecoder() can ingest older plist versions and not reset the database" https://bugs.webkit.org/show_bug.cgi?id=182812 https://trac.webkit.org/changeset/228495 2018-02-15 Zan Dobersek Clean up HarfBuzzFaceCairo https://bugs.webkit.org/show_bug.cgi?id=182824 Reviewed by Carlos Garcia Campos. Clean up Cairo-specific bits of HarfBuzzFace implementation. HarfBuzzFontData is simplified, removing the constructor and turning the cairo_scaled_font_t member into a RefPtr<>, tying the Cairo object's lifetime to the lifetime of the HarfBuzzFontData instance. HarfBuzz font callbacks have the HarfBuzzFontData casting cleaned up, casting the user data pointer straight into a HarfBuzzFontData reference that's then used in the functions. HarfBuzzFontData member access is also adjusted. HarfBuzzFace::createFace() now references the cairo_scaled_font_t object that is then set as the user data pointer, with the destroy callback that dereferences that object also specified. With hb_face_t being a reference-counted object itself, this ensures the cairo_scaled_font_t object doesn't get destroyed while hb_face_t is still alive. In HarfBuzzFace::createFont(), the hb_font_t creation is cleaned up, with a C++ lambda used as the destroy callback. * platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp: (WebCore::harfBuzzGetGlyph): (WebCore::harfBuzzGetGlyphHorizontalAdvance): (WebCore::harfBuzzGetGlyphExtents): (WebCore::harfBuzzCairoGetTable): (WebCore::HarfBuzzFace::createFace): (WebCore::HarfBuzzFace::createFont): (WebCore::HarfBuzzFontData::HarfBuzzFontData): Deleted. (WebCore::destroyHarfBuzzFontData): Deleted. 2018-02-15 Philippe Normand [GStreamer] WebVTT caps changed in GStreamer 1.14 https://bugs.webkit.org/show_bug.cgi?id=182690 Reviewed by Xabier Rodriguez-Calvar. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin): Use text/vtt caps only for GStreamer versions inferior or equal to 1.12. In 1.13 (current git master) the VTT caps format changed to application/x-subtitle-vtt. 2018-02-15 Zan Dobersek HarfBuzzFace should not be ref-counted https://bugs.webkit.org/show_bug.cgi?id=182823 Reviewed by Carlos Garcia Campos. The HarfBuzzFace objects shouldn't be copied along in FontPlatformData copy assignment operator, which made it a requirement for that class to be ref-counted. Cairo-based HarfBuzzFace implementation uses the cairo_scaled_font_t object from FontPlatformData internally, but upon FontPlatformData cloning that scaled font object could change, meaning HarfBuzzFace object that's shared with another FontPlatformData object would end up using a different cairo_scaled_font_t object from the one that's been regenerated in the newly-cloned FontPlatformData object. Instead of ref-counting the HarfBuzzFace objects, they should be handled in FontPlatformData through std::unique_ptr<>. In the FontPlatformData copy assignment operator, the copy target's m_harfBuzzFace object is nulled out, allowing the next harfBuzzFace() call to construct an object that properly leverages the cairo_scaled_font_t object that could have changed during cloning. * platform/graphics/FontPlatformData.h: * platform/graphics/freetype/FontPlatformDataFreeType.cpp: (WebCore::FontPlatformData::operator=): (WebCore::FontPlatformData::harfBuzzFace const): * platform/graphics/harfbuzz/HarfBuzzFace.h: (WebCore::HarfBuzzFace::create): Deleted. 2018-02-14 Zalan Bujtas [RenderTreeBuilder] Move RenderMathMLFenced::addChild() to RenderTreeBuilder https://bugs.webkit.org/show_bug.cgi?id=182817 Reviewed by Antti Koivisto. No change in functionality. * rendering/mathml/RenderMathMLFenced.cpp: (WebCore::RenderMathMLFenced::addChild): Deleted. * rendering/mathml/RenderMathMLFenced.h: * rendering/updating/RenderTreeBuilder.cpp: (WebCore::RenderTreeBuilder::insertChild): (WebCore::RenderTreeBuilder::insertChildToRenderMathMLFenced): Deleted. * rendering/updating/RenderTreeBuilder.h: * rendering/updating/RenderTreeBuilderMathML.cpp: (WebCore::RenderTreeBuilder::MathML::insertChild): 2018-02-14 Antti Koivisto Do sibling invalidation on mutation https://bugs.webkit.org/show_bug.cgi?id=182809 Reviewed by Zalan Bujtas. We used to invalidate siblings for sibling combinators and nth-pseudo classes during style resolution tree walk. This would consider any element with invalid style a reason to invalidate siblings too. However we now do accurate invalidation on class and attribute changes and this approach ends up invalidating too much. This patch sibling style invalidation to mutation time and removes invalidation code from style resolution tree walk. * dom/Element.cpp: (WebCore::invalidateSiblingsIfNeeded): Helper to invalidate siblings. (WebCore::Element::invalidateStyle): (WebCore::Element::invalidateStyleAndLayerComposition): (WebCore::Element::invalidateStyleForSubtree): (WebCore::Element::invalidateStyleAndRenderersForSubtree): Invalidate siblings if needed based on affectsNextSibling/affectedByPreviousSibling bits. (WebCore::Element::invalidateStyleInternal): (WebCore::Element::invalidateStyleForSubtreeInternal): Add "internal" versions that don't invalidate siblings. These are used by StyleInvalidator for accurate invalidation. * dom/Element.h: * style/StyleInvalidator.cpp: (WebCore::Style::Invalidator::invalidateIfNeeded): (WebCore::Style::Invalidator::invalidateStyle): Use internal invalidation functions. * style/StyleTreeResolver.cpp: (WebCore::Style::resetStyleForNonRenderedDescendants): (WebCore::Style::TreeResolver::resolveComposedTree): Remove sibling invalidation. * style/StyleTreeResolver.h: 2018-02-14 John Wilander Resource Load Statistics: Make sure WebResourceLoadStatisticsStore::mergeWithDataFromDecoder() can ingest older plist versions and not reset the database https://bugs.webkit.org/show_bug.cgi?id=182812 Reviewed by Brent Fulgham. No new tests. Tested manually between versions of Safari. * loader/ResourceLoadStatistics.cpp: (WebCore::ResourceLoadStatistics::decode): Now only expects these fields for model version 11 or higher: - topFrameUniqueRedirectsTo - topFrameUniqueRedirectsFrom - subresourceUniqueRedirectsFrom - timesAccessedAsFirstPartyDueToUserInteraction - timesAccessedAsFirstPartyDueToStorageAccessAPI * loader/ResourceLoadStatistics.h: 2018-02-14 Basuke Suzuki [WinCairo] Fix several build warnings under WebCore/platform https://bugs.webkit.org/show_bug.cgi?id=182802 Reviewed by Konstantin Tokarev. Warning C4101 'fileModificationDate': unreferenced local variable Source\WebCore\platform\network\curl\CurlCacheEntry.cpp:279 Warning C4239 nonstandard extension used: 'argument': conversion from 'WTF::String' to 'WTF::String &' Source\WebCore\platform\text\win\LocaleWin.cpp:75 Source\WebCore\platform\text\win\LocaleWin.cpp:77 Warning C4838 conversion from 'UINT' to 'CLIPFORMAT' requires a narrowing conversion Source\WebCore\platform\win\ClipboardUtilitiesWin.cpp:170 Source\WebCore\platform\win\ClipboardUtilitiesWin.cpp:325 Source\WebCore\platform\win\ClipboardUtilitiesWin.cpp:332 Source\WebCore\platform\win\ClipboardUtilitiesWin.cpp:351 Source\WebCore\platform\win\ClipboardUtilitiesWin.cpp:358 Source\WebCore\platform\win\ClipboardUtilitiesWin.cpp:366 Source\WebCore\platform\win\ClipboardUtilitiesWin.cpp:373 Source\WebCore\platform\win\ClipboardUtilitiesWin.cpp:380 Source\WebCore\platform\win\ClipboardUtilitiesWin.cpp:387 * platform/network/curl/CurlCacheEntry.cpp: (WebCore::CurlCacheEntry::parseResponseHeaders): * platform/text/win/LocaleWin.cpp: (WebCore::LCIDFromLocaleInternal): * platform/win/ClipboardUtilitiesWin.cpp: (WebCore::registerClipboardFormat): (WebCore::texthtmlFormat): (WebCore::urlWFormat): (WebCore::urlFormat): (WebCore::filenameWFormat): (WebCore::filenameFormat): (WebCore::htmlFormat): (WebCore::smartPasteFormat): (WebCore::fileDescriptorFormat): (WebCore::fileContentFormatZero): 2018-02-14 Zalan Bujtas [RenderTreeBuilder] Move RenderSVG*::addChild() to RenderTreeBuilder https://bugs.webkit.org/show_bug.cgi?id=182811 Reviewed by Antti Koivisto. No change in functionality. * rendering/svg/RenderSVGContainer.cpp: (WebCore::RenderSVGContainer::addChild): Deleted. * rendering/svg/RenderSVGContainer.h: * rendering/svg/RenderSVGInline.cpp: (WebCore::RenderSVGInline::addChild): Deleted. * rendering/svg/RenderSVGInline.h: * rendering/svg/RenderSVGRoot.cpp: (WebCore::RenderSVGRoot::addChild): Deleted. * rendering/svg/RenderSVGRoot.h: * rendering/svg/RenderSVGText.cpp: (WebCore::RenderSVGText::addChild): Deleted. * rendering/svg/RenderSVGText.h: * rendering/updating/RenderTreeBuilder.cpp: (WebCore::RenderTreeBuilder::insertChild): (WebCore::RenderTreeBuilder::insertChildToSVGContainer): Deleted. (WebCore::RenderTreeBuilder::insertChildToSVGInline): Deleted. (WebCore::RenderTreeBuilder::insertChildToSVGRoot): Deleted. (WebCore::RenderTreeBuilder::insertChildToSVGText): Deleted. * rendering/updating/RenderTreeBuilder.h: 2018-02-14 Daniel Bates Disallow cross-origin subresources from asking for credentials https://bugs.webkit.org/show_bug.cgi?id=182579 Reviewed by Andy Estes. Prompts for credentials to load cross-origin subresources are typically seen as unexpected by a person that navigates to- or interacts with- a web page. The cross-origin and implicit loading nature of these subresources makes asking for credentials questionable because they are not being served by the same origin of the page a person explicitly loaded and are not guaranteed to correspond to an explicit user interaction other than the initial load of the page. We know that subresources that ask for credentials can be abused as part of a phishing attack. It seems reasonable to disallow cross-origin subresources from asking for credentials due to their questionable nature and the risk for abuse. This will also make the behavior of WebKit match the behavior of Chrome. Tests: http/tests/media/video-auth-with-allowCrossOriginSubresourcesToAskForCredentials.html http/tests/security/basic-auth-subresource.html http/tests/security/mixedContent/insecure-basic-auth-image-allowCrossOriginSubresourcesToAskForCredentials.https.html http/tests/security/mixedContent/insecure-image-redirects-to-basic-auth-secure-image-allowCrossOriginSubresourcesToAskForCredentials.html http/tests/security/mixedContent/secure-redirect-to-insecure-redirect-to-basic-auth-secure-image-allowCrossOriginSubresourcesToAskForCredentials.https.html http/tests/security/mixedContent/secure-redirect-to-secure-redirect-to-basic-auth-insecure-image-allowCrossOriginSubresourcesToAskForCredentials.https.html http/tests/security/mixedContent/secure-redirect-to-secure-redirect-to-basic-auth-secure-image-allowCrossOriginSubresourcesToAskForCredentials.https.html * loader/ResourceLoader.cpp: (WebCore::ResourceLoader::isSubresourceLoader const): Formerly non-const. (WebCore::ResourceLoader::shouldAllowResourceToAskForCredentials const): Added. (WebCore::ResourceLoader::didBlockAuthenticationChallenge): Emit Web Inspector console message if the authentication challenge was blocked because the request is cross origin. (WebCore::ResourceLoader::isAllowedToAskUserForCredentials const): Disallow a cross-origin request from prompting for credentials. (WebCore::ResourceLoader::isSubresourceLoader): Deleted; made const. * loader/ResourceLoader.h: * loader/SubresourceLoader.cpp: (WebCore::SubresourceLoader::SubresourceLoader): Update ResourceLoader state so that block cross-origin subresources from prompting for credentials, if applicable. (WebCore::SubresourceLoader::isSubresourceLoader const): Formerly non-const. (WebCore::SubresourceLoader::isSubresourceLoader): Deleted; made const. * loader/SubresourceLoader.h: * page/Settings.yaml: Add setting allowCrossOriginSubresourcesToAskForCredentials (defaults: false - do not allow cross origin subresources to ask for credentials). 2018-02-14 Don Olmstead WebCore headers should not include config.h or PlatformExportMacros.h https://bugs.webkit.org/show_bug.cgi?id=182799 Reviewed by Darin Adler. No new tests. No change in behavior. * Modules/speech/SpeechSynthesis.h: * bindings/js/JSDOMGlobalObject.h: * contentextensions/ContentExtensionError.h: * contentextensions/DFA.h: * dom/ContextDestructionObserver.h: * dom/DeviceOrientationClient.h: * dom/DeviceOrientationData.h: * editing/cocoa/HTMLConverter.h: * loader/FrameLoaderStateMachine.h: * loader/cache/CachedResourceHandle.h: * page/FrameDestructionObserver.h: * page/RuntimeEnabledFeatures.h: * platform/URL.h: * platform/audio/AudioHardwareListener.h: * platform/audio/AudioSession.h: * platform/graphics/Color.h: * platform/graphics/IntSize.h: * platform/graphics/transforms/AffineTransform.h: * platform/graphics/win/LocalWindowsContext.h: * platform/network/CacheValidation.h: * platform/network/CredentialBase.h: * platform/network/ResourceHandleClient.h: * platform/network/cf/CertificateInfo.h: 2018-02-12 Ryosuke Niwa REGRESSION (r223440): Copying & pasting a list from Microsoft Word to TinyMCE fails https://bugs.webkit.org/show_bug.cgi?id=182564 Reviewed by Wenson Hsieh. Unfortunately, r228352 was inadaquate to fix copying & pasting of a list item from Microsoft Word into TinyMCE in older verions of TinyMCE. This patch amends the approach taken by r228352 to make it work across the board as well as unbreak GMail. Turns out older versions of TinyMCE can't handle list items when computed styles are added as inline style declarations by WebKit. To make this work, avoid adding any computed styles as inline styles within mso-list conditionals as well as any p elements whose style attribute contains "mso-list" property. We would instead preserve these styles by keeping Microsoft Word's CSS style rules in addition to special @list rules. In addition, not keeping the style element of Microsoft Word in a head element as done in r228352 causes some versions of TinyMCE to treat it as regular text, and inserting a bunch of @list rules as user visible text. To work around this problem, we serialize the style rules as a comment () within a head element. Furthermore, when Microsoft Word is in the compatibility mode, it does not generate xmlns:o as the first xmlns declaration. Generalized the code to detect Microsoft Word's HTML declaration by looking for xmlns:o and xmlns:w xmls declarations. Finally, it turns out that Gmail has its own handling of list items copy & pasted from Microsoft Word, and also needs this quirks but in the pasted HTML, not the one exposed in getData. As such, this patch also enables the MSO list quirks in the pasted content as well as the one exposed in getData. Tests: PasteHTML.PreservesMSOList PasteHTML.PreservesMSOListInCompatibilityMode PasteHTML.StripsMSOListWhenMissingMSOHTMLElement PasteWebArchive.PreservesMSOList PasteWebArchive.PreservesMSOListInCompatibilityMode PasteWebArchive.StripsMSOListWhenMissingMSOHTMLElement * editing/HTMLInterchange.h: * editing/ReplaceSelectionCommand.cpp: (WebCore::removeHeadContents): Don't remove the special style element needed for the MSO list quirks since we don't keep the computed style as inline styles in this case. * editing/cocoa/WebContentReaderCocoa.mm: (WebCore::WebContentReader::readWebArchive): Enable the quirks in the pasted content as well as opposed to just in DataTransfer API exposed to the JavaScript. (WebCore::WebContentReader::readHTML): Ditto. * editing/markup.cpp: (WebCore::shouldPreserveMSOLists): Added. Generalized the logic to detect a Microsoft Word document. more xmlns declarations. (WebCore::StyledMarkupAccumulator::shouldPreserveMSOListStyleForElement): Added. (WebCore::StyledMarkupAccumulator::appendElement): Don't generate the second style element here for elements with most-list properties. Instead, avoid overriding inline styles with computed styles altogether. (WebCore::StyledMarkupAccumulator::appendNodeToPreserveMSOList): Include the style rules as well as list rules and wrap the "style" element in a "head" element to make it compatible with older versions of TinyMCE. 2018-02-14 Dean Jackson CrashTracer: com.apple.WebKit.WebContent at com.apple.WebCore: WebCore::HTMLPlugInImageElement::didAddUserAgentShadowRoot + 618 https://bugs.webkit.org/show_bug.cgi?id=182798 Reviewed by Eric Carlson. Speculative fix for a crash in HTMLPlugInImageElement::didAddUserAgentShadowRoot. The guess is that the m_swapRendererTimer is set, and the display state changes to something that does not require a shadow root, but before the timer fires. Fix this by ensuring that the timer is reset on every display state change. * html/HTMLPlugInElement.cpp: (WebCore::HTMLPlugInElement::setDisplayState): Guard for sets that wouldn't actually change value, and make sure we always reset the timer. 2018-02-14 Antoine Quint [Modern Media Controls] Don't use arrays as values for localisable strings https://bugs.webkit.org/show_bug.cgi?id=182791 Reviewed by Dean Jackson. Localization tools expect localizable strings to be specified as key-value pairs where both the key and the pair are plain strings. For the skip buttons, we used an array value to specify a replacement string. We now perform this task in code with a centralized SkipSeconds constant defining the skip amount. * English.lproj/modern-media-controls-localized-strings.js: * Modules/modern-media-controls/controls/icon-service.js: * Modules/modern-media-controls/main.js: (UIString): * Modules/modern-media-controls/media/skip-back-support.js: (SkipBackSupport.prototype.buttonWasPressed): * Modules/modern-media-controls/media/skip-forward-support.js: (SkipForwardSupport.prototype.buttonWasPressed): 2018-02-14 Ryan Haddad Unreviewed, rolling out r228444. Introduced API and Layout test failures. Reverted changeset: "[WebAuthN] Revisit the whole async model of task dispatching, timeout and aborting" https://bugs.webkit.org/show_bug.cgi?id=181946 https://trac.webkit.org/changeset/228444 2018-02-14 Brent Fulgham Confirm proper thread in UserGestureIndicator constructor https://bugs.webkit.org/show_bug.cgi?id=175980 Reviewed by Daniel Bates. Document is a main-thread object. If we enter the UserGestureIndicator constructor on a non-main thread, we should ASSERT, not return silently. * dom/UserGestureIndicator.cpp: (WebCore::UserGestureIndicator::UserGestureIndicator): 2018-02-14 Zalan Bujtas [RenderTreeBuilder] Remove redundant RenderTreeBuilder methods https://bugs.webkit.org/show_bug.cgi?id=182770 Reviewed by Daniel Bates. No change in functionality. * rendering/updating/RenderTreeBuilder.cpp: (WebCore::RenderTreeBuilder::dropAnonymousBoxChild): Deleted. (WebCore::RenderTreeBuilder::moveRubyChildren): Deleted. (WebCore::RenderTreeBuilder::resolveMovedChildForMultiColumnFlow): Deleted. * rendering/updating/RenderTreeBuilder.h: * rendering/updating/RenderTreeBuilderBlockFlow.cpp: (WebCore::RenderTreeBuilder::BlockFlow::insertChild): * rendering/updating/RenderTreeBuilderInline.cpp: (WebCore::RenderTreeBuilder::Inline::insertChild): * rendering/updating/RenderTreeBuilderRuby.cpp: (WebCore::RenderTreeBuilder::Ruby::takeChild): 2018-02-14 Zalan Bujtas [RenderTreeBuilder] Move RenderElement::takeChild() to RenderTreeBuilder https://bugs.webkit.org/show_bug.cgi?id=182762 Reviewed by Daniel Bates. This patch removes the remaining takeChild() related mutation logic from the renderers. No change in functionality. * rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::moveChildTo): * rendering/RenderElement.cpp: (WebCore::RenderElement::takeChild): Deleted. (WebCore::RenderElement::takeChildInternal): Deleted. * rendering/RenderElement.h: * rendering/RenderObject.h: * rendering/updating/RenderTreeBuilder.cpp: (WebCore::RenderTreeBuilder::takeChild): (WebCore::RenderTreeBuilder::childFlowStateChangesAndAffectsParentBlock): (WebCore::RenderTreeBuilder::takeChildFromRenderElement): * rendering/updating/RenderTreeBuilder.h: * rendering/updating/RenderTreeBuilderBlock.cpp: (WebCore::RenderTreeBuilder::Block::removeLeftoverAnonymousBlock): (WebCore::RenderTreeBuilder::Block::takeChild): (WebCore::RenderTreeBuilder::Block::dropAnonymousBoxChild): * rendering/updating/RenderTreeBuilderInline.cpp: (WebCore::RenderTreeBuilder::Inline::splitFlow): (WebCore::RenderTreeBuilder::Inline::splitInlines): (WebCore::RenderTreeBuilder::Inline::childBecameNonInline): * rendering/updating/RenderTreeBuilderRuby.cpp: (WebCore::RenderTreeBuilder::Ruby::takeChild): * rendering/updating/RenderTreeBuilderSVG.cpp: (WebCore::RenderTreeBuilder::SVG::takeChild): Leftover from the previous patch. 2018-02-13 Antti Koivisto REGRESSION(r228313): Membuster | macOS | All Devices | 1.5 MB https://bugs.webkit.org/show_bug.cgi?id=182744 Reviewed by Zalan Bujtas. We need to respect low memory notifications explicitly now that the compiled selectors are not part of RuleData. * css/StyleRule.cpp: (WebCore::StyleRule::StyleRule): * css/StyleRule.h: Switch to std::unique_ptr<[]> from Vector to avoid unnecessary bloat. * css/StyleSheetContents.cpp: (WebCore::traverseRulesInVector): (WebCore::StyleSheetContents::traverseRules const): Add a rule traversal function, similar to the existing traverseSubresources. (WebCore::StyleSheetContents::traverseSubresources const): Use traverseRules to implement traverseSubresources. (WebCore::traverseSubresourcesInRules): Deleted. * css/StyleSheetContents.h: * page/MemoryRelease.cpp: (WebCore::releaseCriticalMemory): * style/StyleScope.cpp: (WebCore::Style::Scope::releaseMemory): Release memory for compiled selectors on memory notification. * style/StyleScope.h: 2018-02-13 Commit Queue Unreviewed, rolling out r228431. https://bugs.webkit.org/show_bug.cgi?id=182766 Regressed CMake build stability (Requested by dolmstead on #webkit). Reverted changeset: "[CMake] Make WebCore headers copies" https://bugs.webkit.org/show_bug.cgi?id=182512 https://trac.webkit.org/changeset/228431 2018-02-13 Commit Queue Unreviewed, rolling out r228437, r228439, and r228440. https://bugs.webkit.org/show_bug.cgi?id=182756 Introduced LayoutTest failures (Requested by ryanhadd_ on #webkit). Reverted changesets: "[Web Animations] Make KeyframeEffect target nullable and read-write" https://bugs.webkit.org/show_bug.cgi?id=182741 https://trac.webkit.org/changeset/228437 "Unreviewed attempt to fix build after r228437." https://trac.webkit.org/changeset/228439 "[Web Animations] Make KeyframeEffect target nullable and read-write" https://bugs.webkit.org/show_bug.cgi?id=182741 https://trac.webkit.org/changeset/228440 2018-02-13 Antoine Quint Removing the controls attribute from a