2018-01-15 Sebastian Dröge [GStreamer] Don't wait for draw condition variable when shutting down. https://bugs.webkit.org/show_bug.cgi?id=180978 Reviewed by Carlos Garcia Campos. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint): (WebCore::MediaPlayerPrivateGStreamerBase::cancelRepaint): * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h: By also waiting for the draw condition variable while shutting down, it is possible that the GStreamer video sink is waiting for the main thread to actually render the current frame, while at the same time the main thread is waiting for the GStreamer video sink to shut down, resulting in a deadlock. 2017-10-06 Enrique Ocaña González [MSE][GStreamer] Seek on youtube.com/tv fails after r217185 https://bugs.webkit.org/show_bug.cgi?id=177976 Reviewed by Jer Noble. Covered by existing tests. * Modules/mediasource/MediaSource.cpp: (WebCore::MediaSource::seekToTime): Only call waitForSeekCompleted() when the time is not buffered when using GStreamer. 2018-01-05 Said Abou-Hallawa SVGAnimatedListPropertyTearOff::synchronizeWrappersIfNeeded() should do nothing if the property is not animating https://bugs.webkit.org/show_bug.cgi?id=181316 Reviewed by Simon Fraser. This is a speculative change to fix a crash which appeared after r226065. The crash is very intermittent and sometimes very hard to reproduce. The basic code analysis did not show how this crash can even happen. * svg/SVGAnimatedTypeAnimator.h: (WebCore::SVGAnimatedTypeAnimator::resetFromBaseValues): For SVG property with two values, e.g. , we need to detach the wrappers of the animated property if the animated values are going to change. This is similar to what we did in resetFromBaseValue(). * svg/properties/SVGAnimatedListPropertyTearOff.h: (WebCore::SVGAnimatedListPropertyTearOff::synchronizeWrappersIfNeeded): 2017-11-03 Daniel Bates Invalidate node list when associated form control element is removed https://bugs.webkit.org/show_bug.cgi?id=179232 Reviewed by Ryosuke Niwa. A node list represents a live view of the DOM. Invalidate the node list associated with a form element whenever one of its associated form control elements is removed. Test: fast/forms/node-list-remove-button-from-form.html * html/HTMLFormElement.cpp: (WebCore::HTMLFormElement::removeFormElement): 2017-10-27 Daniel Bates Only allow non-mixed content protected subresources to ask for credentials https://bugs.webkit.org/show_bug.cgi?id=178919 Reviewed by Alex Christensen. Only allow non-mixed content protected subresources to ask for credentials. It is not meaningful to allow protected mixed-content subresources to ask for credentials. Tests: http/tests/security/mixedContent/insecure-image-redirects-to-basic-auth-secure-image.html http/tests/security/mixedContent/insecure-script-redirects-to-basic-auth-secure-script.html http/tests/security/mixedContent/insecure-stylesheet-redirects-to-basic-auth-secure-stylesheet.html http/tests/security/mixedContent/secure-redirect-to-insecure-redirect-to-basic-auth-secure-image.https.html http/tests/security/mixedContent/secure-redirect-to-secure-redirect-to-basic-auth-insecure-image.https.html http/tests/security/mixedContent/secure-redirect-to-secure-redirect-to-basic-auth-secure-image.https.html * loader/ResourceLoader.cpp: (WebCore::ResourceLoader::ResourceLoader): Initialize m_canAskClientForCredentials based on the specified resource loader options. (WebCore::ResourceLoader::init): Update m_canAskClientForCredentials based on the URL of the initial request. (WebCore::ResourceLoader::isMixedContent const): Helper function to check if the specified URL represents a mixed content resource. (WebCore::ResourceLoader::willSendRequestInternal): If the original request or the redirect request is mixed content then update state such that we will disallow asking for credentials. (WebCore::ResourceLoader::isAllowedToAskUserForCredentials const): Modified to use m_canAskClientForCredentials when determining whether the request is allowed to ask for credentials. * loader/ResourceLoader.h: 2018-01-07 Ryosuke Niwa Reduce the precision of "high" resolution time to 1ms https://bugs.webkit.org/show_bug.cgi?id=180910 Reviewed by Saam Barati. Reduced the high prevision time's resolution to 1ms, the same precision as Date.now(). Also fixed the bug in fillRTCStats that we weren't reducing the time resolution in RTCStats dictionaries. * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp: (WebCore::fillRTCStats): * page/Performance.cpp: (WebCore::Performance::reduceTimeResolution): 2017-11-20 Carlos Alberto Lopez Perez [WPE] GLContextEGLWPE.cpp:44:96: error: invalid cast from type ‘GLNativeWindowType {aka long long unsigned int}’ to type ‘EGLNativeWindowType {aka unsigned int} https://bugs.webkit.org/show_bug.cgi?id=179511 Reviewed by Žan Doberšek. r217208 changed the definition of GLNativeWindowType from EGLNativeWindowType to uint64_t for platform WPE. This built fine on a 64-bit platform since uint64_t matches the size of a pointer, but fails on 32-bits. This switches back the definition to EGLNativeWindowType. And we need to include first in order to get a definition for EGLNativeWindowType itself. This commit pretty much reverts the changes r217208 did on platform/graphics/GLContext.h No new tests, it is a build fix. * platform/graphics/GLContext.h: 2017-11-11 Helmut Grohne [GTK] PlatformGTK.cmake: use the PKG_CONFIG_EXECUTABLE variable https://bugs.webkit.org/show_bug.cgi?id=179547 Reviewed by Michael Catanzaro. * PlatformGTK.cmake: Use PKG_CONFIG_EXECUTABLE instead of hardcoding the executable name. 2017-12-04 Carlos Garcia Campos [GStreamer] More leaks in TextCombinerGStreamer https://bugs.webkit.org/show_bug.cgi?id=180331 Reviewed by Michael Catanzaro. I've noticed more leaks reading the code, but I couldn't check them with valgrind, because I don't know how to trigger that code path. This patch cleans up the file using smart pointer everywhere. * platform/graphics/gstreamer/TextCombinerGStreamer.cpp: (webkit_text_combiner_pad_init): (webkitTextCombinerPadEvent): (webkitTextCombinerReleasePad): 2017-12-03 Carlos Garcia Campos [GStreamer] GstPad leaked in WebKitTextCombiner https://bugs.webkit.org/show_bug.cgi?id=180314 Reviewed by Michael Catanzaro. gst_element_get_static_pad() returns a full reference that si never freed, because gst_ghost_pad_new doesn't take the ownership of the given pad. * platform/graphics/gstreamer/TextCombinerGStreamer.cpp: (webkit_text_combiner_init): 2017-12-03 Carlos Garcia Campos [GStreamer] GstCaps leaked in MediaPlayerPrivateGStreamer::createGSTPlayBin https://bugs.webkit.org/show_bug.cgi?id=180311 Reviewed by Michael Catanzaro. gst_caps_new_empty_simple() is passed directly to g_object_set(). The returned caps should be freed with gst_caps_unref(). * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin): 2017-11-10 Miguel Gomez [GTK][WPE] CoordinatedGraphicsLayer::setNeedsDisplayInRect() converts FloatRect to IntRect erroneously https://bugs.webkit.org/show_bug.cgi?id=179476 Reviewed by Žan Doberšek. Convert the passed FloatRect into an IntRect using enclosingIntRect(), so we are guaranteed that the rectangle to paint fits into the buffer that the backingStore will allocate. No behaviour change. * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp: (WebCore::CoordinatedGraphicsLayer::setNeedsDisplayInRect): 2017-12-18 Zalan Bujtas [SVG] Detach list wrappers before resetting the base value. https://bugs.webkit.org/show_bug.cgi?id=180912 Reviewed by Simon Fraser. Before resetting the animation value (and destroying the assigned SVG object -SVGLengthValue in this case), we need to check if there's an associated tear off wrapper for the said SVG object and make a copy of it. This is currently done in the wrong order through animValDidChange. Test: svg/animations/crash-when-animation-is-running-while-getting-value.html * svg/SVGAnimatedTypeAnimator.h: (WebCore::SVGAnimatedTypeAnimator::resetFromBaseValue): * svg/properties/SVGAnimatedPropertyTearOff.h: * svg/properties/SVGAnimatedStaticPropertyTearOff.h: (WebCore::SVGAnimatedStaticPropertyTearOff::synchronizeWrappersIfNeeded): 2017-12-08 Zalan Bujtas Document::updateLayout() could destroy current frame. https://bugs.webkit.org/show_bug.cgi?id=180525 Reviewed by Simon Fraser. Early return when Document::updateLayout() triggers Frame destruction. Test: fast/frames/crash-when-iframe-is-remove-in-eventhandler.html * dom/TreeScope.cpp: (WebCore::absolutePointIfNotClipped): 2017-12-05 Alex Christensen Fix non-unified build after r225381 https://bugs.webkit.org/show_bug.cgi?id=180434 Reviewed by Keith Miller. * loader/ResourceTimingInformation.cpp: FrameLoader.h is included in other files that are combined with this file in unified builds, but we need to merge r225381 to a branch that doesn't use unified builds. This build failure would've come up randomly in the future when we add files, too. 2017-11-30 Alex Christensen Extra PerformanceEntryList entry after iframe navigation https://bugs.webkit.org/show_bug.cgi?id=178433 Reviewed by Joseph Pecoraro. Test: http/tests/security/PerformanceEntryList-parent-only-first-navigation.html When an iframe is loaded, its main resource load should be reported to the parent frame's PerformanceEntryList. Subsequent main resource loads should not. * loader/FrameLoader.h: (WebCore::FrameLoader::shouldReportResourceTimingToParentFrame): * loader/ResourceTimingInformation.cpp: (WebCore::ResourceTimingInformation::addResourceTiming): 2017-11-03 Ryosuke Niwa Crash inside ChildListMutationAccumulator::enqueueMutationRecord() https://bugs.webkit.org/show_bug.cgi?id=179234 Reviewed by Darin Adler. Fixed the crash by keeping MutationObserver referenced by MutationObserverInterestGroup alive. Also added hasCallback() virtual function on MutationObserver to check whether the callback is alive to work around the bug that JS function referenced by MutationObserver isn't kept alive. We'll address this bug separately in https://webkit.org/b/179224. Test: fast/dom/MutationObserver/disconnect-observer-while-mutation-records-are-enqueued-crash.html * bindings/scripts/CodeGeneratorJS.pm: (GenerateCallbackHeaderContent): Added an override for the newly added virtual hasCallback(). * dom/MutationCallback.h: * dom/MutationObserver.cpp: (WebCore::MutationObserver::deliver): Added the aforementioned workaround. * dom/MutationObserverInterestGroup.cpp: (WebCore::MutationObserverInterestGroup::MutationObserverInterestGroup): Fixed the crash by using Ref. (WebCore::MutationObserverInterestGroup::enqueueMutationRecord): Ditto. * dom/MutationObserverInterestGroup.h: * dom/NativeNodeFilter.cpp: (WebCore::NativeNodeFilter::hasCallback const): Always return true here. This function is never called but we still need to implement it since NodeFilter has a pure virtual hasCallback() now. * dom/NativeNodeFilter.h: * dom/Node.cpp: (WebCore::collectMatchingObserversForMutation): Use Ref to fix the crash. (WebCore::Node::registeredMutationObservers): Ditto. * dom/Node.h: * dom/NodeFilter.h: 2017-11-14 Carlos Garcia Campos Move JSONValues to WTF and convert uses of InspectorValues.h to JSONValues.h https://bugs.webkit.org/show_bug.cgi?id=173793 Reviewed by Joseph Pecoraro. Based on patch by Brian Burg. * ForwardingHeaders/inspector/InspectorValues.h: Removed. * Modules/encryptedmedia/InitDataRegistry.cpp: (WebCore::extractKeyIDsKeyids): (WebCore::sanitizeKeyids): * html/parser/XSSAuditorDelegate.cpp: (WebCore::XSSAuditorDelegate::generateViolationReport): * inspector/CommandLineAPIHost.cpp: (WebCore::CommandLineAPIHost::inspect): * inspector/CommandLineAPIHost.h: * inspector/InspectorCanvas.cpp: (WebCore::InspectorCanvas::recordAction): (WebCore::InspectorCanvas::releaseData): (WebCore::InspectorCanvas::indexForData): (WebCore::buildArrayForVector): (WebCore::InspectorCanvas::buildInitialState): (WebCore::InspectorCanvas::buildAction): (WebCore::InspectorCanvas::buildArrayForCanvasGradient): (WebCore::InspectorCanvas::buildArrayForCanvasPattern): (WebCore::InspectorCanvas::buildArrayForImageData): (WebCore::InspectorCanvas::buildArrayForImageBitmap): * inspector/InspectorCanvas.h: * inspector/InspectorDatabaseResource.cpp: * inspector/InspectorOverlay.cpp: (WebCore::evaluateCommandInOverlay): (WebCore::InspectorOverlay::evaluateInOverlay): * inspector/InspectorOverlay.h: * inspector/InspectorShaderProgram.h: * inspector/InspectorStyleSheet.h: (WebCore::InspectorCSSId::InspectorCSSId): * inspector/TimelineRecordFactory.cpp: (WebCore::TimelineRecordFactory::createGenericRecord): (WebCore::TimelineRecordFactory::createFunctionCallData): (WebCore::TimelineRecordFactory::createConsoleProfileData): (WebCore::TimelineRecordFactory::createProbeSampleData): (WebCore::TimelineRecordFactory::createEventDispatchData): (WebCore::TimelineRecordFactory::createGenericTimerData): (WebCore::TimelineRecordFactory::createTimerInstallData): (WebCore::TimelineRecordFactory::createEvaluateScriptData): (WebCore::TimelineRecordFactory::createTimeStampData): (WebCore::TimelineRecordFactory::createAnimationFrameData): (WebCore::createQuad): (WebCore::TimelineRecordFactory::createPaintData): (WebCore::TimelineRecordFactory::appendLayoutRoot): * inspector/TimelineRecordFactory.h: * inspector/agents/InspectorApplicationCacheAgent.cpp: * inspector/agents/InspectorApplicationCacheAgent.h: * inspector/agents/InspectorCSSAgent.cpp: (WebCore::computePseudoClassMask): (WebCore::InspectorCSSAgent::setStyleText): (WebCore::InspectorCSSAgent::setRuleSelector): (WebCore::InspectorCSSAgent::forcePseudoState): * inspector/agents/InspectorCSSAgent.h: * inspector/agents/InspectorDOMAgent.cpp: (WebCore::parseColor): (WebCore::parseConfigColor): (WebCore::parseQuad): (WebCore::InspectorDOMAgent::performSearch): (WebCore::InspectorDOMAgent::setSearchingForNode): (WebCore::InspectorDOMAgent::highlightConfigFromInspectorObject): (WebCore::InspectorDOMAgent::setInspectModeEnabled): (WebCore::InspectorDOMAgent::highlightRect): (WebCore::InspectorDOMAgent::highlightQuad): (WebCore::InspectorDOMAgent::innerHighlightQuad): (WebCore::InspectorDOMAgent::highlightSelector): (WebCore::InspectorDOMAgent::highlightNode): (WebCore::InspectorDOMAgent::highlightNodeList): (WebCore::InspectorDOMAgent::highlightFrame): * inspector/agents/InspectorDOMAgent.h: * inspector/agents/InspectorDOMDebuggerAgent.cpp: (WebCore::InspectorDOMDebuggerAgent::didInvalidateStyleAttr): (WebCore::InspectorDOMDebuggerAgent::willInsertDOMNode): (WebCore::InspectorDOMDebuggerAgent::willRemoveDOMNode): (WebCore::InspectorDOMDebuggerAgent::willModifyDOMAttr): (WebCore::InspectorDOMDebuggerAgent::descriptionForDOMEvent): (WebCore::InspectorDOMDebuggerAgent::pauseOnNativeEventIfNeeded): (WebCore::InspectorDOMDebuggerAgent::willSendXMLHttpRequest): * inspector/agents/InspectorDOMDebuggerAgent.h: * inspector/agents/InspectorDOMStorageAgent.cpp: (WebCore::InspectorDOMStorageAgent::getDOMStorageItems): (WebCore::InspectorDOMStorageAgent::setDOMStorageItem): (WebCore::InspectorDOMStorageAgent::removeDOMStorageItem): (WebCore::InspectorDOMStorageAgent::findStorageArea): * inspector/agents/InspectorDOMStorageAgent.h: * inspector/agents/InspectorDatabaseAgent.cpp: * inspector/agents/InspectorIndexedDBAgent.cpp: (WebCore::Inspector::idbKeyFromInspectorObject): (WebCore::Inspector::idbKeyRangeFromKeyRange): (WebCore::InspectorIndexedDBAgent::requestData): * inspector/agents/InspectorIndexedDBAgent.h: * inspector/agents/InspectorNetworkAgent.cpp: (WebCore::buildObjectForHeaders): (WebCore::InspectorNetworkAgent::buildObjectForResourceResponse): (WebCore::InspectorNetworkAgent::setExtraHTTPHeaders): * inspector/agents/InspectorNetworkAgent.h: * inspector/agents/InspectorPageAgent.cpp: * inspector/agents/InspectorPageAgent.h: * inspector/agents/InspectorTimelineAgent.cpp: (WebCore::InspectorTimelineAgent::setInstruments): (WebCore::InspectorTimelineAgent::internalStart): (WebCore::InspectorTimelineAgent::didInvalidateLayout): (WebCore::InspectorTimelineAgent::willLayout): (WebCore::InspectorTimelineAgent::didScheduleStyleRecalculation): (WebCore::InspectorTimelineAgent::willRecalculateStyle): (WebCore::InspectorTimelineAgent::willComposite): (WebCore::InspectorTimelineAgent::willPaint): (WebCore::InspectorTimelineAgent::addRecordToTimeline): (WebCore::InspectorTimelineAgent::setFrameIdentifier): (WebCore::InspectorTimelineAgent::appendRecord): (WebCore::InspectorTimelineAgent::sendEvent): (WebCore::InspectorTimelineAgent::createRecordEntry): (WebCore::InspectorTimelineAgent::pushCurrentRecord): * inspector/agents/InspectorTimelineAgent.h: * page/csp/ContentSecurityPolicy.cpp: (WebCore::ContentSecurityPolicy::reportViolation const): * platform/encryptedmedia/clearkey/CDMClearKey.cpp: (WebCore::parseJSONObject): (WebCore::parseLicenseFormat): (WebCore::parseLicenseReleaseAcknowledgementFormat): (WebCore::CDMInstanceClearKey::updateLicense): (WebCore::CDMInstanceClearKey::removeSessionData): * platform/graphics/avfoundation/CDMFairPlayStreaming.cpp: (WebCore::extractSinfData): * testing/Internals.cpp: 2017-11-07 Brian Burg Web Automation: inViewCenterPoint should not include topContentInset when computed in viewport coordinates https://bugs.webkit.org/show_bug.cgi?id=179129 Reviewed by Simon Fraser. Add or export some helpers needed to compute element layout for WebDriver. * dom/Element.h: Export the non-DOM version of getClientBounds(). * page/FrameView.h: * page/FrameView.cpp: (WebCore::FrameView::clientToDocumentRect const): Added. This does the same thing as clientToDocumentPoint. Export it, too. 2017-09-07 Carlos Garcia Campos [GTK] Bring back line height rounding when computing font metrics https://bugs.webkit.org/show_bug.cgi?id=176497 Reviewed by Žan Doberšek. In r221670 we changed the way we get the metrics to avoid rounding that was causing a negative line gap to be computed. Since the font metrics value is indeed a float value, we also removed the rounding when setting the line height. However, this caused some test failures because now we report non integer line heights. * platform/graphics/freetype/SimpleFontDataFreeType.cpp: (WebCore::Font::platformInit): 2017-09-06 Dominik Röttsches [GTK] Bump freetype version to 2.8.0 https://bugs.webkit.org/show_bug.cgi?id=176351 Reviewed by Carlos Alberto Lopez Perez. Retrieving line spacing info without metrics hinting - FreeType's metric hinting uses rounding which results in the sum of ascent and descent being larger than the line height. To work around this without globally disabling font metrics hinting, I am temporarily creating a new cairo scaled font with metrics hinting off and retrieving the height values from this one. * platform/graphics/freetype/SimpleFontDataFreeType.cpp: (WebCore::scaledFontWithoutMetricsHinting): New function to clone the existing font, only with metrics hinting disabled. (WebCore::Font::platformInit): Get height info from non-metrics hinted font, disable rounding for linespacing. 2017-09-13 Zalan Bujtas Switch multicolumn's spanner map from raw over to weak pointers. https://bugs.webkit.org/show_bug.cgi?id=176367 Reviewed by Antti Koivisto. Test: fast/multicol/spanner-crash-when-adding-summary.html * rendering/RenderMultiColumnFlowThread.cpp: (WebCore::RenderMultiColumnFlowThread::evacuateAndDestroy): (WebCore::RenderMultiColumnFlowThread::flowThreadDescendantInserted): (WebCore::RenderMultiColumnFlowThread::handleSpannerRemoval): * rendering/RenderMultiColumnFlowThread.h: * rendering/RenderMultiColumnSet.cpp: (WebCore::RenderMultiColumnSet::firstRendererInFlowThread const): (WebCore::RenderMultiColumnSet::lastRendererInFlowThread const): * rendering/RenderMultiColumnSpannerPlaceholder.cpp: (WebCore::RenderMultiColumnSpannerPlaceholder::RenderMultiColumnSpannerPlaceholder): * rendering/RenderMultiColumnSpannerPlaceholder.h: 2017-09-13 Daniel Bates Make history.pushState()/replaceState() more closely aligned to the HTML standard https://bugs.webkit.org/show_bug.cgi?id=176730 Reviewed by Alex Christensen. Update history.pushState()/replaceState() to more closely align with the algorithm specified in (9 September 2017). Test: http/tests/security/history-pushState-replaceState-from-sandboxed-iframe.html * page/History.cpp: (WebCore::History::stateObjectAdded): * page/SecurityOrigin.cpp: (WebCore::SecurityOrigin::extractInnerURL): Use URL constructor that takes a base URL as opposed to using the special ParsedURLString-variant because the latter can only be used to parse a string returned from URL::string(). And the extracted inner URL does not meet this criterion. Using the ParsedURLString-variant of the URL constructor with a string that is not the result of URL::string() will cause an assertion failure in a debug build. 2017-10-25 Ryosuke Niwa Style::Scope::flushPendingUpdate() can replace the entire document in XSLTProcessor::createDocumentFromSource https://bugs.webkit.org/show_bug.cgi?id=178715 Reviewed by Brent Fulgham. Apply XLS tranforms when a 0s timer fires or the document finishes parsing or loading whichever comes first instead of in the middle of collecting a list of stylesheets. * dom/Document.cpp: (WebCore::Document::Document): Initialize the newly added timer. (WebCore::Document::implicitClose): Apply any pending XSLT before we fire load events since some of the event handlers may be expecting to see the document after XSLT had been applied. (WebCore::Document::scheduleToApplyXSLTransforms): Added. (WebCore::Document::applyPendingXSLTransformsNowIfScheduled): Added. (WebCore::Document::applyPendingXSLTransformsTimerFired): Added. Moved the logic to apply XSL transforms from Style::Scope::collectActiveStyleSheets, and merged applyXSLTransform into this function. (WebCore::Document::applyXSLTransform): Deleted. (WebCore::Document::finishedParsing): Apply XSLT right before updating the style. This is where used to apply inline XSLT and it happens much earlier than implicitClose. * dom/Document.h: * dom/ProcessingInstruction.cpp: (WebCore::ProcessingInstruction::checkStyleSheet): Schedule XSLT in the document instead of flushing pending stylesheets, which would have synchronously applied XSLT. We can't apply XSLT synchronously here because this function can be called from a non-script-resilient call stack. (WebCore::ProcessingInstruction::sheetLoaded): Ditto. * style/StyleScope.cpp: (WebCore::Style::Scope::collectXSLTransforms): Added. (WebCore::Style::Scope::collectActiveStyleSheets): Removed the code to apply XSLT. Skip ProcessingInstructions that applies XSLT. Also use RefPtr instead of a raw pointer to store StyleSheet. * style/StyleScope.h: * xml/parser/XMLDocumentParserLibxml2.cpp: (WebCore::XMLDocumentParser::doEnd): Apply any pending XSLTs synchronously here as the comment suggests. 2017-10-24 Miguel Gomez [GTK][X11] Windy.com shows always straight wind lines https://bugs.webkit.org/show_bug.cgi?id=176718 Reviewed by Carlos Garcia Campos. WebGL's GL_LUMINANCE_ALPHA format is not available in OpenGL when using a version >= 3.2 and a core profile. In that case, we need to replace it with GL_RG and swizzle the color components appropriately. No new behavior. * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp: (WebCore::GraphicsContext3D::texImage2D): * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp: (WebCore::GraphicsContext3D::texSubImage2D): 2017-10-23 Zalan Bujtas Call FrameView::scheduleSelectionUpdate when selection needs repainting after layout instead of setting the RenderView dirty. https://bugs.webkit.org/show_bug.cgi?id=178651 Reviewed by Antti Koivisto. Calling setNeedsLayout() on the RenderView to trigger selection update is problematic in 2 different ways: 1. marking the root renderer dirty does not trigger layout (this is very specific to the root, other renderers do trigger layout). It means that it works as long as someone else schedules a layout. 2. when a subtree layout is already scheduled and we mark the root renderer dirty, the root gets stuck with the dirty flag (since the entry point for the subsequent layout is a descendant of the root and not the root itself). This patch addresses these issues by scheduling/converting subtree layout when needed. Covered by fast/dynamic/remove-invisible-node-inside-selection.html/remove-node-inside-selection.html * editing/FrameSelection.cpp: (WebCore::FrameSelection::respondToNodeModification): * page/FrameView.cpp: (WebCore::FrameView::scheduleSelectionUpdate): * page/FrameView.h: 2017-10-20 Said Abou-Hallawa When destroying a resource, register "only" the clients who are losing their resource as having pending resources https://bugs.webkit.org/show_bug.cgi?id=178567 Reviewed by Simon Fraser. SVGResources::resourceDestroyed() will return a bool indicating whether it had a reference to the destroyed resource or not. If it returns true SVGResourcesCache::resourceDestroyed() will register the client Element as having pending resources. * rendering/svg/SVGResources.cpp: (WebCore::paintingResourceFromSVGPaint): (WebCore::SVGResources::removeClientFromCache const): (WebCore::SVGResources::resourceDestroyed): (WebCore::SVGResources::buildSetOfResources): (WebCore::SVGResources::resetClipper): (WebCore::SVGResources::resetFilter): (WebCore::SVGResources::resetMarkerStart): (WebCore::SVGResources::resetMarkerMid): (WebCore::SVGResources::resetMarkerEnd): (WebCore::SVGResources::resetMasker): (WebCore::SVGResources::resetFill): (WebCore::SVGResources::resetStroke): (WebCore::SVGResources::resetLinkedResource): * rendering/svg/SVGResources.h: (WebCore::SVGResources::isEmpty const): (WebCore::SVGResources::ClipperFilterMaskerData::ClipperFilterMaskerData): Deleted. (WebCore::SVGResources::MarkerData::MarkerData): Deleted. (WebCore::SVGResources::FillStrokeData::FillStrokeData): Deleted. * rendering/svg/SVGResourcesCache.cpp: (WebCore::SVGResourcesCache::resourceDestroyed): 2017-10-20 Joanmarie Diggs AX: [ATK] Events missing and state incorrect for aria-activedescendant https://bugs.webkit.org/show_bug.cgi?id=178523 Reviewed by Chris Fleizach. When the aria-activedescendant of an element changes, emit object:state-changed:focused. When a focused element has a valid active descendant, do not expose the focused state on the element, but rather on the active descendant. Also expose the focusable state on the active descendant. Tests: accessibility/gtk/aria-activedescendant-changed-notification.html accessibility/gtk/aria-activedescendant.html * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::isActiveDescendantOfFocusedContainer const): (WebCore::AccessibilityObject::ariaActiveDescendantReferencingElements const): * accessibility/AccessibilityObject.h: * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::shouldNotifyActiveDescendant const): * accessibility/atk/AXObjectCacheAtk.cpp: (WebCore::AXObjectCache::postPlatformNotification): * accessibility/atk/WebKitAccessibleWrapperAtk.cpp: (setAtkStateSetFromCoreObject): 2017-10-19 Antti Koivisto Overlapping text on all CSS fonts specs https://bugs.webkit.org/show_bug.cgi?id=177585 Reviewed by Daniel Bates. We were resetting StyleResolver::overrideDocumentElementStyle too early when resolving slot elements. This resulted in 'rem' units being miscomputed. Reduction by Zalan. Test: fast/html/details-line-height-overlap.html * style/StyleTreeResolver.cpp: (WebCore::Style::TreeResolver::Scope::Scope): (WebCore::Style::TreeResolver::Scope::~Scope): Only reset overrideDocumentElementStyle when destroying the scope. (WebCore::Style::TreeResolver::pushScope): (WebCore::Style::TreeResolver::pushEnclosingScope): (WebCore::Style::TreeResolver::popScope): A scope can show up multiple times in scope stack. * style/StyleTreeResolver.h: 2017-10-26 Carlos Garcia Campos [GTK][Stable] Crash on WebCore::SharedBuffer::data() on 2.18.1 https://bugs.webkit.org/show_bug.cgi?id=178852 Reviewed by Carlos Garcia Campos. Add a mutex to control that the image decoders are not used at the same time from the main thread and the decoding thread. Backport of the fix to https://bugs.webkit.org/show_bug.cgi?id=178510 created by Fujii Hironori . Covered by existent tests. * platform/image-decoders/ImageDecoder.cpp: (WebCore::ImageDecoder::frameIsCompleteAtIndex): (WebCore::ImageDecoder::frameHasAlphaAtIndex const): (WebCore::ImageDecoder::frameBytesAtIndex const): (WebCore::ImageDecoder::frameDurationAtIndex): (WebCore::ImageDecoder::createFrameImageAtIndex): * platform/image-decoders/ImageDecoder.h: (WebCore::ImageDecoder::setData): 2017-10-26 Carlos Garcia Campos REGRESSION(r222090): [HarfBuzz] Arabic shaping is broken except for first word in line https://bugs.webkit.org/show_bug.cgi?id=178625 Reviewed by Michael Catanzaro. Once we find the first space, which has the COMMON script, we split the run, and the next ones keep using COMMON instead of ARABIC because we don't update the current script on every loop iteration. This patch simplifies the script handling by moving the code back to the loop and always breaking in case of different scripts, correctly handling INHERITED and COMMON cases and updating the current script when needed. Covered by existing tests. This improves several tests that have been rebaselined. * platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp: (WebCore::findNextRun): (WebCore::scriptsAreCompatibleForCharacters): Deleted. 2017-10-17 Carlos Garcia Campos [GTK][Stable] BackingStoreBackendCairoImpl.h:23:10: fatal error: WebCore/HysteresisActivity.h https://bugs.webkit.org/show_bug.cgi?id=178407 Reviewed by Žan Doberšek. Do not use #include inside WebCore. * platform/graphics/cairo/BackingStoreBackendCairoImpl.h: 2017-08-17 Zan Dobersek [GStreamer] GstStructure shouldn't be handled through GRefPtr https://bugs.webkit.org/show_bug.cgi?id=175673 Reviewed by Xabier Rodriguez-Calvar. * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp: (webkitMediaCommonEncryptionDecryptTransformCaps): GstStructure isn't ref-counted, so it should be handled through the GUniquePtr smart pointer. 2017-08-28 Carlos Alberto Lopez Perez [GTK] [WPE] Rename EventHandlerGlib to EventHandlerGLib https://bugs.webkit.org/show_bug.cgi?id=175864 Unreviewed cosmetic follow-up patch after r221075. No new tests. No change in behavior. * PlatformGTK.cmake: * PlatformWPE.cmake: * platform/glib/EventHandlerGLib.cpp: Renamed from Source/WebCore/platform/glib/EventHandlerGlib.cpp. (WebCore::EventHandler::tabsToAllFormControls const): (WebCore::EventHandler::focusDocumentView): (WebCore::EventHandler::passWidgetMouseDownEventToWidget): (WebCore::EventHandler::passMouseDownEventToWidget): (WebCore::EventHandler::eventActivatedView const): (WebCore::EventHandler::widgetDidHandleWheelEvent): (WebCore::EventHandler::createDraggingDataTransfer const): (WebCore::EventHandler::passMousePressEventToSubframe): (WebCore::EventHandler::passMouseMoveEventToSubframe): (WebCore::EventHandler::passMouseReleaseEventToSubframe): (WebCore::EventHandler::accessKeyModifiers): (WebCore::EventHandler::shouldTurnVerticalTicksIntoHorizontal const): 2017-08-23 Carlos Alberto Lopez Perez [WPE] Some event handlers not working. https://bugs.webkit.org/show_bug.cgi?id=175864 Reviewed by Michael Catanzaro. Share the EventHandler implementation with the GTK port and add ifdefs where needed. Covered by existing tests. * PlatformGTK.cmake: * PlatformWPE.cmake: * page/wpe/EventHandlerWPE.cpp: Removed. * platform/glib/EventHandlerGlib.cpp: Renamed from Source/WebCore/page/gtk/EventHandlerGtk.cpp. (WebCore::EventHandler::shouldTurnVerticalTicksIntoHorizontal const): 2017-10-16 Maureen Daum If an origin doesn't have databases in the Databases table we should still remove its information from disk in DatabaseTracker::deleteOrigin() https://bugs.webkit.org/show_bug.cgi?id=178281 Reviewed by Brent Fulgham. New test: DatabaseTracker.DeleteOriginWithMissingEntryInDatabasesTable * Modules/webdatabase/DatabaseTracker.cpp: (WebCore::DatabaseTracker::deleteOrigin): If databaseNames is empty, don't bail early. Instead, delete everything in the directory containing the databases for this origin. This condition indicates that we previously tried to remove the origin but didn't get all of the way through the deletion process. Because we have lost track of the databases for this origin, we can assume that no other process is accessing them. This means it should be safe to delete them outright. 2017-10-16 Ryan Haddad Unreviewed attempt to fix the Windows debug build. * Modules/webdatabase/DatabaseTracker.cpp: (WebCore::DatabaseTracker::deleteOrigin): 2017-10-16 Maureen Daum If we fail to delete any database file, don't remove its information from the tracker database and https://bugs.webkit.org/show_bug.cgi?id=178251 Reviewed by Brady Eidson. New tests: DatabaseTracker.DeleteDatabase DatabaseTracker.DeleteDatabaseWhenDatabaseDoesNotExist DatabaseTracker.DeleteOrigin DatabaseTracker.DeleteOriginWhenDeletingADatabaseFails DatabaseTracker.DeleteOriginWhenDatabaseDoesNotExist * Modules/webdatabase/DatabaseTracker.cpp: (WebCore::DatabaseTracker::deleteDatabasesModifiedSince): If the database doesn't exist, we previously deleted it but failed to remove the information from the tracker database. We still want to delete all of the information associated with this database from the tracker database, so add it to databaseNamesToDelete. (WebCore::DatabaseTracker::deleteOrigin): If a database doesn't exist, don't try to delete it. We don't need to, but more importantly, deleteDatabaseFile() will fail if the database doesn't exist, which will cause us to incorrectly think we failed to remove database information from disk. If we actually fail to delete any database file, return before we remove the origin information from the tracker database so we don't lose track of the database. (WebCore::DatabaseTracker::deleteDatabase): If a database doesn't exist, don't try to delete it. We don't need to, but also it will cause us to incorrectly think that we were unable to delete a database, so we would bail before we remove the database information from the tracker database. We want to remove the database information from the tracker database because the database doesn't exist. * Modules/webdatabase/DatabaseTracker.h: Expose fullPathForDatabase() for use by tests. * platform/Logging.h: Add a logging channel. 2017-10-16 Maureen Daum We should wrap the removal of information from the tracker database in a transaction in DatabaseTracker::deleteOrigin() https://bugs.webkit.org/show_bug.cgi?id=178274 Reviewed by Tim Horton. * Modules/webdatabase/DatabaseTracker.cpp: (WebCore::DatabaseTracker::deleteOrigin): Wrap the removal of information from the tracker database in a transaction so that we don't end up in a case where only one of the tables contains information about an origin. If anything goes wrong when we're modifying the tracker database, rollback the transaction before bailing. 2017-10-13 Brent Fulgham Protect FrameView during style calculations https://bugs.webkit.org/show_bug.cgi?id=178300 Reviewed by Ryosuke Niwa. Protect the FrameView during layout and style updates in case arbitrary script is run that might clear it. Test: fast/html/marquee-reparent-check.html * page/FrameView.cpp: (WebCore::FrameView::updateLayoutAndStyleIfNeededRecursive): 2017-10-11 Simon Fraser Avoid triggering layout from style change https://bugs.webkit.org/show_bug.cgi?id=178184 rdar://problem/34699113 Reviewed by Zalan Bujtas. It's bad for RenderBox::styleDidChange() to scroll RenderLayers, because that can trigger layout via FrameView::updateWidgetPositions() and ScrollingCoordinator::absoluteEventTrackingRegions(). So postpone the scrolling until after layout. Test: fast/scrolling/adjust-scroll-offset-on-zoom.html * rendering/RenderBox.cpp: (WebCore::RenderBox::styleDidChange): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::updateLayerPositions): (WebCore::RenderLayer::setPostLayoutScrollPosition): (WebCore::RenderLayer::applyPostLayoutScrollPositionIfNeeded): * rendering/RenderLayer.h: 2017-10-11 Joanmarie Diggs [ATK] Expose value of aria-keyshortcuts as object attribute https://bugs.webkit.org/show_bug.cgi?id=171175 Reviewed by Chris Fleizach. Expose the author-provided string through the "keyshortcuts" object attribute. Test: accessibility/gtk/aria-keyshortcuts.html * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::ariaKeyShortcutsValue const): * accessibility/AccessibilityObject.h: * accessibility/atk/WebKitAccessibleWrapperAtk.cpp: (webkitAccessibleGetAttributes): * html/HTMLAttributeNames.in: 2017-10-10 Xabier Rodriguez Calvar [GStreamer] Fix double seek requested by downloadbuffer GStreamer element in webkibwebsrc https://bugs.webkit.org/show_bug.cgi?id=178079 Reviewed by Žan Doberšek. When the downloadbuffer GStreamer element requests two seeks too close to each other there's some rare race condition where our source answers that it is not seekable and ends up with downloadbuffer element to seek beyond the file size, which causes the server to issue a 416 HTTP error code eventually, causing our MediaPlayer to stop. * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp: (webKitWebSrcStop): We only unset he seekable attribute if we are not seeking. 2017-10-10 Joanmarie Diggs AX: [ATK] ARIA form role should be mapped to ATK_ROLE_LANDMARK; not ATK_ROLE_FORM https://bugs.webkit.org/show_bug.cgi?id=178137 Reviewed by Chris Fleizach. Expose the ARIA form role as ATK_ROLE_LANDMARK; continue to expose the HTML form element as ATK_ROLE_FORM. No new tests needed due to existing coverage. Update expectations for roles-exposed.html. * accessibility/atk/WebKitAccessibleWrapperAtk.cpp: (atkRole): 2017-10-10 Joanmarie Diggs AX: [ATK] STATE_CHECKABLE should be removed from radio buttons in radiogroups with aria-readonly="true" https://bugs.webkit.org/show_bug.cgi?id=177931 Reviewed by Chris Fleizach. Add a check in canSetValueAttribute() for readonly radiogroup ancestors of radio buttons. Test: accessibility/gtk/aria-readonly-radiogroup.html * accessibility/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::canSetValueAttribute const): * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::radioGroupAncestor const): * accessibility/AccessibilityObject.h: 2017-10-09 Joanmarie Diggs AX: [ATK] Explicitly-set aria-sort value of "none" should be exposed as an object attribute https://bugs.webkit.org/show_bug.cgi?id=177955 Reviewed by Chris Fleizach. Expose "none" as the value of aria-sort when the attribute is present and not one of the other valid sort types. Also add a new AccessibilitySortDirection, SortDirectionInvalid. This is currently only being used when the sort direction is sought for a role which does not support this ARIA attribute, but might come in handy if we want to add further sanity checks on the author-provided values. Test: accessibility/gtk/aria-sort-values.html * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::sortDirection const): * accessibility/AccessibilityObject.h: * accessibility/atk/WebKitAccessibleWrapperAtk.cpp: (webkitAccessibleGetAttributes): * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper additionalAccessibilityAttributeNames]): 2017-10-09 Adrian Perez de Castro [WPE][GTK] Propagate libepoxy compiler flags obtained from pkg-config https://bugs.webkit.org/show_bug.cgi?id=178081 Reviewed by Carlos Alberto Lopez Perez. No new tests needed. * CMakeLists.txt: Use ${LIBEPOXY_DEFINITIONS} for building WebCore. 2017-10-08 Brent Fulgham Nullptr deref in WebCore::Node::computeEditability https://bugs.webkit.org/show_bug.cgi?id=177905 Reviewed by Darin Adler. Script can run when setting focus, because a blur event and a focus event are generated. A handler for one of these events can cause the focused element to be cleared. We should handle this possibility gracefully. Test: fast/dom/focus-shift-crash.html * dom/Document.cpp: (WebCore::Document::setFocusedElement): 2017-10-05 Frederic Wang Update Source/ThirdParty/woff2 to 22c256bc457777744ba14b7325a6e8e0e7dec91c https://bugs.webkit.org/show_bug.cgi?id=177994 Reviewed by Michael Catanzaro. No new tests, already covered by existing tests. * CMakeLists.txt: Include the directory for public headers instead. * platform/graphics/WOFFFileFormat.cpp: Use the public header woff2/decode.h and do not use the "wOF2" constant from private headers. (WebCore::isWOFF): (WebCore::convertWOFFToSfnt): 2017-10-05 Miguel Gomez [GTK][WPE] GIFImageDecoder never clears decoded frames even when told to do so https://bugs.webkit.org/show_bug.cgi?id=177864 Reviewed by Carlos Garcia Campos. Fix GIFImageDecoder::clearFrameBufferCache() so it really deletes decoded buffers, and modify GIFImageDecoder to be able to decode frames that are not requested in the expected order. Covered by existent tests. * platform/image-decoders/gif/GIFImageDecoder.cpp: (WebCore::GIFImageDecoder::findFirstRequiredFrameToDecode): (WebCore::GIFImageDecoder::frameBufferAtIndex): (WebCore::GIFImageDecoder::clearFrameBufferCache): * platform/image-decoders/gif/GIFImageDecoder.h: * platform/image-decoders/gif/GIFImageReader.cpp: (GIFImageReader::decode): * platform/image-decoders/gif/GIFImageReader.h: (GIFImageReader::frameContext const): 2017-10-05 Zan Dobersek Align BitmapImage::LargeAnimationCutoff to a megabyte value https://bugs.webkit.org/show_bug.cgi?id=177924 Reviewed by Carlos Garcia Campos. * platform/graphics/BitmapImage.h: Fix the 1014 multiplier used to calculate the LargeAnimationCutoff value. It was most likely a typo. 2017-10-04 Miguel Gomez [GTK][WPE] Fix playback of GIFs https://bugs.webkit.org/show_bug.cgi?id=176089 Reviewed by Carlos Garcia Campos. Allow GIFImageReader to decode again already decoded frames. Thanks to this, we don't need to delete the GIFImageReader when GIFImageDecoder::clearFrameBufferCache() is called, and the we don't need the lock to avoid crashes in that situation. Covered by existent tests. * platform/image-decoders/gif/GIFImageDecoder.cpp: (WebCore::GIFImageDecoder::clearFrameBufferCache): (WebCore::GIFImageDecoder::decode): * platform/image-decoders/gif/GIFImageDecoder.h: * platform/image-decoders/gif/GIFImageReader.cpp: (GIFImageReader::decode): 2017-10-04 Joanmarie Diggs AX: [ATK] aria-pressed="mixed" should be exposed via ATK_STATE_INDETERMINATE https://bugs.webkit.org/show_bug.cgi?id=177807 Reviewed by Chris Fleizach. Include toggle buttons in the element types for which the mixed state is checked and exposed via ATK_STATE_INDETERMINATE if found. Also only do the role checks when AccessibilityObject::isIndeterminate() has returned false. Test: accessibility/gtk/aria-pressed-mixed-value.html * accessibility/atk/WebKitAccessibleWrapperAtk.cpp: (setAtkStateSetFromCoreObject): 2017-10-04 Joanmarie Diggs AX: [ATK] ARIA tabpanel role should be exposed as ATK_ROLE_SCROLL_PANE https://bugs.webkit.org/show_bug.cgi?id=177815 Reviewed by Chris Fleizach. Change the mapping of TabPanelRole from ATK_ROLE_PANEL to ATK_ROLE_SCROLL_PANE. No new tests because this mapping is already covered by aria-tab-roles.html and roles-exposed.html. The platform expectations for each test have been updated. * accessibility/atk/WebKitAccessibleWrapperAtk.cpp: (atkRole): 2017-10-03 Zalan Bujtas Move scroll snap point unregistration from willBeRemovedFromTree to willBeDestroyed https://bugs.webkit.org/show_bug.cgi?id=177830 Reviewed by Antti Koivisto. willBeRemovedFromTree is called conditionally, relying on unregistering objects in there is highly error prone. Covered by existing tests. * rendering/RenderBox.cpp: (WebCore::RenderBox::willBeDestroyed): (WebCore::RenderBox::willBeRemovedFromTree): Deleted. * rendering/RenderBox.h: 2017-10-03 Joanmarie Diggs AX: [ATK] ARIA menuitems should be exposed with ATK_ROLE_MENU_ITEM even when it's the child of group role https://bugs.webkit.org/show_bug.cgi?id=177811 Reviewed by Chris Fleizach. AccessibilityNodeObject::remapAriaRoleDueToParent() remaps ARIA menuitems to the MenuButtonRole AccessibilityRole when the menuitem's parent is an ARIA group, but the ATK code was not handling that remapped role value. As a result, the element was being exposed as ATK_ROLE_UNKNOWN. Add MenuButtonRole to the AccessibilityRole types exposed as ATK_ROLE_MENU_ITEM. Test: accessibility/gtk/menu-with-group-child-tree.html * accessibility/atk/WebKitAccessibleWrapperAtk.cpp: (atkRole): 2017-10-03 Joanmarie Diggs AX: [ATK] aria-rowindex set on row element is not being exposed https://bugs.webkit.org/show_bug.cgi?id=177821 Reviewed by Chris Fleizach. Expose the value of aria-rowindex when set on a row as an object attribute, as we already do when it's set on a cell. Test: accessibility/gtk/aria-rowindex-on-row.html * accessibility/atk/WebKitAccessibleWrapperAtk.cpp: (webkitAccessibleGetAttributes): 2017-10-03 Zalan Bujtas [AX] Do not trigger redundant layout on tables. https://bugs.webkit.org/show_bug.cgi?id=177781 Reviewed by Antti Koivisto. RenderTable::forceSectionsRecalc() marks the RenderTable dirty and schedules a layout. Every time AccessibilityTable asks for the table element (including during construction), we end up triggering a layout. This call was added (r191357) to ensure RenderTable's m_firstBody is always up-to-date (in case of anonymous wrapper table renderer). Instead of relying on the m_firstBody, let's just use the first child to find the table element. The first child always points to a valid renderer (or nullptr), while m_firstBody is the result of section computation. Covered by existing tests. * accessibility/AccessibilityTable.cpp: (WebCore::AccessibilityTable::tableElement const): 2017-10-03 Daniel Bates [CSP] Check policy before opening a new window to a JavaScript URL https://bugs.webkit.org/show_bug.cgi?id=176815 Reviewed by Brent Fulgham. Ensure that the Content Security Policy of the page allows navigation to a JavaScript URL before opening a new window to it. Test: http/tests/security/contentSecurityPolicy/window-open-javascript-url-blocked.html * loader/FrameLoader.cpp: (WebCore::createWindow): 2017-10-03 Joanmarie Diggs AX: [ATK] ARIA drag-and-drop attribute values should be exposed via AtkObject attributes https://bugs.webkit.org/show_bug.cgi?id=177763 Reviewed by Chris Fleizach. Expose the values of aria-grabbed and aria-dropeffect via the "grabbed" and "dropeffect" AtkObject attributes. Test: accessibility/gtk/aria-drag-and-drop.html * accessibility/atk/WebKitAccessibleWrapperAtk.cpp: (webkitAccessibleGetAttributes): 2017-10-02 Joanmarie Diggs AX: [ATK] The value of aria-level is not exposed on non-heading roles https://bugs.webkit.org/show_bug.cgi?id=177775 Reviewed by Chris Fleizach. Expose the value of aria-level via the "level" AtkObject attribute, as is currently done for headings. Test: accessibility/gtk/aria-level.html * accessibility/atk/WebKitAccessibleWrapperAtk.cpp: (webkitAccessibleGetAttributes): 2017-10-02 Olivier Blin [WPE] Remove GnuTLS dependency https://bugs.webkit.org/show_bug.cgi?id=177750 Reviewed by Michael Catanzaro. libgcrypt is used by default instead of GnuTLS. See bug 163125 * PlatformWPE.cmake: 2017-10-02 Gustavo Noronha Silva [GLib] NetworkStateNotifier implementation missing https://bugs.webkit.org/show_bug.cgi?id=177741 Reviewed by Carlos Garcia Campos. No new tests. The DOM support is already being tested, but we would need a way of simulating a network outage to test GNetworkMonitor. * PlatformGTK.cmake: add new file. * PlatformWPE.cmake: add new file. * platform/network/NetworkStateNotifier.cpp: no longer need the empty implementations, all platforms covered. * platform/network/NetworkStateNotifier.h: * platform/network/glib/NetworkStateNotifierGLib.cpp: Added. (WebCore::NetworkStateNotifier::updateStateWithoutNotifying): update the network state using GNetworkMonitor's availability. (WebCore::NetworkStateNotifier::networkChangedCallback): when network-changed is emitted, trigger a state update. (WebCore::NetworkStateNotifier::startObserving): watch GNetworkMonitor's network-changed signal. 2017-10-02 Tomas Popela [SOUP] Default kerberos authentication credentials are used in ephemeral (private) mode https://bugs.webkit.org/show_bug.cgi?id=177738 Reviewed by Carlos Garcia Campos. If the session is ephemeral then don't enable the Negotiate support in our SoupSession. * platform/network/soup/NetworkStorageSessionSoup.cpp: Pass the session ID if it's known to the SoupNetworkSession. (WebCore::NetworkStorageSession::ensurePrivateBrowsingSession): (WebCore::NetworkStorageSession::getOrCreateSoupNetworkSession const): * platform/network/soup/SoupNetworkSession.cpp: (WebCore::SoupNetworkSession::SoupNetworkSession): If the session is ephemeral (based on given session ID) then don't activate the Negotiate support in SoupSession. * platform/network/soup/SoupNetworkSession.h: Change the constructor to accept the PAL::SessionID with the default value set to PAL::SessionID::emptySessionID. 2017-10-02 Joanmarie Diggs REGRESSION(r222640) [GTK] Build broken with ATK 2.14 https://bugs.webkit.org/show_bug.cgi?id=177634 Reviewed by Michael Catanzaro. Use ATK_CHECK_VERSION to prevent the build failure. No new tests. This fixes a downstream build failure. * accessibility/atk/AXObjectCacheAtk.cpp: (WebCore::AXObjectCache::postPlatformNotification): 2017-09-28 Joanmarie Diggs AX: [ATK] object:state-changed notifications missing for multiple ARIA attributes https://bugs.webkit.org/show_bug.cgi?id=177542 Add new notification types to AXObjectCache in order to support the notifications needed, post the notifications to all platforms, emit the signals for ATK. Reviewed by Chris Fleizach. Tests: accessibility/gtk/aria-disabled-changed-notification.html accessibility/gtk/aria-expanded-changed-notification.html accessibility/gtk/aria-pressed-changed-notification.html accessibility/gtk/aria-readonly-changed-notification.html accessibility/gtk/aria-required-changed-notification.html * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::handleAttributeChanged): * accessibility/AXObjectCache.h: * accessibility/atk/AXObjectCacheAtk.cpp: (WebCore::AXObjectCache::postPlatformNotification): 2017-09-28 Brent Fulgham Add ports 6679 and 6697 (IRC SSL) to port blacklist https://bugs.webkit.org/show_bug.cgi?id=177544 Reviewed by Alex Christensen. Test: security/block-test.html * platform/URL.cpp: (WebCore::portAllowed): Also block port 6679. 2017-09-28 Zalan Bujtas AX: Defer RenderListBox selectionChanged event until after layout is done. https://bugs.webkit.org/show_bug.cgi?id=177589 Reviewed by Chris Fleizach. Defer AX update when the selection changed event is followed by a layout. Covered by existing tests. * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::remove): (WebCore::AXObjectCache::performDeferredCacheUpdate): (WebCore::AXObjectCache::deferSelectedChildrenChangedIfNeeded): * accessibility/AXObjectCache.h: (WebCore::AXObjectCache::deferSelectedChildrenChangedIfNeeded): * rendering/RenderListBox.cpp: (WebCore::RenderListBox::selectionChanged): 2017-09-28 Zan Dobersek [Cairo] Remove the cairo_glyph_t complexity from GlyphBuffer https://bugs.webkit.org/show_bug.cgi?id=177598 Reviewed by Carlos Garcia Campos. Remove the decade-old use of cairo_glyph_t as the underlying type for Glyph. The former spans 24 bytes in size, while the latte is just 2 bytes. The x and y coordinate attributes of cairo_glyph_t were only used in FontCascade::drawGlyphs() implementation, where they were overridden even if the same GlyphBuffer object was used here repeatedly. FontCascade::drawGlyphs() now creates a new Vector object and fills it only with the glyph index and coordinates data for glyphs that will actually be drawn. This will likely in the future be leveraged to pack the necessary data and perform the drawing operations in parallelized tasks. GlyphBuffer usages that before required USE(CAIRO) special-casing can now be simplified. This also removes the need for header inclusion in the GlyphBuffer.h header. This further removes Cairo header inclusion in roughly 600 build targets. No new tests -- no change in behavior. * platform/graphics/FontCascade.cpp: (WebCore::FontCascade::widthForSimpleText const): * platform/graphics/GlyphBuffer.h: (WebCore::GlyphBuffer::glyphAt const): (WebCore::GlyphBuffer::add): * platform/graphics/cairo/FontCairo.cpp: (WebCore::drawGlyphsToContext): (WebCore::drawGlyphsShadow): (WebCore::FontCascade::drawGlyphs): * platform/graphics/displaylists/DisplayListItems.cpp: (WebCore::DisplayList::DrawGlyphs::generateGlyphBuffer const): 2017-09-27 Fujii Hironori [REGRESSION] word-spacing property is incorrectly applied https://bugs.webkit.org/show_bug.cgi?id=142086 Reviewed by Zalan Bujtas. word-spacing property isn't applied to text nodes with starting with '\n' if the kerning enabled. In Bug 165796, only ' ' and '\t' are treated for word-spacing, but '\n'. It should be treated as well. Test: fast/text/word-space-between-inlines.html * rendering/RenderBlockLineLayout.cpp: (WebCore::setLogicalWidthForTextRun): Use FontCascade::treatAsSpace() instead of checking explicitly by comparing with ' ' and '\t'. 2017-09-27 Zan Dobersek [Cairo] Remove unnecessary cairo.h includes https://bugs.webkit.org/show_bug.cgi?id=177540 Reviewed by Carlos Garcia Campos. Drop unnecessary includes of the cairo.h header from the Font.h, FontPlatformData.h and Pattern.h headers. For the former two the header isn't required, while in the last one we can use a forward declaration for the cairo_pattern_t type instead of including the whole Cairo headers to have that available. * platform/graphics/Font.h: * platform/graphics/FontPlatformData.h: * platform/graphics/Pattern.h: 2017-09-27 Zan Dobersek [Cairo] Drop cairo_matrix_t conversion operators for AffineTransform, TransformationMatrix https://bugs.webkit.org/show_bug.cgi?id=177539 Reviewed by Carlos Garcia Campos. Remove the cairo_matrix_t conversion operators from the AffineTransform and TransformationMatrix classes. These are rarely used, but enforce including the cairo.h header in both headers, which leads to the Cairo headers being included in around 800 build targets. Instead, the toCairoMatrix() function is added to CairoUtilities.h that creates a cairo_matrix_t object for the given AffineTransform. No toCairoMatrix() is needed for TransformationMatrix since objects of that type aren't converted to cairo_matrix_t anywhere in the codebase. This patch excludes unnecessary Cairo headers from about 550 build targets (with those headers being included in the other affected 250 targets by some other header inclusion chain). CairoUtilities.h header is now included where necessary to make toCairoMatrix() available, and duplicated cairo.h inclusions are removed. No new tests -- no change in behavior. * editing/gtk/EditorGtk.cpp: Explicitly include since it's necessary for Cairo operations used there. * platform/Cairo.cmake: * platform/graphics/cairo/CairoUtilities.cpp: (WebCore::drawPatternToCairoContext): (WebCore::toCairoMatrix): * platform/graphics/cairo/CairoUtilities.h: * platform/graphics/cairo/GradientCairo.cpp: (WebCore::Gradient::platformGradient): (WebCore::Gradient::setPlatformGradientSpaceTransform): * platform/graphics/cairo/GraphicsContextCairo.cpp: (WebCore::GraphicsContext::concatCTM): (WebCore::GraphicsContext::setCTM): * platform/graphics/cairo/PathCairo.cpp: No need to include AffineTransform.h. (WebCore::Path::addPath): (WebCore::Path::transform): * platform/graphics/cairo/PatternCairo.cpp: Ditto. (WebCore::Pattern::createPlatformPattern const): * platform/graphics/cairo/TransformationMatrixCairo.cpp: Removed. * platform/graphics/transforms/AffineTransform.h: * platform/graphics/transforms/TransformationMatrix.h: 2017-09-27 Zalan Bujtas Deferred image size change makes image-load-on-delay.html flaky. https://bugs.webkit.org/show_bug.cgi?id=177520 Reviewed by Dean Jackson. Only defer recomputeIsIgnored when the image change actually triggers layout. * accessibility/AXObjectCache.cpp: (WebCore::rendererNeedsDeferredUpdate): (WebCore::AXObjectCache::deferRecomputeIsIgnoredIfNeeded): (WebCore::AXObjectCache::deferTextChangedIfNeeded): * accessibility/AXObjectCache.h: (WebCore::AXObjectCache::deferRecomputeIsIgnoredIfNeeded): * rendering/RenderImage.cpp: (WebCore::RenderImage::imageChanged): 2017-09-26 Zalan Bujtas AX: Defer RenderImage's imageChanged event until after layout is done. https://bugs.webkit.org/show_bug.cgi?id=177446 Reviewed by Dean Jackson. This is to avoid unintentional tree mutation during layout. Covered by existing tests. * rendering/RenderImage.cpp: (WebCore::RenderImage::imageChanged): 2017-09-27 Myles C. Maxfield Minimum font size may cause elements to have an infinite line-height https://bugs.webkit.org/show_bug.cgi?id=177573 Reviewed by Dan Bernstein. When minimum font size is specified, we were trying to preserve the ratio of specified font-size and specified line-height in order to boost the computed font size proportionately to the font-size boost. However, this doesn't work when the specified font-size is 0, because the ratio between line-height and font-size is infinite. The most straightforward solution is just to make small font-sizes opt out of the line-height adjustment because the result would be too big. Test: fast/text/line-height-minimumFontSize-text-small-font-size.html * css/StyleBuilderCustom.h: (WebCore::computeLineHeightMultiplierDueToFontSize): (WebCore::StyleBuilderCustom::applyValueLineHeight): 2017-09-27 Myles C. Maxfield "Tag" codepoints require the complex text codepath https://bugs.webkit.org/show_bug.cgi?id=177251 Reviewed by David Hyatt. Previously, Tag codepoints (U+E0000 - U+E007F) weren't triggering the complex text codepath. Eventually, we should migrate the default from simple to complex. I'll do that in a separate patch. Test: fast/text/flag-codepoint.html * platform/graphics/FontCascade.cpp: (WebCore::FontCascade::characterRangeCodePath): 2017-09-27 Joanmarie Diggs [ATK] atk_table_cell_get_position() should return values of aria-rowindex and aria-colindex, if present https://bugs.webkit.org/show_bug.cgi?id=171176 Reviewed by Chris Fleizach. Modify webKitAccessibleTableCellGetPosition() to prefer the ARIA value over the DOM-based value. No new tests needed: We have coverage through aria-table-attributes.html. Platform expectations for this test were updated. * accessibility/atk/WebKitAccessibleInterfaceTableCell.cpp: (webkitAccessibleTableCellGetPosition): 2017-09-26 Joanmarie Diggs AX: Several ARIA roles with presentational children are exposing children https://bugs.webkit.org/show_bug.cgi?id=177502 Reviewed by Chris Fleizach. Add MenuItemCheckboxRole, MenuItemRadioRole, and SplitterRole to the list of AccessibilityRole types which cannot have children. In the case of DocumentMathRole, only treat children as presentational (excluded from the accessibility tree) if the element is not MathML. Test: accessibility/presentational-children.html * accessibility/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::canHaveChildren const): 2017-09-26 Zalan Bujtas Fall back to normal line layout position, when simple line layout fails to find one. https://bugs.webkit.org/show_bug.cgi?id=176220 Reviewed by Brent Fulgham. In case of empty content, let's just fall back to normal line layout and try to find the visually correct one. Test: fast/text/invalid-positionForPoint-offset.html * rendering/RenderText.cpp: (WebCore::RenderText::positionForPoint): * rendering/SimpleLineLayoutResolver.cpp: (WebCore::SimpleLineLayout::RunResolver::runForPoint const): 2017-09-26 Joanmarie Diggs AX: ARIA grids claim to be multiselectable even with aria-multiselectable is set to false https://bugs.webkit.org/show_bug.cgi?id=177498 Reviewed by Chris Fleizach. AccessibilityARIAGrid::isMultiSelectable() was unconditionally returning true. Modify it to return false if aria-multiselectable has been set to false by the author. Test: accessibility/aria-multiselectable-grid.html * accessibility/AccessibilityARIAGrid.cpp: (WebCore::AccessibilityARIAGrid::isMultiSelectable const): * accessibility/AccessibilityARIAGrid.h: 2017-09-25 Per Arne Vollan Crash in WebCore::TreeScope::documentScope https://bugs.webkit.org/show_bug.cgi?id=176159 Reviewed by Ryosuke Niwa. When all children are replaced with a new node in ContainerNode::replaceAllChildren, the treescope of the new node should be set after the call to willRemoveChildren, since this call can fire events, and execute JS code, which might change the treescope of the container node. Test: fast/dom/crash-moving-subtree-between-documents.html * dom/ContainerNode.cpp: (WebCore::ContainerNode::replaceAllChildren): 2017-09-25 Alex Christensen Separate form submission from PolicyChecker infrastructure https://bugs.webkit.org/show_bug.cgi?id=177396 Reviewed by Geoffrey Garen. We used PolicyChecker for WillSubmitForm even though we just need a completion handler with no parameters. That is what lambdas and WTF::Functions are for. No change in behavior. * loader/EmptyClients.cpp: (WebCore::EmptyFrameLoaderClient::dispatchWillSubmitForm): * loader/FrameLoader.cpp: (WebCore::FrameLoader::continueLoadAfterNavigationPolicy): (WebCore::FrameLoader::continueLoadAfterWillSubmitForm): Deleted. * loader/FrameLoader.h: * loader/FrameLoaderClient.h: * loader/PolicyChecker.cpp: (WebCore::PolicyChecker::continueLoadAfterWillSubmitForm): Deleted. * loader/PolicyChecker.h: 2017-09-25 Manuel Rego Casasnovas [css-grid] Small refactoring adding RenderGrid::contentAlignment() https://bugs.webkit.org/show_bug.cgi?id=177130 Reviewed by Sergio Villar Senin. As a follow-up of r221931, this patch does a small refactoring adding a new method RenderGrid::contentAlignment() that is used from RenderGrid and GridTrackSizingAlgorithm. No new tests, no change of behavior. * rendering/GridTrackSizingAlgorithm.cpp: (WebCore::GridTrackSizingAlgorithm::stretchAutoTracks): * rendering/RenderGrid.cpp: (WebCore::contentAlignmentNormalBehaviorGrid): (WebCore::RenderGrid::contentAlignment const): (WebCore::RenderGrid::computeContentPositionAndDistributionOffset const): (WebCore::RenderGrid::contentAlignmentNormalBehaviorGrid): Deleted. * rendering/RenderGrid.h: * rendering/style/RenderStyle.cpp: (WebCore::resolvedContentAlignment): (WebCore::RenderStyle::resolvedAlignContent const): (WebCore::RenderStyle::resolvedJustifyContent const): * rendering/style/RenderStyle.h: 2017-09-25 Manuel Rego Casasnovas [css-grid] fit-content() tracks shouldn't stretch https://bugs.webkit.org/show_bug.cgi?id=177300 Reviewed by Sergio Villar Senin. The spec is pretty clear regarding this (https://drafts.csswg.org/css-grid/#algo-stretch): "This step sizes expands tracks that have an auto max track sizing function by dividing any remaining positive, definite free space equally amongst them." The fit-content() tracks don't have an auto max track sizing function, so they shouldn't be considered in this step of the algorithm. The patch modifies GridTrackSizingAlgorithm::initializeTrackSizes() so it doesn't consider fit-content() tracks as auto sized ones (which are the ones later stretched in the last step of the algorithm). Test: imported/w3c/web-platform-tests/css/css-grid-1/alignment/grid-fit-content-tracks-dont-stretch-001.html * rendering/GridTrackSizingAlgorithm.cpp: (WebCore::GridTrackSizingAlgorithm::initializeTrackSizes): (WebCore::GridTrackSizingAlgorithm::stretchAutoTracks): (WebCore::GridTrackSizingAlgorithm::setup): (WebCore::GridTrackSizingAlgorithm::reset): * rendering/GridTrackSizingAlgorithm.h: 2017-09-24 Joanmarie Diggs [ATK] Object attributes are missing for ARIA live region roles https://bugs.webkit.org/show_bug.cgi?id=171174 Reviewed by Chris Fleizach. Expose the values of aria-live, aria-atomic, and aria-relevant via AtkObject attributes on live region elements and their descendants. In order to accomplish exposure on descendants, add AccessibilityObject::ariaLiveRegionAncestor(). Add an optional argument, excludeIfOff, to AccessibilityObject::isInsideARIALiveRegion() and AccessibilityObject::supportsARIALiveRegion(). This is needed because we need to expose live region properties via ATK even in the case where the live region is disabled/off, but supportsARIALiveRegion() deliberately checks if the live region is enabled. Tests: accessibility/aria-liveregion-marquee-default.html accessibility/aria-liveregions-attributes.html * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::isInsideARIALiveRegion const): (WebCore::AccessibilityObject::ariaLiveRegionAncestor const): (WebCore::AccessibilityObject::supportsARIALiveRegion const): * accessibility/AccessibilityObject.h: * accessibility/atk/WebKitAccessibleWrapperAtk.cpp: (webkitAccessibleGetAttributes): 2017-09-26 Said Abou-Hallawa Followup (r222427): SynchronizedFixedQueue should not have a public constructor https://bugs.webkit.org/show_bug.cgi?id=177458 Reviewed by Tim Horton. ImageFrameCache::decodingQueue() and frameRequestQueue() should return raw references instead of Ref objects. * platform/graphics/ImageFrameCache.cpp: (WebCore::ImageFrameCache::decodingQueue): (WebCore::ImageFrameCache::frameRequestQueue): (WebCore::ImageFrameCache::startAsyncDecodingQueue): * platform/graphics/ImageFrameCache.h: 2017-09-23 Said Abou-Hallawa Images may render partial frames even after loading all the encoded data https://bugs.webkit.org/show_bug.cgi?id=177406 Reviewed by Simon Fraser. Because we do not want to block the main thread waiting for the image decoding thread to terminate, we let the decoding thread finish its work even it will be thrown away. If a new decoding thread is created and the SynchronizedFixedQueue is reopened, the terminating decoding thread might have the chance to process a new frame request. After it finishes decoding it, it realize that it is terminating so it will drop the decoded frame to the floor. So the new request was not processed by the new thread and because it was processed by the terminating thread, nothing will be reported to the BitmapImage object and the renderer will not be repainted. The fix is to create a new SynchronizedFixedQueue every time a decoding thread is created. This will guarantee that the terminating thread won't have access to the new frame request and will shut down after being notified by the old SynchronizedFixedQueue that it has been closed. * platform/graphics/ImageFrameCache.cpp: (WebCore::ImageFrameCache::frameRequestQueue): (WebCore::ImageFrameCache::startAsyncDecodingQueue): (WebCore::ImageFrameCache::requestFrameAsyncDecodingAtIndex): (WebCore::ImageFrameCache::stopAsyncDecodingQueue): * platform/graphics/ImageFrameCache.h: 2017-09-22 Nael Ouedraogo [GTK] HTMLMediaElement resize event not fired when video size changes https://bugs.webkit.org/show_bug.cgi?id=174582 Reviewed by Xabier Rodriguez-Calvar. Modify AppendPipeline to notify MediaPlayerPrivateGStreamerMSE that a track is detected not only for the initial track detection but also for subsequent in particular when the video size has changed. Update test expectation for new passing tests. * platform/graphics/gstreamer/mse/AppendPipeline.cpp: (WebCore::AppendPipeline::appsinkCapsChanged): (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsink): * platform/graphics/gstreamer/mse/AppendPipeline.h: * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp: (WebCore::MediaPlayerPrivateGStreamerMSE::trackDetected): * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h: * platform/graphics/gstreamer/mse/PlaybackPipeline.cpp: (WebCore::PlaybackPipeline::reattachTrack): * platform/graphics/gstreamer/mse/PlaybackPipeline.h: 2017-09-21 Zhifei FANG In regular block layout, the width of a child's margin box should always be equal to that of its containing block Merge from Blink https://bugs.chromium.org/p/chromium/issues/detail?id=708751 https://bugs.webkit.org/show_bug.cgi?id=176620 Reviewed by Zalan Bujtas. Test: fast/block/over-constrained-auto-margin.html * rendering/RenderBox.cpp: (WebCore::RenderBox::computeLogicalWidthInRegion const): 2017-09-20 Said Abou-Hallawa REGRESSION(r191731): SVGPatternElement can only reference another SVGPatternElement in the same SVG document https://bugs.webkit.org/show_bug.cgi?id=176221 Reviewed by Tim Horton. According to the specs: https://www.w3.org/TR/SVG11/filters.html#FilterElementHrefAttribute https://www.w3.org/TR/SVG11/pservers.html#LinearGradientElementHrefAttribute https://www.w3.org/TR/SVG11/pservers.html#RadialGradientElementHrefAttribute https://www.w3.org/TR/SVG11/pservers.html#PatternElementHrefAttribute The xlink:href attribute of the SVG filter, gradient and pattern elements must reference another element within the current SVG of the same type. In r191731, the code of SVGPatternElement::collectPatternAttributes() was removed and replaced by RenderSVGResourcePattern::collectPatternAttributes() to avoid cyclic reference in the pattern element. The problem is the old code used to check whether the referenced element is before casting it. This code was not copied to the new function. So we now allow the SVGPatternElement to reference any SVG resource element. To fix this issue, we need to prevent SVGResources from chaining an incorrect type of element to the SVG filter, gradient and pattern elements. We also need to use the SVGResources for getting the referenced element when collecting the attributes for the gradient elements. SVGResources solves the cyclic referencing issue so there is no need to repeat the same code in many places. Also, from now on the SVGResources will have valid linked resource only. So casting the referenced element should always be valid. Tests: svg/custom/pattern-invalid-content-inheritance.svg * rendering/svg/RenderSVGResourcePattern.cpp: (WebCore::RenderSVGResourcePattern::collectPatternAttributes const): Asserts the linkedResource is of type RenderSVGResourcePattern. * rendering/svg/SVGResources.cpp: (WebCore::SVGResources::SVGResources): (WebCore::isChainableResource): Ensure that an SVG resource can reference only an SVG resource with the valid type. (WebCore::SVGResources::buildCachedResources): * rendering/svg/SVGResources.h: 2017-09-20 Joanmarie Diggs [ATK] atk_table_get_n_rows() and atk_table_get_n_columns() should return values of aria-rowcount and aria-colcount, if present https://bugs.webkit.org/show_bug.cgi?id=171172 Reviewed by Chris Fleizach. Modify webKitAccessibleTableGetNColumns() and webkitAccessibleTableGetNRows() to prefer the ARIA value over the DOM-based value. No new tests needed: We already have coverage through aria-table-attributes.html. Platform expectations for this test were updated. * accessibility/atk/WebKitAccessibleInterfaceTable.cpp: (webkitAccessibleTableGetNColumns): (webkitAccessibleTableGetNRows): 2017-09-20 Miguel Gomez [GTK] Completely garbled display in GMail https://bugs.webkit.org/show_bug.cgi?id=168964 Reviewed by Carlos Garcia Campos. Do not try to decode images that are bigger than 32768 pixels, as cairo won't be able to render them, and they will break the rendering of the rest of the page. Covered by existent tests. * platform/graphics/ImageBackingStore.h: (WebCore::ImageBackingStore::isOverSize): 2017-09-19 Wenson Hsieh REGRESSION (r215613): Incorrect corners clipping with border-radius https://bugs.webkit.org/show_bug.cgi?id=176498 Reviewed by Tim Horton. http://trac.webkit.org/r215613 introduced an optimization to bail out of repainting borders if the invalidated rect to paint is fully contained within the inner rounded rect of the border. However, due to issues with coordinate and intersection math in RoundedRect::contains() and ellipseContainsPoint(), this causes RenderBoxModelObject::paintBorder to return early even in circumstances where the border requires a repaint. This patch fixes the contains() helper in RoundedRect and adds a new API test suite for RoundedRect that covers these changes. Test: WebCore.RoundedRectContainsRect * platform/graphics/GeometryUtilities.cpp: (WebCore::ellipseContainsPoint): This function attempts to return early if the Manhattan distance of the transformed point is less than the radius of the circle that results from applying the same transformation to the ellipse. However, this bails and returns true if `x + y <= R`, but this means that if x and y are negative, we'll always end up returning true. We fix this by adding the absolute values instead, so the check becomes: |x| + |y| <= R. * platform/graphics/RoundedRect.cpp: (WebCore::RoundedRect::contains const): Before this patch, otherRect's upper left location was being used to hit-test against the ellipses formed from each of the 4 corners of the rounded rect. Instead, this should use (x, y), (maxX, y), (x, maxY), (maxX, maxY) for the top left, top right, bottom left, and bottom right corners, respectively. Additionally, the checks for the bottom left and bottom right to determine whether the rect corner should be checked for intersection against the ellipse's corner are incorrect. In the bottom left corner, the check for `otherRect.maxX() >= center.x()` should instead be `otherRect.x() <= center.x()`, and the check for `otherRect.x() <= center.x()` should instead be `otherRect.maxX() >= center.x()`. * platform/graphics/RoundedRect.h: 2017-09-19 Zalan Bujtas AXObjectCache::performDeferredCacheUpdate is called recursively through FrameView::layout. https://bugs.webkit.org/show_bug.cgi?id=176218 Reviewed by Simon Fraser. There are certain cases when we might re-enter performDeferredCacheUpdate through recursive layout calls (see webkit.org/b/177176) and mutate m_deferredTextChangedList multiple times. Test: accessibility/crash-table-recursive-layout.html * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::performDeferredCacheUpdate): * accessibility/AXObjectCache.h: 2017-09-19 Zalan Bujtas Do not mutate RenderText content during layout. https://bugs.webkit.org/show_bug.cgi?id=176219 Reviewed by David Hyatt. Update combined text when the style/content change as opposed to lazily, during layout. -content mutation during layout might make the inline tree go out of sync. Test: fast/text/international/dynamic-text-combine-crash.html * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths const): * rendering/RenderCombineText.cpp: (WebCore::RenderCombineText::styleDidChange): (WebCore::RenderCombineText::setRenderedText): (WebCore::RenderCombineText::combineTextIfNeeded): (WebCore::RenderCombineText::combineText): Deleted. * rendering/RenderCombineText.h: * rendering/RenderText.h: * rendering/line/BreakingContext.h: (WebCore::BreakingContext::handleText): * rendering/line/LineBreaker.cpp: (WebCore::LineBreaker::skipLeadingWhitespace): 2017-09-15 Wenson Hsieh createMarkupInternal should protect its pointer to the Range's common ancestor https://bugs.webkit.org/show_bug.cgi?id=177033 Reviewed by Tim Horton. Adds basic safeguarding to codepaths hit while executing an outdent command. Test: editing/execCommand/outdent-with-media-query-listener-in-iframe.html * editing/IndentOutdentCommand.cpp: (WebCore::IndentOutdentCommand::outdentRegion): Avoid an infinite loop if endOfCurrentParagraph is a null position. * editing/markup.cpp: (WebCore::createMarkupInternal): Protect the raw pointer to the Range's common ancestor node. 2017-09-18 Emilio Cobos Álvarez Always update display: contents styles in RenderTreeUpdater. https://bugs.webkit.org/show_bug.cgi?id=177065 Reviewed by Antti Koivisto. Otherwise we keep an old style around, making following style updates wrong. Test: fast/css/display-contents-style-update.html * style/RenderTreeUpdater.cpp: (WebCore::RenderTreeUpdater::updateElementRenderer): 2017-09-18 Antti Koivisto Avoid style resolution when clearing focused element. https://bugs.webkit.org/show_bug.cgi?id=176224 Reviewed by Zalan Bujtas. Test: fast/dom/focus-style-resolution.html * dom/Document.cpp: (WebCore::Document::setFocusedElement): Don't do synchronous style resolution with FocusRemovalEventsMode::DoNotDispatch. Style resolution may dispatch events. * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::didBlur): Move resolveStyleIfNeeded call to setFocusedElement. It is the only client for didBlur. 2017-09-16 Michael Catanzaro [GTK] Build failure with enchant-2.1.1 https://bugs.webkit.org/show_bug.cgi?id=176877 Unreviewed build fix for enchant 2.1.1. enchant_dict_free_suggestions() has been deprecated since at least 2005. Use its replacement, enchant_dict_free_string_list(), instead. That's also been around since at least 2005. * platform/text/enchant/TextCheckerEnchant.cpp: (WebCore::TextCheckerEnchant::getGuessesForWord): 2017-09-15 Wenson Hsieh Avoid style recomputation when forwarding a focus event to an text field's input type https://bugs.webkit.org/show_bug.cgi?id=176160 Reviewed by Ryosuke Niwa. Currently, TextFieldInputType::forwardEvent synchronously triggers style recomputation, for the purpose of scrolling to the origin upon handling a blur event, and also for updating caps lock state after a blur or focus. In synchronously triggering style recomputation, we may end up running arbitrary JavaScript, which may change the HTMLInputElement's type and cause the current TextFieldInputType to be destroyed. To mitigate this, we only update caps lock state when forwarding a focus or blur event to the InputType, and instead scroll blurred text fields to the origin later, in HTMLInputElement::didBlur (invoked from Document::setFocusedElement after blur and focusout events have fired). Instead of having the InputType update style, lift the call to Document::updateStyleIfNeeded up into HTMLInputElement so that we gracefully handle the case where the page destroys and sets a new InputType within the scope of this style update. Test: fast/forms/change-input-type-in-focus-handler.html * dom/Document.cpp: (WebCore::Document::setFocusedElement): * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::didBlur): * html/HTMLInputElement.h: * html/InputType.h: (WebCore::InputType::elementDidBlur): * html/TextFieldInputType.cpp: (WebCore::TextFieldInputType::forwardEvent): (WebCore::TextFieldInputType::elementDidBlur): * html/TextFieldInputType.h: 2017-09-15 Brent Fulgham Make DocumentLoader a FrameDestructionObserver https://bugs.webkit.org/show_bug.cgi?id=176364 Reviewed by Alex Christensen. The DocumentLoader needs to know when its Frame is destroyed so that it can perform properly cleanup. Test: fast/events/beforeunload-dom-manipulation-crash.html * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::DocumentLoader): Call FrameDestructionObserver constructor. (WebCore::DocumentLoader::responseReceived): Drive-by fix. Make sure the current object is valid during the callback. (WebCore::DocumentLoader::attachToFrame): Use FrameDestructionObserver::observerFrame rather than setting the m_frame variable directly. (WebCore::DocumentLoader::detachFromFrame): Ditto. * loader/DocumentLoader.h: (WebCore::DocumentLoader::frame const): Deleted, as this is provided by the FrameDestructionObserver. 2017-09-15 Carlos Garcia Campos [Harfbuzz] Material icons not rendered correctly when using the web font https://bugs.webkit.org/show_bug.cgi?id=176995 Reviewed by Michael Catanzaro. Only a few of them are correctly rendered and some others are wrong. We only render correctly the ones that don't have an underscore in their name (or that start with a number like 3d_rotation). In the cases where the name before the underscore is also an icon, we render that icon instead, that's why some of them are wrong. This is happening because the underscore is causing the HarfbuffShaper to split the text in 3 runs, one for the word before the underscore, another one for the underscore and another for the word after the underscore. So, we end up trying to shape the 3 runs independently and we fail when the icon doesn't exist, or when it exists but it's not the one we are looking for. The cause of this is that the underscore has a different script (Common) than the rest of characters (Latin) which is a condition in HarfbuffShaper to create a different run. The unicode spec says that characters with Common script should be handled differently, but we are just ignoring it. The spec proposes to use an heuristic based on simply inheriting the script of the previous character, which should work in most of the cases. We could take a more conservative approach and do that only if both characters are ASCII. We should also consider handling other cases mentioned by the spec like brackets and quotation marks, but that belongs to a different bug/commit. * platform/graphics/harfbuzz/HarfBuzzShaper.cpp: (WebCore::scriptsAreCompatibleForCharacters): Helper function to check if the current and previous scripts are compatible, (WebCore::HarfBuzzShaper::collectHarfBuzzRuns): Use scriptsAreCompatibleForCharacters() to decided whether to finish the current run or not. In case of Common script, inherit also the script from the previous character. 2017-09-13 Wenson Hsieh Submitting a form can cause HTMLFormElement's associated elements vector to be mutated during iteration https://bugs.webkit.org/show_bug.cgi?id=176368 Reviewed by Ryosuke Niwa. In the process of iterating over form.associatedElements() during form submission in FormSubmission::create, the page may cause us to clobber the vector of FormAssociatedElements* we're currently iterating over by inserting new form controls beneath the form element we're in the process of submitting. This happens because FormSubmission::create calls HTMLTextAreaElement::appendFormData, which requires layout to be up to date, which in turn makes us updateLayout() and set focus, which fires a `change` event, upon which the page's JavaScript inserts additonal DOM nodes into the form, modifying the vector of associated elements. To mitigate this, instead of iterating over HTMLFormElement::associatedElements(), which returns a reference to the HTMLFormElement's actual m_associatedElements vector, we iterate over a new vector of Refs created from m_associatedElements. This patch also removes an event dispatch assertion added in r212026. This assertion was added to catch any other events dispatched in this scope, since dispatching events there would have had security implications, but after making iteration over associated elements robust, this NoEventDispatchAssertion is no longer useful. Test: fast/forms/append-children-during-form-submission.html * loader/FormSubmission.cpp: (WebCore::FormSubmission::create): 2017-09-13 Carlos Alberto Lopez Perez [GTK] Fails to build because 'Float32Array' has not been declared in AudioContext.h https://bugs.webkit.org/show_bug.cgi?id=176870 Reviewed by Konstantin Tokarev. Add missing include of Float32Array.h No new tests, its a build fix. * Modules/webaudio/AudioContext.h: 2017-09-12 Myles C. Maxfield ASSERTION FAILED: !m_valueOrException under FontFaceSet::completedLoading loading a Serious Eats page https://bugs.webkit.org/show_bug.cgi?id=175899 Reviewed by Tim Horton. Slight style update to r221835. Also adds a test. Test: fast/text/document-fonts-while-loading-crash.html * css/CSSFontFaceSet.h: * css/FontFaceSet.cpp: (WebCore::FontFaceSet::FontFaceSet): 2017-09-12 Manuel Rego Casasnovas [css-grid] Stretching auto tracks should be done as part of the track sizing algorithm https://bugs.webkit.org/show_bug.cgi?id=176783 Reviewed by Sergio Villar Senin. CSS WG has agreed to modify the track sizing algorithm to include a new step: https://drafts.csswg.org/css-grid/#algo-stretch We used to do the stretch of the "auto" tracks at the end of the track sizing algorithm, however this change integrates it into the algorithm itself as the last step. See: https://github.com/w3c/csswg-drafts/issues/1150 The patch moves the method RenderGrid::applyStretchAlignmentToTracksIfNeeded() to GridTrackSizingAlgorithm::stretchAutoTracks(). And then modifies the grid track sizing algorithm to execute the new step. This patch uses the WPT test updated to check the new behavior. * rendering/GridTrackSizingAlgorithm.cpp: (WebCore::GridTrackSizingAlgorithm::initializeTrackSizes): Initialize the list of auto tracks. (WebCore::GridTrackSizingAlgorithm::stretchFlexibleTracks): Add early return if there are not flexible tracks. (WebCore::GridTrackSizingAlgorithm::stretchAutoTracks): Code moved from RenderGrid::applyStretchAlignmentToTracksIfNeeded(). (WebCore::GridTrackSizingAlgorithm::setup): Reset list of auto tracks. (WebCore::GridTrackSizingAlgorithm::run): Add new step stretchAutoTracks(). (WebCore::GridTrackSizingAlgorithm::reset): Reset auto tracks. * rendering/GridTrackSizingAlgorithm.h: Add m_autoSizedTracksIndex. * rendering/RenderGrid.cpp: (WebCore::RenderGrid::layoutBlock): Avoid applying stretch here. (WebCore::RenderGrid::contentAlignmentNormalBehaviorGrid): Make public. (WebCore::RenderGrid::applyStretchAlignmentToTracksIfNeeded): Moved to GridTrackSizingAlgorithm::stretchAutoTracks(). * rendering/RenderGrid.h: 2017-09-12 Chris Fleizach AX: On generic container elements, WebKit should distinguish between tooltip (e.g. @title) and label (e.g. @aria-label) attributes https://bugs.webkit.org/show_bug.cgi?id=170475 Reviewed by Joanmarie Diggs. Test: accessibility/title-tag-on-unimportant-elements-is-help-text.html * accessibility/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::helpText): (WebCore::AccessibilityNodeObject::accessibilityDescription): (WebCore::AccessibilityNodeObject::roleIgnoresTitle): * accessibility/AccessibilityNodeObject.h: 2017-09-12 Antti Koivisto Remove RenderElement::isCSSAnimating boolean https://bugs.webkit.org/show_bug.cgi?id=176779 Reviewed by Andreas Kling. This optimization can be replaced with a simple style test that doesn't require keeping two sources of truth in sync. * page/animation/CSSAnimationController.cpp: (WebCore::CSSAnimationControllerPrivate::ensureCompositeAnimation): (WebCore::CSSAnimationControllerPrivate::clear): Can't test here as style might have become non-animating and we don't clear animation when that happens. This is only called on renderer destruction so it is not an important optimization. (WebCore::CSSAnimationControllerPrivate::isRunningAnimationOnRenderer const): (WebCore::CSSAnimationControllerPrivate::isRunningAcceleratedAnimationOnRenderer const): (WebCore::CSSAnimationControllerPrivate::getAnimatedStyleForRenderer): (WebCore::CSSAnimationControllerPrivate::computeExtentOfAnimation const): (WebCore::CSSAnimationController::cancelAnimations): (WebCore::CSSAnimationController::getAnimatedStyleForRenderer): (WebCore::CSSAnimationController::computeExtentOfAnimation const): (WebCore::CSSAnimationController::isRunningAnimationOnRenderer const): (WebCore::CSSAnimationController::isRunningAcceleratedAnimationOnRenderer const): Test if the style has any animations. This is roughly equivalent of the old test. (it is actually somewhat better as the boolean was never cleared on style changes) * rendering/RenderElement.cpp: (WebCore::RenderElement::RenderElement): * rendering/RenderElement.h: (WebCore::RenderElement::isCSSAnimating const): Deleted. (WebCore::RenderElement::setIsCSSAnimating): Deleted. * rendering/style/RenderStyle.h: (WebCore::RenderStyle::hasAnimationsOrTransitions const): 2017-09-12 Manuel Rego Casasnovas [css-grid] Use transferred size over content size for automatic minimum size https://bugs.webkit.org/show_bug.cgi?id=176688 Reviewed by Sergio Villar Senin. CSS WG has agreed to modify the spec so now the transferred size is used (if it exists) independently if it's bigger or smaller than the content size. See: https://github.com/w3c/csswg-drafts/issues/1149 The spec text (https://drafts.csswg.org/css-grid/#min-size-auto): "The automatic minimum size for a grid item in a given dimension is its specified size if it exists, otherwise its transferred size if that exists, else its content size" This patch use the WPT tests updated to check the new behavior. * rendering/GridTrackSizingAlgorithm.cpp: (WebCore::GridTrackSizingAlgorithmStrategy::minSizeForChild const): Modified so it always returns the transferred size (if any). 2017-09-11 Joanmarie Diggs AX: [ATK] aria-autocomplete not exposed on comboboxes https://bugs.webkit.org/show_bug.cgi?id=176724 Reviewed by Chris Fleizach. Add a check to AccessibilityObject::supportsARIAAutoComplete() for combobox because isARIATextControl() returns false for that role. Add new combobox test cases to existing aria-autocomplete.html test. * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::supportsARIAAutoComplete const): 2017-09-10 Zan Dobersek [GStreamer] Drop libgcrypt initialization in webkit_media_clear_key_decrypt_init() https://bugs.webkit.org/show_bug.cgi?id=176656 Reviewed by Michael Catanzaro. * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp: (webkit_media_clear_key_decrypt_init): Don't re-initialize libgcrypt here since that's already done in the WebProcess main(), and the calls here only result in libgcrypt writing out 'Oops' warnings on stderr. 2017-09-07 Darin Adler Fix double resolve assertion in FontFaceSet seen while running tests https://bugs.webkit.org/show_bug.cgi?id=176525 Reviewed by Brent Fulgham. * css/FontFaceSet.cpp: (WebCore::FontFaceSet::FontFaceSet): Only resolve the promise if the CSSFontFaceSet is already loaded. Otherwise, we will resolve it later when it calls completedLoading. 2017-09-08 Dean Jackson gl.detachShader breaks shader program https://bugs.webkit.org/show_bug.cgi?id=137689 Reviewed by Sam Weinig. It should be possible to compile shaders, attach them to a program, link the program, detach the shaders, delete the shaders, and then ask for the uniform and attribute locations. That is, once you've linked, the shaders can be thrown away. We were using the attached shaders to look up uniform locations, so we now keep around a separate map that remembers what shaders were attached when the program links. This fixes the bug, but the whole area is still a bit messy. For one, we're keeping around all the shader information even after it is no longer used. See https://bugs.webkit.org/show_bug.cgi?id=98204 Test: fast/canvas/webgl/detachShader-before-accessing-uniform.html * platform/graphics/GraphicsContext3D.h: Add another map to remember what shaders were used when a program was linked. * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp: (WebCore::GraphicsContext3D::mappedSymbolInShaderSourceMap): New helper to look up a name in our source maps. (WebCore::GraphicsContext3D::mappedSymbolName): Use the helper, and look at linked shaders if there are no attached shaders. (WebCore::GraphicsContext3D::originalSymbolInShaderSourceMap): Does the reverse of the above. (WebCore::GraphicsContext3D::originalSymbolName): (WebCore::GraphicsContext3D::linkProgram): Add to the new map. (WebCore::GraphicsContext3D::deleteProgram): Delete the program from our shader entries. 2017-09-09 Zan Dobersek [GStreamer] Missing GRefPtr adoptions in MediaPlayerPrivateGStreamerBase, PlaybackPipeline https://bugs.webkit.org/show_bug.cgi?id=176646 Reviewed by Carlos Garcia Campos. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: (WebCore::registerWebKitGStreamerElements): Adopt the return value of gst_element_factory_find(), which is transferred in full. * platform/graphics/gstreamer/mse/PlaybackPipeline.cpp: (WebCore::PlaybackPipeline::flush): Adopt the return values of gst_element_get_static_pad() and gst_pad_get_peer(), both being transferred in full. 2017-09-08 Zan Dobersek [GStreamer] Add GRefPtr specializations for GstGLDisplay, GstGLContext https://bugs.webkit.org/show_bug.cgi?id=176543 Reviewed by Xabier Rodriguez-Calvar. Both GstGLDisplay and GstGLContext inherit from GstObject, meaning gst_object_ref_sink() and gst_object_unref() should be used for incrementing and decrementing reference count. Template specializations for the adoptGRef(), refGPtr() and derefGPtr() are added for both types, preventing GRefPtr<> from falling back to using g_object_ref() and g_object_unref() for reference count modification purposes. * platform/graphics/gstreamer/GRefPtrGStreamer.cpp: (WTF::adoptGRef): (WTF::refGPtr): (WTF::derefGPtr): (WTF::refGPtr): (WTF::derefGPtr): * platform/graphics/gstreamer/GRefPtrGStreamer.h: 2017-09-07 Joseph Pecoraro WebKit should claim that it can show responses for a broader range of JSON MIMETypes https://bugs.webkit.org/show_bug.cgi?id=176252 Reviewed by Ryosuke Niwa. * platform/MIMETypeRegistry.h: * platform/MIMETypeRegistry.cpp: (WebCore::MIMETypeRegistry::canShowMIMEType): Extend this to support JavaScript and JSON MIMETypes that WebKit knows how to treat as text. 2017-09-06 Manuel Rego Casasnovas [css-grid] grid shorthand should not reset the gutter properties https://bugs.webkit.org/show_bug.cgi?id=176375 Reviewed by Sergio Villar Senin. The CSS WG has resolved that the "grid" shorthand shouldn't reset the gutter properties anymore: https://github.com/w3c/csswg-drafts/issues/1036 This was originally implemented in r195529, so this is somehow a revert of that change. Test: imported/w3c/web-platform-tests/css/css-grid-1/grid-definition/grid-shorthand-001.html * css/CSSProperties.json: * css/parser/CSSPropertyParser.cpp: (WebCore::CSSPropertyParser::consumeGridShorthand): 2017-10-13 Brent Fulgham Protect FrameView during style calculations https://bugs.webkit.org/show_bug.cgi?id=178300 Reviewed by Ryosuke Niwa. Protect the FrameView during layout and style updates in case arbitrary script is run that might clear it. Test: fast/html/marquee-reparent-check.html * page/FrameView.cpp: (WebCore::FrameView::updateLayoutAndStyleIfNeededRecursive): 2017-09-03 Darin Adler Follow up FrameView::updateLayoutAndStyleIfNeededRecursive changes with related improvements https://bugs.webkit.org/show_bug.cgi?id=176277 Reviewed by Antti Koivisto. * page/FrameView.cpp: (WebCore::FrameView::needsStyleRecalcOrLayout): Deleted. This function was only used by an assertion inside updateLayoutAndStyleIfNeededRecursive, and thus there is no reason for it to be in the header file, or for it to be a public member function. (WebCore::appendRenderedChildren): Deleted. This function was only used inside updateLayoutAndStyleIfNeededRecursive, and it is now packaged in an even better way for efficient use inside that function. (WebCore::FrameView::renderedChildFrameViews): Deleted. This function was only used inside needsStyleRecalcOrLayout, and it's now packaged in a better way inside that function. (WebCore::FrameView::updateLayoutAndStyleIfNeededRecursive): Created a new lambda called nextRendereredDescendant that packages up the process of repeatedly iterating this view and all of its descendants in an easy-to-use way. Replaces both of the functions above. Rewrote to use it; it made the logic clear enough that it was good to get rid of the updateOneFrame lambda, too. Added two separate functions, one that checks for needed style recalculation and a separate one that checked for needed layout. Using those, replaced the old single assertion with two separate assertions. * page/FrameView.h: Removed needsStyleRecalcOrLayout, renderedChildFrameViews, and FrameViewList. 2017-09-06 Tomas Popela Missing break in URLParser https://bugs.webkit.org/show_bug.cgi?id=176357 Reviewed by Darin Adler. Add a missing break so the currently set state is not overwritten after the block. Found by Coverity scan. * platform/URLParser.cpp: (WebCore::URLParser::parse): 2017-09-07 Adrian Perez de Castro [ARM] Building FELightningNEON.cpp fails due to missing {Point,Spot}LightSource declarations https://bugs.webkit.org/show_bug.cgi?id=176531 Reviewed by Žan Doberšek. The m_lightSource member is a Ref, and its get() method returns a reference, therefore the casts have to be done to the corresponding reference types. * platform/graphics/cpu/arm/filters/FELightingNEON.h: (WebCore::FELighting::platformApplyNeon): Adjust casts and member accesses accordingly. 2017-09-03 Yusuke Suzuki String#utf8() allocates new CString https://bugs.webkit.org/show_bug.cgi?id=176302 Reviewed by Sam Weinig. Several places uses String#utf8() like an accessor. In reality, it allocates new CString per call. It is very costly. Furthermore, some places uses this incorrectly. For example, `std::vector(srtpAuth.utf8().data(), srtpAuth.utf8().data() + srtpAuth.utf8().length());` is incorrect since each time strpAuth.utf8() allocates different CString. This patch calls utf8() first and use it. * Modules/websockets/WebSocketChannel.cpp: (WebCore::WebSocketChannel::startClosingHandshake): * platform/wpe/PlatformPasteboardWPE.cpp: (WebCore::PlatformPasteboard::write): 2017-09-03 Yusuke Suzuki [SOUP] Use fastMalloced SoupBuffer in ResourcehandleSoup https://bugs.webkit.org/show_bug.cgi?id=176311 Reviewed by Michael Catanzaro. Use fastMalloced memory instead of g_malloc for SoupBuffer. * platform/network/soup/ResourceHandleSoup.cpp: (WebCore::ResourceHandle::ensureReadBuffer): 2017-09-02 Emilio Cobos Álvarez Wrong getComputedStyle result for pseudo-elements in display: none subtrees. https://bugs.webkit.org/show_bug.cgi?id=176259 Reviewed by Antti Koivisto. Before this patch, we were wrongly returning the parent style when there wasn't a cached pseudo style. With this, the only remaining failures in getComputedStyle-pseudo is a serialisation bug for the "content" property, and the display: contents test, which is because we don't support pseudo-elements of display: contents elements yet. Tests: imported/w3c/web-platform-tests/cssom/getComputedStyle-pseudo.html * dom/Document.cpp: (WebCore::Document::styleForElementIgnoringPendingStylesheets): * dom/Document.h: * dom/Element.cpp: (WebCore::Element::resolvePseudoElementStyle): (WebCore::Element::computedStyle): * dom/Element.h: 2017-09-02 Joseph Pecoraro Performance / PerformanceObserver leaks seen on bots https://bugs.webkit.org/show_bug.cgi?id=176269 Reviewed by Darin Adler. * page/DOMWindow.cpp: (WebCore::DOMWindow::removeAllEventListeners): * workers/WorkerGlobalScope.cpp: (WebCore::WorkerGlobalScope::removeAllEventListeners): Also use this opportunity to break up the reference cycle between PerformanceObservers and the Performance object. * page/Performance.h: * page/Performance.cpp: (WebCore::Performance::removeAllObservers): Disassociate and clear observers. * page/PerformanceObserver.h: * page/PerformanceObserver.cpp: (WebCore::PerformanceObserver::disassociate): Clear the back-reference to the Performance object to break the cycle. 2017-09-02 Carlos Garcia Campos [GTK][Wayland] Use fast malloc to allocate backing store cairo surfaces data https://bugs.webkit.org/show_bug.cgi?id=176226 Reviewed by Michael Catanzaro. It reduces the memory consumption and improves the performance. Also, since performance is better we don't need to keep the scroll surface allocated all the time, we can create it on demand and keep it allocated only while scrolling too fast. * platform/graphics/cairo/BackingStoreBackendCairoImpl.cpp: (WebCore::createCairoImageSurfaceWithFastMalloc): Helper to create a cairo image surface using fast malloc. (WebCore::BackingStoreBackendCairoImpl::BackingStoreBackendCairoImpl): Create the main surface, but no the scroll one. Initialize the hysteresis activity to discard the scroll surface after scrolling. (WebCore::BackingStoreBackendCairoImpl::scroll): Create the scroll surface only if it's nullptr, and notify the hysteresis activity. * platform/graphics/cairo/BackingStoreBackendCairoImpl.h: 2017-09-01 Emilio Cobos Álvarez Wrong getComputedStyle behavior for pseudo-elements for layout-dependent properties. https://bugs.webkit.org/show_bug.cgi?id=175936 Reviewed by Antti Koivisto. Before this patch we may wrongly end up using the wrong renderer to resolve this. Tests: imported/w3c/web-platform-tests/cssom/getComputedStyle-pseudo.html * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::styledElement const): (WebCore::ComputedStyleExtractor::styledRenderer const): (WebCore::ComputedStyleExtractor::propertyValue): * css/CSSComputedStyleDeclaration.h: 2017-09-01 Simon Fraser transformCanLikelyUseFastPath() can read off the end of a string https://bugs.webkit.org/show_bug.cgi?id=176232 rdar://problem/33851237 Reviewed by Tim Horton. Code added in r220382 could read one byte past the end of the string when looking for the 'z' of a rotateZ() function. The code was actually incorrect, testing for the 'z at i+6 after already incrementing i by 6. This patch makes the code correctly detect rotateZ(). Also, rotate functions at the end of a string could be ignored because kShortestValidTransformStringLength was too long, so set it to the length of "rotate(0)", the shortest transform function that we currently fast-parse. There's an implicit assumption in this code that chars is not indexed past i+kShortestValidTransformStringLength. If the 'translate' path is taken, i is incremented by 9 (==kShortestValidTransformStringLength), but that's OK because WTF::find() doesn't index into chars if i >= length. Test: fast/css/transform-fast-paths.html * css/parser/CSSParserFastPaths.cpp: (WebCore::transformCanLikelyUseFastPath): 2017-08-31 Daniel Bates Another attempt to fix the Apple Windows build following (https://bugs.webkit.org/show_bug.cgi?id=176171) Temporarily weaken the size check for RenderStyle from a strict equality to <=. * rendering/style/RenderStyle.cpp: 2017-08-31 Daniel Bates Attempt to fix the Apple Windows and WinCairo build following (https://bugs.webkit.org/show_bug.cgi?id=176171) Explicitly cast PseudoIds to unsigned before computing a difference between two PseudoIds. * rendering/style/RenderStyle.h: 2017-08-31 Daniel Bates Make RenderStyle's non-inherited flags more human friendly https://bugs.webkit.org/show_bug.cgi?id=176171 Reviewed by Antti Koivisto. Revert r166465 as we never followed through and made the CSS JIT update RenderStyle's non-inherited flags directly. * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::RenderStyle): (WebCore::RenderStyle::hashForTextAutosizing const): (WebCore::RenderStyle::equalForTextAutosizing const): (WebCore::RenderStyle::changeRequiresLayout const): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::styleType const): (WebCore::RenderStyle::setStyleType): (WebCore::RenderStyle::setHasViewportUnits): (WebCore::RenderStyle::hasViewportUnits const): (WebCore::RenderStyle::affectedByHover const): (WebCore::RenderStyle::affectedByActive const): (WebCore::RenderStyle::affectedByDrag const): (WebCore::RenderStyle::setAffectedByHover): (WebCore::RenderStyle::setAffectedByActive): (WebCore::RenderStyle::setAffectedByDrag): (WebCore::RenderStyle::isFloating const): (WebCore::RenderStyle::display const): (WebCore::RenderStyle::position const): (WebCore::RenderStyle::floating const): (WebCore::RenderStyle::overflowX const): (WebCore::RenderStyle::overflowY const): (WebCore::RenderStyle::verticalAlign const): (WebCore::RenderStyle::unicodeBidi const): (WebCore::RenderStyle::clear const): (WebCore::RenderStyle::tableLayout const): (WebCore::RenderStyle::hasExplicitlySetDirection const): (WebCore::RenderStyle::isLink const): (WebCore::RenderStyle::setDisplay): (WebCore::RenderStyle::setOriginalDisplay): (WebCore::RenderStyle::setPosition): (WebCore::RenderStyle::setFloating): (WebCore::RenderStyle::setOverflowX): (WebCore::RenderStyle::setOverflowY): (WebCore::RenderStyle::setVerticalAlign): (WebCore::RenderStyle::setUnicodeBidi): (WebCore::RenderStyle::setClear): (WebCore::RenderStyle::setTableLayout): (WebCore::RenderStyle::setHasExplicitlySetDirection): (WebCore::RenderStyle::setIsLink): (WebCore::RenderStyle::hasExplicitlySetWritingMode const): (WebCore::RenderStyle::setHasExplicitlySetWritingMode): (WebCore::RenderStyle::hasExplicitlySetTextAlign const): (WebCore::RenderStyle::setHasExplicitlySetTextAlign): (WebCore::RenderStyle::unique const): (WebCore::RenderStyle::setUnique): (WebCore::RenderStyle::emptyState const): (WebCore::RenderStyle::setEmptyState): (WebCore::RenderStyle::firstChildState const): (WebCore::RenderStyle::setFirstChildState): (WebCore::RenderStyle::lastChildState const): (WebCore::RenderStyle::setLastChildState): (WebCore::RenderStyle::setHasExplicitlyInheritedProperties): (WebCore::RenderStyle::hasExplicitlyInheritedProperties const): (WebCore::RenderStyle::inheritUnicodeBidiFrom): (WebCore::RenderStyle::NonInheritedFlags::operator!= const): (WebCore::RenderStyle::NonInheritedFlags::hasAnyPublicPseudoStyles const): (WebCore::RenderStyle::originalDisplay const): (WebCore::RenderStyle::NonInheritedFlags::operator== const): (WebCore::RenderStyle::NonInheritedFlags::copyNonInheritedFrom): (WebCore::RenderStyle::NonInheritedFlags::hasPseudoStyle const): (WebCore::RenderStyle::NonInheritedFlags::setHasPseudoStyle): (WebCore::RenderStyle::NonInheritedFlags::overflowX const): Deleted. (WebCore::RenderStyle::NonInheritedFlags::setOverflowX): Deleted. (WebCore::RenderStyle::NonInheritedFlags::overflowY const): Deleted. (WebCore::RenderStyle::NonInheritedFlags::setOverflowY): Deleted. (WebCore::RenderStyle::NonInheritedFlags::clear const): Deleted. (WebCore::RenderStyle::NonInheritedFlags::setClear): Deleted. (WebCore::RenderStyle::NonInheritedFlags::effectiveDisplay const): Deleted. (WebCore::RenderStyle::NonInheritedFlags::setEffectiveDisplay): Deleted. (WebCore::RenderStyle::NonInheritedFlags::position const): Deleted. (WebCore::RenderStyle::NonInheritedFlags::setPosition): Deleted. (WebCore::RenderStyle::NonInheritedFlags::originalDisplay const): Deleted. (WebCore::RenderStyle::NonInheritedFlags::setOriginalDisplay): Deleted. (WebCore::RenderStyle::NonInheritedFlags::unicodeBidi const): Deleted. (WebCore::RenderStyle::NonInheritedFlags::setUnicodeBidi): Deleted. (WebCore::RenderStyle::NonInheritedFlags::hasViewportUnits const): Deleted. (WebCore::RenderStyle::NonInheritedFlags::setHasViewportUnits): Deleted. (WebCore::RenderStyle::NonInheritedFlags::verticalAlign const): Deleted. (WebCore::RenderStyle::NonInheritedFlags::setVerticalAlign): Deleted. (WebCore::RenderStyle::NonInheritedFlags::hasExplicitlyInheritedProperties const): Deleted. (WebCore::RenderStyle::NonInheritedFlags::setHasExplicitlyInheritedProperties): Deleted. (WebCore::RenderStyle::NonInheritedFlags::isFloating const): Deleted. (WebCore::RenderStyle::NonInheritedFlags::floating const): Deleted. (WebCore::RenderStyle::NonInheritedFlags::setFloating): Deleted. (WebCore::RenderStyle::NonInheritedFlags::tableLayout const): Deleted. (WebCore::RenderStyle::NonInheritedFlags::setTableLayout): Deleted. (WebCore::RenderStyle::NonInheritedFlags::styleType const): Deleted. (WebCore::RenderStyle::NonInheritedFlags::setStyleType): Deleted. (WebCore::RenderStyle::NonInheritedFlags::isUnique const): Deleted. (WebCore::RenderStyle::NonInheritedFlags::setIsUnique): Deleted. (WebCore::RenderStyle::NonInheritedFlags::emptyState const): Deleted. (WebCore::RenderStyle::NonInheritedFlags::setEmptyState): Deleted. (WebCore::RenderStyle::NonInheritedFlags::firstChildState const): Deleted. (WebCore::RenderStyle::NonInheritedFlags::setFirstChildState): Deleted. (WebCore::RenderStyle::NonInheritedFlags::lastChildState const): Deleted. (WebCore::RenderStyle::NonInheritedFlags::setLastChildState): Deleted. (WebCore::RenderStyle::NonInheritedFlags::affectedByHover const): Deleted. (WebCore::RenderStyle::NonInheritedFlags::setAffectedByHover): Deleted. (WebCore::RenderStyle::NonInheritedFlags::affectedByActive const): Deleted. (WebCore::RenderStyle::NonInheritedFlags::setAffectedByActive): Deleted. (WebCore::RenderStyle::NonInheritedFlags::affectedByDrag const): Deleted. (WebCore::RenderStyle::NonInheritedFlags::setAffectedByDrag): Deleted. (WebCore::RenderStyle::NonInheritedFlags::isLink const): Deleted. (WebCore::RenderStyle::NonInheritedFlags::setIsLink): Deleted. (WebCore::RenderStyle::NonInheritedFlags::hasExplicitlySetDirection const): Deleted. (WebCore::RenderStyle::NonInheritedFlags::setHasExplicitlySetDirection): Deleted. (WebCore::RenderStyle::NonInheritedFlags::hasExplicitlySetWritingMode const): Deleted. (WebCore::RenderStyle::NonInheritedFlags::setHasExplicitlySetWritingMode): Deleted. (WebCore::RenderStyle::NonInheritedFlags::hasExplicitlySetTextAlign const): Deleted. (WebCore::RenderStyle::NonInheritedFlags::setHasExplicitlySetTextAlign): Deleted. (WebCore::RenderStyle::NonInheritedFlags::flagsMemoryOffset): Deleted. (WebCore::RenderStyle::NonInheritedFlags::flagIsaffectedByActive): Deleted. (WebCore::RenderStyle::NonInheritedFlags::flagIsaffectedByHover): Deleted. (WebCore::RenderStyle::NonInheritedFlags::flagPseudoStyle): Deleted. (WebCore::RenderStyle::NonInheritedFlags::setFirstChildStateFlags): Deleted. (WebCore::RenderStyle::NonInheritedFlags::setLastChildStateFlags): Deleted. (WebCore::RenderStyle::NonInheritedFlags::flagIsUnique): Deleted. (WebCore::RenderStyle::NonInheritedFlags::flagFirstChildState): Deleted. (WebCore::RenderStyle::NonInheritedFlags::flagLastChildState): Deleted. (WebCore::RenderStyle::NonInheritedFlags::NonInheritedFlags): Deleted. (WebCore::RenderStyle::NonInheritedFlags::setHasPseudoStyles): Deleted. (WebCore::RenderStyle::NonInheritedFlags::updateBoolean): Deleted. (WebCore::RenderStyle::NonInheritedFlags::getBoolean const): Deleted. (WebCore::RenderStyle::NonInheritedFlags::updateValue): Deleted. (WebCore::RenderStyle::InheritedFlags::operator== const): Deleted. (WebCore::RenderStyle::NonInheritedFlags::getValue const): Deleted. (WebCore::adjustForAbsoluteZoom): Deleted. (WebCore::adjustFloatForAbsoluteZoom): Deleted. (WebCore::adjustLayoutUnitForAbsoluteZoom): Deleted. (WebCore::collapsedBorderStyle): Deleted. (WebCore::RenderStyle::hasBackground const): Deleted. (WebCore::RenderStyle::autoWrap): Deleted. (WebCore::RenderStyle::preserveNewline): Deleted. (WebCore::RenderStyle::collapseWhiteSpace): Deleted. (WebCore::RenderStyle::isCollapsibleWhiteSpace const): Deleted. (WebCore::RenderStyle::breakOnlyAfterWhiteSpace const): Deleted. (WebCore::RenderStyle::breakWords const): Deleted. (WebCore::RenderStyle::hasInlineColumnAxis const): Deleted. (WebCore::RenderStyle::imageOrientation const): Deleted. (WebCore::RenderStyle::setLogicalWidth): Deleted. (WebCore::RenderStyle::setLogicalHeight): Deleted. (WebCore::RenderStyle::setBorderRadius): Deleted. (WebCore::RenderStyle::setZoom): Deleted. (WebCore::RenderStyle::setEffectiveZoom): Deleted. (WebCore::RenderStyle::setTextOrientation): Deleted. (WebCore::RenderStyle::adjustBackgroundLayers): Deleted. (WebCore::RenderStyle::adjustMaskLayers): Deleted. (WebCore::RenderStyle::clearAnimations): Deleted. (WebCore::RenderStyle::clearTransitions): Deleted. (WebCore::RenderStyle::setShapeOutside): Deleted. (WebCore::RenderStyle::setShapeImageThreshold): Deleted. (WebCore::RenderStyle::setClipPath): Deleted. (WebCore::RenderStyle::willChangeCreatesStackingContext const): Deleted. (WebCore::RenderStyle::isDisplayRegionType const): Deleted. (WebCore::RenderStyle::setWritingMode): Deleted. (WebCore::RenderStyle::getShadowInlineDirectionExtent const): Deleted. (WebCore::RenderStyle::getShadowBlockDirectionExtent const): Deleted. (WebCore::RenderStyle::isDisplayReplacedType): Deleted. (WebCore::RenderStyle::isDisplayInlineType): Deleted. (WebCore::RenderStyle::isDisplayFlexibleBox): Deleted. (WebCore::RenderStyle::isDisplayGridBox): Deleted. (WebCore::RenderStyle::isDisplayFlexibleOrGridBox): Deleted. (WebCore::RenderStyle::hasAnyPublicPseudoStyles const): Deleted. (WebCore::RenderStyle::hasPseudoStyle const): Deleted. (WebCore::RenderStyle::setHasPseudoStyle): Deleted. (WebCore::RenderStyle::setHasPseudoStyles): Deleted. (WebCore::RenderStyle::setBoxReflect): Deleted. (WebCore::pseudoElementRendererIsNeeded): Deleted. 2017-08-22 Darin Adler REGRESSION (r220052): ASSERTION FAILED: !frame().isMainFrame() || !needsStyleRecalcOrLayout() in WebCore::FrameView::updateLayoutAndStyleIfNeededRecursive() https://bugs.webkit.org/show_bug.cgi?id=175270 Reviewed by Simon Fraser and Antti Koivisto. * dom/Document.cpp: (WebCore::Document::Document): Initialize m_styleRecalcTimer with a lamdba so it can work with a function that returns a bool and ignore the return value. (WebCore::Document::updateStyleIfNeeded): Added a boolean return value indicating if the function did any work or not. * dom/Document.h: Updated for above change. * page/FrameView.cpp: (WebCore::appendRenderedChildren): Added helper that will later replace the FrameView::renderedChildFrameViews function and is used below. (WebCore::FrameView::updateLayoutAndStyleIfNeededRecursive): Instead of always doing two passes of style and layout update do up to 25 passes, but stop as soon as a pass does no work. This is slightly more efficient in cases where no layout and style update is needed, and works correctly when a additional passes are needed, which is what happens in the test that was failing. We can eventually improve this further, but this resolves the immediate problem we are seeing in the test. 2017-08-30 Myles C. Maxfield Previous elements with lang= can affect fonts selected for subsequent elements https://bugs.webkit.org/show_bug.cgi?id=175959 Reviewed by Zalan Bujtas. FontCascade::update() was erroneously getting a cache hit. Elements with different lang= should be distinct inside the FontCascadeCache. We should be keying off of the locale string instead of the script enum because the string is the thing we actually pass to the platform APIs when performing font selection. This is a regression because we only recently (within the past few years) started making font selection sensitive to lang= at all. Test: fast/text/lang-font-selection-cache.html * platform/graphics/FontCache.h: (WebCore::FontDescriptionKey::FontDescriptionKey): (WebCore::FontDescriptionKey::operator== const): (WebCore::FontDescriptionKey::computeHash const): 2017-08-30 Said Abou-Hallawa The SVG fragment identifier is not respected if it is a part of an HTTP URL https://bugs.webkit.org/show_bug.cgi?id=163811 Reviewed by Darin Adler. If an image is referenced more than once in a page and the URL to that image is an HTTP URL, one CachedImage is created for all the renderers even if the original URLs have different fragmentIdentifiers. In this case the fragment will be removed from the request which is associated with the shared CachedImage. This CachedImage creates an SVGImage with a URL but without a fragmentIdentifier. So SVGImage::draw() does not call FrameView::scrollToFragment() and therefore the viewport is not setup correctly for displaying the SVG in this case. The fix is to move the url from the SVGImage to SVGImageForContainer. Because there is one SVGImageForContainer created for every renderer, we can move the full URL there. The drawing of an SVGImage has to start from the SVGImageForContainer::draw() because the SVGImage may not have an intrinsic size and the SVGImageForContainer is the one which knows the destination rectangle. So SVGImageForContainer can pass the full url to SVGImage::drawForContainer() which can be used to scrollToFragment() before calling SVGImage::draw(). For clarity and consistency, all setContainerSizeForRenderer() will be changed to setContainerContext() and the pair SizeAndZoom will be replaced by the struct ContainerContext. Tests: http/tests/svg/svg-fragment-background.html http/tests/svg/svg-fragment-image.html * css/CSSCursorImageValue.h: * css/CSSImageSetValue.cpp: (WebCore::CSSImageSetValue::fillImageSet): * css/CSSImageSetValue.h: * loader/cache/CachedImage.cpp: (WebCore::CachedImage::didRemoveClient): (WebCore::CachedImage::switchClientsToRevalidatedResource): (WebCore::CachedImage::allClientsRemoved): (WebCore::CachedImage::setContainerContextForClient): (WebCore::CachedImage::clear): (WebCore::CachedImage::createImage): (WebCore::CachedImage::setContainerSizeForRenderer): Deleted. * loader/cache/CachedImage.h: * rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry const): (WebCore::RenderBoxModelObject::paintNinePieceImage): * rendering/RenderImage.cpp: (WebCore::RenderImage::updateInnerContentRect): (WebCore::RenderImage::repaintOrMarkForLayout): * rendering/RenderImageResource.cpp: (WebCore::RenderImageResource::setContainerContext): (WebCore::RenderImageResource::setContainerSizeForRenderer): Deleted. * rendering/RenderImageResource.h: * rendering/RenderImageResourceStyleImage.cpp: (WebCore::RenderImageResourceStyleImage::setContainerContext): (WebCore::RenderImageResourceStyleImage::setContainerSizeForRenderer): Deleted. * rendering/RenderImageResourceStyleImage.h: * rendering/RenderListMarker.cpp: (WebCore::RenderListMarker::updateContent): * rendering/shapes/ShapeOutsideInfo.cpp: (WebCore::ShapeOutsideInfo::createShapeForImage const): * rendering/style/StyleCachedImage.cpp: (WebCore::StyleCachedImage::imageURL): (WebCore::StyleCachedImage::setContainerContextForRenderer): (WebCore::StyleCachedImage::setContainerSizeForRenderer): Deleted. * rendering/style/StyleCachedImage.h: * rendering/style/StyleGeneratedImage.h: * rendering/style/StyleImage.h: * rendering/svg/RenderSVGImage.cpp: (WebCore::RenderSVGImage::updateImageViewport): * svg/SVGImageElement.h: * svg/graphics/SVGImage.cpp: (WebCore::SVGImage::SVGImage): (WebCore::SVGImage::drawForContainer): (WebCore::SVGImage::drawPatternForContainer): (WebCore::SVGImage::draw): (WebCore::SVGImage::dump const): Deleted. * svg/graphics/SVGImage.h: * svg/graphics/SVGImageCache.cpp: (WebCore::SVGImageCache::setContainerContextForClient): (WebCore::SVGImageCache::setContainerSizeForRenderer): Deleted. * svg/graphics/SVGImageCache.h: * svg/graphics/SVGImageForContainer.cpp: (WebCore::SVGImageForContainer::size const): (WebCore::SVGImageForContainer::draw): (WebCore::SVGImageForContainer::drawPattern): * svg/graphics/SVGImageForContainer.h: 2017-08-29 Said Abou-Hallawa Assertion failure when opening a file with a missing tag closing bracket https://bugs.webkit.org/show_bug.cgi?id=176061 Reviewed by Darin Adler. If a tag is missing its closing bracket, the tokenizer just needs to advance() the character position without checking m_currentCharacter != '\n'. Newline character is a valid ending for partially closed tags. Test: fast/tokenizer/missing-script-tag-closing-bracket.html * html/parser/HTMLTokenizer.cpp: (WebCore::HTMLTokenizer::commitToPartialEndTag): 2017-08-19 Sergio Villar Senin [SVG] Leak in SVGAnimatedListPropertyTearOff https://bugs.webkit.org/show_bug.cgi?id=172545 Reviewed by Darin Adler. SVGAnimatedListPropertyTearOff maintains a vector m_wrappers with references to SVGPropertyTraits::ListItemTearOff. Apart from that SVGPropertyTearOff has a reference to SVGAnimatedProperty. When SVGListProperty::getItemValuesAndWrappers() is called, it creates a SVGPropertyTraits::ListItemTearOff pointing to the same SVGAnimatedProperty (a SVGAnimatedListPropertyTearOff) which stores the m_wrappers vector where the ListItemTearOff is going to be added to. This effectively creates a reference cycle between the SVGAnimatedListPropertyTearOff and all the ListItemTearOff it stores in m_wrappers. In order to effectively break the cycle without freeing too many wrappers we should take two measures: 1) Break the reference cycle by storing raw pointers in the m_wrappers Vector 2) Remove the ListItemTearOff which is being deleted (it notifies the animated property by calling propertyWillBeDeleted) from the m_wrappers Vector. This is a re-land of r219334 which caused early releases of custom data attribute objects added to SVG elements (wkb.ug/175023). Tests: svg/animations/animation-leak-list-property-instances.html svg/dom/SVGAnimatedListPropertyTearOff-crash-2.html svg/dom/SVGAnimatedListPropertyTearOff-crash.html svg/dom/SVGAnimatedListPropertyTearOff-leak.html * svg/properties/SVGAnimatedListPropertyTearOff.h: * svg/properties/SVGListProperty.h: (WebCore::SVGListProperty::getItemValuesAndWrappers): * svg/properties/SVGListPropertyTearOff.h: (WebCore::SVGListPropertyTearOff::removeItemFromList): 2017-08-28 Joseph Pecoraro REGRESSION(r220278): Web Inspector: ContextMenu items are not getting triggered https://bugs.webkit.org/show_bug.cgi?id=176034 Reviewed by Devin Rousso. * inspector/InspectorFrontendHost.cpp: (WebCore::InspectorFrontendHost::showContextMenu): Responses go through InspectorFrontendAPI not InspectorFrontendHost. 2017-08-26 Alex Christensen Remove PolicyChecker::cancelCheck https://bugs.webkit.org/show_bug.cgi?id=176002 Reviewed by Darin Adler. cancelCheck is conceptually equivalent to not calling a completion handler. stopCheck is conceptually equivalent to calling a completion handler with PolicyIgnore just before cleaning up everything, which is semantically cleaner and necessary when I replace the last use of PolicyCallback with a CompletionHandler. Before this change, we were probably causing some loading objects to hang right before deleting them, and this cleans them up better. * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::cancelPolicyCheckIfNeeded): * loader/PolicyChecker.cpp: (WebCore::PolicyChecker::cancelCheck): Deleted. * loader/PolicyChecker.h: 2017-08-25 Daniel Bates InlineTextBox::paintDocumentMarker() does not need to special case painting of grammar and dictation alternatives https://bugs.webkit.org/show_bug.cgi?id=175966 Reviewed by Tim Horton. Remove code that forced computing the marker rect for grammar and dictation alternative regardless of whether the marker spans the entire width of the line box. InlineTextBox::paintDocumentMarker() has performance optimizations to avoid computing the marker rect if it spans the entire line box. Prior to r190363 we had to opt out of these optimizations for grammar and dictation alternative markers so that we could store their computed marker rect. In r190363 we removed the logic in InlineTextBox::paintDocumentMarker() to store the computed marker rect and hence no longer needed to opt out of the optimization for these marker types, but inadvertently left in the conditional code that opts them out. No functionality changed. So no new tests. * rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::paintDocumentMarker): Remove unnecessary argument grammar and code that special cased handling of grammar an dictation alternative markers. (WebCore::InlineTextBox::paintDocumentMarkers): Update as necessary. * rendering/InlineTextBox.h: 2017-08-25 Miguel Gomez [GTK] Completely garbled display in Transifex in accelerated compositing mode https://bugs.webkit.org/show_bug.cgi?id=174632 Reviewed by Michael Catanzaro. Remove the copy constructor from PlatformContextCairo::State. This is because it will be used by WTF::Vector to copy the instances around when allocating new memory, but it doesn't copy the m_imageMaskInformation attribute, so it will be lost when the Vector reallocates its contents. When this happens, renderings that use GraphicsContext::clipToImageBuffer() fail to render properly. Covered by existent tests. * platform/graphics/cairo/PlatformContextCairo.cpp: (WebCore::PlatformContextCairo::State::State): (WebCore::PlatformContextCairo::save): 2017-08-24 Alex Christensen Stop using PolicyCallback for new window policies https://bugs.webkit.org/show_bug.cgi?id=175907 Reviewed by Andy Estes. PolicyCallback is an artifact from the days before C++11. Let's use lambdas instead! No change in behaviour. * loader/PolicyCallback.cpp: (WebCore::PolicyCallback::set): (WebCore::PolicyCallback::call): (WebCore::PolicyCallback::cancel): * loader/PolicyCallback.h: * loader/PolicyChecker.cpp: (WebCore::PolicyChecker::checkNewWindowPolicy): (WebCore::PolicyChecker::continueAfterNewWindowPolicy): Deleted. * loader/PolicyChecker.h: 2017-08-24 Kirill Ovchinnikov HTMLTrackElement behavior violates the standard https://bugs.webkit.org/show_bug.cgi?id=175888 Reviewed by Eric Carlson. Test: media/track/text-track-src-change.html: added asserts * html/HTMLTrackElement.cpp: (WebCore::HTMLTrackElement::parseAttribute): (WebCore::HTMLTrackElement::loadTimerFired): * html/track/LoadableTextTrack.cpp: (WebCore::LoadableTextTrack::scheduleLoad): * html/track/TextTrack.cpp: (WebCore::TextTrack::removeAllCues): * html/track/TextTrackCueList.cpp: (WebCore::TextTrackCueList::removeAll): * html/track/TextTrackCueList.h: 2017-08-23 Adrian Perez de Castro Geoclue2 based backend should provide the right desktop ID https://bugs.webkit.org/show_bug.cgi?id=129879 Reviewed by Michael Catanzaro. * platform/geoclue/GeolocationProviderGeoclue.cpp: (GeolocationProviderGeoclue::createGeoclueClientProxyCallback): Try first obtaining the application identifier using GApplication first, keeping a fallback to the value returned by g_get_prgname(). 2017-08-23 Wenson Hsieh DeleteSelectionCommand should be robust when starting and ending editable positions cannot be found https://bugs.webkit.org/show_bug.cgi?id=175914 Reviewed by Ryosuke Niwa. DeleteSelectionCommand can cause a null dereference if editable start and end positions are not found. This can happen when attempting to delete after selecting the contents within a canvas or output element with `read-write` `-webkit-user-modify` style. To fix this, we make the initialization step of the DeleteSelectionCommand robust when editable start and end positions are missing. Test: editing/execCommand/forward-delete-read-write-canvas.html * editing/DeleteSelectionCommand.cpp: (WebCore::DeleteSelectionCommand::initializePositionData): Make this initialization helper indicate failure via a bool return value. DeleteSelectionCommand::doApply bails early if initializePositionData returned false. (WebCore::DeleteSelectionCommand::doApply): * editing/DeleteSelectionCommand.h: 2017-08-23 Alex Christensen Stop using PolicyChecker for ContentPolicy https://bugs.webkit.org/show_bug.cgi?id=175904 Reviewed by Tim Horton. PolicyChecker is an artifact from the days before C++11. Now we have lambdas which have a cleaner flow than one class that exists to be effectively one of three lambda types. Let's remove them one at a time, starting with ContentPolicy checks. No change in behaviour. * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::responseReceived): * loader/FrameLoader.cpp: (WebCore::FrameLoader::checkContentPolicy): * loader/FrameLoader.h: * loader/PolicyCallback.cpp: (WebCore::PolicyCallback::set): (WebCore::PolicyCallback::call): (WebCore::PolicyCallback::cancel): * loader/PolicyCallback.h: * loader/PolicyChecker.cpp: (WebCore::PolicyChecker::checkContentPolicy): Deleted. (WebCore::PolicyChecker::continueAfterContentPolicy): Deleted. * loader/PolicyChecker.h: 2017-08-22 Zan Dobersek GLContext: zero-initialize the GLContext pointer in ThreadGlobalGLContext https://bugs.webkit.org/show_bug.cgi?id=175819 Reviewed by Xabier Rodriguez-Calvar. * platform/graphics/GLContext.cpp: The ThreadGlobalGLContext object is allocated on heap, so the embedded GLContext pointer can contain a non-null value that can cause problems when e.g. checking for a current GLContext on some specific thread on which a GLContext hasn't yet been made current. Zero-initializing this pointer will avoid false positives that can occur in these circumstances. 2017-08-21 Daniel Bates Cleanup TextPainter https://bugs.webkit.org/show_bug.cgi?id=175782 Reviewed by Myles C. Maxfield. Remove redundant mention of "text" in the name of TextPainter member functions, add separate setters for selection and non-selection shadows, and do some other minor cleanups. * rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::paint): Update code for renamed functions. * rendering/SimpleLineLayoutFunctions.cpp: (WebCore::SimpleLineLayout::paintFlow): Ditto. * rendering/TextPainter.cpp: Include ShadowData.h. (WebCore::ShadowApplier::ShadowApplier): Use C++11 brace-initialization syntax. (WebCore::ShadowApplier::isLastShadowIteration): Moved from TextPainter.h. (WebCore::ShadowApplier::shadowIsCompletelyCoveredByText): Ditto. (WebCore::TextPainter::paintTextOrEmphasisMarks): Renamed; formerly named drawTextOrEmphasisMarks. (WebCore::TextPainter::paintTextWithShadows): Update code for renamed functions. (WebCore::TextPainter::paintRange): Renamed; formerly named paintTextInRange. (WebCore::TextPainter::paint): Renamed; formerly named paintText. (WebCore::TextPainter::drawTextOrEmphasisMarks): Renamed to paintTextOrEmphasisMarks() to match the naming convention of all the other paint functions in this class. (WebCore::TextPainter::paintTextInRange): Renamed to paintRange. (WebCore::TextPainter::paintText): Renamed to paint. * rendering/TextPainter.h: Forward declare ShadowData. (WebCore::TextPainter::setStyle): Renamed; formerly named setTextPaintStyle. (WebCore::TextPainter::setSelectionStyle): Renamed; formerly named setSelectionPaintStyle. (WebCore::TextPainter::setShadow): Added. (WebCore::TextPainter::setSelectionShadow): Added. (WebCore::TextPainter::setEmphasisMark): Renamed; formerly named addEmphasis. (WebCore::TextPainter::setTextPaintStyle): Renamed to setStyle. (WebCore::TextPainter::setSelectionPaintStyle): Renamed to setSelectionStyle. (WebCore::TextPainter::addEmphasis): Renamed to setEmphasisMark. (WebCore::TextPainter::addTextShadow): Split functionality into setShadow and setSelectionShadow. (WebCore::ShadowApplier::isLastShadowIteration): Moved to TextPainter.cpp. (WebCore::ShadowApplier::shadowIsCompletelyCoveredByText): Ditto. 2017-08-21 Adrian Perez de Castro [GTK][WPE][GSTREAMER_GL] Overriden virtual function not marked “override” in MediaPlayerPrivateGStreamerBase.h https://bugs.webkit.org/show_bug.cgi?id=175780 Reviewed by Konstantin Tokarev. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h: Add missing "override" qualifier. 2017-08-18 Said Abou-Hallawa Followup (r220289): RenderImageResourceStyleImage code clean up https://bugs.webkit.org/show_bug.cgi?id=175444 Reviewed by Darin Adler. RenderImageResourceStyleImage may be created with a StyleImage of type StyleGeneratedImage. It may also be associated with a CachedImage which is loaded through a source URL. In this case, adding and removing m_renderer as a client of the CachedImage will be done through RenderImageResource::setCachedImage(). RenderImageResource::setCachedImage() is already called from ImageLoader::updateRenderer() when the CachedImage finishes loading. This call adds m_renderer to the clients of the CachedImage. RenderImageResource::setCachedImage() will also be called from RenderImageResourceStyleImage::shutdown() via RenderImageResource::shutdown() to remove m_renderer from the clients of CachedImage by passing a null pointer. * rendering/RenderImage.cpp: (WebCore::RenderImage::styleWillChange): * rendering/RenderImageResource.cpp: (WebCore::RenderImageResource::initialize): (WebCore::RenderImageResource::shutdown): (WebCore::RenderImageResource::setCachedImage): (WebCore::RenderImageResource::resetAnimation): (WebCore::RenderImageResource::image const): (WebCore::RenderImageResource::setContainerSizeForRenderer): (WebCore::RenderImageResource::imageSize const): (WebCore::RenderImageResource::~RenderImageResource): Deleted. (WebCore::RenderImageResource::errorOccurred const): Deleted. (WebCore::RenderImageResource::imageHasRelativeWidth const): Deleted. (WebCore::RenderImageResource::imageHasRelativeHeight const): Deleted. (WebCore::RenderImageResource::intrinsicSize const): Deleted. (WebCore::RenderImageResource::getImageSize const): Deleted. * rendering/RenderImageResource.h: (WebCore::RenderImageResource::initialize): (WebCore::RenderImageResource::renderer const): (WebCore::RenderImageResource::errorOccurred const): (WebCore::RenderImageResource::imageHasRelativeWidth const): (WebCore::RenderImageResource::imageHasRelativeHeight const): (WebCore::RenderImageResource::imageSize const): (WebCore::RenderImageResource::intrinsicSize const): (WebCore::RenderImageResource::imagePtr const): * rendering/RenderImageResourceStyleImage.cpp: (WebCore::RenderImageResourceStyleImage::initialize): (WebCore::RenderImageResourceStyleImage::shutdown): (WebCore::RenderImageResourceStyleImage::image const): (WebCore::RenderImageResourceStyleImage::setContainerSizeForRenderer): (WebCore::RenderImageResourceStyleImage::~RenderImageResourceStyleImage): Deleted. * rendering/RenderImageResourceStyleImage.h: * rendering/RenderSnapshottedPlugIn.cpp: (WebCore::RenderSnapshottedPlugIn::RenderSnapshottedPlugIn): * rendering/svg/RenderSVGImage.cpp: (WebCore::RenderSVGImage::RenderSVGImage): 2017-08-18 Antti Koivisto Factor render tree mutation code from RenderListItem to RenderTreeUpdater https://bugs.webkit.org/show_bug.cgi?id=175718 Reviewed by Andreas Kling. We already stopped doing layout time mutations. We can now move the code out too. * WebCore.xcodeproj/project.pbxproj: * rendering/RenderListItem.cpp: (WebCore::isHTMLListElement): (WebCore::getParentOfFirstLineBox): Deleted. (WebCore::firstNonMarkerChild): Deleted. (WebCore::RenderListItem::updateMarkerRenderer): Deleted. Moved to RenderTreeUpdater::ListItem. * rendering/RenderListItem.h: * rendering/RenderListMarker.cpp: (WebCore::RenderListMarker::willBeDestroyed): * rendering/TextAutoSizing.cpp: (WebCore::TextAutoSizingValue::adjustTextNodeSizes): * style/RenderTreeUpdater.cpp: (WebCore::RenderTreeUpdater::pushParent): (WebCore::RenderTreeUpdater::popParent): (WebCore::RenderTreeUpdater::updateBeforeDescendants): (WebCore::RenderTreeUpdater::updateAfterDescendants): Factor pre/post update into functions. (WebCore::RenderTreeUpdater::updateBeforeOrAfterPseudoElement): * style/RenderTreeUpdater.h: * style/RenderTreeUpdaterListItem.cpp: Added. Mutation functions move here. (WebCore::getParentOfFirstLineBox): (WebCore::firstNonMarkerChild): (WebCore::RenderTreeUpdater::ListItem::updateMarker): * style/RenderTreeUpdaterListItem.h: Added. 2017-08-18 Ms2ger [GTK] Show controls if a video element isn't allowed to play inline. https://bugs.webkit.org/show_bug.cgi?id=141705 Reviewed by Xabier Rodriguez-Calvar. Test: covered by media/video-fullscreeen-only-controls.html [sic]. * Modules/mediacontrols/mediaControlsGtk.js: (ControllerGtk.prototype.shouldHaveControls): 2017-08-17 Antti Koivisto RenderListItem - Avoid render tree mutation during layout https://bugs.webkit.org/show_bug.cgi?id=175666 Reviewed by Andreas Kling. Mutations should be done by RenderTreeUpdater only. * rendering/RenderListItem.cpp: (WebCore::RenderListItem::updateMarkerRenderer): This is now called by RenderTreeUpdater only. Remove code dealing with this being called at layout time. Merged marker construction code from styleDidChange here and renamed for clarity. (WebCore::RenderListItem::layout): (WebCore::RenderListItem::computePreferredLogicalWidths): Remove mutating calls. (WebCore::RenderListItem::styleDidChange): Deleted. (WebCore::RenderListItem::insertOrMoveMarkerRendererIfNeeded): Deleted. * rendering/RenderListItem.h: * rendering/TextAutoSizing.cpp: (WebCore::TextAutoSizingValue::adjustTextNodeSizes): Call updateMarkerRenderer. * style/RenderTreeUpdater.cpp: (WebCore::RenderTreeUpdater::popParent): (WebCore::RenderTreeUpdater::updateBeforeOrAfterPseudoElement): Call updateMarkerRenderer. 2017-08-18 Commit Queue Unreviewed, rolling out r220854. https://bugs.webkit.org/show_bug.cgi?id=175716 I'm not sure we really need this (Requested by KaL on #webkit). Reverted changeset: "[GTK][WPE] Add NTLM authentication enabled API" https://bugs.webkit.org/show_bug.cgi?id=122952 http://trac.webkit.org/changeset/220854 2017-08-17 Carlos Garcia Campos [GTK][WPE] Add NTLM authentication enabled API https://bugs.webkit.org/show_bug.cgi?id=122952 Reviewed by Michael Catanzaro. Add/remove NTLM feature to/from soup session depending on whether the feature is enabled or disabled. * platform/network/soup/SoupNetworkSession.cpp: (WebCore::SoupNetworkSession::SoupNetworkSession): (WebCore::SoupNetworkSession::setInitialNTLMAuthenticationEnabled): (WebCore::SoupNetworkSession::setNTLMAuthenticationEnabled): * platform/network/soup/SoupNetworkSession.h: 2017-08-16 Simon Fraser Make RenderLayer and RenderLayerBacking TextStream-loggable, and clean up compositing logging https://bugs.webkit.org/show_bug.cgi?id=175634 Reviewed by Zalan Bujtas. Add operator<<(TextStream&) for RenderLayer and RenderLayer backing, and use them for compositing logging. Convert CompositingUpdateType to an enum class. * page/FrameView.cpp: (WebCore::FrameView::updateCompositingLayersAfterLayout): (WebCore::FrameView::updateCompositingLayersAfterScrolling): * page/ios/FrameIOS.mm: (WebCore::Frame::viewportOffsetChanged): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::updateLayerPositionsAfterLayout): (WebCore::RenderLayer::updateCompositingLayersAfterScroll): (WebCore::RenderLayer::calculateClipRects const): * rendering/RenderLayer.h: * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateAfterLayout): (WebCore::RenderLayerBacking::updateGeometry): (WebCore::operator<<): * rendering/RenderLayerBacking.h: * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::didRecalcStyleWithNoPendingLayout): (WebCore::RenderLayerCompositor::flushPendingLayerChanges): (WebCore::RenderLayerCompositor::updateCompositingLayersTimerFired): (WebCore::RenderLayerCompositor::updateCompositingLayers): (WebCore::RenderLayerCompositor::layerTreeAsText): (WebCore::operator<<): * rendering/RenderLayerCompositor.h: 2017-08-16 Fujii Hironori [HarfBuzz] Decomposed Vietnamese characters are rendered incorrectly https://bugs.webkit.org/show_bug.cgi?id=174418 Reviewed by Michael Catanzaro. HarfBuzzShaper should normalize the input text before collecting HarfBuzzRuns. Actually, HarfBuzzShaper::setNormalizedBuffer does the task. But, this function hasn't been called from anywhere since Bug 90951. Test: fast/text/international/vietnamese-nfd.html imported/blink/fast/text/international/text-shaping-arabic-diffs.html * platform/graphics/harfbuzz/HarfBuzzShaper.cpp: (WebCore::HarfBuzzShaper::HarfBuzzShaper): Call setNormalizedBuffer instead of normalizeCharacters. (WebCore::normalizeCharacters): Deleted. (WebCore::normalizeSpacesAndMirrorChars) Use FontCascade::treatAsZeroWidthSpaceInComplexScript instead of FontCascade::treatAsZeroWidthSpace to preserve ZWJ and ZWNJ. 2017-08-15 Commit Queue Unreviewed, rolling out r219504. https://bugs.webkit.org/show_bug.cgi?id=175580 Broke Arabic text shaping (Requested by mcatanzaro on #webkit). Reverted changeset: "[HarfBuzz] Decomposed Vietnamese characters are rendered incorrectly" https://bugs.webkit.org/show_bug.cgi?id=174418 http://trac.webkit.org/changeset/219504 2017-08-16 Antti Koivisto Move first-letter renderer mutation code out of RenderBlock and into RenderTreeUpdater https://bugs.webkit.org/show_bug.cgi?id=175627 Reviewed by Andreas Kling. Render tree should not mutate itself. We already fixed this for first-letter, supporting code can now move to RenderTreeUpdater too. * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * rendering/RenderBlock.cpp: (WebCore::styleForFirstLetter): Deleted. (WebCore::isPunctuationForFirstLetter): Deleted. (WebCore::shouldSkipForFirstLetter): Deleted. (WebCore::RenderBlock::updateFirstLetterStyle): Deleted. (WebCore::RenderBlock::createFirstLetterRenderer): Deleted. (WebCore::RenderBlock::updateFirstLetter): Deleted. * rendering/RenderBlock.h: * rendering/RenderRubyRun.cpp: (WebCore::RenderRubyRun::updateFirstLetter): Deleted. * rendering/RenderRubyRun.h: * rendering/RenderTable.cpp: (WebCore::RenderTable::updateFirstLetter): Deleted. * rendering/RenderTable.h: Virtual overrides just disabled first letter for some RenderBlock subclasses. This is now achieved via supportsFirstLetter test in the first letter updater. * rendering/TextAutoSizing.cpp: (WebCore::TextAutoSizingValue::adjustTextNodeSizes): * rendering/svg/RenderSVGText.cpp: (WebCore::RenderSVGText::updateFirstLetter): Deleted. * rendering/svg/RenderSVGText.h: * style/RenderTreeUpdater.cpp: (WebCore::RenderTreeUpdater::popParent): * style/RenderTreeUpdater.h: * style/RenderTreeUpdaterFirstLetter.cpp: Added. (WebCore::styleForFirstLetter): (WebCore::isPunctuationForFirstLetter): (WebCore::shouldSkipForFirstLetter): (WebCore::updateFirstLetterStyle): (WebCore::createFirstLetterRenderer): (WebCore::supportsFirstLetter): (WebCore::RenderTreeUpdater::FirstLetter::update): * style/RenderTreeUpdaterFirstLetter.h: Added. 2017-08-15 Darin Adler REGRESSION(r220052): http/tests/appcache/deferred-events-delete-while-raising-timer.html is crashing. https://bugs.webkit.org/show_bug.cgi?id=175107 Reviewed by Alexey Proskuryakov. * loader/FrameLoader.cpp: (WebCore::FrameLoader::checkLoadComplete): Moved the assertion to after the null page check. 2017-08-14 Carlos Garcia Campos WebDriver: handle click events on option elements https://bugs.webkit.org/show_bug.cgi?id=174710 Reviewed by Brian Burg. Export WebCore symbols required by WebKit layer. * html/HTMLOptGroupElement.h: * html/HTMLOptionElement.h: 2017-08-14 Chris Dumez XHR should only fire an abort event if the cancellation was requested by the client https://bugs.webkit.org/show_bug.cgi?id=175546 Reviewed by Youenn Fablet. XHR should only fire an abort event if the cancellation was requested by the client, otherwise it should fire an error event. Blink and Gecko already match the specification. Specification: - https://xhr.spec.whatwg.org/#handle-errors - https://xhr.spec.whatwg.org/#the-abort()-method Test: http/tests/navigation/page-cache-xhr-in-pagehide.html * xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::open): (WebCore::XMLHttpRequest::abort): (WebCore::XMLHttpRequest::abortError): (WebCore::XMLHttpRequest::didFail): * xml/XMLHttpRequest.h: 2017-08-14 Simon Fraser Remove Proximity Events and related code https://bugs.webkit.org/show_bug.cgi?id=175545 Reviewed by Daniel Bates. No platform enables Proximity Events, so remove code inside ENABLE(PROXIMITY_EVENTS) and other related code. * CMakeLists.txt: * Configurations/FeatureDefines.xcconfig: * DerivedSources.cpp: * Modules/proximity/DeviceProximityClient.h: Removed. * Modules/proximity/DeviceProximityController.cpp: Removed. * Modules/proximity/DeviceProximityController.h: Removed. * Modules/proximity/DeviceProximityEvent.cpp: Removed. * Modules/proximity/DeviceProximityEvent.h: Removed. * Modules/proximity/DeviceProximityEvent.idl: Removed. * dom/EventNames.h: * dom/EventNames.in: * history/PageCache.cpp: (WebCore::canCachePage): * page/DOMWindow.cpp: (WebCore::DOMWindow::addEventListener): (WebCore::DOMWindow::removeEventListener): (WebCore::DOMWindow::removeAllEventListeners): * page/DOMWindow.idl: * page/DiagnosticLoggingKeys.cpp: (WebCore::DiagnosticLoggingKeys::deviceProximityKey): Deleted. * page/DiagnosticLoggingKeys.h: * testing/Internals.cpp: (WebCore::Internals::setDeviceProximity): Deleted. * testing/Internals.h: * testing/Internals.idl: 2017-08-14 Simon Fraser Remove ENABLE(REQUEST_AUTOCOMPLETE) code, which was disabled everywhere https://bugs.webkit.org/show_bug.cgi?id=175504 Reviewed by Sam Weinig. REQUEST_AUTOCOMPLETE was added in r133396 then removed in r148731, but brought back in r173596, however no further work was done, and it was left disabled. So remove the code. * Configurations/FeatureDefines.xcconfig: * DerivedSources.make: * WebCore.xcodeproj/project.pbxproj: * dom/AutocompleteErrorEvent.h: Removed. * dom/AutocompleteErrorEvent.idl: Removed. * dom/EventNames.in: * dom/GlobalEventHandlers.idl: * html/HTMLFormElement.cpp: (WebCore::HTMLFormElement::HTMLFormElement): (WebCore::HTMLFormElement::requestAutocomplete): Deleted. (WebCore::HTMLFormElement::finishRequestAutocomplete): Deleted. (WebCore::HTMLFormElement::requestAutocompleteTimerFired): Deleted. * html/HTMLFormElement.h: * html/HTMLFormElement.idl: * loader/EmptyClients.cpp: * loader/FrameLoaderClient.h: 2017-08-14 Simon Fraser Remove ENABLE_VIEW_MODE_CSS_MEDIA and related code https://bugs.webkit.org/show_bug.cgi?id=175557 Reviewed by Jon Lee. No port cares about the ENABLE(VIEW_MODE_CSS_MEDIA) feature, so remove it. * Configurations/FeatureDefines.xcconfig: * css/CSSValueKeywords.in: * css/MediaFeatureNames.h: * css/MediaQueryEvaluator.cpp: (WebCore::viewModeEvaluate): Deleted. * css/MediaQueryExpression.cpp: (WebCore::featureWithValidIdent): (WebCore::isFeatureValidWithoutValue): * page/Page.cpp: (WebCore::Page::stringToViewMode): Deleted. (WebCore::Page::setViewMode): Deleted. * page/Page.h: (WebCore::Page::viewMode const): Deleted. 2017-08-14 Said Abou-Hallawa The none smooth stroke applied to an SVG shape breaks its hit testing https://bugs.webkit.org/show_bug.cgi?id=175506 Reviewed by Simon Fraser. Clear RenderSVGShape::m_path when calling RenderSVGRect::updateShapeFromElement(). The m_path will be recalculated when RenderSVGShape::updateShapeFromElement() is called from RenderSVGRect::shapeDependentStrokeContains(). Test: svg/stroke/stroke-linejoin-click.html * rendering/svg/RenderSVGRect.cpp: (WebCore::RenderSVGRect::updateShapeFromElement): * rendering/svg/RenderSVGShape.h: (WebCore::RenderSVGShape::clearPath): 2017-08-10 Zan Dobersek Unreviewed GTK+ build fix for ENABLE_GLES2=ON. * platform/graphics/texmap/TextureMapperGLHeaders.h: Define various GL constants that are not provided in GLES2 headers but are only leveraged in OpenGL calls if at runtime the underlying OpenGL is GLES2-capable. 2017-08-10 Zan Dobersek [TexMap] Remove GraphicsContext3D usage from BitmapTexturePool https://bugs.webkit.org/show_bug.cgi?id=175319 Reviewed by Carlos Garcia Campos. Drop the GraphicsContext3D reference in BitmapTexturePool now that the BitmapTextureGL doesn't require it anymore. No new tests -- no change in behavior. * platform/graphics/texmap/BitmapTexturePool.cpp: (WebCore::BitmapTexturePool::BitmapTexturePool): * platform/graphics/texmap/BitmapTexturePool.h: * platform/graphics/texmap/TextureMapperGL.cpp: (WebCore::TextureMapperGL::TextureMapperGL): 2017-08-14 Zan Dobersek REGRESSION(r220517-r220521) [GTK] Various compositing tests fail https://bugs.webkit.org/show_bug.cgi?id=175478 Reviewed by Sergio Villar Senin. Fix a regression introduced in r220519. Move a framebuffer binding in TextureMapperGL away from GraphicsContext3D and onto the OpenGL API to work around the framebuffer binding state that's kept in the GraphicsContext3D class. This mismatch in how the framebuffer was bound was causing a couple of test failures in compositing tests. No new tests -- regressed tests have their failure expectations removed. * platform/graphics/texmap/TextureMapperGL.cpp: (WebCore::TextureMapperGL::bindDefaultSurface): Don't use GraphicsContext3D for the glBindFramebuffer() call. This would be done in subsequent patches that would move TextureMapperGL off the GraphicsContext3D usage, but this specific use case clashes with the framebuffer binding that's done in BitmapTextureGL and was causing test failures. 2017-08-10 Zan Dobersek [TexMap] Drop GraphicsContext3D usage from BitmapTextureGL https://bugs.webkit.org/show_bug.cgi?id=175317 Reviewed by Carlos Garcia Campos. Have BitmapTextureGL use direct OpenGL API entrypoints and constants instead of leveraging the GraphicsContext3D class. Any GraphicsContext3D object passed to BitmapTextureGL would assume rendering to the GL context that's current on that thread, translating method invocations to the OpenGL API. We can do this by ourselves and benefit by avoiding allocating GraphicsContext3D resources like the ANGLE compiler that are by most useful for WebGL. BitmapTextureGL::create() call sites are adjusted to stop passing a GraphicsContext3D reference. BitmapTextureGL::bindAsSurface() doesn't need a replacement for the passed-in GraphicsContext3D object since that object originated from the TextureMapperGL instance, whose GraphicsContext3D is by default of the render-to-current-context nature. Other changes are direct translations of GraphicsContext3D methods to OpenGL API calls, or of GraphicsContext3D values to OpenGL API constants. No new tests -- no change in behavior. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: (WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor): * platform/graphics/texmap/BitmapTextureGL.cpp: Also remove an unnecessary GraphicsContext.h header inclusion. (WebCore::BitmapTextureGL::BitmapTextureGL): (WebCore::BitmapTextureGL::didReset): (WebCore::BitmapTextureGL::updateContentsNoSwizzle): (WebCore::BitmapTextureGL::updateContents): (WebCore::BitmapTextureGL::initializeStencil): (WebCore::BitmapTextureGL::initializeDepthBuffer): (WebCore::BitmapTextureGL::clearIfNeeded): (WebCore::BitmapTextureGL::createFboIfNeeded): (WebCore::BitmapTextureGL::bindAsSurface): (WebCore::BitmapTextureGL::~BitmapTextureGL): (WebCore::BitmapTextureGL::copyFromExternalTexture): * platform/graphics/texmap/BitmapTextureGL.h: (WebCore::BitmapTextureGL::create): (WebCore::BitmapTextureGL::textureTarget const): (WebCore::BitmapTextureGL::internalFormat const): * platform/graphics/texmap/BitmapTexturePool.cpp: (WebCore::BitmapTexturePool::createTexture): * platform/graphics/texmap/TextureMapperGL.cpp: (WebCore::TextureMapperGL::bindSurface): (WebCore::TextureMapperGL::createTexture): 2017-08-14 Antti Koivisto Factor text autosizing into a class https://bugs.webkit.org/show_bug.cgi?id=175530 Reviewed by Andreas Kling. Move the remaining parts out of Document. * css/StyleBuilderCustom.h: (WebCore::computeLineHeightMultiplierDueToFontSize): * dom/Document.cpp: (WebCore::Document::destroyRenderTree): (WebCore::Document::textAutoSizing): (WebCore::TextAutoSizingTraits::constructDeletedValue): Deleted. (WebCore::TextAutoSizingTraits::isDeletedValue): Deleted. (WebCore::Document::addAutoSizedNode): Deleted. (WebCore::Document::updateAutoSizedNodes): Deleted. (WebCore::Document::clearAutoSizedNodes): Deleted. * dom/Document.h: * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::adjustComputedFontSizes): * rendering/RenderElement.cpp: (WebCore::RenderElement::adjustComputedFontSizesOnBlocks): (WebCore::RenderElement::resetTextAutosizing): * rendering/TextAutoSizing.cpp: (WebCore::TextAutoSizingTraits::constructDeletedValue): (WebCore::TextAutoSizingTraits::isDeletedValue): (WebCore::TextAutoSizing::addTextNode): (WebCore::TextAutoSizing::updateRenderTree): (WebCore::TextAutoSizing::reset): * rendering/TextAutoSizing.h: 2017-08-14 Antti Koivisto [Render Tree Mutation] First letter should not mutate the render tree while in layout. https://bugs.webkit.org/show_bug.cgi?id=163848 Reviewed by Zalan Bujtas. RenderBlock::updateFirstLetter shouldn't be called during layout. Instead it should be invoked by the RenderTreeUpdater. With this future patches can move updateFirstLetter() and the related functions completely out of the render tree. * rendering/RenderBlock.cpp: (WebCore::RenderBlock::layout): No more updateFirstLetter calls during layout... (WebCore::RenderBlock::computePreferredLogicalWidths): ...or preferred width computation. (WebCore::RenderBlock::updateFirstLetter): * rendering/RenderBlock.h: * rendering/RenderRubyRun.cpp: (WebCore::RenderRubyRun::updateFirstLetter): * rendering/RenderRubyRun.h: * rendering/RenderTable.cpp: (WebCore::RenderTable::updateFirstLetter): * rendering/RenderTable.h: * rendering/svg/RenderSVGText.cpp: (WebCore::RenderSVGText::updateFirstLetter): * rendering/svg/RenderSVGText.h: * style/RenderTreeUpdater.cpp: (WebCore::RenderTreeUpdater::popParent): Call updateFirstLetter when closing the element. All of of descedant renderers are known here so this can be resolved correctly. 2017-08-13 Manuel Rego Casasnovas Composition underline color is always black https://bugs.webkit.org/show_bug.cgi?id=174675 Reviewed by Ryosuke Niwa. This patch uses the current color of the text instead of black for the composition underline marker. This makes it visible in the case we have a black/dark background. Test: editing/composition-underline-color.html * editing/CompositionUnderline.h: (WebCore::CompositionUnderline::CompositionUnderline): Added new attribute compositionUnderlineColor. * rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::paintCompositionUnderline): Use the text color if compositionUnderlineColor is TextColor. 2017-08-13 Carlos Garcia Campos [GTK] stop kinetic scrolling when a zero movement is reached https://bugs.webkit.org/show_bug.cgi?id=175468 Reviewed by Michael Catanzaro. This is GTK+ change by Christian Hergert. https://git.gnome.org/browse/gtk+/commit/?h=gtk-3-22&id=4f63d839550f7a9038b391e7d3e1e6fc8bdfafa6 When the kinetic scrolling reduces its speed, there can be multiple frames where the movement is zero pixels, followed by a 1 pixel movement later on. This causes a "jitter" right at the end of the scroll which makes it feel less quality than other platforms. Instead, we should just clamp it as soon as we get a zero movement. * platform/ScrollAnimationKinetic.cpp: (WebCore::ScrollAnimationKinetic::PerAxisData::animateScroll): 2017-08-13 Chris Dumez Drop non-const getter for CachedResource::resourceRequest() https://bugs.webkit.org/show_bug.cgi?id=175524 Reviewed by Youenn Fablet. Drop non-const getter for CachedResource::resourceRequest(). It would be unsafe to modify the request of a CachedResource after it has been cached. Exposing such a getter is therefore a footgun. * loader/LinkLoader.cpp: (WebCore::LinkLoader::preloadIfNeeded): * loader/cache/CachedImage.cpp: (WebCore::CachedImage::CachedImage): * loader/cache/CachedImage.h: * loader/cache/CachedResource.cpp: (WebCore::CachedResource::CachedResource): * loader/cache/CachedResource.h: (WebCore::CachedResource::resourceRequest const): (WebCore::CachedResource::ignoreForRequestCount const): (WebCore::CachedResource::setIgnoreForRequestCount): * loader/cache/CachedResourceLoader.cpp: (WebCore::CachedResourceLoader::requestResource): * loader/cache/CachedResourceRequest.h: (WebCore::CachedResourceRequest::ignoreForRequestCount const): (WebCore::CachedResourceRequest::setIgnoreForRequestCount): * loader/cache/MemoryCache.cpp: (WebCore::MemoryCache::addImageToCache): * platform/network/ResourceRequestBase.h: 2017-08-13 Adrian Perez de Castro [WPE] Implement WebCore::standardUserAgent() https://bugs.webkit.org/show_bug.cgi?id=175507 Reviewed by Carlos Alberto Lopez Perez. Implement missing User-Agent handling for the WPE port by sharing the code with the GTK+ port. * PlatformGTK.cmake: Handlde renaming of UserAgentGtk.cpp to UserAgentGLib.cpp. * PlatformWPE.cmake: Add UserAgentGLib.cpp and UserAgentQuirks.cpp to the list of built WebCore sources. * platform/glib/UserAgentGLib.cpp: Renamed from Source/WebCore/platform/gtk/UserAgentGtk.cpp. (WebCore::versionForUAString): Change "GTK" in UA version macros to "GLIB". 2017-08-11 Don Olmstead [WTF] Move ValueToString into WTF https://bugs.webkit.org/show_bug.cgi?id=175469 Reviewed by Sam Weinig. No new tests. No change in behavior. * WebCore.xcodeproj/project.pbxproj: * html/HTMLMediaElement.h: (WTF::ValueToString::string): Deleted. * platform/LayoutUnit.h: (WTF::ValueToString::string): (WebCore::ValueToString::string): Deleted. * platform/PODInterval.h: * platform/PODIntervalTree.h: * platform/PODRedBlackTree.h: * platform/graphics/FloatPolygon.h: (WTF::ValueToString [Bindings] Simplify DOMPromiseProxy now that WTF::Function can return references https://bugs.webkit.org/show_bug.cgi?id=175394 Reviewed by Chris Dumez. * bindings/IDLTypes.h: (WebCore::IDLWrapper::convertToParameterType): Deleted. Remove no longer used convertToParameterType. * bindings/js/DOMPromiseProxy.h: - Replace Variant with ExceptionOr / ExceptionOr. - Update ResolveCallback to have a return type of IDLType::ParameterType, rather than IDLType::ImplementationType, now that WTF::Function supports references as the return type. This is needed, since the IDLType::ParameterType for an interface T is T&. * css/FontFace.cpp: * css/FontFace.h: * css/FontFaceSet.cpp: * css/FontFaceSet.h: Update resolve callbacks to return a reference rather than a RefPtr, matching the new signature requirement. 2017-08-11 Sam Weinig [WebIDL] Replace JSCryptoKeyCustom and JSCryptoAlgorithmBuilder with generated code https://bugs.webkit.org/show_bug.cgi?id=175457 Reviewed by Chris Dumez. * CMakeLists.txt: * DerivedSources.make: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSCryptoAlgorithmBuilder.cpp: Removed. * bindings/js/JSCryptoAlgorithmBuilder.h: Removed. * bindings/js/JSCryptoKeyCustom.cpp: Removed. Remove JSCryptoAlgorithmBuilder and JSCryptoKeyCustom, add KeyAlgorithm IDLs and headers. * crypto/CryptoKey.cpp: * crypto/CryptoKey.h: * crypto/CryptoKey.idl: Replace custom algorithm attribute with a union of the supported key algorithms. * crypto/keys/CryptoAesKeyAlgorithm.h: Added. * crypto/keys/CryptoAesKeyAlgorithm.idl: Added. * crypto/keys/CryptoEcKeyAlgorithm.h: Added. * crypto/keys/CryptoEcKeyAlgorithm.idl: Added. * crypto/keys/CryptoHmacKeyAlgorithm.h: Added. * crypto/keys/CryptoHmacKeyAlgorithm.idl: Added. * crypto/keys/CryptoKeyAlgorithm.h: Added. * crypto/keys/CryptoKeyAlgorithm.idl: Added. * crypto/keys/CryptoRsaHashedKeyAlgorithm.h: Added. * crypto/keys/CryptoRsaHashedKeyAlgorithm.idl: Added. * crypto/keys/CryptoRsaKeyAlgorithm.h: Added. * crypto/keys/CryptoRsaKeyAlgorithm.idl: Added. Add IDLs and headers fo the supported key algorithms. * crypto/keys/CryptoKeyAES.h: * crypto/keys/CryptoKeyEC.h: * crypto/keys/CryptoKeyHMAC.h: * crypto/keys/CryptoKeyRSA.h: * crypto/keys/CryptoKeyRaw.h: Give each of the existing KeyAlgorithm subclasses a dictionary() function that returns the populated corresponding spec'd dictionary. 2017-08-11 Simon Fraser Some RenderSVGResource cleanup https://bugs.webkit.org/show_bug.cgi?id=175494 Reviewed by Zalan Bujtas. Use more initializers. Remove spurious use of bitfields that didn't save any space at all. 0 -> nullptr. No behavior change. * rendering/svg/RenderSVGResourceContainer.cpp: (WebCore::RenderSVGResourceContainer::RenderSVGResourceContainer): * rendering/svg/RenderSVGResourceContainer.h: * rendering/svg/RenderSVGResourceGradient.cpp: (WebCore::RenderSVGResourceGradient::RenderSVGResourceGradient): (WebCore::RenderSVGResourceGradient::applyResource): * rendering/svg/RenderSVGResourceGradient.h: * rendering/svg/RenderSVGResourcePattern.cpp: (WebCore::RenderSVGResourcePattern::RenderSVGResourcePattern): * rendering/svg/RenderSVGResourcePattern.h: * rendering/svg/RenderSVGShape.cpp: (WebCore::RenderSVGShape::fillShape): (WebCore::RenderSVGShape::strokeShape): * rendering/svg/SVGRenderingContext.cpp: (WebCore::SVGRenderingContext::~SVGRenderingContext): (WebCore::SVGRenderingContext::prepareToRenderSVGContent): * rendering/svg/SVGRenderingContext.h: (WebCore::SVGRenderingContext::SVGRenderingContext): 2017-08-10 Sam Weinig WTF::Function does not allow for reference / non-default constructible return types https://bugs.webkit.org/show_bug.cgi?id=175244 Reviewed by Chris Dumez. * bindings/js/JSCustomElementInterface.h: (WebCore::JSCustomElementInterface::invokeCallback): Update the default value for the addArguments parameter to be an empty lambda, rather than default initialization, which leads to a null WTF::Function. This allows us to remove support for calling null WTF::Function. No change in behavior. 2017-08-11 Antti Koivisto Remove RenderQuote collection from RenderView https://bugs.webkit.org/show_bug.cgi?id=175479 Reviewed by Andreas Kling. We can do it well enough without maintaining this pointer structure. Global updating doesn't work well with future direction for first-letter and similar anyway. We need to update quote immediately when updating its style. * rendering/RenderQuote.cpp: (WebCore::RenderQuote::insertedIntoTree): (WebCore::RenderQuote::willBeRemovedFromTree): Just tell the view that there are renderers to update. (WebCore::RenderQuote::styleDidChange): (WebCore::RenderQuote::isOpen const): (WebCore::RenderQuote::updateRenderer): (WebCore::RenderQuote::updateRenderers): Deleted. Update single renderer only. RenderTreeUpdater provides the previous renderer to compute the depth. * rendering/RenderQuote.h: * rendering/RenderView.cpp: (WebCore::RenderView::registerQuote): Deleted. (WebCore::RenderView::unregisterQuote): Deleted. (WebCore::RenderView::updateSpecialRenderers): Deleted. Remove the quote list. * rendering/RenderView.h: * style/RenderTreeUpdater.cpp: (WebCore::RenderTreeUpdater::commit): Ensure that all quotes are updated. (WebCore::RenderTreeUpdater::updateBeforeOrAfterPseudoElement): (WebCore::RenderTreeUpdater::updateQuotesUpTo): Traverse render tree to find quotes to update starting from the previous updated quote. * style/RenderTreeUpdater.h: 2017-08-11 Adrian Perez de Castro [GTK][WPE] Overriden virtual function not marked “override” in ImageBufferDataCairo.h https://bugs.webkit.org/show_bug.cgi?id=175476 Reviewed by Carlos Garcia Campos. * platform/graphics/cairo/ImageBufferDataCairo.h: Add missing "override" qualifier. 2017-08-11 Carlos Garcia Campos [Soup] Cannot access HTTPS sites using a HTTP proxy that requires authentication https://bugs.webkit.org/show_bug.cgi?id=175378 Reviewed by Sergio Villar Senin. Bring back part of the code removed in r206732, to keep a reference to the SoupMessage in the AuthenticationChallenge since it can be different to the resource message. * platform/network/soup/AuthenticationChallenge.h: (WebCore::AuthenticationChallenge::AuthenticationChallenge): Deleted. (WebCore::AuthenticationChallenge::authenticationClient const): Deleted. (WebCore::AuthenticationChallenge::soupAuth const): Deleted. (WebCore::AuthenticationChallenge::setProposedCredential): Deleted. * platform/network/soup/AuthenticationChallengeSoup.cpp: (WebCore::AuthenticationChallenge::AuthenticationChallenge): (WebCore::AuthenticationChallenge::platformCompare): 2017-08-10 Yusuke Suzuki Make ThreadGlobalData RefCounted for web thread https://bugs.webkit.org/show_bug.cgi?id=175439 Reviewed by Mark Lam. When the web thread is enabled, we share ThreadGlobalData between the web thread and the main thread. The problem happens when the main thread is dying. It could start deallocating TLS and the web thread may see the destructed ThreadGlobalData. Even though, the current implementation is safe because the main thread do not perform TLS deallocation in the Darwin environment. But this is not true in Windows. And we should not rely on this condition that depends on the platforms. In this patch, we make ThreadGlobalData ThreadSafeRefCounted. This type verbosely describes that ThreadGlobalData could be shared between threads when the web thread enabled. And make the life time management simple instead of relying on the platform dependent TLS implementation. * platform/ThreadGlobalData.cpp: (WebCore::ThreadGlobalData::setWebCoreThreadData): (WebCore::threadGlobalData): * platform/ThreadGlobalData.h: (WebCore::ThreadGlobalData::cachedResourceRequestInitiators): Deleted. (WebCore::ThreadGlobalData::eventNames): Deleted. (WebCore::ThreadGlobalData::threadTimers): Deleted. (WebCore::ThreadGlobalData::qualifiedNameCache): Deleted. (WebCore::ThreadGlobalData::cachedConverterICU): Deleted. (WebCore::ThreadGlobalData::cachedConverterTEC): Deleted. 2017-08-10 Yusuke Suzuki [JSC] Use @toNumber in builtins https://bugs.webkit.org/show_bug.cgi?id=172692 Reviewed by Sam Weinig. Use @toNumber bytecode intrinsic. It emits op_to_number, which efficiently converts a given argument to a number. * Modules/streams/ReadableByteStreamInternals.js: (privateInitializeReadableByteStreamController): (readableByteStreamControllerRespond): * Modules/streams/StreamInternals.js: (validateAndNormalizeQueuingStrategy): (enqueueValueWithSize): 2017-08-10 Nan Wang AX: crash at WebCore::AccessibilityObject::supportsARIALiveRegion() const + 24 https://bugs.webkit.org/show_bug.cgi?id=175340 Reviewed by Chris Fleizach. The issue here is that we manualy set the parent object of the AccessibilitySVGRoot object and there are chances that the parent doesn't detach it properly during the parent's destroying process. Accessing the stale parent object will lead to a crash. Fixed this by making the parent object a weak pointer so we don't access an invalid memory. Test: accessibility/add-children-pseudo-element.html * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::AccessibilityRenderObject): * accessibility/AccessibilityRenderObject.h: (WebCore::AccessibilityRenderObject::createWeakPtr): * accessibility/AccessibilitySVGRoot.cpp: (WebCore::AccessibilitySVGRoot::AccessibilitySVGRoot): (WebCore::AccessibilitySVGRoot::setParent): (WebCore::AccessibilitySVGRoot::parentObject const): * accessibility/AccessibilitySVGRoot.h: 2017-08-09 Yusuke Suzuki [WTF] ThreadSpecific should not introduce additional indirection https://bugs.webkit.org/show_bug.cgi?id=175187 Reviewed by Mark Lam. We drop ThreadSpecific::replace feature which is only used by Web thread. Instead, we use ThreadSpecific> here. While this std::unique_ptr shares one instance between main thread and web thread, this is the same to the current implementation. It is safe because the web thread never finishes. And for non-web thread implementation, we just use ThreadSpecific, since it is the most efficient. * platform/ThreadGlobalData.cpp: (WebCore::ThreadGlobalData::ThreadGlobalData): (WebCore::ThreadGlobalData::setWebCoreThreadData): (WebCore::threadGlobalData): We also drop StringImpl::empty() call since it is not necessary now: StringImpl::empty data is statically initialized by using constexpr. * platform/ThreadGlobalData.h: We make it FAST_ALLOCATED since it is previously allocated by fast malloc in ThreadSpecific. 2017-08-10 Tim Horton Remove some unused lambda captures so that WebKit builds with -Wunused-lambda-capture https://bugs.webkit.org/show_bug.cgi?id=175436 Reviewed by Simon Fraser. * platform/audio/cocoa/MediaSessionManagerCocoa.cpp: (PlatformMediaSessionManager::updateSessionState): * platform/graphics/cocoa/WebCoreDecompressionSession.mm: (WebCore::WebCoreDecompressionSession::handleDecompressionOutput): 2017-08-10 Myles C. Maxfield Addressing post-review comments after r219173. https://bugs.webkit.org/show_bug.cgi?id=174149 Unreviewed. * css/CSSFontStyleValue.h: * editing/EditingStyle.cpp: (WebCore::identifierForStyleProperty): 2017-08-10 Antti Koivisto Try to fix windows build. * style/StyleUpdate.h: (WebCore::Style::TextUpdate::TextUpdate): 2017-08-10 Carlos Garcia Campos [GTK] Crashes in WebCore::PasteboardHelper::fillSelectionData when source file of drag is unavailable https://bugs.webkit.org/show_bug.cgi?id=174161 Reviewed by Xabier Rodriguez-Calvar. In r219385 we changed the early return in fillSelectionData() to check the selection data length instead of the data pointer. However, the gtk_selection_data_get_length() can return -1, so we need to check also if the value less than 0. The case of setting an empty string could be valid depending on the target type, so it's better to return early only when data lenght is less than 0 and handle the 0 length case in each target. * platform/gtk/PasteboardHelper.cpp: (WebCore::PasteboardHelper::fillSelectionData): 2017-08-10 Antti Koivisto Text renderer updates should be done by RenderTreeUpdater https://bugs.webkit.org/show_bug.cgi?id=175417 Reviewed by Andreas Kling. All render tree mutations should be done by RenderTreeUpdater. Currently Text::updateRendererAfterContentChange calls RenderText::setTextWithOffset directly. * dom/Document.cpp: (WebCore::Document::updateTextRenderer): Add range argument. * dom/Document.h: * dom/Text.cpp: (WebCore::Text::updateRendererAfterContentChange): Remove call to setTextWithOffset and pass the range to updateTextRenderer * style/RenderTreeUpdater.cpp: (WebCore::RenderTreeUpdater::updateRenderTree): (WebCore::RenderTreeUpdater::updateTextRenderer): Call setTextWithOffset here. * style/RenderTreeUpdater.h: * style/StyleTreeResolver.cpp: (WebCore::Style::TreeResolver::resolveComposedTree): * style/StyleUpdate.cpp: (WebCore::Style::Update::textUpdate const): (WebCore::Style::Update::addText): Add TextUpdate struct similar to ElementUpdate to pass the range to the RenderTreeUpdater. * style/StyleUpdate.h: 2017-08-09 Don Olmstead [WTF] Move TextStream into WTF https://bugs.webkit.org/show_bug.cgi?id=175211 Reviewed by Myles C. Maxfield. No new tests. No change in behavior. * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * dom/ComposedTreeIterator.cpp: * dom/Position.cpp: * dom/Position.h: * dom/Range.cpp: (WebCore::operator<<): * dom/Range.h: * dom/ViewportArguments.cpp: * dom/ViewportArguments.h: * editing/VisiblePosition.cpp: * editing/VisiblePosition.h: * editing/VisibleSelection.cpp: * editing/VisibleSelection.h: * html/HTMLVideoElement.cpp: * html/canvas/CanvasRenderingContext2D.cpp: * page/FrameView.cpp: * page/ViewportConfiguration.cpp: * page/ViewportConfiguration.h: * page/WheelEventDeltaFilter.cpp: * page/animation/CSSPropertyAnimation.cpp: * page/scrolling/AsyncScrollingCoordinator.cpp: * page/scrolling/ScrollingConstraints.cpp: * page/scrolling/ScrollingConstraints.h: * page/scrolling/ScrollingCoordinator.cpp: * page/scrolling/ScrollingCoordinator.h: * page/scrolling/ScrollingStateFixedNode.cpp: * page/scrolling/ScrollingStateFixedNode.h: * page/scrolling/ScrollingStateFrameScrollingNode.cpp: * page/scrolling/ScrollingStateFrameScrollingNode.h: * page/scrolling/ScrollingStateNode.cpp: * page/scrolling/ScrollingStateNode.h: * page/scrolling/ScrollingStateOverflowScrollingNode.cpp: * page/scrolling/ScrollingStateOverflowScrollingNode.h: * page/scrolling/ScrollingStateScrollingNode.cpp: * page/scrolling/ScrollingStateScrollingNode.h: * page/scrolling/ScrollingStateStickyNode.cpp: * page/scrolling/ScrollingStateStickyNode.h: * page/scrolling/ScrollingTree.cpp: * page/scrolling/ScrollingTreeFrameScrollingNode.cpp: * page/scrolling/ScrollingTreeFrameScrollingNode.h: * page/scrolling/ScrollingTreeNode.cpp: * page/scrolling/ScrollingTreeNode.h: * page/scrolling/ScrollingTreeScrollingNode.cpp: * page/scrolling/ScrollingTreeScrollingNode.h: * page/scrolling/mac/ScrollingTreeFixedNode.h: * page/scrolling/mac/ScrollingTreeFixedNode.mm: * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm: * page/scrolling/mac/ScrollingTreeStickyNode.h: * page/scrolling/mac/ScrollingTreeStickyNode.mm: * platform/CalculationValue.cpp: * platform/CalculationValue.h: * platform/LayoutUnit.cpp: * platform/LayoutUnit.h: * platform/Length.cpp: * platform/Length.h: * platform/LengthBox.cpp: * platform/LengthBox.h: * platform/LengthPoint.cpp: * platform/LengthPoint.h: * platform/LengthSize.cpp: * platform/LengthSize.h: * platform/LogMacros.h: * platform/ScrollView.cpp: * platform/ScrollableArea.cpp: * platform/animation/TimingFunction.cpp: * platform/animation/TimingFunction.h: * platform/graphics/BitmapImage.cpp: * platform/graphics/BitmapImage.h: * platform/graphics/Color.cpp: * platform/graphics/Color.h: * platform/graphics/CrossfadeGeneratedImage.cpp: * platform/graphics/CrossfadeGeneratedImage.h: * platform/graphics/FloatPoint.cpp: * platform/graphics/FloatPoint.h: * platform/graphics/FloatPoint3D.cpp: * platform/graphics/FloatPoint3D.h: * platform/graphics/FloatRect.cpp: * platform/graphics/FloatRect.h: * platform/graphics/FloatRoundedRect.cpp: * platform/graphics/FloatRoundedRect.h: * platform/graphics/FloatSize.cpp: * platform/graphics/FloatSize.h: * platform/graphics/FontTaggedSettings.cpp: * platform/graphics/FontTaggedSettings.h: * platform/graphics/GradientImage.cpp: (WebCore::GradientImage::dump const): * platform/graphics/GradientImage.h: * platform/graphics/GraphicsContext.cpp: * platform/graphics/GraphicsContext.h: * platform/graphics/GraphicsLayer.cpp: * platform/graphics/GraphicsLayer.h: (WebCore::GraphicsLayer::dumpAdditionalProperties const): * platform/graphics/GraphicsTypes.cpp: * platform/graphics/GraphicsTypes.h: * platform/graphics/Image.cpp: * platform/graphics/Image.h: * platform/graphics/ImageSource.h: * platform/graphics/IntPoint.cpp: * platform/graphics/IntPoint.h: * platform/graphics/IntRect.cpp: * platform/graphics/IntRect.h: * platform/graphics/IntSize.cpp: * platform/graphics/IntSize.h: * platform/graphics/LayoutPoint.cpp: * platform/graphics/LayoutPoint.h: * platform/graphics/LayoutRect.cpp: * platform/graphics/LayoutRect.h: * platform/graphics/LayoutSize.cpp: * platform/graphics/LayoutSize.h: * platform/graphics/NamedImageGeneratedImage.cpp: * platform/graphics/NamedImageGeneratedImage.h: * platform/graphics/Path.cpp: * platform/graphics/Path.h: * platform/graphics/ca/GraphicsLayerCA.cpp: * platform/graphics/ca/GraphicsLayerCA.h: * platform/graphics/ca/PlatformCAAnimation.cpp: * platform/graphics/ca/PlatformCAAnimation.h: * platform/graphics/ca/PlatformCALayer.cpp: * platform/graphics/ca/PlatformCALayer.h: * platform/graphics/ca/TileController.cpp: * platform/graphics/ca/TileGrid.cpp: * platform/graphics/cg/GraphicsContextCG.cpp: * platform/graphics/cg/PDFDocumentImage.cpp: * platform/graphics/cg/PDFDocumentImage.h: * platform/graphics/cocoa/IOSurface.h: * platform/graphics/cocoa/IOSurface.mm: * platform/graphics/displaylists/DisplayList.cpp: (WebCore::DisplayList::DisplayList::description const): * platform/graphics/displaylists/DisplayList.h: * platform/graphics/displaylists/DisplayListItems.cpp: * platform/graphics/displaylists/DisplayListItems.h: * platform/graphics/displaylists/DisplayListRecorder.cpp: * platform/graphics/displaylists/DisplayListReplayer.cpp: * platform/graphics/filters/DistantLightSource.cpp: * platform/graphics/filters/DistantLightSource.h: * platform/graphics/filters/FEBlend.cpp: * platform/graphics/filters/FEBlend.h: * platform/graphics/filters/FEColorMatrix.cpp: * platform/graphics/filters/FEColorMatrix.h: * platform/graphics/filters/FEComponentTransfer.cpp: * platform/graphics/filters/FEComponentTransfer.h: * platform/graphics/filters/FEComposite.cpp: * platform/graphics/filters/FEComposite.h: * platform/graphics/filters/FEConvolveMatrix.cpp: * platform/graphics/filters/FEConvolveMatrix.h: * platform/graphics/filters/FEDiffuseLighting.cpp: * platform/graphics/filters/FEDiffuseLighting.h: * platform/graphics/filters/FEDisplacementMap.cpp: * platform/graphics/filters/FEDisplacementMap.h: * platform/graphics/filters/FEDropShadow.cpp: * platform/graphics/filters/FEDropShadow.h: * platform/graphics/filters/FEFlood.cpp: * platform/graphics/filters/FEFlood.h: * platform/graphics/filters/FEGaussianBlur.cpp: * platform/graphics/filters/FEGaussianBlur.h: * platform/graphics/filters/FEMerge.cpp: * platform/graphics/filters/FEMerge.h: * platform/graphics/filters/FEMorphology.cpp: * platform/graphics/filters/FEMorphology.h: * platform/graphics/filters/FEOffset.cpp: * platform/graphics/filters/FEOffset.h: * platform/graphics/filters/FESpecularLighting.cpp: * platform/graphics/filters/FESpecularLighting.h: * platform/graphics/filters/FETile.cpp: * platform/graphics/filters/FETile.h: * platform/graphics/filters/FETurbulence.cpp: * platform/graphics/filters/FETurbulence.h: * platform/graphics/filters/FilterEffect.cpp: * platform/graphics/filters/FilterEffect.h: * platform/graphics/filters/FilterOperation.cpp: * platform/graphics/filters/FilterOperation.h: * platform/graphics/filters/FilterOperations.cpp: * platform/graphics/filters/FilterOperations.h: * platform/graphics/filters/LightSource.h: * platform/graphics/filters/PointLightSource.cpp: * platform/graphics/filters/PointLightSource.h: * platform/graphics/filters/SourceAlpha.cpp: * platform/graphics/filters/SourceAlpha.h: * platform/graphics/filters/SourceGraphic.cpp: * platform/graphics/filters/SourceGraphic.h: * platform/graphics/filters/SpotLightSource.cpp: * platform/graphics/filters/SpotLightSource.h: * platform/graphics/transforms/AffineTransform.cpp: * platform/graphics/transforms/AffineTransform.h: * platform/graphics/transforms/IdentityTransformOperation.h: * platform/graphics/transforms/Matrix3DTransformOperation.cpp: * platform/graphics/transforms/Matrix3DTransformOperation.h: * platform/graphics/transforms/MatrixTransformOperation.cpp: * platform/graphics/transforms/MatrixTransformOperation.h: * platform/graphics/transforms/PerspectiveTransformOperation.cpp: * platform/graphics/transforms/PerspectiveTransformOperation.h: * platform/graphics/transforms/RotateTransformOperation.cpp: * platform/graphics/transforms/RotateTransformOperation.h: * platform/graphics/transforms/ScaleTransformOperation.cpp: * platform/graphics/transforms/ScaleTransformOperation.h: * platform/graphics/transforms/SkewTransformOperation.cpp: * platform/graphics/transforms/SkewTransformOperation.h: * platform/graphics/transforms/TransformOperation.cpp: * platform/graphics/transforms/TransformOperation.h: * platform/graphics/transforms/TransformOperations.cpp: * platform/graphics/transforms/TransformOperations.h: * platform/graphics/transforms/TransformationMatrix.cpp: * platform/graphics/transforms/TransformationMatrix.h: * platform/graphics/transforms/TranslateTransformOperation.cpp: * platform/graphics/transforms/TranslateTransformOperation.h: * platform/ios/SelectionRect.cpp: (WebCore::operator<<): * platform/ios/SelectionRect.h: * platform/mac/ScrollAnimatorMac.mm: * platform/text/TextAllInOne.cpp: * rendering/InlineBox.cpp: * rendering/InlineBox.h: * rendering/InlineFlowBox.cpp: (WebCore::InlineFlowBox::outputLineTreeAndMark const): * rendering/InlineFlowBox.h: * rendering/InlineTextBox.cpp: * rendering/InlineTextBox.h: * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::outputLineTreeAndMark const): * rendering/RenderBlockFlow.h: * rendering/RenderLayer.cpp: * rendering/RenderLayerCompositor.cpp: * rendering/RenderObject.cpp: * rendering/RenderObject.h: * rendering/RenderTreeAsText.cpp: * rendering/RenderTreeAsText.h: * rendering/ScrollAlignment.cpp: * rendering/ScrollAlignment.h: * rendering/SimpleLineLayoutCoverage.cpp: * rendering/SimpleLineLayoutFunctions.cpp: * rendering/SimpleLineLayoutFunctions.h: * rendering/style/FillLayer.cpp: * rendering/style/FillLayer.h: * rendering/style/NinePieceImage.cpp: * rendering/style/NinePieceImage.h: * rendering/style/RenderStyleConstants.cpp: * rendering/style/RenderStyleConstants.h: * rendering/svg/SVGRenderTreeAsText.cpp: (WebCore::operator<<): * rendering/svg/SVGRenderTreeAsText.h: (WebCore::operator<<): * svg/SVGLengthValue.cpp: * svg/SVGLengthValue.h: * svg/graphics/SVGImage.cpp: * svg/graphics/SVGImage.h: * svg/graphics/filters/SVGFEImage.cpp: * svg/graphics/filters/SVGFEImage.h: 2017-08-09 Commit Queue Unreviewed, rolling out r219334. https://bugs.webkit.org/show_bug.cgi?id=175398 Caused bug 175023 (Requested by ap on #webkit). Reverted changeset: "[SVG] Leak in SVGAnimatedListPropertyTearOff" https://bugs.webkit.org/show_bug.cgi?id=172545 http://trac.webkit.org/changeset/219334 2017-08-09 Dave Hyatt [Repaint from Layout Removal] Move layer repaint rects into a map https://bugs.webkit.org/show_bug.cgi?id=175393 Reviewed by Zalan Bujtas. Move the two repaint rects held by RenderLayer into a RenderLayerModelObject -> RepaintLayoutRects hash map. RepaintLayoutRects is a new struct that holds both rects. Eventually more objects than just self painting layers will be caching repaint rects, so this takes a first step towards having a common cache for these repaint rects. In addition this change saves memory, since layers that aren't self-painting no longer have empty repaint rects taking up space in RenderLayer. * rendering/RenderBlockLineLayout.cpp: (WebCore::RenderBlockFlow::layoutRunsAndFloats): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::RenderLayer): (WebCore::RenderLayer::updateLayerPositions): (WebCore::RenderLayer::repaintRectIncludingNonCompositingDescendants): (WebCore::RenderLayer::computeRepaintRects): (WebCore::RenderLayer::clearRepaintRects): (WebCore::RenderLayer::updateLayerPositionsAfterScroll): (WebCore::RenderLayer::scrollTo): * rendering/RenderLayer.h: * rendering/RenderLayerModelObject.cpp: (WebCore::RepaintLayoutRects::RepaintLayoutRects): (WebCore::RenderLayerModelObject::willBeDestroyed): (WebCore::RenderLayerModelObject::destroyLayer): (WebCore::RenderLayerModelObject::styleDidChange): (WebCore::RenderLayerModelObject::hasRepaintLayoutRects): (WebCore::RenderLayerModelObject::setRepaintLayoutRects): (WebCore::RenderLayerModelObject::clearRepaintLayoutRects): (WebCore::RenderLayerModelObject::repaintLayoutRects): (WebCore::RenderLayerModelObject::computeRepaintLayoutRects): * rendering/RenderLayerModelObject.h: (WebCore::RepaintLayoutRects::RepaintLayoutRects): 2017-08-09 Kirill Ovchinnikov Old subtitle track is not deleted on 'src' attribute change event https://bugs.webkit.org/show_bug.cgi?id=175031 Reviewed by Eric Carlson. Test: media/track/text-track-src-change.html * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::textTrackReadyStateChanged): * html/HTMLTrackElement.cpp: (WebCore::HTMLTrackElement::loadTimerFired): * html/shadow/MediaControls.cpp: (WebCore::MediaControls::clearTextDisplayContainer): * html/shadow/MediaControls.h: 2017-08-09 Don Olmstead [WinCairo] Fix build after rev 220399 https://bugs.webkit.org/show_bug.cgi?id=175360 Reviewed by Žan Doberšek. No new tests. No change in behavior. * platform/graphics/texmap/TextureMapperGLHeaders.h: 2017-08-09 Charlie Turner [GStreamer][MSE] Add missing lock around getStreamByTrackId https://bugs.webkit.org/show_bug.cgi?id=175323 Reviewed by Xabier Rodriguez-Calvar. Covered by existing tests. * platform/graphics/gstreamer/mse/PlaybackPipeline.cpp: (WebCore::PlaybackPipeline::enqueueSample): Ensure the media source lock is taken before modifiying the track queues indirectly via the iterator use in getTrackId. 2017-08-09 Ms2ger Remove unnecessary copies of PlatformMediaSessionManager::m_sessions https://bugs.webkit.org/show_bug.cgi?id=175375 Reviewed by Sam Weinig. Remove unnecessary copies of PlatformMediaSessionManager::m_sessions. These should have been removed in r207688. No new tests: no behavior change. * platform/audio/PlatformMediaSessionManager.cpp: (WebCore::PlatformMediaSessionManager::applicationWillBecomeInactive const): (WebCore::PlatformMediaSessionManager::applicationDidBecomeActive const): (WebCore::PlatformMediaSessionManager::applicationDidEnterBackground const): (WebCore::PlatformMediaSessionManager::applicationWillEnterForeground const): 2017-08-09 Chris Dumez Reinstate active flag for iterators https://bugs.webkit.org/show_bug.cgi?id=175312 Reviewed by Sam Weinig. NodeIterator / TreeWalker should no longer allow recursive filters after the following change to the DOM specification: - https://github.com/whatwg/dom/pull/359 This patch aligns our behavior with the latest specification. No new tests, updated existing tests. * dom/NodeIterator.cpp: (WebCore::NodeIterator::nextNode): (WebCore::NodeIterator::previousNode): Note that we now also call m_candidateNode.clear() before returning an exception. This was a pre-existing bug that we failed to do so in the exception case but it became more obvious after this change now that we throw. This was causing traversal/moz-bug559526.html to fail otherwise (the filter was called one too many times). The test case is passing in Firefox (The filter is called 4 times and they throw each time). * dom/Traversal.cpp: (WebCore::NodeIteratorBase::NodeIteratorBase): (WebCore::NodeIteratorBase::acceptNode): * dom/Traversal.h: * dom/TreeWalker.cpp: 2017-08-09 Antti Koivisto RenderQuote should not mutate render tree https://bugs.webkit.org/show_bug.cgi?id=175328 Reviewed by Zalan Bujtas. RenderQuote text renderers are currently created and deleted in a quirky fashion using a linked list. This patch moves to a simpler model that guarantees the mutations are always done in controlled fashion during render tree update. * dom/Document.cpp: (WebCore::Document::updateTextRenderer): Move text renderer updating to Document so we can set the inRenderTreeUpdate bit for it too. * dom/Document.h: * dom/Text.cpp: (WebCore::Text::updateRendererAfterContentChange): * rendering/RenderDescendantIterator.h: (WebCore::RenderDescendantIteratorAdapter::at): (WebCore::RenderDescendantConstIteratorAdapter::at const): Add at() function for starting iteration from a specified renderer. * rendering/RenderQuote.cpp: (WebCore::RenderQuote::insertedIntoTree): (WebCore::RenderQuote::willBeRemovedFromTree): Register and unregister quotes to RenderView. Don't do any mutations. (WebCore::RenderQuote::styleDidChange): Invalidate the text renderer but don't mutate it. (WebCore::RenderQuote::updateTextRenderer): (WebCore::RenderQuote::computeText const): (WebCore::RenderQuote::updateRenderers): Compute depth of all render quotes and update the text renderer as needed. (WebCore::RenderQuote::willBeDestroyed): Deleted. (WebCore::RenderQuote::attachQuote): Deleted. (WebCore::RenderQuote::detachQuote): Deleted. (WebCore::RenderQuote::updateDepth): Deleted. Get rid of the linked list. * rendering/RenderQuote.h: * rendering/RenderView.cpp: (WebCore::RenderView::registerQuote): (WebCore::RenderView::unregisterQuote): Maintain a render tree order ListHashSet of RenderQuotes. (WebCore::RenderView::updateSpecialRenderers): Add a function for making additional render tree mutations at the end of a render tree update. Currently this just invokes RenderQuote::updateRenderers. * rendering/RenderView.h: * style/RenderTreeUpdater.cpp: (WebCore::RenderTreeUpdater::commit): Call RenderView::updateSpecialRenderers after committing all other changes. 2017-08-09 Zan Dobersek [Soup] Incorrect conversion in msToSoupDate() https://bugs.webkit.org/show_bug.cgi?id=175320 Reviewed by Carlos Garcia Campos. Original patch by VaL Doroshchuk. * platform/network/soup/NetworkStorageSessionSoup.cpp: (WebCore::msToSoupDate): monthFromDayInYear() returns a value in the [0,11] range, while soup_date_new() expects a month value in the [1,12] range. The return value must be thus incremented by one to match that expectation. 2017-08-08 Wenson Hsieh Unreviewed, rolling out r220393. This patch regresses the performance of WebPage::editorState. Reverted changeset: "[iOS WK2] WKWebView schedules nonstop layout after pressing cmb+b,i,u inside a contenteditable div" https://bugs.webkit.org/show_bug.cgi?id=175116 http://trac.webkit.org/changeset/220393 2017-08-08 Chris Dumez [Beacon] Add support for CORS-preflighting for WK2 / NETWORK_SESSION https://bugs.webkit.org/show_bug.cgi?id=175264 Reviewed by Youenn Fablet. Pass additional information when creating a PingHandle so that the PingLoad can deal with CORS-preflighting on Network process side. Tests: http/wpt/beacon/cors/cors-preflight-arraybufferview-failure.html http/wpt/beacon/cors/cors-preflight-arraybufferview-success.html http/wpt/beacon/cors/cors-preflight-blob-failure.html http/wpt/beacon/cors/cors-preflight-blob-success.html http/wpt/beacon/cors/cors-preflight-cookie.html * WebCore.xcodeproj/project.pbxproj: * loader/CrossOriginAccessControl.cpp: (WebCore::validatePreflightResponse): * loader/CrossOriginAccessControl.h: * loader/CrossOriginPreflightChecker.cpp: (WebCore::CrossOriginPreflightChecker::validatePreflightResponse): * loader/CrossOriginPreflightResultCache.h: * loader/LoaderStrategy.h: * loader/PingLoader.cpp: (WebCore::PingLoader::loadImage): (WebCore::PingLoader::sendPing): (WebCore::PingLoader::sendViolationReport): (WebCore::PingLoader::startPingLoad): * loader/PingLoader.h: * loader/cache/CachedResource.cpp: (WebCore::CachedResource::load): * page/SecurityOrigin.h: 2017-08-08 Sam Weinig Address review feedback from https://bugs.webkit.org/show_bug.cgi?id=175246. * bindings/js/DOMPromiseProxy.h: * css/FontFaceSet.cpp: * css/FontFaceSet.h: 2017-08-08 Devin Rousso Web Inspector: Canvas: support editing WebGL shaders https://bugs.webkit.org/show_bug.cgi?id=124211 Reviewed by Matt Baker. Test: inspector/canvas/updateShader.html * inspector/InspectorCanvasAgent.h: * inspector/InspectorCanvasAgent.cpp: (WebCore::InspectorCanvasAgent::updateShader): * html/canvas/WebGLRenderingContextBase.h: * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::linkProgram): (WebCore::WebGLRenderingContextBase::linkProgramWithoutInvalidatingAttribLocations): Normally, when a program is linked, it invalidates any WebGLUniformLocation associated with the program by incrementing its `linkCount`. In order to allow live editing of shaders, we need to be able to compile and link a shader without invalidating these locations. This patch moves the shader linking logic to its own function that is called by `linkProgram` so that InspectorCanvasAgent can compile and link without invalidation. 2017-08-08 Sam Weinig [WebIDL] Add support for Promise<> attributes https://bugs.webkit.org/show_bug.cgi?id=175246 Reviewed by Yusuke Suzuki. Introduces and adopts DOMPromiseProxy, a new class for binding promises in a more straightforward and safe (from a wrapper world perspective) way. * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSFontFaceCustom.cpp: Removed. * bindings/js/JSFontFaceSetCustom.cpp: Removed. * bindings/js/JSMediaKeySessionCustom.cpp: Removed. * bindings/js/JSServiceWorkerContainerCustom.cpp: Removed. * bindings/js/JSWebGPUCommandBufferCustom.cpp: Removed. Remove custom bindings only needed for promise attributes. Add DOMPromiseProxy.h * Modules/encryptedmedia/MediaKeySession.cpp: (WebCore::MediaKeySession::sessionClosed): (WebCore::MediaKeySession::registerClosedPromise): Deleted. * Modules/encryptedmedia/MediaKeySession.h: * Modules/encryptedmedia/MediaKeySession.idl: Replace custom promise code using the registerPromise idiom with DOMPromiseProxy. * bindings/IDLTypes.h: Add StorageType type alias to allow specifying a specific form for storage. This allows use to use Ref<> for interfaces in DOMPromiseProxy. (WebCore::IDLWrapper::convertToParameterType): Also add convertToParameterType, an annoying hack to workaround the fact WTF::Function can't return references / no * bindings/js/DOMPromiseProxy.h: Added. (WebCore::DOMPromiseProxy): DOMPromiseProxy is a new class (set of classes) to represent promises that works with the standard toJS<> / JSDOMConvert infrastructure used by the bindings generator. From the implementation perspective, it is similar to DOMPromiseDeferred, but instead of receiving one as a parameter, you can initialize it directly in your constructor and start using it. From the bindings perspective, a DOMPromiseProxy can be converted into a JS Promise by calling its promise function, which will either create a new promise, or return a cached one. To make this work, DOMPromiseProxy maintains a Vector of DeferredPromises that hold onto those actualized promises. The reason it has a Vector, is that we need one DeferredPromises per DOMWrapperWorld, just like we need one wrapper for an interface per DOMWrapperWorld in the wrapper cache. In most cases, only the normal world will be in play, so the Vector has an inline capacity of one. In addition, DOMPromiseProxy maintains a Variant of either an Exception or the result value type. This allows the DOMPromiseProxy to be resolved or rejected at anytime. Then, when the bindings request the promise, the stored result / exception can be resolved / rejected into the promise. (WebCore::DOMPromiseProxy): For void promises, we need slightly different semantics (resolve takes no parameters, Value is a bit indicating resolved state), so it is specialized. (WebCore::DOMPromiseProxyWithResolveCallback): In addition to the void specialization, we have DOMPromiseProxyWithResolveCallback. Instead of storing the value of the resolution directly, this specialization allows the owner to specify callback to be called when the resolved value is needed. This is needed to avoid reference cycles when the resolved value is the owner such as is the case with FontFace and FontFaceSet. * bindings/js/JSDOMConvertPromise.h: (WebCore::JSConverter>::convert): Add converter that calls through to the DOMPromiseProxy function promise. * bindings/js/JSDOMPromiseDeferred.cpp: (WebCore::DeferredPromise::callFunction): (WebCore::DeferredPromise::reject): * bindings/js/JSDOMPromiseDeferred.h: (WebCore::DeferredPromise::create): (WebCore::DeferredPromise::DeferredPromise): Add a new create function for DeferredPromise that creates the JSPromiseDeferred for you. Also adds a mode to DeferredPromise to allow keeping the promise after resolution. Maintain the old behavior as the default. Change reject to take an Exception as sink rather than an r-value, to allow DOMPromiseProxy to copy a Exception into multiple DeferredPromises. For callers already moving into reject, this should be no change. * bindings/scripts/CodeGeneratorJS.pm: (AddToIncludesForIDLType): (GenerateParametersCheck): (GenerateImplementationFunctionCall): (NativeToJSValueDOMConvertNeedsState): (NativeToJSValueDOMConvertNeedsGlobalObject): Add support DOMPromiseProxy. For now, this means a new extended attribute, [PromiseProxy], but once I convert all the existing promises over to using DOMPromiseProxy, it will be removed. Also specify the right #includes for promises and necessary parameters for conversion. * bindings/scripts/IDLAttributes.json: Add [PromiseProxy], a temporary extended attribute for using DOMPromiseProxy. * css/FontFace.cpp: * css/FontFace.h: * css/FontFace.idl: * css/FontFaceSet.cpp: * css/FontFaceSet.h: * css/FontFaceSet.idl: Replace custom promise code using the registerPromise idiom with DOMPromiseProxyWithResolveCallback. The callback is necessary for these two classes since the value the resolve is themselves, and using a normal resolve would create a cycle. * html/canvas/WebGPUCommandBuffer.cpp: * html/canvas/WebGPUCommandBuffer.h: * html/canvas/WebGPUCommandBuffer.idl: * platform/graphics/cocoa/GPUCommandBufferMetal.mm: * platform/graphics/gpu/GPUCommandBuffer.cpp: * platform/graphics/gpu/GPUCommandBuffer.h: Replace custom promise code using the registerPromise idiom with DOMPromiseProxy. * page/NavigatorBase.cpp: (WebCore::NavigatorBase::NavigatorBase): * page/NavigatorBase.h: Forward declare ServiceWorkerContainer and add an explicit constructor to allow removing #include of ServiceWorkerContainer.h in the header, avoiding an #include cycle. * workers/ServiceWorkerContainer.cpp: * workers/ServiceWorkerContainer.h: * workers/ServiceWorkerContainer.idl: Replace custom promise code using the registerPromise idiom with DOMPromiseProxy. * bindings/scripts/test/JS/JSTestObj.cpp: * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp: * bindings/scripts/test/TestObj.idl: Add / update tests. 2017-08-08 John Wilander Resource Load Statistics: Merge of dataRecordsRemoved should use std::max() https://bugs.webkit.org/show_bug.cgi?id=175348 Reviewed by Chris Dumez. No new tests. Online change of a statistic that doesn't affect logic flow. * loader/ResourceLoadStatistics.cpp: (WebCore::ResourceLoadStatistics::merge): Now uses std::max() instead of addition. 2017-08-08 Brent Fulgham Sandbox flags do not support document.domain control https://bugs.webkit.org/show_bug.cgi?id=175281 Reviewed by Chris Dumez. Update the 'setDomain' logic to honor the sandbox properties as defined in the current HTML5 specification. This brings us in line with how Chrome and other browsers have worked for some time. Test: fast/frames/sandboxed-iframe-domain.html * dom/Document.cpp: (WebCore::Document::setDomain): Add check for sandbox flag (with appropriate error message) * dom/SecurityContext.h: 2017-08-08 Jeremy Jones Change fast seek logic to prevent ping-ponging. https://bugs.webkit.org/show_bug.cgi?id=175167 rdar://problem/32936116 Reviewed by Jer Noble. Updated test: media/video-fast-seek.html Changed fast seek behavior to always seek early than seek time; and after current time when seeking forward. This prevents ping-ponging, where a fast seek overshoots the target looking for a keyframe. A subsequent seek will suddenly be on the other side of current time and will search in the opposite direction for a key frame; repeat. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::fastSeek): 2017-08-08 Ms2ger Unreviewed. Correct the function name in a debug message. https://bugs.webkit.org/show_bug.cgi?id=175262 No new tests: debug logs are not tested. * platform/audio/PlatformMediaSessionManager.cpp: (WebCore::PlatformMediaSessionManager::applicationDidBecomeActive const): 2017-08-08 Brent Fulgham Unreviewed build fix after r220376. Don't attempt to use isPublicSuffix when building without that feature enabled. * dom/Document.cpp: (WebCore::Document::domainIsRegisterable const): 2017-08-08 Michael Catanzaro [CMake] Properly test if compiler supports compiler flags https://bugs.webkit.org/show_bug.cgi?id=174490 Reviewed by Konstantin Tokarev. * CMakeLists.txt: * PlatformGTK.cmake: * PlatformWPE.cmake: 2017-08-08 Zan Dobersek [GStreamer] Don't use GraphicsContext3D in VideoTextureCoperGStreamer https://bugs.webkit.org/show_bug.cgi?id=174774 Reviewed by Carlos Garcia Campos. VideoTextureCoperGStreamer class creates a new GraphicsContext3D internally that's used to render to whichever OpenGL context is current. Such usage doesn't add anything to the user since there's no underlying offscreen-based OpenGL context created, and instead all GraphicsContext3D calls are directly translated to usual OpenGL API calls. We should avoid using GraphicsContext3D in such cases and instead use direct OpenGL API calls. This patch achieves that for the VideoTextureCoperGStreamer class. A GraphicsContext3D object is still created because it's needed to construct an instance of the TextureMapperShaderProgram class, but this will be removed as soon as TextureMapperShaderProgram drops the GraphicsContext3D dependence. No new tests -- no change in behavior. * platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp: (WebCore::VideoTextureCopierGStreamer::VideoTextureCopierGStreamer): (WebCore::VideoTextureCopierGStreamer::~VideoTextureCopierGStreamer): (WebCore::VideoTextureCopierGStreamer::copyVideoTextureToPlatformTexture): * platform/graphics/gstreamer/VideoTextureCopierGStreamer.h: (WebCore::VideoTextureCopierGStreamer::resultTexture): 2017-08-08 Zan Dobersek [TexMap] Drop GC3D* type usage from TextureMapperPlatformLayer{Buffer,Proxy} https://bugs.webkit.org/show_bug.cgi?id=175314 Reviewed by Carlos Garcia Campos. Switch to using OpenGL types in the TextureMapperPlatformLayerBuffer and TextureMapperPlatformLayerProxy classes, instead of the equivalent GC3D* types provided in the GraphicsTypes3D.h header. No new tests -- no change in behavior. * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp: (WebCore::TextureMapperPlatformLayerBuffer::TextureMapperPlatformLayerBuffer): (WebCore::TextureMapperPlatformLayerBuffer::canReuseWithoutReset): * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h: * platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp: (WebCore::TextureMapperPlatformLayerProxy::getAvailableBuffer): * platform/graphics/texmap/TextureMapperPlatformLayerProxy.h: 2017-08-08 Zan Dobersek [TexMap] Don't use GraphicsContext3D in ClipStack https://bugs.webkit.org/show_bug.cgi?id=174776 Reviewed by Carlos Garcia Campos. Any GraphicsContext3D object that's passed to ClipStack methods is of the render-to-current-context nature, meaning there's no internally owned GL context that has to be properly handled and all calls are simply passed to OpenGL APIs. We should drop such (non-)usage of GraphicsContext3D in favor of direct OpenGL API invocations. This patch covers TextureMapper's ClipStack. Call sites to the apply() and applyIfNeeded() are modified to not pass a reference to any GraphicsContext3D object. Internally, OpenGL API entrypoints and constants are used instead of GraphicsContext3D invocations. No new tests -- no change in behavior. * platform/graphics/texmap/BitmapTextureGL.cpp: (WebCore::BitmapTextureGL::clearIfNeeded): (WebCore::BitmapTextureGL::bindAsSurface): * platform/graphics/texmap/ClipStack.cpp: (WebCore::ClipStack::apply): (WebCore::ClipStack::applyIfNeeded): * platform/graphics/texmap/ClipStack.h: * platform/graphics/texmap/TextureMapperGL.cpp: (WebCore::TextureMapperGL::bindDefaultSurface): (WebCore::TextureMapperGL::beginScissorClip): (WebCore::TextureMapperGL::beginClip): (WebCore::TextureMapperGL::endClip): 2017-08-08 Javier Fernandez Not possible to remove the 'li' element inside the table cell https://bugs.webkit.org/show_bug.cgi?id=173148 Reviewed by Ryosuke Niwa. We need to add a new case for breaking out empty list items when they are at the start of an editable area. Since list items can be also inside table cells, we need to consider this kind of elements as well. Tests: editing/deleting/delete-list-items-in-table-cell-1.html editing/deleting/delete-list-items-in-table-cell-2.html editing/deleting/delete-list-items-in-table-cell-3.html editing/deleting/delete-list-items-in-table-cell-4.html editing/deleting/delete-list-items-in-table-cell-5.html editing/deleting/delete-list-items-in-table-cell-6.html editing/deleting/delete-list-items-in-table-cell-7.html editing/deleting/delete-list-items-in-table-cell-8.html * editing/TypingCommand.cpp: (WebCore::TypingCommand::deleteKeyPressed): 2017-08-08 Zan Dobersek [TexMap] Isolate the TextureMapperPlatformLayerProxyProvider class https://bugs.webkit.org/show_bug.cgi?id=175316 Reviewed by Carlos Garcia Campos. Move the TextureMapperPlatformLayerProxyProvider class (which is the type aliased to PlatformLayer for threaded CoordGraphics) into its own header file. This prevents including the TextureMapperPlatformLayerProxy.h header file in MediaPlayerPrivateGStreamerBase.h, avoiding spilling OpenGL types and function declarations before the GStreamer GL headers include them later in the MediaPlayerPrivateGStreamerBase implementation file. In the MediaPlayerPrivateGStreamerBase.h header file, only the new header is included, and a forward declaration of the TextureMapperPlatformLayerProxy class is used. proxy() and swapBuffersIfNeeded() methods are moved into the implementation file to avoid requiring the full definition of the TextureMapperPlatformLayerProxy class. Similar is done for the TextureMapperGC3DPlatformLayer class and the Cairo-specific implementation of the ImageBufferData class. The CoordinatedGraphicsLayer implementation file also gains an include of the TextureMapperPlatformLayerProxyProvider.h header since it requires the full definition of that class. No new tests -- no change in behavior. * platform/graphics/cairo/ImageBufferCairo.cpp: (WebCore::ImageBufferData::proxy const): * platform/graphics/cairo/ImageBufferDataCairo.h: * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: (WebCore::MediaPlayerPrivateGStreamerBase::updateTexture): (WebCore::MediaPlayerPrivateGStreamerBase::proxy const): (WebCore::MediaPlayerPrivateGStreamerBase::swapBuffersIfNeeded): * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h: * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.cpp: * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.h: * platform/graphics/texmap/TextureMapperPlatformLayerProxy.h: * platform/graphics/texmap/TextureMapperPlatformLayerProxyProvider.h: Added. * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp: 2017-08-08 Zan Dobersek Unreviewed. Follow-up to r220392 that fixes build on configurations that disable USE(GSTREAMER_GL). * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: (WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor): When creating the BitmapTextureGL object, also provide an initialized TextureMapperContextAttributes object. 2017-08-08 Zan Dobersek [TexMap] Group GL header file inclusions in a single header file https://bugs.webkit.org/show_bug.cgi?id=175313 Reviewed by Carlos Garcia Campos. Add a helper header file to the TextureMapper subsystem that includes the OpenGL headers, properly addressing the build configuration to include headers as provided by either libepoxy, the OpenGL ES library, or the OpenGL library. TextureMapperContextAttributes implementation file is the only one that can leverage the header at the moment, but more will follow. * platform/graphics/texmap/TextureMapperContextAttributes.cpp: * platform/graphics/texmap/TextureMapperGLHeaders.h: Copied from Source/WebCore/platform/graphics/texmap/TextureMapperContextAttributes.cpp. 2017-08-08 Wenson Hsieh [iOS WK2] WKWebView schedules nonstop layout after pressing cmb+b,i,u inside a contenteditable div https://bugs.webkit.org/show_bug.cgi?id=175116 Reviewed by Darin Adler and Ryosuke Niwa. WebCore support for WebPage::editorState refactoring. See WebKit ChangeLogs for more detail. Tests: EditorStateTests.TypingAttributesBold EditorStateTests.TypingAttributesItalic EditorStateTests.TypingAttributesUnderline EditorStateTests.TypingAttributesTextAlignmentAbsoluteAlignmentOptions EditorStateTests.TypingAttributesTextAlignmentStartEnd EditorStateTests.TypingAttributesTextAlignmentDirectionalText EditorStateTests.TypingAttributesTextColor EditorStateTests.TypingAttributesMixedStyles EditorStateTests.TypingAttributesLinkColor * css/StyleProperties.cpp: (WebCore::StyleProperties::propertyAsColor const): (WebCore::StyleProperties::propertyAsValueID const): Introduces some helper functions in StyleProperties to convert CSS property values to Color or a CSSValueID. * css/StyleProperties.h: * editing/EditingStyle.cpp: (WebCore::EditingStyle::hasStyle): Pull out logic in selectionStartHasStyle that asks for a style TriState into EditingStyle::hasStyle. This is because WebPage::editorState will now query for multiple styles at the selection start, but selectionStartHasStyle currently recomputes styleAtSelectionStart every time it is called. To prevent extra work from being done, we can just call selectionStartHasStyle once and use ask for EditingStyle::hasStyle on the computed EditingStyle at selection start. * editing/EditingStyle.h: * editing/Editor.cpp: (WebCore::Editor::selectionStartHasStyle const): 2017-08-08 Zan Dobersek [TexMap] Add TextureMapperContextAttributes https://bugs.webkit.org/show_bug.cgi?id=175311 Reviewed by Carlos Garcia Campos. Add and use TextureMapperContextAttributes, a slim struct that holds information about the type and extensions supported by the OpenGL context that's being used for one specific TextureMapperGL instance. This struct is initialized in the TextureMapperGL constructor for the OpenGL context that's been made current on that thread, and that will be used for that TextureMapperGL instance through its lifetime. The struct is then also copied into any BitmapTextureGL objects that have been created through this TextureMapperGL (or its texture pool). The struct is initialized with information about GLES2 support (which is at this point done through the USE_OPENGL_ES_2 macro) and about specific OpenGL extensions that are supported. These are then used in TextureMapperGL (NPOT textures) and BitmapTextureGL (BGRA support, sub-image unpacking) to deploy specific optimizations or workarounds. This ultimately serves as a replacement for clunky static functions that need to operate on GraphicsContext3D objects to retrieve this information. No new tests -- no change in behavior. * platform/TextureMapper.cmake: * platform/graphics/texmap/BitmapTextureGL.cpp: (WebCore::BitmapTextureGL::BitmapTextureGL): (WebCore::BitmapTextureGL::updateContentsNoSwizzle): (WebCore::BitmapTextureGL::updateContents): (WebCore::driverSupportsSubImage): Deleted. * platform/graphics/texmap/BitmapTextureGL.h: (WebCore::BitmapTextureGL::create): * platform/graphics/texmap/BitmapTexturePool.cpp: (WebCore::BitmapTexturePool::BitmapTexturePool): (WebCore::BitmapTexturePool::createTexture): * platform/graphics/texmap/BitmapTexturePool.h: * platform/graphics/texmap/TextureMapperContextAttributes.cpp: Added. (WebCore::TextureMapperContextAttributes::initialize): * platform/graphics/texmap/TextureMapperContextAttributes.h: Added. * platform/graphics/texmap/TextureMapperGL.cpp: (WebCore::TextureMapperGL::TextureMapperGL): (WebCore::TextureMapperGL::drawTexture): (WebCore::TextureMapperGL::drawTexturedQuadWithProgram): (WebCore::TextureMapperGL::createTexture): (WebCore::driverSupportsNPOTTextures): Deleted. * platform/graphics/texmap/TextureMapperGL.h: 2017-08-08 Zan Dobersek [TexMap] Don't expose GraphicsContext3D object https://bugs.webkit.org/show_bug.cgi?id=175310 Reviewed by Carlos Garcia Campos. Remove the GraphicsContext3D getter from the TextureMapperGL class. Instead, the clearColor() method is added that's to be used by the CoordinatedGraphicsScene class which was accessing the GraphicsContext3D object for this purpose. * platform/graphics/texmap/TextureMapper.h: * platform/graphics/texmap/TextureMapperGL.cpp: (WebCore::TextureMapperGL::clearColor): * platform/graphics/texmap/TextureMapperGL.h: (WebCore::TextureMapperGL::graphicsContext3D const): Deleted. 2017-08-07 Simon Fraser RenderStyle:diff() was inadvertently doing deep compares of StyleRareNonInheritedData etc https://bugs.webkit.org/show_bug.cgi?id=175304 Reviewed by Tim Horton. r210758 changed DataRef::get() from returning a pointer to a reference. This caused all the places in RenderStyle::diff() and related functions, where we intended to do a quick pointer comparison, to doing deep compares via operator!=. This made the code slightly slower. Fix by exposing ptr() on DataRef and using it wherever we wish to do pointer comparison. * rendering/style/DataRef.h: (WebCore::DataRef::ptr const): * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::inheritedDataShared const): (WebCore::RenderStyle::changeAffectsVisualOverflow const): (WebCore::RenderStyle::changeRequiresLayout const): (WebCore::RenderStyle::changeRequiresRecompositeLayer const): (WebCore::RenderStyle::listStyleImage const): Expand the function onto multiple lines. 2017-08-07 Simon Fraser Add a fast path for rotate() and rotateZ() transform parsing https://bugs.webkit.org/show_bug.cgi?id=175308 Reviewed by Zalan Bujtas. Fast paths only existed for translate-related functions, matrix3d() and scale3d(). Add rotate() and rotateX(), which gives a small boost to one of the MotionMark tests. * css/parser/CSSParserFastPaths.cpp: (WebCore::parseSimpleAngle): (WebCore::parseTransformAngleArgument): (WebCore::parseSimpleTransformValue): (WebCore::transformCanLikelyUseFastPath): 2017-08-07 Simon Fraser Re-order the tests in RenderLayerCompositor::requiresCompositingLayer() for performance https://bugs.webkit.org/show_bug.cgi?id=175306 Reviewed by Tim Horton. Re-order the tests for compositing reasons so that reasons more likely to happen are higher in the list. * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::requiresCompositingLayer const): (WebCore::RenderLayerCompositor::requiresOwnBackingStore const): 2017-08-07 Simon Fraser Avoid a hash lookup in FilterInfo::remove() https://bugs.webkit.org/show_bug.cgi?id=175301 Reviewed by Sam Weinig. FilterInfo::remove() always called map().remove(&layer)), even when layer.m_hasFilterInfo was false (and even asserted that layer.m_hasFilterInfo == map().contains(&layer)). So we can early return if layer.m_hasFilterInfo is false. * rendering/RenderLayerFilterInfo.cpp: (WebCore::RenderLayer::FilterInfo::getIfExists): (WebCore::RenderLayer::FilterInfo::remove): 2017-08-07 Simon Fraser Make TransformOperation::type() non-virtual https://bugs.webkit.org/show_bug.cgi?id=175297 Reviewed by Sam Weinig. Store the OperationType in the base class so that type() and isSameType() can be non-virtual. Small perf win on some benchmarks. * platform/graphics/transforms/IdentityTransformOperation.h: * platform/graphics/transforms/Matrix3DTransformOperation.h: * platform/graphics/transforms/MatrixTransformOperation.h: * platform/graphics/transforms/PerspectiveTransformOperation.h: * platform/graphics/transforms/RotateTransformOperation.cpp: (WebCore::RotateTransformOperation::blend): * platform/graphics/transforms/RotateTransformOperation.h: * platform/graphics/transforms/ScaleTransformOperation.cpp: (WebCore::ScaleTransformOperation::blend): * platform/graphics/transforms/ScaleTransformOperation.h: * platform/graphics/transforms/SkewTransformOperation.cpp: (WebCore::SkewTransformOperation::blend): * platform/graphics/transforms/SkewTransformOperation.h: * platform/graphics/transforms/TransformOperation.h: (WebCore::TransformOperation::TransformOperation): (WebCore::TransformOperation::type const): (WebCore::TransformOperation::isSameType const): * platform/graphics/transforms/TranslateTransformOperation.cpp: (WebCore::TranslateTransformOperation::blend): * platform/graphics/transforms/TranslateTransformOperation.h: 2017-08-07 Simon Fraser Inline ~Color and Color::isExtended() https://bugs.webkit.org/show_bug.cgi?id=175293 Reviewed by Zalan Bujtas. The Color destructor and Color::isExtended() show up on profiles, so inline them. Before r207265 the destructor was inlined. Also make sure that LengthSize::operator== is inlined, which it was not (according to profiles). * platform/LengthSize.h: (WebCore::operator==): * platform/graphics/Color.cpp: (WebCore::Color::~Color): Deleted. (WebCore::Color::isExtended const): Deleted. * platform/graphics/Color.h: (WebCore::Color::~Color): (WebCore::Color::isExtended const): 2017-08-04 Brent Fulgham Implement the HTML5 same-origin restriction specification https://bugs.webkit.org/show_bug.cgi?id=175226 Reviewed by Chris Dumez. Follow the algorithms defined in the HTML5 specification for relaxing the same-origin restriction. We were missing a few steps related to checking for public suffix and presence of a browsing context. Tested by new TestWebKitAPI tests. * dom/Document.cpp: (WebCore::Document::domainIsRegisterable): Added helper function. (WebCore::Document::setDomain): 2017-08-07 Devin Rousso Web Inspector: Preview Canvas path when viewing a recording https://bugs.webkit.org/show_bug.cgi?id=174967 Reviewed by Brian Burg. Tests: fast/canvas/2d.currentPoint.html fast/canvas/2d.getPath.modification.html fast/canvas/2d.getPath.newobject.html fast/canvas/2d.setPath.html * html/canvas/CanvasPath.idl: * html/canvas/CanvasPath.h: * html/canvas/CanvasPath.cpp: (WebCore::CanvasPath::currentX const): (WebCore::CanvasPath::currentY const): * html/canvas/CanvasRenderingContext2D.idl: * html/canvas/CanvasRenderingContext2D.h: * html/canvas/CanvasRenderingContext2D.cpp: (WebCore::CanvasRenderingContext2D::setPath): (WebCore::CanvasRenderingContext2D::getPath const): * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::setInspectorAdditionsEnabled): (WebCore::RuntimeEnabledFeatures::inspectorAdditionsEnabled const): Add runtime flag for added IDL items above so that they are only usable within the inspector process. The runtime flag is not enabled from anywhere else as of now. * inspector/InspectorCanvas.cpp: (WebCore::InspectorCanvas::buildInitialState): Send current path as part of the InitialState. Drive-by: deduplicate more string values. 2017-08-07 Chris Dumez Update sendBeacon() to rely on FetchBody instead of the whole FetchRequest https://bugs.webkit.org/show_bug.cgi?id=175280 Reviewed by Youenn Fablet. Update sendBeacon() to rely on FetchBody instead of the whole FetchRequest. FetchBody for data extraction is really the only thing we need at the moment. The new code also properly sets the CORS mode, which will be needed for Bug 175264. * Modules/beacon/NavigatorBeacon.cpp: (WebCore::NavigatorBeacon::sendBeacon): 2017-08-07 Michael Catanzaro -Wimplicit-fallthrough warning in ComputedStyleExtractor::propertyValue https://bugs.webkit.org/show_bug.cgi?id=174469 Reviewed by Simon Fraser. Add a RELEASE_ASSERT_NOT_REACHED to silence this warning. * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::propertyValue): 2017-08-06 Filip Pizlo Primitive auxiliaries and JSValue auxiliaries should have separate gigacages https://bugs.webkit.org/show_bug.cgi?id=174919 Reviewed by Keith Miller. No new tests because no change in behavior. Adapting to API changes - we now specify the AlignedMemoryAllocator differently and we need to be specific about which Gigacage we're using. * bindings/js/WebCoreJSClientData.cpp: (WebCore::JSVMClientData::JSVMClientData): * platform/graphics/cocoa/GPUBufferMetal.mm: (WebCore::GPUBuffer::GPUBuffer): 2017-08-07 Basuke Suzuki [Curl] Add abstraction layer of cookie jar implementation for Curl port https://bugs.webkit.org/show_bug.cgi?id=174943 Reviewed by Brent Fulgham. * platform/network/curl/CookieJarCurl.cpp: (WebCore::CookieJarCurlFileSystem::setCookiesFromDOM): (WebCore::CookieJarCurlFileSystem::cookiesForDOM): (WebCore::CookieJarCurlFileSystem::cookieRequestHeaderFieldValue): (WebCore::CookieJarCurlFileSystem::cookiesEnabled): (WebCore::CookieJarCurlFileSystem::getRawCookies): (WebCore::CookieJarCurlFileSystem::deleteCookie): (WebCore::CookieJarCurlFileSystem::getHostnamesWithCookies): (WebCore::CookieJarCurlFileSystem::deleteCookiesForHostnames): (WebCore::CookieJarCurlFileSystem::deleteAllCookies): (WebCore::CookieJarCurlFileSystem::deleteAllCookiesModifiedSince): (WebCore::cookiesForDOM): (WebCore::setCookiesFromDOM): (WebCore::cookieRequestHeaderFieldValue): (WebCore::cookiesEnabled): (WebCore::getRawCookies): (WebCore::deleteCookie): (WebCore::getHostnamesWithCookies): (WebCore::deleteCookiesForHostnames): (WebCore::deleteAllCookies): (WebCore::deleteAllCookiesModifiedSince): * platform/network/curl/CookieJarCurl.h: Added. * platform/network/curl/CurlContext.cpp: * platform/network/curl/CurlContext.h: (WebCore::CurlContext::cookieJar): 2017-08-07 Brady Eidson Implement most of ServiceWorkerContainer::addRegistration. https://bugs.webkit.org/show_bug.cgi?id=175237 Reviewed by Andy Estes. No new tests (Covered by changes to existing tests). There's still so much supporting infrastructure to add with these early patches that I'm still moving them in baby steps for now, hence not implementing register() all in one shot. Things will start moving very quickly once we no longer need to add lots of new primitives in each change. * CMakeLists.txt: * DerivedSources.make: * WebCore.xcodeproj/project.pbxproj: * page/DOMWindow.cpp: (WebCore::DOMWindow::navigator const): * page/Navigator.cpp: (WebCore::Navigator::Navigator): Make the constructor take a ScriptExecutionContext for creation of objects where its import (e.g. ServiceWorkerContainer). * page/Navigator.h: * page/WorkerNavigator.cpp: (WebCore::WorkerNavigator::WorkerNavigator): Ditto. * page/WorkerNavigator.h: * page/NavigatorBase.cpp: (WebCore::NavigatorBase::NavigatorBase): Create the ServiceWorkerContainer upfront with the passed-in ScriptExecutionContext. (WebCore::NavigatorBase::serviceWorker): * page/NavigatorBase.h: Make ServiceWorkerContainer into an ActiveDOMObject. This will eventually be necessary for Document suspension reasons, but is also necessary because it also needs to be a ContextDestructionObserver (which ActiveDOMObject is): * workers/ServiceWorkerContainer.cpp: (WebCore::ServiceWorkerContainer::ServiceWorkerContainer): (WebCore::ServiceWorkerContainer::ready): (WebCore::ServiceWorkerContainer::addRegistration): (WebCore::ServiceWorkerContainer::getRegistration): (WebCore::ServiceWorkerContainer::getRegistrations): (WebCore::ServiceWorkerContainer::activeDOMObjectName const): (WebCore::ServiceWorkerContainer::canSuspendForDocumentSuspension const): (WebCore::rejectLater): Deleted. (WebCore::ServiceWorkerContainer::eventTargetInterface const): Deleted. (WebCore::ServiceWorkerContainer::scriptExecutionContext const): Deleted. * workers/ServiceWorkerContainer.h: * workers/ServiceWorkerContainer.idl: Add updateViaCache, etc: * workers/ServiceWorkerRegistration.cpp: (WebCore::ServiceWorkerRegistration::updateViaCache const): (WebCore::ServiceWorkerRegistration::update): (WebCore::ServiceWorkerRegistration::unregister): * workers/ServiceWorkerRegistration.h: * workers/ServiceWorkerRegistration.idl: * workers/ServiceWorkerUpdateViaCache.h: Copied from Source/WebCore/workers/ServiceWorkerRegistration.idl. * workers/ServiceWorkerUpdateViaCache.idl: Copied from Source/WebCore/workers/ServiceWorkerRegistration.idl. * workers/WorkerGlobalScope.cpp: (WebCore::WorkerGlobalScope::navigator): (WebCore::WorkerGlobalScope::navigator const): Deleted. * workers/WorkerGlobalScope.h: * workers/WorkerType.h: Copied from Source/WebCore/workers/ServiceWorkerRegistration.idl. * workers/WorkerType.idl: Copied from Source/WebCore/workers/ServiceWorkerRegistration.idl. 2017-08-07 Ryan Haddad Unreviewed, rolling out r220299. This change caused LayoutTest inspector/dom-debugger/dom- breakpoints.html to fail. Reverted changeset: "Web Inspector: capture async stack trace when workers/main context posts a message" https://bugs.webkit.org/show_bug.cgi?id=167084 http://trac.webkit.org/changeset/220299 2017-08-07 Brian Burg Cleanup: simplify WebSockets code for RuntimeEnabledFeatures https://bugs.webkit.org/show_bug.cgi?id=175190 Reviewed by Sam Weinig. This runtime enabled flag is not used by anything. It was added for V8 in . * Modules/websockets/WebSocket.cpp: (WebCore::WebSocket::setIsAvailable): Deleted. (WebCore::WebSocket::isAvailable): Deleted. * Modules/websockets/WebSocket.h: * Modules/websockets/WebSocket.idl: * page/RuntimeEnabledFeatures.cpp: (WebCore::RuntimeEnabledFeatures::webSocketEnabled const): Deleted. * page/RuntimeEnabledFeatures.h: 2017-08-07 Brian Burg Remove CANVAS_PATH compilation guard https://bugs.webkit.org/show_bug.cgi?id=175207 Reviewed by Sam Weinig. * Configurations/FeatureDefines.xcconfig: * html/canvas/DOMPath.h: * html/canvas/DOMPath.idl: 2017-08-07 Carlos Alberto Lopez Perez [WPE][CMake] Only pass pkg-config CFLAGS from (E)GL when not using libepoxy. https://bugs.webkit.org/show_bug.cgi?id=175125 Reviewed by Michael Catanzaro. No change of behavior, covered by existing tests. * CMakeLists.txt: Instead of negating 3 times the use of libepoxy move the logic for (E)GL detection inside an else() block. 2017-08-07 Antti Koivisto REGRESSION (r219121): Airmail 3 prints header part only. https://bugs.webkit.org/show_bug.cgi?id=175258 Reviewed by Andreas Kling. When a WK1 WebViw is printed via AppKit view hierarchy it won't explictly set the page width but uses the existing width. r219121 assumes that all printing code paths set the page width. No test, there appears to be no good way to test AppKit printing behaviors without adding complicated new testing infrastructure. * rendering/RenderView.cpp: (WebCore::RenderView::layout): If we are in printing layout and don't have page width set yet then use the current view width. This matches the behavior prior r219121. 2017-08-05 Youenn Fablet [Fetch API] Response should keep all ResourceResponse information https://bugs.webkit.org/show_bug.cgi?id=175099 Reviewed by Sam Weinig. No change of behavior, covered by existing tests. Disabling filtering of resource response at DocumentThreadableLoader for fetch API and doing the filtering at FetchResponse level. This requires passing the tainting parameter to FetchResponse. For that purpose, we store the tainting on the ResourceResponse itself. This allows mimicking the concept of internal response from the fetch spec. This might be useful for future developments related to caching the responses. The body is now also stored in FetchResponse so a flag is added to ensure we only expose the body if allowed. Changing storage of opaque redirect information to keep the redirection information in the response. * Modules/fetch/FetchBodyOwner.cpp: (WebCore::FetchBodyOwner::blob): (WebCore::FetchBodyOwner::consumeNullBody): * Modules/fetch/FetchBodyOwner.h: * Modules/fetch/FetchLoader.cpp: (WebCore::FetchLoader::start): * Modules/fetch/FetchResponse.cpp: (WebCore::FetchResponse::BodyLoader::didReceiveResponse): (WebCore::FetchResponse::consume): (WebCore::FetchResponse::consumeBodyAsStream): (WebCore::FetchResponse::createReadableStreamSource): * Modules/fetch/FetchResponse.h: * loader/DocumentThreadableLoader.cpp: (WebCore::DocumentThreadableLoader::responseReceived): (WebCore::DocumentThreadableLoader::didReceiveResponse): (WebCore::DocumentThreadableLoader::didFinishLoading): (WebCore::DocumentThreadableLoader::loadRequest): * loader/DocumentThreadableLoader.h: * loader/SubresourceLoader.cpp: (WebCore::SubresourceLoader::willSendRequestInternal): * loader/cache/CachedResource.cpp: (WebCore::CachedResource::setBodyDataFrom): (WebCore::CachedResource::setResponse): * platform/network/ResourceResponseBase.cpp: (WebCore::ResourceResponseBase::crossThreadData const): (WebCore::ResourceResponseBase::fromCrossThreadData): (WebCore::ResourceResponseBase::filter): * platform/network/ResourceResponseBase.h: (WebCore::ResourceResponseBase::setTainting): (WebCore::ResourceResponseBase::tainting const): (WebCore::ResourceResponseBase::encode const): (WebCore::ResourceResponseBase::decode): 2017-08-05 Carlos Garcia Campos WebDriver: use in-view center point for clicks instead of bounding box center point https://bugs.webkit.org/show_bug.cgi?id=174863 Reviewed by Simon Fraser. Make DOMRect, and FloatPoint::narrowPrecision() available to WebKit layer. Also add FrameView::clientToDocumentPoint(). * WebCore.xcodeproj/project.pbxproj: * dom/Element.h: * page/FrameView.h: * platform/graphics/FloatPoint.h: 2017-08-05 Carlos Garcia Campos getClientRects doesn't work with list box option elements https://bugs.webkit.org/show_bug.cgi?id=175016 Reviewed by Darin Adler. Since HTMLOptionElement and HTMLOptGroupElement don't have a renderer, we are always returning an empty list from getClientRects. This is working fine in both chromium and firefox, option elements return its own bounding box and group elements return the bounding box of the group label and all its children items. Test: fast/dom/HTMLSelectElement/listbox-items-client-rects.html * dom/Element.cpp: (WebCore::listBoxElementBoundingBox): Helper function to return the bounding box of a HTMLOptionElement or HTMLOptGroupElement element. (WebCore::Element::getClientRects): Use listBoxElementBoundingBox() in case of HTMLOptionElement or HTMLOptGroupElement. (WebCore::Element::boundingClientRect): Ditto. 2017-08-04 Youenn Fablet [Cache API] Add Cache and CacheStorage IDL definitions https://bugs.webkit.org/show_bug.cgi?id=175201 Reviewed by Brady Eidson. Covered by activated tests. Adding IDLs as per https://www.w3.org/TR/service-workers-1/#idl-index. Implementation is guarded by a runtime flag which is off by default. It is off for DRT but on for WTR. * CMakeLists.txt: * DerivedSources.make: * Modules/cache/Cache.cpp: Added. (WebCore::Cache::match): (WebCore::Cache::matchAll): (WebCore::Cache::add): (WebCore::Cache::addAll): (WebCore::Cache::put): (WebCore::Cache::remove): (WebCore::Cache::keys): * Modules/cache/Cache.h: Added. (WebCore::Cache::create): (WebCore::Cache::Cache): * Modules/cache/Cache.idl: Added. * Modules/cache/CacheQueryOptions.h: Added. * Modules/cache/CacheQueryOptions.idl: Added. * Modules/cache/CacheStorage.cpp: Added. (WebCore::CacheStorage::match): (WebCore::CacheStorage::has): (WebCore::CacheStorage::open): (WebCore::CacheStorage::remove): (WebCore::CacheStorage::keys): * Modules/cache/CacheStorage.h: Added. (WebCore::CacheStorage::create): * Modules/cache/CacheStorage.idl: Added. * Modules/cache/DOMWindowCaches.cpp: Added. (WebCore::DOMWindowCaches::DOMWindowCaches): (WebCore::DOMWindowCaches::supplementName): (WebCore::DOMWindowCaches::from): (WebCore::DOMWindowCaches::caches): (WebCore::DOMWindowCaches::caches const): * Modules/cache/DOMWindowCaches.h: Added. * Modules/cache/DOMWindowCaches.idl: Added. * Modules/cache/WorkerGlobalScopeCaches.cpp: Added. (WebCore::WorkerGlobalScopeCaches::supplementName): (WebCore::WorkerGlobalScopeCaches::from): (WebCore::WorkerGlobalScopeCaches::caches): (WebCore::WorkerGlobalScopeCaches::caches const): * Modules/cache/WorkerGlobalScopeCaches.h: Added. * Modules/cache/WorkerGlobalScopeCaches.idl: Added. * WebCore.xcodeproj/project.pbxproj: * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::setCacheAPIEnabled): (WebCore::RuntimeEnabledFeatures::cacheAPIEnabled const): 2017-08-04 Brady Eidson Have navigator.serviceWorker() actually return a ServiceWorkerContainer object. https://bugs.webkit.org/show_bug.cgi?id=175215 Reviewed by Youenn Fablet. * page/NavigatorBase.cpp: (WebCore::NavigatorBase::serviceWorker): Actually create and remember an object. * page/NavigatorBase.h: * workers/ServiceWorkerContainer.cpp: (WebCore::rejectLater): Asynchronously reject the given promise with an error message. (WebCore::ServiceWorkerContainer::ServiceWorkerContainer): (WebCore::ServiceWorkerContainer::refEventTarget): Ref the underlying Navigator. (WebCore::ServiceWorkerContainer::derefEventTarget): Deref the underlying Navigator. (WebCore::ServiceWorkerContainer::ready): rejectLater the promise. (WebCore::ServiceWorkerContainer::addRegistration): Ditto. (WebCore::ServiceWorkerContainer::getRegistration): Ditto. (WebCore::ServiceWorkerContainer::getRegistrations): Ditto. * workers/ServiceWorkerContainer.h: 2017-08-04 Chris Dumez [Beacon] Update sendBeacon to use the CachedResourceLoader https://bugs.webkit.org/show_bug.cgi?id=175192 Reviewed by Youenn Fablet. Update sendBeacon to use the FetchRequest / CachedResourceLoader instead of the PingLoader. This gets us closer to the specification which is based on Fetch and reduces code duplication. This also fixes an issue where our Origin header was not properly set on Beacon resquests. In a follow-up, we will implement in CachedResourceLoader Fetch's quota for inflight keepalive requests which is needed to fully support sendBeacon(). * Modules/beacon/NavigatorBeacon.cpp: (WebCore::NavigatorBeacon::sendBeacon): * Modules/beacon/NavigatorBeacon.h: * loader/LinkLoader.cpp: (WebCore::createLinkPreloadResourceClient): * loader/PingLoader.cpp: * loader/PingLoader.h: * loader/ResourceLoadInfo.cpp: (WebCore::toResourceType): * loader/SubresourceLoader.cpp: (WebCore::logResourceLoaded): * loader/cache/CachedResource.cpp: (WebCore::CachedResource::defaultPriorityForResourceType): (WebCore::CachedResource::load): * loader/cache/CachedResource.h: * loader/cache/CachedResourceLoader.cpp: (WebCore::createResource): (WebCore::CachedResourceLoader::requestBeaconResource): (WebCore::contentTypeFromResourceType): (WebCore::CachedResourceLoader::checkInsecureContent const): (WebCore::CachedResourceLoader::allowedByContentSecurityPolicy const): (WebCore::isResourceSuitableForDirectReuse): * loader/cache/CachedResourceLoader.h: 2017-08-04 John Wilander Resource Load Statistics: Report user interaction immediately, but only when needed https://bugs.webkit.org/show_bug.cgi?id=175090 Reviewed by Chris Dumez. Test: http/tests/loading/resourceLoadStatistics/user-interaction-only-reported-once-within-short-period-of-time.html * loader/ResourceLoadObserver.cpp: (WebCore::ResourceLoadObserver::ResourceLoadObserver): (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution): Now tells the UI process immediately but also records that it has done so to avoid doing it when not needed. (WebCore::ResourceLoadObserver::scheduleNotificationIfNeeded): Conditional throttling gone, now always throttles. (WebCore::ResourceLoadObserver::notifyObserver): Renamed from ResourceLoadObserver::notificationTimerFired(). (WebCore::ResourceLoadObserver::clearState): New function to allow the test runner to reset the web process' statistics state now that we keep track of whether or not we've reported user interaction to the UI process. (WebCore::ResourceLoadObserver::setShouldThrottleObserverNotifications): Deleted. (WebCore::ResourceLoadObserver::notificationTimerFired): Deleted. * loader/ResourceLoadObserver.h: (): Deleted. * testing/Internals.cpp: (WebCore::Internals::resetToConsistentState): (WebCore::Internals::setResourceLoadStatisticsShouldThrottleObserverNotifications): Deleted. No longer needed since user interaction is always communicated immediately. * testing/Internals.h: * testing/Internals.idl: 2017-08-04 Matt Baker Web Inspector: capture async stack trace when workers/main context posts a message https://bugs.webkit.org/show_bug.cgi?id=167084 Reviewed by Brian Burg. Add instrumentation to DOMWindow to support showing asynchronous stack traces when the debugger pauses in a MessageEvent handler. Test: inspector/debugger/async-stack-trace.html * inspector/InspectorInstrumentation.cpp: (WebCore::InspectorInstrumentation::didPostMessageImpl): (WebCore::InspectorInstrumentation::didFailPostMessageImpl): (WebCore::InspectorInstrumentation::willDispatchPostMessageImpl): (WebCore::InspectorInstrumentation::didDispatchPostMessageImpl): * inspector/InspectorInstrumentation.h: (WebCore::InspectorInstrumentation::didPostMessage): (WebCore::InspectorInstrumentation::didFailPostMessage): (WebCore::InspectorInstrumentation::willDispatchPostMessage): (WebCore::InspectorInstrumentation::didDispatchPostMessage): * inspector/PageDebuggerAgent.cpp: (WebCore::PageDebuggerAgent::didClearAsyncStackTraceData): (WebCore::PageDebuggerAgent::didPostMessage): (WebCore::PageDebuggerAgent::didFailPostMessage): (WebCore::PageDebuggerAgent::willDispatchPostMessage): (WebCore::PageDebuggerAgent::didDispatchPostMessage): * inspector/PageDebuggerAgent.h: * page/DOMWindow.cpp: (WebCore::DOMWindow::postMessage): (WebCore::DOMWindow::postMessageTimerFired): 2017-08-04 Devin Rousso Web Inspector: add source view for WebGL shader programs https://bugs.webkit.org/show_bug.cgi?id=138593 Reviewed by Matt Baker. Test: inspector/canvas/requestShaderSource.html * inspector/InspectorCanvasAgent.h: * inspector/InspectorCanvasAgent.cpp: (WebCore::InspectorCanvasAgent::requestShaderSource): * inspector/InspectorShaderProgram.h: * inspector/InspectorShaderProgram.cpp: (WebCore::InspectorShaderProgram::shaderForType): 2017-08-04 Matt Lewis Unreviewed, rolling out r220288. This broke multiple builds. Reverted changeset: "Use MPAVRoutingController instead of deprecated versions." https://bugs.webkit.org/show_bug.cgi?id=175063 http://trac.webkit.org/changeset/220288 2017-08-03 Filip Pizlo The allocator used to allocate memory for MarkedBlocks and LargeAllocations should not be the Subspace itself https://bugs.webkit.org/show_bug.cgi?id=175141 Reviewed by Mark Lam. No new tests because no new behavior. Just adapting to an API change. * ForwardingHeaders/heap/FastMallocAlignedMemoryAllocator.h: Added. * bindings/js/WebCoreJSClientData.cpp: (WebCore::JSVMClientData::JSVMClientData): 2017-08-04 Chris Dumez Match newly-clarified spec on textarea defaultValue/value/child text content https://bugs.webkit.org/show_bug.cgi?id=173878 Reviewed by Darin Adler. Update HTMLTextArea.defaultValue to match align with other browsers and match the latest HTML specification: - https://html.spec.whatwg.org/#dom-textarea-defaultvalue The defaultValue getter should return the child text content: - https://dom.spec.whatwg.org/#concept-child-text-content Our code was traversing all Text descendants, not just the children. The defaultValue setter should act as the setter of the Element's textContent IDL attribute. Previously, we had a custom logic that was only removing the text children. Test: imported/w3c/web-platform-tests/html/semantics/forms/the-textarea-element/value-defaultValue-textContent.html * dom/ScriptElement.cpp: (WebCore::ScriptElement::scriptContent const): * dom/TextNodeTraversal.cpp: (WebCore::TextNodeTraversal::childTextContent): * dom/TextNodeTraversal.h: * html/HTMLTextAreaElement.cpp: (WebCore::HTMLTextAreaElement::defaultValue const): (WebCore::HTMLTextAreaElement::setDefaultValue): * html/HTMLTitleElement.cpp: (WebCore::HTMLTitleElement::text const): 2017-08-04 Said Abou-Hallawa RenderImageResourceStyleImage::image() should return the nullImage() if the image is not available https://bugs.webkit.org/show_bug.cgi?id=174874 Reviewed by Simon Fraser. If an element has a non-CachedImage content data, e.g. -webkit-named-image, RenderImageResourceStyleImage will be created and attached to the RenderImage. RenderImageResourceStyleImage::m_cachedImage will be set to null at the beginning because the m_styleImage->isCachedImage() is false in this case. When ImageLoader finishes loading the url of the src attribute, RenderImageResource::setCachedImage() will be called to set m_cachedImage. A crash will happen when the RenderImage is destroyed. Destroying the RenderImage calls RenderImageResourceStyleImage::shutdown() which checks m_cachedImage and finds it not null, so it calls RenderImageResourceStyleImage::image() which ends up calling CSSNamedImageValue::image() which returns a null pointer because the size is empty. RenderImageResourceStyleImage::shutdown() calls image()->stopAnimation() without checking the return value of image(). Another crash will happen later when deleting the CachedImage from the memory cache if CachedImage::canDestroyDecodedData() is called because the client it gets from m_clients is a freed pointer. This happens because RenderImageResourceStyleImage has m_styleImage of type StyleGeneratedImage but its m_cachedImage is set by RenderImageResource::setCachedImage(). When RenderImageResourceStyleImage::shutdown() is called, it calls StyleGeneratedImage::removeClient() which does not know anything about RenderImageResourceStyleImage::m_cachedImage. So we end up having a freed pointer in the m_clients of the CachedImage. Test: fast/images/image-element-image-content-data.html * rendering/RenderImageResourceStyleImage.cpp: (WebCore::RenderImageResourceStyleImage::shutdown): Revert back the changes of r208511 in this function. Add a call to image()->stopAnimation() without checking the return of image() since it will return the nullImage() if the image not available. There is no need to check m_cachedImage before calling image() because image() does not check or access m_cachedImage. If m_styleImage is not a CachedStyleImage but m_cachedImage is not null, we need to remove m_renderer from the set of the clients of this m_cachedImage. (WebCore::RenderImageResourceStyleImage::image const): The base class method RenderImageResource::image() returns the nullImage() if the image not available. This is because CachedImage::imageForRenderer() returns the nullImage() if the image is not available; see CachedImage.h. We should do the same for the derived class for consistency. 2017-08-04 Jeremy Jones Use MPAVRoutingController instead of deprecated versions. https://bugs.webkit.org/show_bug.cgi?id=175063 Reviewed by Tim Horton. No new tests because no behavior change. This uses a different platform class to present an interface. Remove deprecated MPAudioVideoRoutingPopoverController and MPAVRoutingSheet Add MPMediaControlsViewController. * platform/spi/ios/MediaPlayerSPI.h: 2017-08-04 Matt Baker Web Inspector: REGRESSION (r220233): Check for null pointer passed to WebGLRenderingContextBase::deleteProgram https://bugs.webkit.org/show_bug.cgi?id=175196 Reviewed by Devin Rousso. * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::deleteProgram): 2017-08-04 Matt Lewis Unreviewed, rolling out r220271. Rolling out due to Layout Test failing on iOS Simulator. Reverted changeset: "Remove STREAMS_API compilation guard" https://bugs.webkit.org/show_bug.cgi?id=175165 http://trac.webkit.org/changeset/220271 2017-08-03 Sam Weinig [Cleanup] Remove ScriptGlobalObject https://bugs.webkit.org/show_bug.cgi?id=175173 Reviewed by Darin Adler. ScriptGlobalObject's two functions were only being used in four places. Three of those uses (ScriptGlobalObject::set in InspectorFrontendClientLocal, WebInspectorUI, and RemoteWebInspectorUI) were merged into the new function addSelfToGlobalObjectInWorld on InspectorFrontendHost. The remaining function (ScriptGlobalObject::get in InspectorFrontendHost) was easily inlined. * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSBindingsAllInOne.cpp: * bindings/js/ScriptGlobalObject.cpp: Removed. * bindings/js/ScriptGlobalObject.h: Removed. Removed ScriptGlobalObject. * inspector/InspectorFrontendClientLocal.cpp: (WebCore::InspectorFrontendClientLocal::windowObjectCleared): Remove call to ScriptGlobalObject::set and use addSelfToGlobalObjectInWorld instead. * inspector/InspectorFrontendHost.h: * inspector/InspectorFrontendHost.cpp: (WebCore::InspectorFrontendHost::showContextMenu): Inline ScriptGlobalObject::get. (WebCore::InspectorFrontendHost::addSelfToGlobalObjectInWorld): Add helper which inlines ScriptGlobalObject::set and works as a helper for the three inspector frontends. 2017-08-04 Ryan Haddad Unreviewed, rolling out r220268. This change caused assertion failures on macOS and iOS Debug WK2. Reverted changeset: "Resource Load Statistics: Report user interaction immediately, but only when needed" https://bugs.webkit.org/show_bug.cgi?id=175090 http://trac.webkit.org/changeset/220268 2017-08-04 Youenn Fablet Remove STREAMS_API compilation guard https://bugs.webkit.org/show_bug.cgi?id=175165 Reviewed by Darin Adler. No change of behavior. * Configurations/FeatureDefines.xcconfig: * Modules/fetch/FetchBody.cpp: (WebCore::FetchBody::consumeAsStream): * Modules/fetch/FetchBody.h: * Modules/fetch/FetchBodyOwner.cpp: (WebCore::FetchBodyOwner::isDisturbedOrLocked const): (WebCore::FetchBodyOwner::blobLoadingSucceeded): (WebCore::FetchBodyOwner::blobLoadingFailed): (WebCore::FetchBodyOwner::blobChunk): * Modules/fetch/FetchBodyOwner.h: * Modules/fetch/FetchResponse.cpp: (WebCore::FetchResponse::BodyLoader::didSucceed): (WebCore::FetchResponse::BodyLoader::didFail): (WebCore::FetchResponse::BodyLoader::didReceiveData): * Modules/fetch/FetchResponse.h: * Modules/fetch/FetchResponse.idl: * Modules/fetch/FetchResponse.js: (initializeFetchResponse): * Modules/fetch/FetchResponseSource.cpp: * Modules/fetch/FetchResponseSource.h: * Modules/streams/ByteLengthQueuingStrategy.idl: * Modules/streams/ByteLengthQueuingStrategy.js: * Modules/streams/CountQueuingStrategy.idl: * Modules/streams/CountQueuingStrategy.js: * Modules/streams/ReadableByteStreamController.idl: * Modules/streams/ReadableByteStreamController.js: * Modules/streams/ReadableByteStreamInternals.js: * Modules/streams/ReadableStream.idl: * Modules/streams/ReadableStream.js: * Modules/streams/ReadableStreamBYOBReader.idl: * Modules/streams/ReadableStreamBYOBReader.js: * Modules/streams/ReadableStreamBYOBRequest.idl: * Modules/streams/ReadableStreamBYOBRequest.js: * Modules/streams/ReadableStreamDefaultController.idl: * Modules/streams/ReadableStreamDefaultController.js: * Modules/streams/ReadableStreamDefaultReader.idl: * Modules/streams/ReadableStreamDefaultReader.js: * Modules/streams/ReadableStreamInternals.js: * Modules/streams/ReadableStreamSource.h: * Modules/streams/ReadableStreamSource.idl: * Modules/streams/StreamInternals.js: * Modules/streams/WritableStream.idl: * Modules/streams/WritableStream.js: * Modules/streams/WritableStreamInternals.js: * bindings/js/JSDOMGlobalObject.cpp: (WebCore::isReadableByteStreamAPIEnabled): (WebCore::JSDOMGlobalObject::addBuiltinGlobals): * bindings/js/JSReadableStreamPrivateConstructors.cpp: * bindings/js/JSReadableStreamPrivateConstructors.h: * bindings/js/JSReadableStreamSourceCustom.cpp: * bindings/js/ReadableStreamDefaultController.cpp: * bindings/js/ReadableStreamDefaultController.h: * page/RuntimeEnabledFeatures.h: * testing/Internals.cpp: * testing/Internals.h: * testing/Internals.idl: 2017-08-04 Zan Dobersek [EME][GStreamer] Register ClearKey CDMFactory https://bugs.webkit.org/show_bug.cgi?id=175136 Reviewed by Xabier Rodriguez-Calvar. Register the ClearKey CDM factory in CDMFactoryGStreamer. A CDMFactoryClearKey singleton object is introduced and used for that registration. The basic CDMFactoryClearKey and CDMPrivateClearKey methods are implemented, marking `org.w3.clearkey` as the supported key system and `keyids` as the supported init data type. Additional logic around key system configurations, distinctive identifiers, persistent state and related restrictions and requirements is implemented. This improves the ClearKey EME tests a bit, now progressing to the point of failing with a NotAllowedError exception due to the CDMInstance object failing to properly initialize because of missing implementation. No new tests -- relevant tests have underlying baselines updated to reflect changes in behavior. * platform/encryptedmedia/clearkey/CDMClearKey.cpp: (WebCore::CDMFactoryClearKey::singleton): (WebCore::CDMFactoryClearKey::supportsKeySystem): (WebCore::CDMPrivateClearKey::supportsInitDataType const): (WebCore::CDMPrivateClearKey::supportsConfiguration const): (WebCore::CDMPrivateClearKey::supportsConfigurationWithRestrictions const): (WebCore::CDMPrivateClearKey::supportsSessionTypeWithConfiguration const): (WebCore::CDMPrivateClearKey::supportsRobustness const): (WebCore::CDMPrivateClearKey::distinctiveIdentifiersRequirement const): (WebCore::CDMPrivateClearKey::persistentStateRequirement const): * platform/encryptedmedia/clearkey/CDMClearKey.h: * platform/graphics/gstreamer/eme/CDMFactoryGStreamer.cpp: (WebCore::CDMFactory::platformRegisterFactories): 2017-08-04 John Wilander Resource Load Statistics: Report user interaction immediately, but only when needed https://bugs.webkit.org/show_bug.cgi?id=175090 Reviewed by Chris Dumez. Test: http/tests/loading/resourceLoadStatistics/user-interaction-only-reported-once-within-short-period-of-time.html * loader/ResourceLoadObserver.cpp: (WebCore::ResourceLoadObserver::ResourceLoadObserver): (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution): Now tells the UI process immediately but also records that it has done so to avoid doing it when not needed. (WebCore::ResourceLoadObserver::scheduleNotificationIfNeeded): Conditional throttling gone, now always throttles. (WebCore::ResourceLoadObserver::notifyObserver): Renamed from ResourceLoadObserver::notificationTimerFired(). (WebCore::ResourceLoadObserver::clearState): New function to allow the test runner to reset the web process' statistics state now that we keep track of whether or not we've reported user interaction to the UI process. (WebCore::ResourceLoadObserver::setShouldThrottleObserverNotifications): Deleted. (WebCore::ResourceLoadObserver::notificationTimerFired): Deleted. * loader/ResourceLoadObserver.h: (): Deleted. * testing/Internals.cpp: (WebCore::Internals::resetToConsistentState): (WebCore::Internals::setResourceLoadStatisticsShouldThrottleObserverNotifications): Deleted. No longer needed since user interaction is always communicated immediately. * testing/Internals.h: * testing/Internals.idl: 2017-08-04 Zan Dobersek [EME] Push CDMFactory into the platform layer https://bugs.webkit.org/show_bug.cgi?id=175129 Reviewed by Xabier Rodriguez-Calvar. This is a follow-up to r219678 that moved the majority of CDM abstraction classes into the platform layer, but missed the CDMFactory class. The CDMFactory abstraction is now also placed in the platform layer. Only change to the interface is that the createCDM() method can't accept a CDM object reference anymore since that class is cemented into the WebCore layer, and no current implementation used it anyway. Additionally, the static Vector object of registered factories is moved under the CDMFactory class, along with the register and unregister functions. The platformRegisterFactories() function is added to allow for platform-specific factory registrations to occur when the registered factories are queried for the first time. Empty implementation for this function is provided for non-GStreamer platforms, while for GStreamer the implementation is kept in CDMFactoryGStreamer.cpp. It's still empty for now, but it will register the ClearKey factory there in the near future. No new tests -- none affected, only refactoring. * CMakeLists.txt: * Modules/encryptedmedia/CDM.cpp: (WebCore::createCDMPrivateForKeySystem): (WebCore::CDM::supportsKeySystem): (WebCore::CDM::CDM): (): Deleted. (WebCore::CDM::registerCDMFactory): Deleted. (WebCore::CDM::unregisterCDMFactory): Deleted. * Modules/encryptedmedia/CDM.h: (WebCore::CDMFactory::~CDMFactory): Deleted. * PlatformWPE.cmake: * platform/GStreamer.cmake: * platform/encryptedmedia/CDMFactory.cpp: Added. (WebCore::CDMFactory::registerFactory): (WebCore::CDMFactory::unregisterFactory): (WebCore::CDMFactory::platformRegisterFactories): * platform/encryptedmedia/CDMFactory.h: Added. (WebCore::CDMFactory::~CDMFactory): * platform/encryptedmedia/clearkey/CDMClearKey.cpp: (WebCore::CDMFactoryClearKey::createCDM): * platform/encryptedmedia/clearkey/CDMClearKey.h: * platform/encryptedmedia/gstreamer/CDMFactoryGStreamer.cpp: Added. (WebCore::CDMFactory::platformRegisterFactories): * testing/MockCDMFactory.cpp: (WebCore::m_weakPtrFactory): (WebCore::MockCDMFactory::unregister): (WebCore::MockCDMFactory::createCDM): * testing/MockCDMFactory.h: 2017-08-04 Frederic Wang ScrollingTreeOverflowScrollingNodeIOS uses the wrong fixed position rectangle https://bugs.webkit.org/show_bug.cgi?id=175135 Reviewed by Simon Fraser. This patch modifies ScrollingTreeOverflowScrollingNodeIOS::updateChildNodesAfterScroll so that it uses the fixed position rectangle relative of the first frame ancestor instead of the one of the main frame. This makes it consistent with ScrollingTreeFrameScrollingNodeIOS and RenderLayerCompositor. This fixes some flickering issues on iOS. Test: fast/scrolling/ios/fixed-inside-overflow-inside-iframe.html * page/scrolling/ScrollingTreeFrameScrollingNode.h: (WebCore::ScrollingTreeFrameScrollingNode::fixedPositionRect): Helper function to get the fixed position rect to use for that frame. * page/scrolling/ScrollingTreeNode.cpp: (WebCore::ScrollingTreeNode::enclosingFrameNode const): Helper function to get the enclosing frame for this scrolling node or null if there is none. * page/scrolling/ScrollingTreeNode.h: Declare enclosingFrameNode. 2017-08-04 Zan Dobersek Unreviewed. Removing redundant NotImplemented.h header inclusions and cleaning up whitespace issues in libgcrypt-specific CryptoKeyEC and CryptoKeyRSA implementation files. * crypto/gcrypt/CryptoKeyECGCrypt.cpp: * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp: 2017-08-04 Jeremy Jones Remove unnecesary call to status bar SPI. https://bugs.webkit.org/show_bug.cgi?id=175176 rdar://problem/20887306 Reviewed by Darin Adler. No new tests because no behavior change. This removes an obsolete call to SPI. * platform/ios/VideoFullscreenInterfaceAVKit.mm: (VideoFullscreenInterfaceAVKit::cleanupFullscreen): 2017-08-03 Zan Dobersek [GCrypt] Implement CryptoKeyEC PKCS#8 imports https://bugs.webkit.org/show_bug.cgi?id=173647 Reviewed by Jiewen Tan. No new tests -- affected tests are now passing and are unskipped. Implement libgcrypt-based support for PKCS#8 imports of EC keys. Existing libtasn1 utilities are used to achieve this. First, the provided key data is decoded against the PrivateKeyInfo ASN.1 definition. First, the version member of that structure is validated, followed by the algorithm member. The latter is also properly tested depending on this being an import of an ECDSA or ECDH key. Data of the parameters member is decoded against the ECParameters ASN.1 definition, and the namedCurve object identifier is validated, making sure it represents a valid EC curve and that this curve maches the one specified for the import operation. Data of the privateKey member is decoded against the ECPrivateKey ASN.1 definition. The version member of that structure is properly validated. The optional parameters member of that structure is already decoded against the ECParameters ASN.1 definition. If present, it is checked to contain a valid EC curve identifier that matches the specified curve. The optional publicKey member of the ECPrivateKey structure is validated, testing that its data matches in size an uncompressed EC point, and that the first byte of this data is 0x04, as expected for an uncompressed EC point. What's left is the private key data on the initial ECPrivateKey structure. That data is retrieved and validated, making sure its size matches the size of the specified curve. The `private-key` s-expression is then constructed, embedding the curve name and the validated private key data. This s-expression is then used to construct an EC context. If the optional publicKey data was provided, it's used to set the `q` parameter for this EC context. Otherwise, the value for `q` is computed on-the-fly for the specified EC and the provided private key. The `q` point is then tested through the gcry_mpi_ec_curve_point() function, making sure that the derived point is indeed located on the given EC. Finally, with the private key properly validated, a new CryptoKeyEC object is constructed, using the `private-key` s-expression and the parameters that were specified for this import operation. * crypto/gcrypt/CryptoKeyECGCrypt.cpp: (WebCore::CryptoKeyEC::platformImportPkcs8): * crypto/gcrypt/GCryptUtilities.h: 2017-08-03 Chris Dumez Fix parsing of to allow time starting with a '.' without a leading 0 https://bugs.webkit.org/show_bug.cgi?id=175132 Reviewed by Darin Adler. Fix parsing of to allow time starting with a '.', without a leading 0. This is as per https://github.com/whatwg/html/pull/2852. The latest spec is at: - https://html.spec.whatwg.org/multipage/semantics.html#attr-meta-http-equiv-refresh Test: imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/parsing.html * html/parser/HTMLParserIdioms.cpp: (WebCore::parseHTTPRefreshInternal): 2017-08-03 Brian Burg Remove ENABLE(WEB_SOCKET) guards https://bugs.webkit.org/show_bug.cgi?id=167044 Reviewed by Joseph Pecoraro. * Configurations/FeatureDefines.xcconfig: * Modules/websockets/ThreadableWebSocketChannel.cpp: * Modules/websockets/ThreadableWebSocketChannel.h: * Modules/websockets/ThreadableWebSocketChannelClientWrapper.cpp: * Modules/websockets/ThreadableWebSocketChannelClientWrapper.h: * Modules/websockets/WebSocket.cpp: * Modules/websockets/WebSocket.h: * Modules/websockets/WebSocket.idl: * Modules/websockets/WebSocketChannel.cpp: * Modules/websockets/WebSocketChannel.h: * Modules/websockets/WebSocketChannelClient.h: * Modules/websockets/WebSocketDeflateFramer.cpp: * Modules/websockets/WebSocketDeflateFramer.h: * Modules/websockets/WebSocketDeflater.cpp: * Modules/websockets/WebSocketDeflater.h: * Modules/websockets/WebSocketExtensionDispatcher.cpp: * Modules/websockets/WebSocketExtensionDispatcher.h: * Modules/websockets/WebSocketExtensionParser.cpp: * Modules/websockets/WebSocketExtensionParser.h: * Modules/websockets/WebSocketExtensionProcessor.h: * Modules/websockets/WebSocketFrame.cpp: * Modules/websockets/WebSocketFrame.h: * Modules/websockets/WebSocketHandshake.cpp: * Modules/websockets/WebSocketHandshake.h: * Modules/websockets/WorkerThreadableWebSocketChannel.cpp: * Modules/websockets/WorkerThreadableWebSocketChannel.h: * dom/Document.cpp: (WebCore::Document::Document): (WebCore::Document::idbConnectionProxy): (WebCore::Document::socketProvider): * dom/Document.h: * dom/ScriptExecutionContext.h: * inspector/InspectorInstrumentation.cpp: (WebCore::InspectorInstrumentation::didSendWebSocketFrameImpl): * inspector/InspectorInstrumentation.h: (WebCore::InspectorInstrumentation::didSendWebSocketFrame): * inspector/InspectorNetworkAgent.cpp: * inspector/InspectorNetworkAgent.h: * page/RuntimeEnabledFeatures.cpp: (WebCore::RuntimeEnabledFeatures::webSocketEnabled const): * page/RuntimeEnabledFeatures.h: * page/SocketProvider.cpp: * page/SocketProvider.h: * workers/WorkerGlobalScope.cpp: (WebCore::WorkerGlobalScope::WorkerGlobalScope): * workers/WorkerGlobalScope.h: * workers/WorkerMessagingProxy.cpp: (WebCore::WorkerMessagingProxy::startWorkerGlobalScope): * workers/WorkerThread.cpp: (WebCore::WorkerThread::WorkerThread): (WebCore::WorkerThread::socketProvider): * workers/WorkerThread.h: 2017-08-03 Don Olmstead Remove LayoutUnit dependency in TextStream https://bugs.webkit.org/show_bug.cgi?id=175110 Reviewed by Zalan Bujtas. No new tests. No change in behavior. * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * platform/LayoutUnit.cpp: Added. (WebCore::operator<<): * platform/LayoutUnit.h: * platform/text/TextStream.cpp: * platform/text/TextStream.h: 2017-08-03 Jeremy Jones Improve WebKitLegacy video fullscreen animation begin and end rects. https://bugs.webkit.org/show_bug.cgi?id=175152 rdar://problem/32840576 Reviewed by Eric Carlson. No new tests, becuase this change has no effect on the DOM. This change uses different rects for fullscreen animation to prevent the animation from failing, and to improve the aesthetics of the animation. * platform/mac/WebVideoFullscreenController.mm: (frameExpandedToRatioOfFrame): (-[WebVideoFullscreenController enterFullscreen:]): (-[WebVideoFullscreenController exitFullscreen]): (-[WebVideoFullscreenWindow animateFromRect:toRect:withSubAnimation:controllerAction:]): (constrainFrameToRatioOfFrame): Deleted. 2017-08-03 Jer Noble [EME][Mac] SecureStop left on disk in Private Browsing mode. https://bugs.webkit.org/show_bug.cgi?id=175162 Reviewed by Eric Carlson. Return an empty string from mediaKeysStorageDirectory() when the page indicates that storage should be ephemeral(). Previously, an empty string in this case would be treated as an error. Instead, treat an empty string as valid, and do not try to store or retrieve session information to disk in that case. * Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp: (WebCore::WebKitMediaKeySession::mediaKeysStorageDirectory const): * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm: (WebCore::CDMSessionAVContentKeySession::releaseKeys): (WebCore::CDMSessionAVContentKeySession::update): (WebCore::CDMSessionAVContentKeySession::generateKeyReleaseMessage): (WebCore::CDMSessionAVContentKeySession::contentKeySession): * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm: (WebCore::CDMSessionMediaSourceAVFObjC::storagePath const): 2017-08-03 Youenn Fablet [Fetch API] Add support for Request keepalive getter https://bugs.webkit.org/show_bug.cgi?id=175151 Reviewed by Chris Dumez. Test: imported/w3c/web-platform-tests/fetch/api/request/request-keepalive.html Adding keepalive as a fetch option. Adding initialization and getter of keepalive into FetchRequest. * Modules/fetch/FetchRequest.cpp: (WebCore::buildOptions): * Modules/fetch/FetchRequest.h: * Modules/fetch/FetchRequest.idl: * loader/FetchOptions.h: 2017-08-03 Yoshiaki Jitsukawa [PAL] Move spi/cf directory into PAL https://bugs.webkit.org/show_bug.cgi?id=175057 Reviewed by Antti Koivisto. * WebCore.xcodeproj/project.pbxproj: * loader/cocoa/DiskCacheMonitorCocoa.mm: * loader/cocoa/SubresourceLoaderCocoa.mm: * loader/mac/ResourceLoaderMac.mm: * platform/cf/CoreMediaSoftLink.cpp: * platform/cf/CoreMediaSoftLink.h: * platform/mac/PluginBlacklist.mm: * platform/mac/WebCoreNSStringExtras.mm: * platform/mac/WebGLBlacklist.mm: * platform/mediastream/mac/CoreAudioCaptureSource.cpp: * platform/network/NetworkStorageSession.h: * platform/network/cf/CookieJarCFNet.cpp: * platform/network/cf/CredentialStorageCFNet.cpp: * platform/network/cf/ResourceHandleCFNet.cpp: * platform/network/cf/ResourceHandleCFURLConnectionDelegate.cpp: * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp: * platform/network/cf/ResourceRequestCFNet.cpp: * platform/network/cf/ResourceRequestCFNet.h: * platform/network/cf/ResourceResponse.h: * platform/network/cf/ResourceResponseCFNet.cpp: * platform/network/cf/SocketStreamHandleImplCFNet.cpp: * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp: * platform/network/cocoa/CookieStorageObserver.h: * platform/network/cocoa/CredentialCocoa.h: * platform/network/cocoa/NetworkStorageSessionCocoa.mm: * platform/network/cocoa/ResourceRequestCocoa.mm: * platform/network/cocoa/ResourceResponseCocoa.mm: * platform/network/ios/ResourceRequestIOS.mm: * platform/network/mac/CookieJarMac.mm: * platform/network/mac/FormDataStreamMac.mm: * platform/network/mac/ResourceHandleMac.mm: * platform/network/mac/ResourceRequestMac.mm: * platform/network/mac/WebCoreResourceHandleAsDelegate.mm: * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm: * platform/network/mac/WebCoreURLResponse.h: * testing/cocoa/WebArchiveDumpSupport.mm: 2017-08-03 Youenn Fablet Remove FETCH_API compilation guard https://bugs.webkit.org/show_bug.cgi?id=175154 Reviewed by Chris Dumez. No change of behavior. * Configurations/FeatureDefines.xcconfig: * Modules/fetch/DOMWindowFetch.cpp: * Modules/fetch/DOMWindowFetch.h: * Modules/fetch/DOMWindowFetch.idl: * Modules/fetch/FetchBody.cpp: * Modules/fetch/FetchBody.h: * Modules/fetch/FetchBody.idl: * Modules/fetch/FetchBodyConsumer.cpp: * Modules/fetch/FetchBodyConsumer.h: * Modules/fetch/FetchBodyOwner.cpp: * Modules/fetch/FetchBodyOwner.h: * Modules/fetch/FetchHeaders.cpp: * Modules/fetch/FetchHeaders.h: * Modules/fetch/FetchHeaders.idl: * Modules/fetch/FetchInternals.js: * Modules/fetch/FetchLoader.cpp: * Modules/fetch/FetchLoader.h: * Modules/fetch/FetchLoaderClient.h: * Modules/fetch/FetchRequest.cpp: * Modules/fetch/FetchRequest.h: * Modules/fetch/FetchRequest.idl: * Modules/fetch/FetchResponse.cpp: * Modules/fetch/FetchResponse.h: * Modules/fetch/FetchResponse.idl: * Modules/fetch/FetchResponse.js: * Modules/fetch/FetchResponseSource.cpp: * Modules/fetch/FetchResponseSource.h: * Modules/fetch/WorkerGlobalScopeFetch.cpp: * Modules/fetch/WorkerGlobalScopeFetch.h: * Modules/fetch/WorkerGlobalScopeFetch.idl: * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::fetchAPIEnabled const): 2017-08-03 Devin Rousso Web Inspector: add button to open Inspector^2 https://bugs.webkit.org/show_bug.cgi?id=175108 Reviewed by Brian Burg. This patch just exposes a function to the inspector page. No new functionality was added. * inspector/InspectorFrontendHost.idl: * inspector/InspectorFrontendHost.h: * inspector/InspectorFrontendHost.cpp: (WebCore::InspectorFrontendHost::inspectInspector): 2017-08-03 Matt Baker Web Inspector: Instrument WebGLProgram created/deleted https://bugs.webkit.org/show_bug.cgi?id=175059 Reviewed by Devin Rousso. Tests: inspector/canvas/shaderProgram-add-remove-webgl.html inspector/canvas/shaderProgram-add-remove-webgl2.html This patch adds instrumentation to WebGLRenderingContextBase for tracking WebGLPrograms. A new helper class, InspectorShaderProgram, is used by the CanvasAgent to hold related data. * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::createProgram): (WebCore::WebGLRenderingContextBase::deleteProgram): * inspector/InspectorCanvasAgent.cpp: (WebCore::InspectorCanvasAgent::enable): (WebCore::InspectorCanvasAgent::frameNavigated): (WebCore::InspectorCanvasAgent::didCreateProgram): (WebCore::InspectorCanvasAgent::willDeleteProgram): (WebCore::InspectorCanvasAgent::clearCanvasData): (WebCore::InspectorCanvasAgent::unbindCanvas): (WebCore::InspectorCanvasAgent::unbindProgram): (WebCore::InspectorCanvasAgent::assertInspectorProgram): (WebCore::InspectorCanvasAgent::findInspectorProgram): * inspector/InspectorCanvasAgent.h: * inspector/InspectorInstrumentation.cpp: (WebCore::InspectorInstrumentation::didCreateCSSCanvasImpl): (WebCore::InspectorInstrumentation::didChangeCSSCanvasClientNodesImpl): (WebCore::InspectorInstrumentation::didCreateCanvasRenderingContextImpl): (WebCore::InspectorInstrumentation::didChangeCanvasMemoryImpl): (WebCore::InspectorInstrumentation::recordCanvasActionImpl): (WebCore::InspectorInstrumentation::didFinishRecordingCanvasFrameImpl): (WebCore::InspectorInstrumentation::didCreateProgramImpl): (WebCore::InspectorInstrumentation::willDeleteProgramImpl): * inspector/InspectorInstrumentation.h: (WebCore::InspectorInstrumentation::recordCanvasActionImpl): (WebCore::InspectorInstrumentation::didCreateCSSCanvas): (WebCore::InspectorInstrumentation::didChangeCSSCanvasClientNodes): (WebCore::InspectorInstrumentation::didCreateCanvasRenderingContext): (WebCore::InspectorInstrumentation::didChangeCanvasMemory): (WebCore::InspectorInstrumentation::recordCanvasAction): (WebCore::InspectorInstrumentation::didFinishRecordingCanvasFrame): (WebCore::InspectorInstrumentation::didCreateProgram): (WebCore::InspectorInstrumentation::willDeleteProgram): * inspector/InspectorShaderProgram.cpp: Added. (WebCore::InspectorShaderProgram::create): (WebCore::InspectorShaderProgram::InspectorShaderProgram): (WebCore::InspectorShaderProgram::context const): * inspector/InspectorShaderProgram.h: Added. 2017-08-03 Matt Lewis Unreviewed, rolling out r220209. This caused internal build failures. Reverted changeset: "Use MPAVRoutingController instead of deprecated versions." https://bugs.webkit.org/show_bug.cgi?id=175063 http://trac.webkit.org/changeset/220209 2017-08-03 Brady Eidson Add SW IDLs and stub out basic functionality. https://bugs.webkit.org/show_bug.cgi?id=175115 Reviewed by Chris Dumez. No new tests (Currently no behavior change). Overall note: This feature is EnabledAtRuntime as opposed to EnabledBySetting because the Settings-based code generation is completely broken for non-Document contexts, whereas the RuntimeEnabledFeatures-based generation is not. * CMakeLists.txt: * Configurations/FeatureDefines.xcconfig: * DerivedSources.make: * WebCore.xcodeproj/project.pbxproj: * bindings/scripts/preprocess-idls.pl: Handle the new global scope c'tor file. * bindings/js/JSServiceWorkerContainerCustom.cpp: Added. (WebCore::JSServiceWorkerContainer::ready const): * bindings/js/JSWorkerGlobalScopeBase.cpp: (WebCore::toJSWorkerGlobalScope): Refactor to handle both types of derived workers. (WebCore::toJSServiceWorkerGlobalScope): * bindings/js/JSWorkerGlobalScopeBase.h: * dom/EventNames.h: * dom/EventTargetFactory.in: * features.json: Change status of feature. * page/Navigator.idl: * page/NavigatorBase.cpp: (WebCore::NavigatorBase::serviceWorker): * page/NavigatorBase.h: * page/NavigatorServiceWorker.idl: Added. * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::serviceWorkerEnabled const): (WebCore::RuntimeEnabledFeatures::setServiceWorkerEnabled): * workers/ServiceWorker.cpp: Added. (WebCore::ServiceWorker::postMessage): (WebCore::ServiceWorker::~ServiceWorker): (WebCore::ServiceWorker::scriptURL const): (WebCore::ServiceWorker::state const): (WebCore::ServiceWorker::eventTargetInterface const): (WebCore::ServiceWorker::scriptExecutionContext const): * workers/ServiceWorker.h: Added. * workers/ServiceWorker.idl: Added. * workers/ServiceWorkerContainer.cpp: Added. (WebCore::ServiceWorkerContainer::~ServiceWorkerContainer): (WebCore::ServiceWorkerContainer::controller const): (WebCore::ServiceWorkerContainer::ready): (WebCore::ServiceWorkerContainer::addRegistration): (WebCore::ServiceWorkerContainer::getRegistration): (WebCore::ServiceWorkerContainer::getRegistrations): (WebCore::ServiceWorkerContainer::startMessages): (WebCore::ServiceWorkerContainer::eventTargetInterface const): (WebCore::ServiceWorkerContainer::scriptExecutionContext const): * workers/ServiceWorkerContainer.h: Added. * workers/ServiceWorkerContainer.idl: Added. * workers/ServiceWorkerGlobalScope.cpp: Added. (WebCore::ServiceWorkerGlobalScope::registration): (WebCore::ServiceWorkerGlobalScope::skipWaiting): * workers/ServiceWorkerGlobalScope.h: Added. * workers/ServiceWorkerGlobalScope.idl: Added. * workers/ServiceWorkerRegistration.cpp: Added. (WebCore::ServiceWorkerRegistration::~ServiceWorkerRegistration): (WebCore::ServiceWorkerRegistration::installing): (WebCore::ServiceWorkerRegistration::waiting): (WebCore::ServiceWorkerRegistration::active): (WebCore::ServiceWorkerRegistration::scope const): (WebCore::ServiceWorkerRegistration::update): (WebCore::ServiceWorkerRegistration::unregister): (WebCore::ServiceWorkerRegistration::eventTargetInterface const): (WebCore::ServiceWorkerRegistration::scriptExecutionContext const): * workers/ServiceWorkerRegistration.h: Added. * workers/ServiceWorkerRegistration.idl: Added. 2017-08-03 Yoshiaki Jitsukawa [WebCore] Sort Xcode project files https://bugs.webkit.org/show_bug.cgi?id=175121 Reviewed by Antti Koivisto. * WebCore.xcodeproj/project.pbxproj: 2017-08-02 Sam Weinig [WebIDL] Convert MutationCallback to be a normal generated callback https://bugs.webkit.org/show_bug.cgi?id=174140 Reviewed by Darin Adler. To make this work more nicely, I: - Added the ability to for non-nullable interfaces in sequences to be passed via a Ref<> rather than a RefPtr<> as a parameter to a callback function. (e.g. callback MyCallback = void (sequence foos) will now have the signature, CallbackResult handleEvent(const Vector>&) rather than CallbackResult handleEvent(const Vector>&). - Added a new extended attribute for callback functions called [CallbackThisObject=Type] which allows you to specify that the callback needs a this object in addition to its arguments. When specified, the first argument of the C++ implementation function will now correspond to the this object, with the remaining arguments shifted over one. - Converted callback objects to all inherit directly from ActiveDOMCallback rather than having the generated JS callback derived class inherit from it. This allows us to have access to a callback's canInvokeCallback() function anywhere (needed for MutationCallback) as well as giving a place to put an optional virtual visitJSFunction to allow marking weak callbacks (while not an ideal layering, this matches what we do in EventListener). This change requires each callback to have a bit more code to import the ActiveDOMCallback's constructor and requires non-JS derived callbacks to pass a ScriptExecutionContext (e.g. the Document). * CMakeLists.txt: * DerivedSources.make: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSMutationCallback.cpp: Removed. * bindings/js/JSMutationCallback.h: Removed. Remove custom JSMutationCallback.h/cpp * Modules/geolocation/PositionCallback.h: * Modules/geolocation/PositionErrorCallback.h: * Modules/notifications/NotificationPermissionCallback.h: * Modules/webaudio/AudioBufferCallback.h: * Modules/webdatabase/DatabaseCallback.h: * Modules/webdatabase/SQLStatementCallback.h: * Modules/webdatabase/SQLStatementErrorCallback.h: * Modules/webdatabase/SQLTransactionCallback.h: * Modules/webdatabase/SQLTransactionErrorCallback.h: * css/MediaQueryListListener.h: * dom/NodeFilter.h: * dom/RequestAnimationFrameCallback.h: * dom/StringCallback.h: * fileapi/BlobCallback.h: * html/VoidCallback.h: * page/IntersectionObserverCallback.h: * page/PerformanceObserverCallback.h: Add ActiveDOMCallback as a base class. Import the ActiveDOMCallback constructor. * Modules/mediastream/MediaDevicesRequest.cpp: (WebCore::MediaDevicesRequest::filterDeviceList): (WebCore::MediaDevicesRequest::start): * Modules/mediastream/MediaDevicesRequest.h: Change filterDeviceList to take a Vector of Refs. * bindings/IDLTypes.h: Add InnerParameterType and NullableInnerParameterType type hooks and specialize wrappers to use Ref for InnerParameterType, and RefPtr for NullableInnerParameterType. * bindings/js/JSCallbackData.cpp: * bindings/js/JSCallbackData.h: Add support for passing a this object and give JSCallbackDataWeak a visitJSFunction to allow marking the underlying function. * bindings/js/JSMutationObserverCustom.cpp: (WebCore::JSMutationObserver::visitAdditionalChildren): (WebCore::constructJSMutationObserver): Deleted. Remove the custom constructor and replace it with a custom visitAdditionalChildren that calls the new ActiveDOMObject's visitJSFunction. * bindings/scripts/CodeGenerator.pm: (ParseType): Add helper to parse a type and cache the result. * bindings/scripts/CodeGeneratorJS.pm: (GenerateCallbackHeaderContent): (GenerateCallbackImplementationContent): (GetJSCallbackDataType): Deleted. - Add support for [CallbackThisObject]. When [CallbackThisObject] is not specified, use jsUndefined() as the this object as specified by WebIDL. - Stop inheriting from ActiveDOMCallback now that callbacks need to do this themselves. - Add a visitJSFunction override for weak callback functions which calls into the callback data. * bindings/scripts/IDLAttributes.json: Add [CallbackThisObject]. * bindings/scripts/IDLParser.pm: (ParseType): Add entry point to parse a single type. * css/FontFaceSet.h: Use Ref rather than RefPtr for the faces sequence. * dom/ActiveDOMCallback.h: (WebCore::ActiveDOMCallback::visitJSFunction): Add an optional visitJSFunction virtual function so that derived classes have a way of marking underlying function objects. * dom/MutationCallback.h: Convert to support generation (return a CallbackResult, inherit from ActiveDOMObject). * dom/MutationCallback.idl: Added. Added to generate the callback. Uses the new [CallbackThisObject]. * dom/MutationObserver.cpp: (WebCore::MutationObserver::deliver): Switch to call idiomatic handleEvent, and pass *this as the first parameter which will be translated into the this object. * dom/MutationObserver.h: (WebCore::MutationObserver::callback): Expose the callback so it can marked during GC. * dom/MutationObserver.idl: Remove CustomConstructor and replace it with a custom mark function. * dom/NativeNodeFilter.cpp: * dom/NativeNodeFilter.h: * inspector/InspectorDatabaseAgent.cpp: Pass now needed ScriptExecutionContext to non-js based callbacks. * bindings/scripts/test/JS/JSTestCallbackFunction.cpp: * bindings/scripts/test/JS/JSTestCallbackFunctionRethrow.cpp: * bindings/scripts/test/JS/JSTestCallbackFunctionWithThisObject.cpp: Added. * bindings/scripts/test/JS/JSTestCallbackFunctionWithThisObject.h: Added. * bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.cpp: * bindings/scripts/test/JS/JSTestCallbackInterface.cpp: * bindings/scripts/test/JS/JSTestCallbackInterface.h: * bindings/scripts/test/JS/JSTestVoidCallbackFunction.cpp: * bindings/scripts/test/TestCallbackFunctionWithThisObject.idl: Added. * bindings/scripts/test/TestCallbackInterface.idl: Add/update tests. 2017-08-03 Jeremy Jones Use MPAVRoutingController instead of deprecated versions. https://bugs.webkit.org/show_bug.cgi?id=175063 Reviewed by Tim Horton. No new tests because no behavior change. This uses a different platform class to present an interface. Remove deprecated MPAudioVideoRoutingPopoverController and MPAVRoutingSheet Add MPMediaControlsViewController. * platform/spi/ios/MediaPlayerSPI.h: 2017-08-03 Chris Dumez Improve our support for referrer policies https://bugs.webkit.org/show_bug.cgi?id=175069 Reviewed by Darin Adler. Improve our support for referrer policies. In particular, we now support the additional following ones: "same-origin", "origin-when-cross-origin" and "strict-origin-when-cross-origin". This is as per the following specification: - https://www.w3.org/TR/referrer-policy/#referrer-policies Also refactor the code a bit for clarity: I merged the ReferrerPolicy enum and the FetchOptions::ReferrerPolicy one. Tests: http/tests/referrer-policy/origin-when-cross-origin/cross-origin-http-http.html http/tests/referrer-policy/origin-when-cross-origin/cross-origin-http.https.html http/tests/referrer-policy/origin-when-cross-origin/same-origin.html http/tests/referrer-policy/same-origin/cross-origin-http-http.html http/tests/referrer-policy/same-origin/cross-origin-http.https.html http/tests/referrer-policy/same-origin/same-origin.html http/tests/referrer-policy/strict-origin-when-cross-origin/cross-origin-http-http.html http/tests/referrer-policy/strict-origin-when-cross-origin/cross-origin-http.https.html http/tests/referrer-policy/strict-origin-when-cross-origin/same-origin.html http/tests/referrer-policy/strict-origin/cross-origin-http-http.html http/tests/referrer-policy/strict-origin/cross-origin-http.https.html http/tests/referrer-policy/strict-origin/same-origin.html * Modules/fetch/FetchLoader.cpp: (WebCore::FetchLoader::start): * Modules/fetch/FetchReferrerPolicy.h: * Modules/fetch/FetchReferrerPolicy.idl: * Modules/fetch/FetchRequest.h: * Modules/fetch/FetchRequestInit.h: * dom/Document.cpp: (WebCore::Document::processReferrerPolicy): (WebCore::Document::applyQuickLookSandbox): (WebCore::Document::applyContentDispositionAttachmentSandbox): * dom/Document.h: * loader/FetchOptions.h: * loader/FrameNetworkingContext.h: * loader/PingLoader.cpp: (WebCore::PingLoader::sendBeacon): Drop explicit call to SecurityPolicy::shouldHideReferrer(). This is already called inside SecurityPolicy::generateReferrerHeader() and used only when needed, depending on the actual referrer policy. * loader/cache/CachedResourceLoader.cpp: (WebCore::CachedResourceLoader::updateHTTPRequestHeaders): * loader/cache/CachedResourceRequest.cpp: (WebCore::CachedResourceRequest::updateReferrerOriginAndUserAgentHeaders): * page/SecurityPolicy.cpp: (WebCore::referrerToOriginString): (WebCore::SecurityPolicy::generateReferrerHeader): * page/SecurityPolicy.h: * platform/ReferrerPolicy.h: 2017-08-03 Daniel Bates Support ::marker pseudo-element https://bugs.webkit.org/show_bug.cgi?id=141477 Reviewed by David Hyatt. Implements the ::marker pseudo element as per the CSS Pseudo-Element Module Level 4 spec., (Editor's Draft, 24 July 2017). The ::marker pseudo element is a convenience pseudo element that allows a person to style the appearance of a list item marker. For example, to render all list item markers in bolded, blue text you would define a stylesheet with the following content: li::marker { color: blue; font-weight: bold; } and this could be applied to a page that contains markup of the form:
  1. Item 1
  2. Item 2
  3. ...
  4. Item N-1
  5. Item N
Formerly to the achieve the same effect you would need to use a stylesheet of the form: li { color: blue; font-weight: bold; } .list-item-content { all: initial; } and then write your markup to have the form:
  1. Item 1
  2. Item 2
  3. ...
  4. Item N-1
  5. Item N
The ::marker pseudo element only supports stylizing all font properties and the color property of a list item marker. Tests: fast/lists/list-marker-with-display.html http/wpt/css/css-pseudo-4/marker-and-other-pseudo-elements.html http/wpt/css/css-pseudo-4/marker-color.html http/wpt/css/css-pseudo-4/marker-font-properties.html http/wpt/css/css-pseudo-4/marker-inherit-values.html * css/CSSSelector.cpp: (WebCore::CSSSelector::pseudoId): Return the pseudo id for the ::marker pseudo element. * css/CSSSelector.h: Add enumerator PseudoElementMarker to the pseudo element enum. * css/RuleSet.cpp: (WebCore::determinePropertyWhitelistType): Return whitelist type PropertyWhitelistMarker for ::marker so that we match rules against the acceptable rules for ::marker. * css/RuleSet.h: Add enumerator PropertyWhitelistMarker to the property whitelist type enum. * css/SelectorPseudoElementTypeMap.in: Add "marker" to the list of pseudo element types. * css/StyleResolver.cpp: (WebCore::isValidMarkerStyleProperty): Determines if the specified CSS property is valid inside ::marker. (WebCore::StyleResolver::CascadedProperties::addMatch): Only recognize CSS properties in the content block of ::marker that match the ::marker whitelist policy. * rendering/RenderListItem.cpp: (WebCore::RenderListItem::computeMarkerStyle): Computes the style object for the list item marker. We apply the user-agent style to the marker here as opposed to defining ::marker in the UA sheet as per the spec. as an optimization to avoid having the style resolver apply the pseudo element to all elements. For now, we always inherit style from the originating element (list item). Added FIXME to selectively inherit styles. (WebCore::RenderListItem::styleDidChange): Always apply the list marker style to the list marker renderer. * rendering/RenderListItem.h: * rendering/style/RenderStyleConstants.h: Add pseudo ID for the ::marker pseudo element. 2017-08-03 Antti Koivisto Factor common code in Style::*ChangeInvalidation into helper functions https://bugs.webkit.org/show_bug.cgi?id=174312 Reviewed by Andreas Kling. There is a lot of copy code here. * Style/StyleInvalidationFunctions.h: Added. (WebCore::Style::traverseRuleFeaturesInShadowTree): (WebCore::Style::traverseRuleFeaturesForSlotted): (WebCore::Style::traverseRuleFeatures): Add functions for traversing rule features that may affect style of an element. Use lambdas to implement client-specific behavior. * WebCore.xcodeproj/project.pbxproj: * style/AttributeChangeInvalidation.cpp: (WebCore::Style::mayBeAffectedByAttributeChange): (WebCore::Style::AttributeChangeInvalidation::invalidateStyle): (WebCore::Style::mayBeAffectedByHostRules): Deleted. (WebCore::Style::mayBeAffectedBySlottedRules): Deleted. * style/ClassChangeInvalidation.cpp: (WebCore::Style::ClassChangeInvalidation::invalidateStyle): (WebCore::Style::mayBeAffectedByHostRules): Deleted. (WebCore::Style::mayBeAffectedBySlottedRules): Deleted. * style/IdChangeInvalidation.cpp: (WebCore::Style::IdChangeInvalidation::invalidateStyle): (WebCore::Style::mayBeAffectedByHostRules): Deleted. (WebCore::Style::mayBeAffectedBySlottedRules): Deleted. 2017-08-03 Zan Dobersek [EME] CDM constructor assigns CDMPrivate member multiple times https://bugs.webkit.org/show_bug.cgi?id=175128 Reviewed by Xabier Rodriguez-Calvar. In the CDM class constructor, iterate over the registered CDM factories, finding one that supports the specified key system. A CDMPrivate object is created through that factory, and the iteration is now stopped at that point, while previously it contined to potentially create CDMPrivate objects through other factories. Helper createCDMPrivateForKeySystem() function is removed. * Modules/encryptedmedia/CDM.cpp: (WebCore::CDM::CDM): (WebCore::createCDMPrivateForKeySystem): Deleted. 2017-08-03 Emilio Cobos Álvarez Don't always recalc the style of display: contents elements. https://bugs.webkit.org/show_bug.cgi?id=172753 Reviewed by Antti Koivisto. No new tests (no functionality change). This only removes an inefficiency. * dom/Element.cpp: (WebCore::Element::existingComputedStyle): * dom/Element.h: * style/RenderTreeUpdater.cpp: (WebCore::RenderTreeUpdater::updateRenderTree): (WebCore::RenderTreeUpdater::updateElementRenderer): * style/StyleTreeResolver.cpp: (WebCore::Style::renderOrDisplayContentsStyle): (WebCore::Style::TreeResolver::resolveElement): (WebCore::Style::TreeResolver::createAnimatedElementUpdate): (WebCore::Style::shouldResolveElement): (WebCore::Style::TreeResolver::resolveComposedTree): 2017-08-02 Devin Rousso Web Inspector: add stack trace information for each RecordingAction https://bugs.webkit.org/show_bug.cgi?id=174663 Reviewed by Joseph Pecoraro. Tests: inspector/canvas/recording-2d.html inspector/model/recording.html * inspector/InspectorCanvas.h: * inspector/InspectorCanvas.cpp: (WebCore::InspectorCanvas::indexForData): (WebCore::InspectorCanvas::buildAction): 2017-08-02 Yusuke Suzuki Merge WTFThreadData to Thread::current https://bugs.webkit.org/show_bug.cgi?id=174716 Reviewed by Mark Lam. Use Thread::current() instead. * fileapi/AsyncFileStream.cpp: * platform/ThreadGlobalData.cpp: (WebCore::ThreadGlobalData::ThreadGlobalData): * platform/graphics/cocoa/WebCoreDecompressionSession.h: * platform/ios/wak/WebCoreThread.mm: (StartWebThread): * workers/WorkerThread.cpp: (WebCore::WorkerThread::workerThread): 2017-08-02 Sam Weinig Fix crashes in GC creating a document fragment on a background thread https://bugs.webkit.org/show_bug.cgi?id=175111 Reviewed by Chris Dumez. r220095 (https://webkit.org/b/175006) change JSHTMLTemplateElement from using a private name + property to manager the lifetime of the reference DocumentFragment to using the idiomatic visitAdditionalChildren. Unfortunately, the function to access the DocumentFragment lazily creates it. If this lazy creation happens on a GC thread, badness ensues. This introduces an accessor that returns the DocumentFragment if it has been created or null if it has not. * bindings/js/JSHTMLTemplateElementCustom.cpp: (WebCore::JSHTMLTemplateElement::visitAdditionalChildren): * html/HTMLTemplateElement.cpp: (WebCore::HTMLTemplateElement::contentIfAvailable): * html/HTMLTemplateElement.h: 2017-08-02 Sam Weinig [WebIDL] Simplify [EnabledBySettings] extended attribute code to not require passing a global object to finishCreation https://bugs.webkit.org/show_bug.cgi?id=175087 Reviewed by Chris Dumez. * bindings/scripts/CodeGeneratorJS.pm: (GenerateImplementation): (GeneratePrototypeDeclaration): Remove unnecessary passing of the global object to finishCreation for [EnabledBySettings]. * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp: * bindings/scripts/test/JS/JSTestNode.cpp: * bindings/scripts/test/JS/JSTestObj.cpp: Update tests. 2017-08-02 Andy Estes REGRESSION (r207155): Unable to switch sheets when previewing Numbers '09 spreadsheets https://bugs.webkit.org/show_bug.cgi?id=175098 Reviewed by Daniel Bates. r207155 enabled sandboxing on the frame displaying a QuickLook preview. This restricted frames within the sandbox from navigating their sandboxed siblings or ancestors, which breaks the functionality of multi-sheet Numbers '09 spreadsheet previews. These previews contain a frameset with a table of contents frame and a content frame, and the table of contents frame needs to be able to navigate the content frame when the sheet selection changes. Fix this by disabling the SandboxNavigation flag in the QuickLook sandbox. Frames within the sandbox will be able to navigate each other, but will not be able to navigate the top frame (due to SandboxTopNavigation still being enabled), nor will they be able to navigate any other ancestor frame outside the sandbox (due to QuickLook previews being in a different origin than the hosting frame). These two cases are covered by existing tests. Test: quicklook/multi-sheet-numbers-09.html * dom/Document.cpp: (WebCore::Document::applyQuickLookSandbox): Added a call to disableSandboxFlags(SandboxNavigation) after applying the content security policy. * dom/SecurityContext.h: (WebCore::SecurityContext::disableSandboxFlags): Defined disableSandboxFlags(). 2017-08-02 Jer Noble [MSE] Removing samples when presentation order does not match decode order can cause bad behavior. https://bugs.webkit.org/show_bug.cgi?id=175091 Reviewed by Eric Carlson. Address follow-up comments to r219519. * Modules/mediasource/SourceBuffer.cpp: (WebCore::SourceBuffer::removeCodedFrames): 2017-08-02 Jeremy Jones Remove unused and obsolete setting mediaDocumentEntersFullscreenAutomatically https://bugs.webkit.org/show_bug.cgi?id=175080 Reviewed by Jon Lee. No new tests because this only removes unused code. This is obsolete because of the alternate solution in https://bugs.webkit.org/show_bug.cgi?id=174850 * page/Settings.in: 2017-08-02 Filip Pizlo GPUBuffer::length() should return the size of the array buffer backing the GPU buffer, not the rounded-up GPU buffer length https://bugs.webkit.org/show_bug.cgi?id=175079 Reviewed by Simon Fraser. This fixes a failure in the GPU.BufferCreate unit test. The problem is that in order to have a Metal buffer wrap memory we allocated, we have to tell Metal that the memory is page-aligned. This means that the Metal buffer reports back a page-aligned size, which is different than what the test expected. It seems that it's most convenient for our GPUBuffer class to return the unaligned length, rather than the aligned length. This is just a simple matter of returning the length from the ArrayBuffer rather than the Metal buffer. This fixes the unit test and is probably more sensible for actual users of this class, since the page alignment of the length is a goofy implementation detail. * platform/graphics/cocoa/GPUBufferMetal.mm: (WebCore::GPUBuffer::length const): 2017-08-01 Brian Burg HTML file input elements do not support file extensions in the "accept" attribute https://bugs.webkit.org/show_bug.cgi?id=95698 Reviewed by Darin Adler. Serialize the accepted file extensions so they can be accessed in the UI process. * platform/FileChooser.h: * platform/FileChooser.cpp: (WebCore::FileChooser::invalidate): Modernize. (WebCore::FileChooserSettings::acceptTypes const): Deleted. This is dead code, it was only used by Chromium. 2017-08-02 Fujii Hironori Use LazyNeverDestroyed instead of DEFINE_GLOBAL for QualifiedName https://bugs.webkit.org/show_bug.cgi?id=175010 Reviewed by Alex Christensen. No new tests because no behavior change. Stop using DEFINE_GLOBAL hack in favor of LazyNeverDestroyed. * contentextensions/ContentExtensionParser.cpp: (WebCore::ContentExtensions::isValidCSSSelector): Call QualifiedName::init(). * dom/DOMAllInOne.cpp: Remove the warning. Include QualifiedName.cpp. * dom/QualifiedName.cpp: (WebCore::QualifiedName::init): Call LazyNeverDestroyed::construct instead of placement new. * dom/QualifiedName.h: Use LazyNeverDestroyed. 2017-08-01 Joseph Pecoraro CFString leak dragging an image - allocation under PlatformPasteboard::writeObjectRepresentations https://bugs.webkit.org/show_bug.cgi?id=175064 Reviewed by Tim Horton. * platform/ios/PlatformPasteboardIOS.mm: (WebCore::PlatformPasteboard::writeObjectRepresentations): Adopt a created string into the RetainPtr. * platform/ios/WebItemProviderPasteboard.h: * platform/ios/WebItemProviderPasteboard.mm: (-[WebItemProviderRegistrationInfoList dealloc]): Release suggestedName and switch from -strong to -copy. 2017-08-01 Chris Dumez Unreviewed, update Beacon API status to "In Development". * features.json: 2017-08-01 Chris Dumez Add initial support for navigator.sendBeacon https://bugs.webkit.org/show_bug.cgi?id=175007 Reviewed by Sam Weinig. Add initial support for navigator.sendBeacon behind an experimental feature runtime flag. The specification is available at: - https://w3c.github.io/beacon/ The current implementation supports sending beacons with all types of payloads except for ReadableStream. Some functionality is incomplete and will be taken care of in follow-up patches: - Support for CORS preflight for the cases where it is required. We currently return false and do not send the beacon in such cases. - Better support for redirects. - Use a more power-friendly network priority for beacon requests. Tests: http/tests/blink/sendbeacon/* http/tests/security/mixedContent/beacon/insecure-beacon-in-iframe.html http/wpt/beacon/* imported/blink/fast/beacon/* imported/w3c/web-platform-tests/beacon/* * CMakeLists.txt: * DerivedSources.make: * Modules/beacon/NavigatorBeacon.cpp: Added. (WebCore::NavigatorBeacon::sendBeacon): * Modules/beacon/NavigatorBeacon.h: Added. * Modules/beacon/NavigatorBeacon.idl: Added. * WebCore.xcodeproj/project.pbxproj: * loader/PingLoader.cpp: (WebCore::PingLoader::sendBeacon): * loader/PingLoader.h: 2017-08-01 Filip Pizlo Bmalloc and GC should put auxiliaries (butterflies, typed array backing stores) in a gigacage (separate multi-GB VM region) https://bugs.webkit.org/show_bug.cgi?id=174727 Reviewed by Mark Lam. No new tests because no change in behavior. Needed to teach Metal how to allocate in the Gigacage. * platform/graphics/cocoa/GPUBufferMetal.mm: (WebCore::GPUBuffer::GPUBuffer): (WebCore::GPUBuffer::contents): 2017-08-01 Fujii Hironori [WinCairo] Implement Font::platformBoundsForGlyph https://bugs.webkit.org/show_bug.cgi?id=174813 Reviewed by Alex Christensen. Test: fast/text/emphasis.html * platform/graphics/win/SimpleFontDataCairoWin.cpp: (WebCore::Font::platformBoundsForGlyph): Implemented by copying the code from Font::boundsForGDIGlyph(). 2017-08-01 Zalan Bujtas REGRESSION (r217197): New Yorker website hangs for a long time on load, lots of blank tiles https://bugs.webkit.org/show_bug.cgi?id=175009 Reviewed by Simon Fraser. This patch ensures that we report the desktop, non-frame-flattened frame size for media queries in subframes. Some websites don't expect the iframes to be expanded to the size of the content and when the media query callback mutates the content (triggering frame resize), they might end up getting into a never ending layout. Test: fast/frames/flattening/media-query-growing-content.html * css/MediaQueryEvaluator.cpp: (WebCore::orientationEvaluate): (WebCore::aspectRatioEvaluate): (WebCore::heightEvaluate): (WebCore::widthEvaluate): * page/FrameView.cpp: (WebCore::FrameView::layout): (WebCore::FrameView::layoutSizeForMediaQuery const): (WebCore::FrameView::evaluateMediaQueryList): * page/FrameView.h: 2017-07-26 Jiewen Tan Add tests to detect mistakes in backward compatibility when the structured clone algorithm is changed in the future https://bugs.webkit.org/show_bug.cgi?id=173998 Reviewed by Darin Adler. * bindings/js/SerializedScriptValue.cpp: Add a comment. 2017-08-01 Matt Lewis Unreviewed, rolling out r220089. This caused multiple crashes on macOS Debug testers. Reverted changeset: "Use LazyNeverDestroyed instead of DEFINE_GLOBAL for QualifiedName" https://bugs.webkit.org/show_bug.cgi?id=175010 http://trac.webkit.org/changeset/220089 2017-08-01 Sam Weinig [WebIDL] Swap a custom attribute for a custom mark function for HTMLTemplateElement https://bugs.webkit.org/show_bug.cgi?id=175006 Reviewed by Chris Dumez. Use the standard way of augmenting GC, visitAdditionalChildren, rather than using a private name to create ownership. * bindings/js/JSHTMLTemplateElementCustom.cpp: (WebCore::JSHTMLTemplateElement::visitAdditionalChildren): (WebCore::JSHTMLTemplateElement::content const): Deleted. * html/HTMLTemplateElement.idl: 2017-08-01 Zan Dobersek [GCrypt] Gather crypto constants in a single location https://bugs.webkit.org/show_bug.cgi?id=174091 Reviewed by Jiewen Tan. Gather common constants used across the libgcrypt-specific Web Crypto implementations in a single place -- in the GCryptUtilities.h header, inside the CryptoConstants namespace. The various ASN.1 object identifiers and other helper values are placed inside, in the std::array container. Additionally, CryptoConstants::matches() helper function is provided. It compares the provided data-and-size pair with the given std::array container and returns true if the std::memcmp() call returns 0. Changes in CryptoKeyEC and CryptoKeyRSA consist mostly of switching to the use of CryptoConstants::matches() and the CryptoConstants data arrays, as well as some whitespace cleanup. Additionallity in CryptoKeyEC, the helper functions covering various curve attributes are reordered, renamed and reorganized for simplicity. No new tests -- no changes in behavior. * crypto/gcrypt/CryptoKeyECGCrypt.cpp: (WebCore::curveIdentifier): (WebCore::curveSize): (WebCore::curveUncompressedFieldElementSize): (WebCore::curveUncompressedPointSize): (WebCore::CryptoKeyEC::platformImportRaw): (WebCore::CryptoKeyEC::platformImportJWKPublic): (WebCore::CryptoKeyEC::platformImportJWKPrivate): (WebCore::supportedAlgorithmIdentifier): (WebCore::curveForIdentifier): (WebCore::CryptoKeyEC::platformImportSpki): (WebCore::CryptoKeyEC::platformExportRaw): (WebCore::CryptoKeyEC::platformAddFieldElements): (WebCore::CryptoKeyEC::platformExportSpki): (WebCore::CryptoKeyEC::platformExportPkcs8): (WebCore::uncompressedPointSizeForCurve): Deleted. (WebCore::uncompressedFieldElementSizeForCurve): Deleted. * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp: (WebCore::supportedAlgorithmIdentifier): (WebCore::CryptoKeyRSA::importPkcs8): (WebCore::CryptoKeyRSA::exportSpki): (WebCore::CryptoKeyRSA::exportPkcs8): * crypto/gcrypt/GCryptUtilities.h: (WebCore::CryptoConstants::matches): 2017-07-31 Fujii Hironori Use LazyNeverDestroyed instead of DEFINE_GLOBAL for MediaFeatureNames https://bugs.webkit.org/show_bug.cgi?id=175008 Reviewed by Alex Christensen. No new tests because no behavior change. Stop using DEFINE_GLOBAL hack in favor of LazyNeverDestroyed. * css/MediaFeatureNames.cpp: (WebCore::MediaFeatureNames::init): Do not include . Use LazyNeverDestroyed instead of DEFINE_GLOBAL. Call LazyNeverDestroyed::construct instead of placement new. * css/MediaFeatureNames.h: Use LazyNeverDestroyed. * css/MediaQueryEvaluator.cpp: (WebCore::MediaQueryEvaluator::evaluate const): Dereference with ->. 2017-07-31 Fujii Hironori Use LazyNeverDestroyed instead of DEFINE_GLOBAL for QualifiedName https://bugs.webkit.org/show_bug.cgi?id=175010 Reviewed by Alex Christensen. No new tests because no behavior change. Stop using DEFINE_GLOBAL hack in favor of LazyNeverDestroyed. * dom/DOMAllInOne.cpp: Remove the warning. Include QualifiedName.cpp. * dom/QualifiedName.cpp: (WebCore::QualifiedName::init): Call LazyNeverDestroyed::construct instead of placement new. * dom/QualifiedName.h: Use LazyNeverDestroyed. 2017-07-31 Matt Rajca Support quirk for letting media autoplay if the user interacted with at least one media element. https://bugs.webkit.org/show_bug.cgi?id=175005 Reviewed by Eric Carlson. If the user has interacted with at least one media element, let other media elements auto-play as a quirk. * dom/Document.cpp: (WebCore::Document::updateIsPlayingMedia): * dom/Document.h: (WebCore::Document::noteUserInteractionWithMediaElement): * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::removeBehaviorsRestrictionsAfterFirstUserGesture): * html/MediaElementSession.cpp: (WebCore::needsDocumentLevelMediaUserGestureQuirk): (WebCore::MediaElementSession::playbackPermitted const): * page/MediaProducer.h: 2017-07-31 Nan Wang AX: CFEqual is failing on text markers with exact same data https://bugs.webkit.org/show_bug.cgi?id=175002 Reviewed by Chris Fleizach. We should zero the memory of the TextMarkerData instance so that it can be tested for byte-equivalence. Made sure this change won't break any of the existing tests. * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::textMarkerDataForVisiblePosition): (WebCore::AXObjectCache::textMarkerDataForFirstPositionInTextControl): 2017-07-28 Matt Rajca Propagate user gesture tokens when script elements are loaded. https://bugs.webkit.org/show_bug.cgi?id=174959 Reviewed by Eric Carlson. Propagate user gesture tokens when script elements are loaded (i.e. between the time an element is created and its onload handler is invoked). * dom/ScriptElement.cpp: (WebCore::ScriptElement::ScriptElement): (WebCore::ScriptElement::dispatchLoadEventRespectingUserGestureIndicator): (WebCore::ScriptElement::executeScriptAndDispatchEvent): (WebCore::ScriptElement::executePendingScript): * dom/ScriptElement.h: 2017-07-31 Matt Lewis Unreviewed, rolling out r220048. This revision caused multiple crashes in fast/images. See webkit.org/b/174990 Reverted changeset: "RenderImageResourceStyleImage::image() should return the nullImage() if the image is not available" https://bugs.webkit.org/show_bug.cgi?id=174874 http://trac.webkit.org/changeset/220048 2017-07-31 Sam Weinig Remove unnecessary exceptions from storage code https://bugs.webkit.org/show_bug.cgi?id=174572 Reviewed by Chris Dumez. Remove checks for canAccessStorage() and the exceptions they would cause. These were used for Storage in ephemeral sessions, but they are now supported. Add checks for a null frame to functions that can mutate the storage, as the frame is needed for that, and it retains our existing behavior for disconnected frames. By removing these checks / exceptions, we can fully generate Storage.idl. * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSBindingsAllInOne.cpp: * bindings/js/JSStorageCustom.cpp: Removed. Remove JSStorageCustom.cpp * loader/EmptyClients.cpp: * page/DOMWindow.cpp: (WebCore::DOMWindow::sessionStorage): (WebCore::DOMWindow::localStorage): * storage/StorageArea.h: Remove canAccessStorage. * storage/Storage.cpp: (WebCore::Storage::length): (WebCore::Storage::key): (WebCore::Storage::getItem): (WebCore::Storage::setItem): (WebCore::Storage::removeItem): (WebCore::Storage::clear): (WebCore::Storage::contains): (WebCore::Storage::isSupportedPropertyName): (WebCore::Storage::supportedPropertyNames): * storage/Storage.h: * storage/Storage.idl: Remove canAccessStorage checks and corresponding exceptions. Add supportedPropertyNames to allow the removal of the [CustomGetOwnPropertyNames]. 2017-07-31 Matt Lewis Unreviewed, rolling out r220060. This broke our internal builds. Contact reviewer of patch for more information. Reverted changeset: "Merge WTFThreadData to Thread::current" https://bugs.webkit.org/show_bug.cgi?id=174716 http://trac.webkit.org/changeset/220060 2017-07-31 Yusuke Suzuki Merge WTFThreadData to Thread::current https://bugs.webkit.org/show_bug.cgi?id=174716 Reviewed by Sam Weinig. Use Thread::current() instead. * fileapi/AsyncFileStream.cpp: * platform/ThreadGlobalData.cpp: (WebCore::ThreadGlobalData::ThreadGlobalData): * platform/graphics/cocoa/WebCoreDecompressionSession.h: * platform/ios/wak/WebCoreThread.mm: (StartWebThread): * workers/WorkerThread.cpp: (WebCore::WorkerThread::workerThread): 2017-07-31 Xabier Rodriguez Calvar Created a bool pretty printer at WTF for debugging purposes https://bugs.webkit.org/show_bug.cgi?id=174893 Reviewed by Darin Adler. Use WTF::boolPrettyPrinter in debugging messages. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: (WebCore::MediaPlayerPrivateGStreamerBase::supportsKeySystem): * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp: (WebCore::MediaPlayerPrivateGStreamerMSE::seek): 2017-07-30 Zan Dobersek Unreviewed. Suppress the -Wextra compiler warning when building with GCC 6.3.0, explicitly initializing the RefCounted<> base class in the FetchHeaders(const FetchHeaders&) constructor. Note that while that's the signature of the copy constructor for the FetchHeaders class, the base RefCounted<> class is not copyable, so the default RefCounted<> constructor is used, but the FetchHeaders resources are normally copied into the new object from the one that's passed in. * Modules/fetch/FetchHeaders.h: (WebCore::FetchHeaders::FetchHeaders): 2017-07-30 Darin Adler Remove code in HTMLObjectElement attribute parsing that forces style resolution and layout https://bugs.webkit.org/show_bug.cgi?id=130653 Reviewed by Antti Koivisto. Also fixes a bug where load events are delivered prematurely in some cases when an object, embed, frame, or iframe element is still loading. * dom/Document.cpp: (WebCore::Document::loadEventDelayTimerFired): Added a call to FrameLoader::checkLoadComplete. Goes along with the change to FrameLoader::checkLoadCompleteForThisFrame, which now respects the isDelayingLoadEvent flag. * html/HTMLAppletElement.cpp: (WebCore::HTMLAppletElement::HTMLAppletElement): Removed the createdByParser argument, no longer needed by the base class. (WebCore::HTMLAppletElement::create): Added call to finishCreating, which is now part of the process of creating any object in a class derived from HTMLPlugInImageElement. (WebCore::HTMLAppletElement::updateWidget): Rearranged logic so setNeedsWidgetUpdate is only called when it's becoming false; avoids a false/true/false round trip that can cause trouble. * html/HTMLAppletElement.h: Updated for the above. * html/HTMLEmbedElement.cpp: (WebCore::HTMLEmbedElement::HTMLEmbedElement): Removed the createdByParser argument, no longer needed by the base class. (WebCore::HTMLEmbedElement::create): Added call to finishCreating, which is now part of the process of creating any object in a class derived from HTMLPlugInImageElement. (WebCore::HTMLEmbedElement::parseAttribute): Changed srcAttr to call updateImageLoaderWithNewURLSoon to do the image loading logic. (WebCore::HTMLEmbedElement::updateWidget): Rearranged logic so setNeedsWidgetUpdate is only called when it's becoming false; avoids a false/true/false round trip that can cause trouble. * html/HTMLEmbedElement.h: Updated for the above. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::setReadyState): Call setShouldDelayLoadEvent(false) when transitioning to HAVE_CURRENT_DATA (or beyond), even if we have already fired a loadeddata event in the past. This matches what the HTML specification calls for, but only if you read it carefully. Without this change, and with the more complete implementation of load event delay below, one of the regression tests hangs because are permanently stuck dealying load events. Also added a FIXME about other code that likely has a similar problem; the symptom is likely to be subtle and minor, though. * html/HTMLObjectElement.cpp: (WebCore::HTMLObjectElement::HTMLObjectElement): Removed the createdByParser argument, no longer needed by the base class. (WebCore::HTMLObjectElement::create): Added call to finishCreating, which is now part of the process of creating any object in a class derived from HTMLPlugInImageElement. (WebCore::HTMLObjectElement::parseAttribute): Changed dataAttr to use updateImageLoaderWithNewURLSoon. Explicitly call scheduleUpdateForAfterStyleResolution since just calling invalidateStyleAndRenderersForSubtree alone is no longer sufficient. (WebCore::HTMLObjectElement::updateWidget): Rearranged logic so setNeedsWidgetUpdate is only called when it's becoming false; avoids a false/true/false round trip that can cause trouble. (WebCore::HTMLObjectElement::childrenChanged): Added calls to the new scheduleUpdateForAfterStyleResolution since invalidating style is no longer sufficient. (WebCore::HTMLObjectElement::renderFallbackContent): Remove the call to updateStyleIfNeeded. This is the main change that the title of this bug refers to. * html/HTMLObjectElement.h: Updated for the above. Also removed the clearUseFallbackContent function because it's clearer to set the data member in line at the single call site in HTMLObjectElement::parseAttribute. * html/HTMLPlugInImageElement.cpp: (WebCore::HTMLPlugInImageElement::HTMLPlugInImageElement): Removed the createdByParser argument; no need to set an m_needsWidgetUpdate flag differently for parser cases now. (WebCore::HTMLPlugInImageElement::finshCreating): Added. To be called after creating an element to do work that can't be done in a constructor. (WebCore::HTMLPlugInImageElement::didRecalcStyle): Added. Calls the new scheduleUpdateForAfterStyleResolution function. (WebCore::HTMLPlugInImageElement::didAttachRenderers): Moved all the logic from this function into scheduleUpdateForAfterStyleResolution. Also added a call through to the base class; cleans things up, even though it's just an assertion. (WebCore::HTMLPlugInImageElement::willDetachRenderers): Removed the call to setNeedsWidgetUpdate(true) here; no longer needed because the new logic already does the right thing in this case. (WebCore::HTMLPlugInImageElement::updateWidgetIfNecessary): Deleted. Now handled by updateAfterStyleResolution instead. (WebCore::HTMLPlugInImageElement::finishParsingChildren): Deleted. Handling updates after parsing all the children now comes naturally out of the new implementation. (WebCore::HTMLPlugInImageElement::scheduleUpdateForAfterStyleResolution): Added. Schedules a call to updateAfterStyleResolution when needed, and equally importantly, increments the load event delay count to make sure that loads that are part of that update can participate in decision about whether it's time for the load event. (WebCore::HTMLPlugInImageElement::updateAfterStyleResolution): Added. Combines updateWidgetIfNecessary and startLoadingImage, and also deals with the new m_needsImageReload boolean in cases where no actual loading is done. (WebCore::HTMLPlugInImageElement::didMoveToNewDocument): Update load event delay count when moving an element that is in the middle of loading. This lets the updateAfterStyleResolution function do the right thing even when the element is moved without leaving anything stuck in a strange state. (WebCore::HTMLPlugInImageElement::prepareForDocumentSuspension): Call the new scheduleUpdateForAfterStyleResolution since invalidating style is no longer sufficient. (WebCore::HTMLPlugInImageElement::startLoadingImage): Deleted. Now handled by updateAfterStyleResolution instead. (WebCore::HTMLPlugInImageElement::updateImageLoaderWithNewURLSoon): Added. Does all the right things for when an image URL is changed; for use by the concrete derived classes. * html/HTMLPlugInImageElement.h: Updated for above changes. Also made m_imageLoader private rather than protected, and added the two new boolean data members. * html/HTMLTagNames.in: Removed unneeded constructorNeedsCreatedByParser flags for applet, embed, and object. * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::isLoadingInAPISense): Return true if the document is delaying a load event. * loader/FrameLoader.cpp: (WebCore::FrameLoader::checkLoadCompleteForThisFrame): Don't do any work if isDelayingLoadEvent is true; otherwise this function can have a side effect of triggering the load event. (WebCore::FrameLoader::detachFromParent): Schedule a checkLoadComplete here, too, not just a checkCompleted. This is relevant if the frame we are detaching was delaying a load event because it no longer will be and so the load might be complete. 2017-07-30 Sam Weinig [WebIDL] Remove JS builtin bindings for FetchRequest, DOMWindowFetch and WorkerGlobalScopeFetch https://bugs.webkit.org/show_bug.cgi?id=174974 Reviewed by Darin Adler. * CMakeLists.txt: * DerivedSources.make: * WebCore.xcodeproj/project.pbxproj: * Modules/fetch/DOMWindowFetch.js: Removed. * Modules/fetch/FetchRequest.js: Removed. * Modules/fetch/WorkerGlobalScopeFetch.js: Removed. Remove builtin files. * Modules/fetch/DOMWindowFetch.cpp: (WebCore::DOMWindowFetch::fetch): * Modules/fetch/DOMWindowFetch.h: * Modules/fetch/DOMWindowFetch.idl: * Modules/fetch/WorkerGlobalScopeFetch.cpp: (WebCore::WorkerGlobalScopeFetch::fetch): * Modules/fetch/WorkerGlobalScopeFetch.h: * Modules/fetch/WorkerGlobalScopeFetch.idl: Remove builtin and instead create FetchRequest in the implementation. * Modules/fetch/FetchBody.cpp: (WebCore::FetchBody::extract): * Modules/fetch/FetchBody.h: * Modules/fetch/FetchBodyOwner.cpp: (WebCore::FetchBodyOwner::extractBody): * Modules/fetch/FetchBodyOwner.h: * Modules/fetch/FetchResponse.cpp: * Modules/fetch/FetchResponse.h: Rename FetchBody::BindingDataType to FetchBody::Init to match its IDL naming. * Modules/fetch/FetchHeaders.cpp: (WebCore::appendToHeaderMap): (WebCore::fillHeaderMap): (WebCore::FetchHeaders::create): (WebCore::FetchHeaders::fill): * Modules/fetch/FetchHeaders.h: Add helpers to implement the fill algorithm for various input types. Leave the existing fill for now, as it is still used by the FetchResponse builtin, but will eventually be removed. * Modules/fetch/FetchRequest.cpp: (WebCore::FetchRequest::initializeOptions): (WebCore::FetchRequest::initializeWith): (WebCore::FetchRequest::setBody): (WebCore::FetchRequest::create): (WebCore::FetchRequest::setBodyFromInputRequest): Deleted. * Modules/fetch/FetchRequest.h: Migrate builtin code to the implementation. This is 1-to-1 re-implementation, so I did not attempt to fix any conformance issues. That will come in follow up. * Modules/fetch/FetchRequest.idl: Replace builtins with an IDL constructor. * Modules/fetch/FetchRequestInit.h: * Modules/fetch/FetchRequestInit.idl: Add missing headers and body to FetchRequestInit. 2017-07-30 Said Abou-Hallawa RenderImageResourceStyleImage::image() should return the nullImage() if the image is not available https://bugs.webkit.org/show_bug.cgi?id=174874 Reviewed by Darin Adler. If an element has image content data for a none cached image, e.g. -webkit-named-image, RenderImageResourceStyleImage will be created and attached to the RenderImage. RenderImageResourceStyleImage::m_cachedImage will be set to null because the m_styleImage->isCachedImage() is false in this case. When ImageLoader finishes loading the url of the src attribute, RenderImageResource::setCachedImage() will be called to set m_cachedImage. A crash will happen when the RenderImage is destroyed. Destroying the RenderImage calls RenderImageResourceStyleImage::shutdown() which checks m_cachedImage and finds it not null, so it calls RenderImageResourceStyleImage::image() which ends up calling CSSNamedImageValue::image() which returns a null pointer because the size is empty. RenderImageResourceStyleImage::shutdown() calls image()->stopAnimation() without checking the return value of image(). Like the base class virtual method RenderImageResource::image(), RenderImageResourceStyleImage::image() should return the nullImage() if the image is not available. Test: fast/images/image-element-image-content-data.html * css/CSSCrossfadeValue.cpp: * css/CSSFilterImageValue.cpp: * page/EventHandler.cpp: * page/PageSerializer.cpp: * rendering/RenderElement.cpp: * rendering/RenderImageResource.cpp: * rendering/RenderImageResourceStyleImage.cpp: (WebCore::RenderImageResourceStyleImage::initialize): (WebCore::RenderImageResourceStyleImage::shutdown): Revert back the changes of r208511 in this function. Add a call to image()->stopAnimation() without checking the return of image() since it will return the nullImage() if the image not available. There is no need to check m_cachedImage before calling image() because image() does not check or access m_cachedImage. (WebCore::RenderImageResourceStyleImage::image): The base class method RenderImageResource::image() returns the nullImage() if the image not available. This is because CachedImage::imageForRenderer() returns the nullImage() if the image is not available; see CachedImage.h. We should do the same for the derived class for consistency. * rendering/style/ContentData.cpp: * rendering/style/StyleCachedImage.cpp: * style/StylePendingResources.cpp: 2017-07-29 Filip Pizlo Unreviewed, rollout r220044 because it set the bots on fire. It seems that the "-Wunguarded-availability-new" pragma is not widely supported. So, a bunch of the Mac bots are now unable to build and that includes EWS. Fixing by rolling it out. * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setHasAvailableAudioSample): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::addAudioRenderer): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::removeAudioRenderer): * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h: * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: (-[WebAVSampleBufferErrorListener beginObservingRenderer:]): (-[WebAVSampleBufferErrorListener stopObservingRenderer:]): (-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]): (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled): (WebCore::SourceBufferPrivateAVFObjC::rendererDidReceiveError): (WebCore::SourceBufferPrivateAVFObjC::flush): 2017-07-29 Dan Bernstein Fixed building for macOS 10.12 with the macOS 10.13 SDK. Suppressed the unguarded-availability-new warning around uses of AVSampleBufferAudioRenderer and AVSampleBufferRenderSynchronizer. Even though the 10.13 SDK declares them as available starting in that release, they have been available as SPI earlier. * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setHasAvailableAudioSample): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::addAudioRenderer): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::removeAudioRenderer): * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h: * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: (-[WebAVSampleBufferErrorListener beginObservingRenderer:]): (-[WebAVSampleBufferErrorListener stopObservingRenderer:]): (-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]): (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled): (WebCore::SourceBufferPrivateAVFObjC::rendererDidReceiveError): (WebCore::SourceBufferPrivateAVFObjC::flush): 2017-07-29 Nan Wang AX: findMatchingObjects doesn't work when the startObject is ignored https://bugs.webkit.org/show_bug.cgi?id=174965 Reviewed by Chris Fleizach. findMatchingObjects would return a wrong element if we pass in an ignored start object. To fix this, we should use the closest accessible sibling as the start object. Test: accessibility/mac/search-predicate-from-ignored-element.html * accessibility/AccessibilityObject.cpp: (WebCore::appendChildrenToArray): 2017-07-29 Aaron Chu AX: FKA: Buttons need a visible focus indicator https://bugs.webkit.org/show_bug.cgi?id=171040 Reviewed by Antoine Quint. Added a background color for the focus state of the icon buttons in modern media controls. Test: media/modern-media-controls/button/button-focus-state.html * Modules/modern-media-controls/controls/button.css: (button:focus): (button:focus > picture): * Modules/modern-media-controls/controls/slider.css: (.slider > input): 2017-07-28 Sam Weinig [WebIDL] Remove JS builtin bindings for FetchHeaders https://bugs.webkit.org/show_bug.cgi?id=174905 Reviewed by Alex Christensen. * CMakeLists.txt: * DerivedSources.make: * WebCore.xcodeproj/project.pbxproj: * Modules/fetch/FetchHeaders.js: Removed. Remove FetchHeaders.js * Modules/fetch/FetchHeaders.cpp: (WebCore::appendToHeaderMap): (WebCore::FetchHeaders::create): (WebCore::FetchHeaders::append): * Modules/fetch/FetchHeaders.h: (WebCore::FetchHeaders::FetchHeaders): Add create function for generated constructor. Add appendToHeaderMap static function which takes the functionality from the existing append function, and makes it useable in create. * Modules/fetch/FetchHeaders.idl: Replace [JSBuiltinConstructor] with real constructor. Keep other builtin attributes as they are still used by other Fetch code. * bindings/js/JSDOMConvertRecord.h: Fix record conversion to work with proxies by changing to use the method table for getOwnPropertyNames, and undefined values by not excluding undefined values. 2017-07-28 Matt Baker Web Inspector: capture an async stack trace when web content calls addEventListener https://bugs.webkit.org/show_bug.cgi?id=174739 Reviewed by Brian Burg. Test: inspector/debugger/async-stack-trace.html Add instrumentation to EventTarget to support showing asynchronous stack traces when the debugger breaks in a script event listener. * dom/EventTarget.cpp: (WebCore::EventTarget::addEventListener): (WebCore::EventTarget::removeEventListener): (WebCore::EventTarget::fireEventListeners): * inspector/InspectorInstrumentation.cpp: (WebCore::InspectorInstrumentation::didAddEventListenerImpl): (WebCore::InspectorInstrumentation::willRemoveEventListenerImpl): (WebCore::InspectorInstrumentation::willHandleEventImpl): (WebCore::InspectorInstrumentation::didHandleEventImpl): * inspector/InspectorInstrumentation.h: (WebCore::InspectorInstrumentation::didAddEventListener): (WebCore::InspectorInstrumentation::willRemoveEventListener): (WebCore::InspectorInstrumentation::willHandleEvent): (WebCore::InspectorInstrumentation::didHandleEvent): * inspector/PageDebuggerAgent.cpp: (WebCore::PageDebuggerAgent::didClearAsyncStackTraceData): (WebCore::PageDebuggerAgent::didAddEventListener): (WebCore::PageDebuggerAgent::willRemoveEventListener): (WebCore::PageDebuggerAgent::willHandleEvent): * inspector/PageDebuggerAgent.h: 2017-07-28 Matt Rajca Don't add autoplay restrictions to media elements created in response to user gestures. https://bugs.webkit.org/show_bug.cgi?id=174947 Reviewed by Eric Carlson. Test: media/video-create-with-user-gesture.html * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::HTMLMediaElement): 2017-07-28 Jeremy Jones WebMediaSessionHelper calls -[UIApplication beginReceivingRemoteControlEvents] from WebThread https://bugs.webkit.org/show_bug.cgi?id=174934 rdar://problem/33586772 Reviewed by Eric Carlson. No new tests because no effect on DOM. This dispatches a UIKit call to the main thread since it might happen on WebThread in WK1. * platform/audio/ios/MediaSessionManagerIOS.mm: (-[WebMediaSessionHelper initWithCallback:]): 2017-07-28 Myles C. Maxfield [macOS] Reeder's defaults font is Times instead of San Francisco https://bugs.webkit.org/show_bug.cgi?id=174885 Reviewed by Simon Fraser. Reeder uses explicit dot-prefixed names in its source code. Within Core Text, dot-prefixed names cannot be matched case insensitively. The solution is to not case-fold these family names, and to make our caches case sensitive for these special names. Tests: fast/text/font-lookup-dot-prefix-case-sensitive-2.html fast/text/font-lookup-dot-prefix-case-sensitive.html * platform/graphics/FontCache.cpp: (WebCore::FontPlatformDataCacheKey::operator==): (WebCore::FontPlatformDataCacheKeyHash::hash): * platform/graphics/FontCascade.cpp: (WebCore::keysMatch): (WebCore::computeFontCascadeCacheHash): * platform/graphics/FontDescription.cpp: (WebCore::FontCascadeDescription::familyNamesAreEqual): (WebCore::FontCascadeDescription::familyNameHash): (WebCore::FontCascadeDescription::foldedFamilyName): * platform/graphics/FontDescription.h: * platform/graphics/cocoa/FontCacheCoreText.cpp: (WebCore::FontDatabase::fontForPostScriptName): 2017-07-28 Devin Rousso Web Inspector: Record actions performed on CanvasRenderingContext2D https://bugs.webkit.org/show_bug.cgi?id=174482 Reviewed by Joseph Pecoraro. Tests: inspector/canvas/recording-2d.html inspector/canvas/recording.html * html/canvas/CanvasRenderingContext2D.idl: Add CallTracingCallback to interface to record all API calls. * html/HTMLCanvasElement.cpp: (WebCore::HTMLCanvasElement::paint): If a recording is active, mark the current frame as completed. * bindings/scripts/CodeGeneratorJS.pm: (GenerateAttributeGetterBodyDefinition): (GenerateAttributeSetterBodyDefinition): (GenerateImplementationFunctionCall): (GenerateCallTracerParameter): (GenerateCallTracer): * bindings/scripts/test/TestCallTracer.idl: * bindings/scripts/test/JS/JSTestCallTracer.cpp: (WebCore::setJSTestCallTracerTestAttributeInterfaceSetter): (WebCore::setJSTestCallTracerTestAttributeSpecifiedSetter): (WebCore::jsTestCallTracerTestAttributeWithVariantGetter): (WebCore::jsTestCallTracerTestAttributeWithVariant): (WebCore::setJSTestCallTracerTestAttributeWithVariantSetter): (WebCore::setJSTestCallTracerTestAttributeWithVariant): (WebCore::jsTestCallTracerPrototypeFunctionTestOperationInterfaceBody): (WebCore::jsTestCallTracerPrototypeFunctionTestOperationSpecifiedBody): (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithArgumentsBody): (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithNullableArgumentBody): (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithVariantArgumentBody): (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithVariantArgument): * inspector/InspectorCanvas.h: * inspector/InspectorCanvas.cpp: (WebCore::InspectorCanvas::recordAction): (WebCore::InspectorCanvas::buildAction): Change CallTracer IDL generation to flatten any variants so that all types for the parameters of an action are able to be listed in a single variant. This prevents possible ambiguity when constructing the variant, as they require that exactly one type be constructible and a sub-variant might not satisfy that condition. This was only an issue for older mac SDKs. * bindings/js/CallTracer.h: * bindings/js/CallTracer.cpp: (WebCore::CallTracer::recordCanvasAction): * bindings/js/CallTracerTypes.h: * inspector/InspectorCanvasAgent.h: * inspector/InspectorCanvasAgent.cpp: (WebCore::InspectorCanvasAgent::recordCanvasAction): * inspector/InspectorInstrumentation.h: * inspector/InspectorInstrumentation.cpp: (WebCore::InspectorInstrumentation::recordCanvasAction): (WebCore::InspectorInstrumentation::recordCanvasActionImpl): Rename CanvasActionParameterVariant to RecordCanvasActionVariant to match what is expected by the IDL generator. Also remove unnecessary includes now that they are in CallTracerTypes.h. * CMakeLists.txt: * bindings/js/JSBindingsAllInOne.cpp: Add CallTracer for CMake builds. 2017-07-28 Sam Weinig [WebIDL] Split-up and cleanup Fetch IDL files in preparation for removing unnecessary js builtins https://bugs.webkit.org/show_bug.cgi?id=174915 Reviewed by Alex Christensen. - Split FetchRequest enums and Init dictionary out of FetchRequest so they can be used from other files like WorkerGlobalScopeFetch and DOMWindowFetch. - Add missing FetchResponseInit. Currently unused but will be in a subsequent patch. - Add and update comments about missing properties and functions. * CMakeLists.txt: * DerivedSources.make: * WebCore.xcodeproj/project.pbxproj: * Modules/fetch/DOMWindowFetch.idl: * Modules/fetch/FetchBody.idl: * Modules/fetch/FetchBodyOwner.h: * Modules/fetch/FetchHeaders.h: * Modules/fetch/FetchHeaders.idl: * Modules/fetch/FetchReferrerPolicy.h: Added. * Modules/fetch/FetchReferrerPolicy.idl: Added. * Modules/fetch/FetchRequest.h: * Modules/fetch/FetchRequest.idl: * Modules/fetch/FetchRequestCache.h: Added. * Modules/fetch/FetchRequestCache.idl: Added. * Modules/fetch/FetchRequestCredentials.h: Added. * Modules/fetch/FetchRequestCredentials.idl: Added. * Modules/fetch/FetchRequestInit.h: Added. * Modules/fetch/FetchRequestInit.idl: Added. * Modules/fetch/FetchRequestMode.h: Added. * Modules/fetch/FetchRequestMode.idl: Added. * Modules/fetch/FetchRequestRedirect.h: Added. * Modules/fetch/FetchRequestRedirect.idl: Added. * Modules/fetch/FetchResponse.h: * Modules/fetch/FetchResponse.idl: * Modules/fetch/WorkerGlobalScopeFetch.idl: 2017-07-28 Myles C. Maxfield REGRESSION(r216944): Fallback fonts erroneously visible when the primary font is loading https://bugs.webkit.org/show_bug.cgi?id=174772 Reviewed by Simon Fraser. During a font load, we try pretty hard to find a font to use that isn't the last resort font (which happens to be Times). We do this by iterating through all the fonts in the font-family list, as well as through all the relevant @font-face blocks which share the requested font family name. Unfortunately, if we find one of these fallback fonts, we were simply using it directly, which means that it was being drawn as visible (because the visibility setting lives inside the Font object). Instead, we should carry the invisibility setting from the interstitial font to this used fallback font. This patch is an extension of r219221, which fixed the problem only for system fallback fonts. This patch adopts the same methodology to all fallback fonts. Test: http/tests/webfont/font-loading-system-fallback-visibility-FontRanges.html * platform/graphics/FontCascadeFonts.cpp: (WebCore::FontCascadeFonts::glyphDataForVariant): (WebCore::glyphPageFromFontRanges): * platform/graphics/FontRanges.cpp: (WebCore::FontRanges::glyphDataForCharacter): 2017-07-28 Frederic Wang Fix typo in scrollPositionChangedViaDelegatedScrolling https://bugs.webkit.org/show_bug.cgi?id=174937 Reviewed by Wenson Hsieh. No new tests, fix typo in the inUserInteraction parameter. * page/scrolling/ScrollingTree.cpp: (WebCore::ScrollingTree::scrollPositionChangedViaDelegatedScrolling): * page/scrolling/ScrollingTree.h: 2017-07-28 Wenson Hsieh [iOS DnD] [WK1] Snapshots generated using -[DOMRange renderImageForcingBlackText:] are upside down https://bugs.webkit.org/show_bug.cgi?id=174928 Reviewed by Tim Horton. Pulls the implementation of createDragImageForRange out into DragImageIOS, and use TextIndicator to generate a snapshot instead of FrameSelection's snapshotting utilities. This makes snapshotting a DOMRange behave the same way as snapshotting a dragged selection. No way of testing TextIndicator-based snapshotting yet. * platform/DragImage.cpp: Guard createDragImageForRange for !PLATFORM(IOS). * platform/ios/DragImageIOS.mm: (WebCore::createDragImageForSelection): Add a FIXME to point out that having an additional context flip inside the UIGraphicsImageRenderer block results in an upside-down drag image being returned from createDragImageFromImage. This image is being flipped elsewhere in drag initiation code, which eventually results in the correct orientation; we'll need further investigation to remove this extraneous flip. (WebCore::createDragImageForRange): 2017-07-28 Jeremy Jones Remove Web prefix from WebVideoFullscreen and WebPlaybackSession classes. https://bugs.webkit.org/show_bug.cgi?id=174437 Reviewed by Darin Adler. No new tests because no behavior change. Remove redundant Web- prefix from classes in WebCore namespace. * WebCore.xcodeproj/project.pbxproj: * html/HTMLMediaElement.cpp: * html/HTMLVideoElement.cpp: * platform/cocoa/PlaybackSessionInterface.h: Renamed from Source/WebCore/platform/cocoa/WebPlaybackSessionInterface.h. (WebCore::PlaybackSessionInterface::~PlaybackSessionInterface): * platform/cocoa/PlaybackSessionModel.h: Renamed from Source/WebCore/platform/cocoa/WebPlaybackSessionModel.h. (WebCore::PlaybackSessionModel::~PlaybackSessionModel): (WebCore::PlaybackSessionModelClient::~PlaybackSessionModelClient): (WebCore::PlaybackSessionModelClient::externalPlaybackChanged): * platform/cocoa/PlaybackSessionModelMediaElement.h: Renamed from Source/WebCore/platform/cocoa/WebPlaybackSessionModelMediaElement.h. * platform/cocoa/PlaybackSessionModelMediaElement.mm: Renamed from Source/WebCore/platform/cocoa/WebPlaybackSessionModelMediaElement.mm. * platform/cocoa/VideoFullscreenChangeObserver.h: Renamed from Source/WebCore/platform/cocoa/WebVideoFullscreenChangeObserver.h. (WebCore::VideoFullscreenChangeObserver::~VideoFullscreenChangeObserver): * platform/cocoa/VideoFullscreenModel.h: Renamed from Source/WebCore/platform/cocoa/WebVideoFullscreenModel.h. (WebCore::VideoFullscreenModel::~VideoFullscreenModel): (WebCore::VideoFullscreenModelClient::~VideoFullscreenModelClient): * platform/cocoa/VideoFullscreenModelVideoElement.h: Renamed from Source/WebCore/platform/cocoa/WebVideoFullscreenModelVideoElement.h. (WebCore::VideoFullscreenModelVideoElement::create): * platform/cocoa/VideoFullscreenModelVideoElement.mm: Renamed from Source/WebCore/platform/cocoa/WebVideoFullscreenModelVideoElement.mm. * platform/ios/PlaybackSessionInterfaceAVKit.h: Renamed from Source/WebCore/platform/ios/WebPlaybackSessionInterfaceAVKit.h. * platform/ios/PlaybackSessionInterfaceAVKit.mm: Renamed from Source/WebCore/platform/ios/WebPlaybackSessionInterfaceAVKit.mm. * platform/ios/VideoFullscreenInterfaceAVKit.h: Renamed from Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.h. * platform/ios/VideoFullscreenInterfaceAVKit.mm: Renamed from Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm. * platform/ios/WebAVPlayerController.h: * platform/ios/WebAVPlayerController.mm: * platform/ios/WebVideoFullscreenControllerAVKit.mm: * platform/mac/PlaybackSessionInterfaceMac.h: Renamed from Source/WebCore/platform/mac/WebPlaybackSessionInterfaceMac.h. * platform/mac/PlaybackSessionInterfaceMac.mm: Renamed from Source/WebCore/platform/mac/WebPlaybackSessionInterfaceMac.mm. * platform/mac/VideoFullscreenInterfaceMac.h: Renamed from Source/WebCore/platform/mac/WebVideoFullscreenInterfaceMac.h. * platform/mac/VideoFullscreenInterfaceMac.mm: Renamed from Source/WebCore/platform/mac/WebVideoFullscreenInterfaceMac.mm. * platform/mac/WebPlaybackControlsManager.h: * platform/mac/WebPlaybackControlsManager.mm: 2017-07-27 Jeremy Jones Don't override _allowsMediaDocumentInlinePlayback in MediaDocument with playsinlineAttr. https://bugs.webkit.org/show_bug.cgi?id=174850 rdar://problem/33449903 Reviewed by Jon Lee. This change removes playsinlineAttr from MediaDocument so that it doesn't override the setting from _allowsMediaDocumentInlinePlayback. In its place is an update to requiresFullscreenForVideoPlayback that implements the details of exactly which media documents are still allowed to play inlne. Media documents always use a video element; but when there are no video tracks, it has behavior like an audio element. See media-controller.js isAudio(). This change preserves this behavior with respect to fullscreen requirements for media document by mirroring the isAudio() check in requiresFullscreenForVideoPlayback. * html/MediaDocument.cpp: (WebCore::MediaDocumentParser::createDocumentStructure): * html/MediaElementSession.cpp: (WebCore::MediaElementSession::requiresFullscreenForVideoPlayback): 2017-07-27 Jeremy Jones MediaDocument fullscreen pinch gesture should trigger navigate back. https://bugs.webkit.org/show_bug.cgi?id=174914 Reviewed by Jon Lee. No new tests because only effect is from interaction with platform. For media documents, pressing the "done" button on fullscreen video navigates back to the previous page. The same should happen for other gestures that pause playback when returning to inline. This allows the gesture to have the same behavior as the button. * platform/ios/WebVideoFullscreenInterfaceAVKit.mm: (WebVideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason): 2017-07-27 Aaron Chu AX: VoiceOver silent or skipping over time values on media player. https://bugs.webkit.org/show_bug.cgi?id=174324 Reviewed by Antoine Quint. Added role attribute to modern media controls time lable class so that VoiceOver can access the time label when the media is playing. Test Updated: media/modern-media-controls/time-label/time-label.html Test Added: media/modern-media-controls/time-label/ios-time-label.html * Modules/modern-media-controls/controls/time-label.js: 2017-07-27 Yusuke Suzuki Hoist DOM binding attribute getter prologue into JavaScriptCore taking advantage of DOMJIT / CheckSubClass https://bugs.webkit.org/show_bug.cgi?id=171637 Reviewed by Darin Adler. We use DOMAttribute. When DOMAttribute is specified, ClassInfo check is performed by JSC side. So, we can drop ClassInfo check from the actual function. We also simplify DOMJIT::GetterSetter to make it smaller size. WebCore size comparison Before: 48443292 After: 48087800 (0.7% reduction) Speedometer Scores show 0.8% improvement. Before: 158.9 +- 0.46 After: 160.2 +- 0.36 Dromaeo DOM core Scores show 5.8% improvement. Before After Total Score: 8424.12runs/s ±1.38% 8911.60runs/s ±1.47% DOM Attributes 12627.27runs/s ±1.87% 14023.17runs/s ±1.87% DOM Modification 1207.82runs/s ±2.48% 1204.21runs/s ±3.05% DOM Query 68068.82runs/s ±0.63% 74273.38runs/s ±0.69% DOM Traversal 1240.07runs/s ±1.96% 1256.64runs/s ±1.77% Performance improvement can be explained by the following optimizations. 1. Type checks are typically eliminated in all the JIT tiers. IC / DFG / FTL can drop type checks since get_by_id operation already performs a structure check which subsumes this type check. 2. Direct getter call by CallDOMGetter without creating IC in DFG and FTL. * bindings/js/JSDOMAttribute.h: (WebCore::IDLAttribute::get): Add CastedThisErrorBehavior::Assert case. When this is specified, we perform casting without using jsDynamicCast. * bindings/scripts/CodeGeneratorJS.pm: (IsAcceleratedDOMAttribute): (GetJSCAttributesForAttribute): (GenerateHeader): (GeneratePropertiesHashTable): (GenerateImplementation): (GenerateAttributeGetterTrampolineDefinition): (GenerateAttributeGetterDefinition): (GenerateCallbackImplementationContent): (GenerateHashTableValueArray): (GenerateHashTable): (GenerateConstructorHelperMethods): Update CodeGeneratorJS to emit DOMAttribute. And DOMJIT::GetterSetter becomes changed to be smaller size. * bindings/scripts/test/JS/JSInterfaceName.cpp: (WebCore::JSInterfaceNamePrototype::finishCreation): * bindings/scripts/test/JS/JSMapLike.cpp: (WebCore::JSMapLikePrototype::finishCreation): * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp: (WebCore::JSReadOnlyMapLikePrototype::finishCreation): * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp: (WebCore::JSTestActiveDOMObjectPrototype::finishCreation): (WebCore::jsTestActiveDOMObjectExcitingAttr): * bindings/scripts/test/JS/JSTestCEReactions.cpp: (WebCore::JSTestCEReactionsPrototype::finishCreation): (WebCore::jsTestCEReactionsAttributeWithCEReactions): (WebCore::jsTestCEReactionsReflectAttributeWithCEReactions): (WebCore::jsTestCEReactionsStringifierAttribute): * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp: (WebCore::JSTestCEReactionsStringifierPrototype::finishCreation): (WebCore::jsTestCEReactionsStringifierValue): * bindings/scripts/test/JS/JSTestCallTracer.cpp: (WebCore::JSTestCallTracerPrototype::finishCreation): (WebCore::jsTestCallTracerTestAttributeInterface): (WebCore::jsTestCallTracerTestAttributeSpecified): * bindings/scripts/test/JS/JSTestCallbackInterface.cpp: (WebCore::JSTestCallbackInterfaceConstructor::initializeProperties): * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp: (WebCore::JSTestClassWithJSBuiltinConstructorPrototype::finishCreation): * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp: (WebCore::JSTestCustomConstructorWithNoInterfaceObjectPrototype::finishCreation): * bindings/scripts/test/JS/JSTestDOMJIT.cpp: (WebCore::JSTestDOMJITPrototype::finishCreation): (WebCore::TestDOMJITAnyAttrDOMJIT::TestDOMJITAnyAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITAnyAttr): Deleted. (WebCore::TestDOMJITBooleanAttrDOMJIT::TestDOMJITBooleanAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITBooleanAttr): Deleted. (WebCore::TestDOMJITByteAttrDOMJIT::TestDOMJITByteAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITByteAttr): Deleted. (WebCore::TestDOMJITOctetAttrDOMJIT::TestDOMJITOctetAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITOctetAttr): Deleted. (WebCore::TestDOMJITShortAttrDOMJIT::TestDOMJITShortAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITShortAttr): Deleted. (WebCore::TestDOMJITUnsignedShortAttrDOMJIT::TestDOMJITUnsignedShortAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITUnsignedShortAttr): Deleted. (WebCore::TestDOMJITLongAttrDOMJIT::TestDOMJITLongAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITLongAttr): Deleted. (WebCore::TestDOMJITUnsignedLongAttrDOMJIT::TestDOMJITUnsignedLongAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITUnsignedLongAttr): Deleted. (WebCore::TestDOMJITLongLongAttrDOMJIT::TestDOMJITLongLongAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITLongLongAttr): Deleted. (WebCore::TestDOMJITUnsignedLongLongAttrDOMJIT::TestDOMJITUnsignedLongLongAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITUnsignedLongLongAttr): Deleted. (WebCore::TestDOMJITFloatAttrDOMJIT::TestDOMJITFloatAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITFloatAttr): Deleted. (WebCore::TestDOMJITUnrestrictedFloatAttrDOMJIT::TestDOMJITUnrestrictedFloatAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITUnrestrictedFloatAttr): Deleted. (WebCore::TestDOMJITDoubleAttrDOMJIT::TestDOMJITDoubleAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITDoubleAttr): Deleted. (WebCore::TestDOMJITUnrestrictedDoubleAttrDOMJIT::TestDOMJITUnrestrictedDoubleAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITUnrestrictedDoubleAttr): Deleted. (WebCore::TestDOMJITDomStringAttrDOMJIT::TestDOMJITDomStringAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITDomStringAttr): Deleted. (WebCore::TestDOMJITByteStringAttrDOMJIT::TestDOMJITByteStringAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITByteStringAttr): Deleted. (WebCore::TestDOMJITUsvStringAttrDOMJIT::TestDOMJITUsvStringAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITUsvStringAttr): Deleted. (WebCore::TestDOMJITNodeAttrDOMJIT::TestDOMJITNodeAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITNodeAttr): Deleted. (WebCore::TestDOMJITBooleanNullableAttrDOMJIT::TestDOMJITBooleanNullableAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITBooleanNullableAttr): Deleted. (WebCore::TestDOMJITByteNullableAttrDOMJIT::TestDOMJITByteNullableAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITByteNullableAttr): Deleted. (WebCore::TestDOMJITOctetNullableAttrDOMJIT::TestDOMJITOctetNullableAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITOctetNullableAttr): Deleted. (WebCore::TestDOMJITShortNullableAttrDOMJIT::TestDOMJITShortNullableAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITShortNullableAttr): Deleted. (WebCore::TestDOMJITUnsignedShortNullableAttrDOMJIT::TestDOMJITUnsignedShortNullableAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITUnsignedShortNullableAttr): Deleted. (WebCore::TestDOMJITLongNullableAttrDOMJIT::TestDOMJITLongNullableAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITLongNullableAttr): Deleted. (WebCore::TestDOMJITUnsignedLongNullableAttrDOMJIT::TestDOMJITUnsignedLongNullableAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITUnsignedLongNullableAttr): Deleted. (WebCore::TestDOMJITLongLongNullableAttrDOMJIT::TestDOMJITLongLongNullableAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITLongLongNullableAttr): Deleted. (WebCore::TestDOMJITUnsignedLongLongNullableAttrDOMJIT::TestDOMJITUnsignedLongLongNullableAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITUnsignedLongLongNullableAttr): Deleted. (WebCore::TestDOMJITFloatNullableAttrDOMJIT::TestDOMJITFloatNullableAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITFloatNullableAttr): Deleted. (WebCore::TestDOMJITUnrestrictedFloatNullableAttrDOMJIT::TestDOMJITUnrestrictedFloatNullableAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITUnrestrictedFloatNullableAttr): Deleted. (WebCore::TestDOMJITDoubleNullableAttrDOMJIT::TestDOMJITDoubleNullableAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITDoubleNullableAttr): Deleted. (WebCore::TestDOMJITUnrestrictedDoubleNullableAttrDOMJIT::TestDOMJITUnrestrictedDoubleNullableAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITUnrestrictedDoubleNullableAttr): Deleted. (WebCore::TestDOMJITDomStringNullableAttrDOMJIT::TestDOMJITDomStringNullableAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITDomStringNullableAttr): Deleted. (WebCore::TestDOMJITByteStringNullableAttrDOMJIT::TestDOMJITByteStringNullableAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITByteStringNullableAttr): Deleted. (WebCore::TestDOMJITUsvStringNullableAttrDOMJIT::TestDOMJITUsvStringNullableAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITUsvStringNullableAttr): Deleted. (WebCore::TestDOMJITNodeNullableAttrDOMJIT::TestDOMJITNodeNullableAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITNodeNullableAttr): Deleted. * bindings/scripts/test/JS/JSTestDOMJIT.h: * bindings/scripts/test/JS/JSTestEventConstructor.cpp: (WebCore::JSTestEventConstructorPrototype::finishCreation): (WebCore::jsTestEventConstructorAttr1): (WebCore::jsTestEventConstructorAttr2): (WebCore::jsTestEventConstructorAttr3): * bindings/scripts/test/JS/JSTestEventTarget.cpp: (WebCore::JSTestEventTargetPrototype::finishCreation): * bindings/scripts/test/JS/JSTestException.cpp: (WebCore::JSTestExceptionPrototype::finishCreation): (WebCore::jsTestExceptionName): * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp: (WebCore::JSTestGenerateIsReachablePrototype::finishCreation): (WebCore::jsTestGenerateIsReachableASecretAttribute): * bindings/scripts/test/JS/JSTestGlobalObject.cpp: (WebCore::jsTestGlobalObjectRegularAttribute): * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp: (WebCore::JSTestIndexedSetterNoIdentifierPrototype::finishCreation): * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp: (WebCore::JSTestIndexedSetterThrowingExceptionPrototype::finishCreation): * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp: (WebCore::JSTestIndexedSetterWithIdentifierPrototype::finishCreation): * bindings/scripts/test/JS/JSTestInterface.cpp: (WebCore::JSTestInterfaceConstructor::initializeProperties): (WebCore::JSTestInterfacePrototype::finishCreation): (WebCore::jsTestInterfaceImplementsStr1): (WebCore::jsTestInterfaceImplementsStr2): (WebCore::jsTestInterfaceImplementsStr3): (WebCore::jsTestInterfaceImplementsNode): (WebCore::jsTestInterfaceSupplementalStr1): (WebCore::jsTestInterfaceSupplementalStr2): (WebCore::jsTestInterfaceSupplementalStr3): (WebCore::jsTestInterfaceSupplementalNode): * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp: (WebCore::JSTestInterfaceLeadingUnderscorePrototype::finishCreation): (WebCore::jsTestInterfaceLeadingUnderscoreReadonly): * bindings/scripts/test/JS/JSTestIterable.cpp: (WebCore::JSTestIterablePrototype::finishCreation): * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp: (WebCore::JSTestJSBuiltinConstructorPrototype::finishCreation): (WebCore::jsTestJSBuiltinConstructorTestAttributeCustom): (WebCore::jsTestJSBuiltinConstructorTestAttributeRWCustom): * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp: (WebCore::JSTestMediaQueryListListenerPrototype::finishCreation): * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp: (WebCore::JSTestNamedAndIndexedSetterNoIdentifierPrototype::finishCreation): * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp: (WebCore::JSTestNamedAndIndexedSetterThrowingExceptionPrototype::finishCreation): * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp: (WebCore::JSTestNamedAndIndexedSetterWithIdentifierPrototype::finishCreation): * bindings/scripts/test/JS/JSTestNamedConstructor.cpp: (WebCore::JSTestNamedConstructorPrototype::finishCreation): * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp: (WebCore::JSTestNamedDeleterNoIdentifierPrototype::finishCreation): * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp: (WebCore::JSTestNamedDeleterThrowingExceptionPrototype::finishCreation): * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp: (WebCore::JSTestNamedDeleterWithIdentifierPrototype::finishCreation): * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp: (WebCore::JSTestNamedDeleterWithIndexedGetterPrototype::finishCreation): * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp: (WebCore::JSTestNamedGetterCallWithPrototype::finishCreation): * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp: (WebCore::JSTestNamedGetterNoIdentifierPrototype::finishCreation): * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp: (WebCore::JSTestNamedGetterWithIdentifierPrototype::finishCreation): * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp: (WebCore::JSTestNamedSetterNoIdentifierPrototype::finishCreation): * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp: (WebCore::JSTestNamedSetterThrowingExceptionPrototype::finishCreation): * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp: (WebCore::JSTestNamedSetterWithIdentifierPrototype::finishCreation): * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp: (WebCore::JSTestNamedSetterWithIndexedGetterPrototype::finishCreation): * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp: (WebCore::JSTestNamedSetterWithIndexedGetterAndSetterPrototype::finishCreation): * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp: (WebCore::JSTestNamedSetterWithOverrideBuiltinsPrototype::finishCreation): * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp: (WebCore::JSTestNamedSetterWithUnforgablePropertiesPrototype::finishCreation): (WebCore::jsTestNamedSetterWithUnforgablePropertiesUnforgeableAttribute): * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp: (WebCore::JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsPrototype::finishCreation): (WebCore::jsTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsUnforgeableAttribute): * bindings/scripts/test/JS/JSTestNode.cpp: (WebCore::JSTestNodePrototype::finishCreation): (WebCore::jsTestNodeName): * bindings/scripts/test/JS/JSTestObj.cpp: (WebCore::JSTestObjConstructor::initializeProperties): (WebCore::JSTestObjPrototype::finishCreation): (WebCore::jsTestObjReadOnlyLongAttr): (WebCore::jsTestObjReadOnlyStringAttr): (WebCore::jsTestObjReadOnlyTestObjAttr): (WebCore::jsTestObjEnumAttr): (WebCore::jsTestObjByteAttr): (WebCore::jsTestObjOctetAttr): (WebCore::jsTestObjShortAttr): (WebCore::jsTestObjClampedShortAttr): (WebCore::jsTestObjEnforceRangeShortAttr): (WebCore::jsTestObjUnsignedShortAttr): (WebCore::jsTestObjLongAttr): (WebCore::jsTestObjLongLongAttr): (WebCore::jsTestObjUnsignedLongLongAttr): (WebCore::jsTestObjStringAttr): (WebCore::jsTestObjUsvstringAttr): (WebCore::jsTestObjTestObjAttr): (WebCore::jsTestObjTestNullableObjAttr): (WebCore::jsTestObjUnforgeableAttr): (WebCore::jsTestObjStringAttrTreatingNullAsEmptyString): (WebCore::jsTestObjUsvstringAttrTreatingNullAsEmptyString): (WebCore::jsTestObjByteStringAttrTreatingNullAsEmptyString): (WebCore::jsTestObjStringLongRecordAttr): (WebCore::jsTestObjUsvstringLongRecordAttr): (WebCore::jsTestObjStringObjRecordAttr): (WebCore::jsTestObjStringNullableObjRecordAttr): (WebCore::jsTestObjDictionaryAttr): (WebCore::jsTestObjNullableDictionaryAttr): (WebCore::jsTestObjAnnotatedTypeInUnionAttr): (WebCore::jsTestObjAnnotatedTypeInSequenceAttr): (WebCore::jsTestObjImplementationEnumAttr): (WebCore::jsTestObjXMLObjAttr): (WebCore::jsTestObjCreate): (WebCore::jsTestObjReflectedStringAttr): (WebCore::jsTestObjReflectedUSVStringAttr): (WebCore::jsTestObjReflectedIntegralAttr): (WebCore::jsTestObjReflectedUnsignedIntegralAttr): (WebCore::jsTestObjReflectedBooleanAttr): (WebCore::jsTestObjReflectedURLAttr): (WebCore::jsTestObjReflectedUSVURLAttr): (WebCore::jsTestObjReflectedCustomIntegralAttr): (WebCore::jsTestObjReflectedCustomBooleanAttr): (WebCore::jsTestObjReflectedCustomURLAttr): (WebCore::jsTestObjEnabledAtRuntimeAttribute): (WebCore::jsTestObjEnabledBySettingAttribute): (WebCore::jsTestObjTypedArrayAttr): (WebCore::jsTestObjAttributeWithGetterException): (WebCore::jsTestObjAttributeWithSetterException): (WebCore::jsTestObjStringAttrWithGetterException): (WebCore::jsTestObjStringAttrWithSetterException): (WebCore::jsTestObjCustomAttr): (WebCore::jsTestObjOnfoo): (WebCore::jsTestObjOnwebkitfoo): (WebCore::jsTestObjWithScriptStateAttribute): (WebCore::jsTestObjWithCallWithAndSetterCallWithAttribute): (WebCore::jsTestObjWithScriptExecutionContextAttribute): (WebCore::jsTestObjWithScriptStateAttributeRaises): (WebCore::jsTestObjWithScriptExecutionContextAttributeRaises): (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttribute): (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttributeRaises): (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute): (WebCore::jsTestObjConditionalAttr1): (WebCore::jsTestObjConditionalAttr2): (WebCore::jsTestObjConditionalAttr3): (WebCore::jsTestObjCachedAttribute1): (WebCore::jsTestObjCachedAttribute2): (WebCore::jsTestObjAnyAttribute): (WebCore::jsTestObjObjectAttribute): (WebCore::jsTestObjContentDocument): (WebCore::jsTestObjMutablePoint): (WebCore::jsTestObjStrawberry): (WebCore::jsTestObjDescription): (WebCore::jsTestObjId): (WebCore::jsTestObjHash): (WebCore::jsTestObjReplaceableAttribute): (WebCore::jsTestObjNullableDoubleAttribute): (WebCore::jsTestObjNullableLongAttribute): (WebCore::jsTestObjNullableBooleanAttribute): (WebCore::jsTestObjNullableStringAttribute): (WebCore::jsTestObjNullableLongSettableAttribute): (WebCore::jsTestObjNullableStringSettableAttribute): (WebCore::jsTestObjNullableUSVStringSettableAttribute): (WebCore::jsTestObjNullableByteStringSettableAttribute): (WebCore::jsTestObjNullableStringValue): (WebCore::jsTestObjAttribute): (WebCore::jsTestObjAttributeWithReservedEnumType): (WebCore::jsTestObjPutForwardsAttribute): (WebCore::jsTestObjPutForwardsNullableAttribute): (WebCore::jsTestObjStringifierAttribute): (WebCore::jsTestObjConditionallyReadWriteAttribute): (WebCore::jsTestObjConditionalAndConditionallyReadWriteAttribute): * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp: (WebCore::JSTestOverloadedConstructorsPrototype::finishCreation): * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp: (WebCore::JSTestOverloadedConstructorsWithSequencePrototype::finishCreation): * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp: (WebCore::JSTestOverrideBuiltinsPrototype::finishCreation): * bindings/scripts/test/JS/JSTestPluginInterface.cpp: (WebCore::JSTestPluginInterfacePrototype::finishCreation): * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp: (WebCore::JSTestPromiseRejectionEventPrototype::finishCreation): (WebCore::jsTestPromiseRejectionEventReason): * bindings/scripts/test/JS/JSTestSerialization.cpp: (WebCore::JSTestSerializationPrototype::finishCreation): (WebCore::jsTestSerializationFirstStringAttribute): (WebCore::jsTestSerializationSecondLongAttribute): (WebCore::jsTestSerializationThirdUnserializableAttribute): (WebCore::jsTestSerializationFourthUnrestrictedDoubleAttribute): (WebCore::jsTestSerializationFifthLongAttribute): (WebCore::jsTestSerializationSixthTypedefAttribute): (WebCore::jsTestSerializationSeventhDirectlySerializableAttribute): (WebCore::jsTestSerializationEighthIndirectlyAttribute): * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp: (WebCore::JSTestSerializationIndirectInheritancePrototype::finishCreation): * bindings/scripts/test/JS/JSTestSerializationInherit.cpp: (WebCore::JSTestSerializationInheritPrototype::finishCreation): (WebCore::jsTestSerializationInheritInheritLongAttribute): * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp: (WebCore::JSTestSerializationInheritFinalPrototype::finishCreation): (WebCore::jsTestSerializationInheritFinalFinalLongAttributeFoo): (WebCore::jsTestSerializationInheritFinalFinalLongAttributeBar): * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp: (WebCore::JSTestSerializedScriptValueInterfacePrototype::finishCreation): (WebCore::jsTestSerializedScriptValueInterfaceValue): (WebCore::jsTestSerializedScriptValueInterfaceReadonlyValue): (WebCore::jsTestSerializedScriptValueInterfaceCachedValue): (WebCore::jsTestSerializedScriptValueInterfacePorts): (WebCore::jsTestSerializedScriptValueInterfaceCachedReadonlyValue): * bindings/scripts/test/JS/JSTestStringifier.cpp: (WebCore::JSTestStringifierPrototype::finishCreation): * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp: (WebCore::JSTestStringifierAnonymousOperationPrototype::finishCreation): * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp: (WebCore::JSTestStringifierNamedOperationPrototype::finishCreation): * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp: (WebCore::JSTestStringifierOperationImplementedAsPrototype::finishCreation): * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp: (WebCore::JSTestStringifierOperationNamedToStringPrototype::finishCreation): * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp: (WebCore::JSTestStringifierReadOnlyAttributePrototype::finishCreation): (WebCore::jsTestStringifierReadOnlyAttributeIdentifier): * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp: (WebCore::JSTestStringifierReadWriteAttributePrototype::finishCreation): (WebCore::jsTestStringifierReadWriteAttributeIdentifier): * bindings/scripts/test/JS/JSTestTypedefs.cpp: (WebCore::JSTestTypedefsConstructor::initializeProperties): (WebCore::JSTestTypedefsPrototype::finishCreation): (WebCore::jsTestTypedefsUnsignedLongLongAttr): (WebCore::jsTestTypedefsSerializedScriptValue): (WebCore::jsTestTypedefsAttributeWithClamp): (WebCore::jsTestTypedefsAttributeWithClampInTypedef): (WebCore::jsTestTypedefsAttrWithGetterException): (WebCore::jsTestTypedefsAttrWithSetterException): (WebCore::jsTestTypedefsStringAttrWithGetterException): (WebCore::jsTestTypedefsStringAttrWithSetterException): (WebCore::jsTestTypedefsBufferSourceAttr): (WebCore::jsTestTypedefsDomTimeStampAttr): They are binding test rebaselines. * domjit/DOMJITIDLTypeFilter.h: * domjit/JSDocumentDOMJIT.cpp: (WebCore::compileDocumentDocumentElementAttribute): (WebCore::compileDocumentBodyAttribute): (WebCore::DocumentDocumentElementDOMJIT::callDOMGetter): Deleted. (WebCore::DocumentBodyDOMJIT::callDOMGetter): Deleted. * domjit/JSNodeDOMJIT.cpp: (WebCore::compileNodeFirstChildAttribute): (WebCore::compileNodeLastChildAttribute): (WebCore::compileNodeNextSiblingAttribute): (WebCore::compileNodePreviousSiblingAttribute): (WebCore::compileNodeParentNodeAttribute): (WebCore::compileNodeNodeTypeAttribute): (WebCore::compileNodeOwnerDocumentAttribute): (WebCore::NodeFirstChildDOMJIT::callDOMGetter): Deleted. (WebCore::NodeLastChildDOMJIT::callDOMGetter): Deleted. (WebCore::NodeNextSiblingDOMJIT::callDOMGetter): Deleted. (WebCore::NodePreviousSiblingDOMJIT::callDOMGetter): Deleted. (WebCore::NodeParentNodeDOMJIT::callDOMGetter): Deleted. (WebCore::NodeNodeTypeDOMJIT::callDOMGetter): Deleted. (WebCore::NodeOwnerDocumentDOMJIT::callDOMGetter): Deleted. DOMJIT::GetterSetter becomes smaller constexpr data. 2017-07-27 Xabier Rodriguez Calvar [GStreamer][EME] Not having a key id buffer should not always error https://bugs.webkit.org/show_bug.cgi?id=174889 Reviewed by Žan Doberšek. In r219946 we introduced a hard requirement for a key id buffer that does not happen for all CDMs. * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp: (webKitMediaClearKeyDecryptorSetupCipher): Check for key id buffer and error if we didn't get it. * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp: (webkitMediaCommonEncryptionDecryptTransformInPlace): Soften the requirement for key id buffer. 2017-07-27 Xabier Rodriguez Calvar [GStreamer][EME] Fix phony debug output in player base for supported key system https://bugs.webkit.org/show_bug.cgi?id=174888 Reviewed by Žan Doberšek. The debug output was returning always false because that method was not checking anything before. Now it is and should reflect it. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: (WebCore::MediaPlayerPrivateGStreamerBase::supportsKeySystem): 2017-07-27 Zan Dobersek [EME][GStreamer] Add barebones CDM interface implementations for ClearKey https://bugs.webkit.org/show_bug.cgi?id=174887 Reviewed by Xabier Rodriguez-Calvar. Add empty ClearKey derivations of CDMFactory, CDMPrivate and CDMInstance classes. These will be enhanced as the implementation progresses. ClearKey is added to CDMInstance::ImplementationType, and the CDMInstanceClearKey::implementationType() override returns that value. Type traits specialization for the CDMInstanceClearKey class is also added, utilizing the CDMInstance::ImplementationType::ClearKey value. The implementation file is added to the WPE build, along with the necessary inclusion directory. * PlatformWPE.cmake: * platform/encryptedmedia/CDMInstance.h: * platform/encryptedmedia/clearkey/CDMClearKey.cpp: Added. (WebCore::CDMFactoryClearKey::createCDM): (WebCore::CDMFactoryClearKey::supportsKeySystem): (WebCore::CDMPrivateClearKey::supportsInitDataType): (WebCore::CDMPrivateClearKey::supportsConfiguration): (WebCore::CDMPrivateClearKey::supportsConfigurationWithRestrictions): (WebCore::CDMPrivateClearKey::supportsSessionTypeWithConfiguration): (WebCore::CDMPrivateClearKey::supportsRobustness): (WebCore::CDMPrivateClearKey::distinctiveIdentifiersRequirement): (WebCore::CDMPrivateClearKey::persistentStateRequirement): (WebCore::CDMPrivateClearKey::distinctiveIdentifiersAreUniquePerOriginAndClearable): (WebCore::CDMPrivateClearKey::createInstance): (WebCore::CDMPrivateClearKey::loadAndInitialize): (WebCore::CDMPrivateClearKey::supportsServerCertificates): (WebCore::CDMPrivateClearKey::supportsSessions): (WebCore::CDMPrivateClearKey::supportsInitData): (WebCore::CDMPrivateClearKey::sanitizeResponse): (WebCore::CDMPrivateClearKey::sanitizeSessionId): (WebCore::CDMInstanceClearKey::initializeWithConfiguration): (WebCore::CDMInstanceClearKey::setDistinctiveIdentifiersAllowed): (WebCore::CDMInstanceClearKey::setPersistentStateAllowed): (WebCore::CDMInstanceClearKey::setServerCertificate): (WebCore::CDMInstanceClearKey::requestLicense): (WebCore::CDMInstanceClearKey::updateLicense): (WebCore::CDMInstanceClearKey::loadSession): (WebCore::CDMInstanceClearKey::closeSession): (WebCore::CDMInstanceClearKey::removeSessionData): (WebCore::CDMInstanceClearKey::storeRecordOfKeyUsage): * platform/encryptedmedia/clearkey/CDMClearKey.h: Added. 2017-07-27 Zan Dobersek [EME] Allow CDMInstance type traits specialization https://bugs.webkit.org/show_bug.cgi?id=174886 Reviewed by Xabier Rodriguez-Calvar. Allow using the trait-based type casting for the CDMInstance class and its derivatives. ImplementationType enumeration values are to be used and returned from the new implementationType() virtual method. This method is leveraged in the type trait specialization that enables using is<>() and downcast<>() helpers for CDMInstance objects. This will allow differentiating between CDMInstance implementations once the media playback pipeline has to retrieve any key information that's necessary for playback of encrypted content. MockCDMInstance class overrides the implementationType() method, returning the ImplementationType::Mock value. Type trait specializations for this class aren't added since they're not needed anywhere at this point. * platform/encryptedmedia/CDMInstance.h: * testing/MockCDMFactory.h: 2017-07-27 Zan Dobersek [GCrypt] Key serialization support https://bugs.webkit.org/show_bug.cgi?id=173883 Reviewed by Jiewen Tan. Implement crypto key serialization for platforms that use libgcrypt. Despite the function names and the existing implementation for the Mac port, we don't perform the KEK wrapping and unwrapping due to the review feedback advising against it. Instead the passed-in key data is simply copied and returned as the result of the 'wrapping' operation, and similarly the passed-in serialized data is simply copied and returned as the result of the 'unwrapping' operation. No new tests -- related tests are now passing and are unskipped. * crypto/gcrypt/SerializedCryptoKeyWrapGCrypt.cpp: (WebCore::getDefaultWebCryptoMasterKey): (WebCore::wrapSerializedCryptoKey): (WebCore::unwrapSerializedCryptoKey): 2017-07-26 Arnaud Renevier and Fujii Hironori Implement new TextMetrics, returned by canvas measureText() https://bugs.webkit.org/show_bug.cgi?id=82798 Reviewed by Dean Jackson. The specification: https://html.spec.whatwg.org/multipage/canvas.html#dom-context-2d-measuretext Add new attributes to TextMetrics. Add a new method textOffset() of CanvasRenderingContext2D by extracting from drawTextInternal() to use the same horizontal and vertical offsets of a text in both drawTextInternal() and measureText(). Test: fast/canvas/canvas-measureText-2.html * html/TextMetrics.h: (WebCore::TextMetrics::actualBoundingBoxLeft): (WebCore::TextMetrics::setActualBoundingBoxLeft): (WebCore::TextMetrics::actualBoundingBoxRight): (WebCore::TextMetrics::setActualBoundingBoxRight): (WebCore::TextMetrics::fontBoundingBoxAscent): (WebCore::TextMetrics::setFontBoundingBoxAscent): (WebCore::TextMetrics::fontBoundingBoxDescent): (WebCore::TextMetrics::setFontBoundingBoxDescent): (WebCore::TextMetrics::actualBoundingBoxAscent): (WebCore::TextMetrics::setActualBoundingBoxAscent): (WebCore::TextMetrics::actualBoundingBoxDescent): (WebCore::TextMetrics::setActualBoundingBoxDescent): (WebCore::TextMetrics::emHeightAscent): (WebCore::TextMetrics::setEmHeightAscent): (WebCore::TextMetrics::emHeightDescent): (WebCore::TextMetrics::setEmHeightDescent): (WebCore::TextMetrics::hangingBaseline): (WebCore::TextMetrics::setHangingBaseline): (WebCore::TextMetrics::alphabeticBaseline): (WebCore::TextMetrics::setAlphabeticBaseline): (WebCore::TextMetrics::ideographicBaseline): (WebCore::TextMetrics::setIdeographicBaseline): Added getters and setters. (WebCore::TextMetrics::TextMetrics): Deleted. * html/TextMetrics.idl: Added new attributes. * html/canvas/CanvasRenderingContext2D.cpp: (WebCore::CanvasRenderingContext2D::FontProxy::fontMetrics): Changed the return value type to a const reference of FontMetrics not to copy it. (WebCore::CanvasRenderingContext2D::FontProxy::width): Added the second arguemnt of GlyphOverflow type. (WebCore::CanvasRenderingContext2D::measureText): Calculate and set the new attributes of TextMetrics. (WebCore::CanvasRenderingContext2D::textOffset): Extracted from drawTextInternal. (WebCore::CanvasRenderingContext2D::drawTextInternal): Removed the offset calculation code and call textOffset. * html/canvas/CanvasRenderingContext2D.h: Added the method declaration of textOffset. Change types of fontMetrics and width methods. * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp: (WebCore::FontCascade::floatWidthForComplexText): Added a dummy implementation of calculating GlyphOverflow. 2017-07-26 Devin Rousso Web Inspector: create protocol for recording Canvas contexts https://bugs.webkit.org/show_bug.cgi?id=174481 Reviewed by Joseph Pecoraro. Currently, a recording doesn't actually "start" until an action is performed on the context. This change adds the recording logic, but it does not use it anywhere. Additonal tests will be added in the patches that add uses: - Web Inspector: Record actions performed on CanvasRenderingContext2D - Web Inspector: Record actions performed on WebGLRenderingContext Test: inspector/model/recording.html * bindings/scripts/IDLAttributes.json: * bindings/scripts/CodeGeneratorJS.pm: (GenerateAttributeGetterBodyDefinition): (GenerateAttributeSetterBodyDefinition): (GenerateImplementationFunctionCall): * WebCore.xcodeproj/project.pbxproj: * bindings/js/CallTracer.h: Added. * bindings/js/CallTracer.cpp: Added. (WebCore::CallTracer::recordCanvasAction): * bindings/js/CallTracerTypes.h: Added. * bindings/scripts/test/TestCallTracer.idl: Added. * bindings/scripts/test/JS/JSTestCallTracer.h: Added. * bindings/scripts/test/JS/JSTestCallTracer.cpp: Added. Create new IDL extended attribute called "CallTracingCallback" that will add code to call a static function on CallTracer with the given extended attribute value as the function name, the `impl` object as the first parameter, the name of the attribute/operation as the second, and an optional object that accepts an initializer list of all the parameters as the third. This function will not be called, however, unless a `callTracingActive` function on the `impl` object returns true, and this is marked as UNLIKELY. "CallTracingCallback" can be added to an Interface, in which case it will apply to all attributes/operations of the generated class, or an individual Attribute/Operation. * html/canvas/CanvasRenderingContext.h: (WebCore::CanvasRenderingContext::callTracingActive): (WebCore::CanvasRenderingContext::setCallTracingActive): * inspector/InspectorCanvas.h: * inspector/InspectorCanvas.cpp: (WebCore::InspectorCanvas::~InspectorCanvas): (WebCore::InspectorCanvas::resetRecordingData): (WebCore::InspectorCanvas::hasRecordingData): (WebCore::InspectorCanvas::recordAction): (WebCore::InspectorCanvas::releaseInitialState): (WebCore::InspectorCanvas::releaseFrames): (WebCore::InspectorCanvas::releaseData): (WebCore::InspectorCanvas::markNewFrame): (WebCore::InspectorCanvas::markCurrentFrameIncomplete): (WebCore::InspectorCanvas::setBufferLimit): (WebCore::InspectorCanvas::hasBufferSpace): (WebCore::InspectorCanvas::singleFrame): (WebCore::InspectorCanvas::setSingleFrame): (WebCore::InspectorCanvas::indexForData): (WebCore::buildArrayForAffineTransform): (WebCore::buildArrayForVector): (WebCore::InspectorCanvas::buildInitialState): (WebCore::InspectorCanvas::buildAction): (WebCore::InspectorCanvas::buildArrayForCanvasGradient): (WebCore::InspectorCanvas::buildArrayForCanvasPattern): (WebCore::InspectorCanvas::buildArrayForImageData): Hold the recording data on the corresponding InspectorCanvas. Recording Frames are completed when the HTMLCanvasElement paints or a 0_s timer is fired. A recording is not considered valid until at least one action is performed on the canvas context. Once that condition is satisfied, canceling the recording will flush the data. * inspector/InspectorCanvasAgent.h: * inspector/InspectorCanvasAgent.cpp: (WebCore::InspectorCanvasAgent::InspectorCanvasAgent): (WebCore::InspectorCanvasAgent::disable): (WebCore::InspectorCanvasAgent::requestRecording): (WebCore::InspectorCanvasAgent::cancelRecording): (WebCore::InspectorCanvasAgent::recordCanvasAction): (WebCore::InspectorCanvasAgent::didFinishRecordingCanvasFrame): (WebCore::InspectorCanvasAgent::canvasDestroyed): (WebCore::InspectorCanvasAgent::canvasRecordingTimerFired): (WebCore::InspectorCanvasAgent::clearCanvasData): * inspector/InspectorInstrumentation.h: * inspector/InspectorInstrumentation.cpp: (WebCore::InspectorInstrumentation::recordCanvasAction): (WebCore::InspectorInstrumentation::recordCanvasActionImpl): (WebCore::InspectorInstrumentation::didFinishRecordingCanvasFrameImpl): * html/canvas/CanvasRenderingContext2D.h: * html/canvas/CanvasRenderingContext2D.cpp: (WebCore::CanvasRenderingContext2D::stringForWindingRule): (WebCore::CanvasRenderingContext2D::stringForImageSmoothingQuality): * platform/graphics/Gradient.h: (WebCore::Gradient::stops): * svg/SVGPathUtilities.h: * svg/SVGPathUtilities.cpp: (WebCore::buildStringFromPath): 2017-07-26 Ali Juma Implement document.elementsFromPoint https://bugs.webkit.org/show_bug.cgi?id=153137 Reviewed by Simon Fraser. This ports Blink's implementation of elementsFromPoint, from the following patches by Philip Rogers (pdr@chromium.org): -https://src.chromium.org/viewvc/blink?revision=190686&view=revision -https://src.chromium.org/viewvc/blink?revision=191240&view=revision -https://src.chromium.org/viewvc/blink?revision=199214&view=revision Tests: imported/w3c/web-platform-tests/cssom-view/elementsFromPoint-iframes.html imported/w3c/web-platform-tests/cssom-view/elementsFromPoint-invalid-cases.html imported/w3c/web-platform-tests/cssom-view/elementsFromPoint-shadowroot.html imported/w3c/web-platform-tests/cssom-view/elementsFromPoint-simple.html imported/w3c/web-platform-tests/cssom-view/elementsFromPoint-svg.html imported/w3c/web-platform-tests/cssom-view/elementsFromPoint-table.html * dom/DocumentOrShadowRoot.idl: * dom/TreeScope.cpp: (WebCore::absolutePointIfNotClipped): (WebCore::TreeScope::nodeFromPoint): (WebCore::TreeScope::elementFromPoint): (WebCore::TreeScope::elementsFromPoint): * dom/TreeScope.h: * page/EventHandler.cpp: (WebCore::EventHandler::hitTestResultAtPoint): * rendering/EllipsisBox.cpp: (WebCore::EllipsisBox::nodeAtPoint): * rendering/HitTestRequest.h: (WebCore::HitTestRequest::HitTestRequest): (WebCore::HitTestRequest::resultIsElementList): (WebCore::HitTestRequest::includesAllElementsUnderPoint): * rendering/HitTestResult.cpp: (WebCore::HitTestResult::HitTestResult): (WebCore::HitTestResult::operator=): (WebCore::HitTestResult::addNodeToListBasedTestResult): (WebCore::HitTestResult::append): (WebCore::HitTestResult::listBasedTestResult): (WebCore::HitTestResult::mutableListBasedTestResult): (WebCore::HitTestResult::addNodeToRectBasedTestResult): Deleted. (WebCore::HitTestResult::rectBasedTestResult): Deleted. (WebCore::HitTestResult::mutableRectBasedTestResult): Deleted. * rendering/HitTestResult.h: * rendering/InlineFlowBox.cpp: (WebCore::InlineFlowBox::nodeAtPoint): * rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::nodeAtPoint): * rendering/RenderBlock.cpp: (WebCore::RenderBlock::nodeAtPoint): * rendering/RenderBox.cpp: (WebCore::RenderBox::nodeAtPoint): * rendering/RenderImage.cpp: (WebCore::RenderImage::nodeAtPoint): * rendering/RenderInline.cpp: (WebCore::RenderInline::hitTestCulledInline): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::hitTestFixedLayersInNamedFlows): (WebCore::RenderLayer::hitTestLayer): (WebCore::RenderLayer::hitTestContents): (WebCore::RenderLayer::hitTestList): (WebCore::RenderLayer::calculateClipRects): * rendering/RenderTable.cpp: (WebCore::RenderTable::nodeAtPoint): * rendering/RenderTableSection.cpp: (WebCore::RenderTableSection::nodeAtPoint): * rendering/RenderWidget.cpp: (WebCore::RenderWidget::nodeAtPoint): * rendering/SimpleLineLayoutFunctions.cpp: (WebCore::SimpleLineLayout::hitTestFlow): * rendering/svg/RenderSVGContainer.cpp: (WebCore::RenderSVGContainer::nodeAtFloatPoint): * rendering/svg/RenderSVGImage.cpp: (WebCore::RenderSVGImage::nodeAtFloatPoint): * rendering/svg/RenderSVGRoot.cpp: (WebCore::RenderSVGRoot::nodeAtPoint): * rendering/svg/RenderSVGShape.cpp: (WebCore::RenderSVGShape::nodeAtFloatPoint): * rendering/svg/SVGInlineTextBox.cpp: (WebCore::SVGInlineTextBox::nodeAtPoint): * testing/Internals.cpp: (WebCore::Internals::nodesFromRect): 2017-07-26 Charlie Turner [GStreamer] Review WebKitWebSource after r219252. https://bugs.webkit.org/show_bug.cgi?id=174415 Reviewed by Carlos Garcia Campos. Remove ResourceHandleStreamingClient, and flatten the StreamingClient into CachedResourceStreamingClient (the only implemetation left). They are no longer required after r219252. Also remove the locking code. It's not needed now, and what existed was heavy-handed and missed several cases it was supposed to protect Covered by existing tests. * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp: (webkit_web_src_init): (webKitWebSrcDispose): (webKitWebSrcStop): (webKitWebSrcStart): (webKitWebSrcNeedData): (webKitWebSrcEnoughData): (webKitWebSrcSeek): (webKitWebSrcSetMediaPlayer): (CachedResourceStreamingClient::CachedResourceStreamingClient): (CachedResourceStreamingClient::~CachedResourceStreamingClient): (CachedResourceStreamingClient::getOrCreateReadBuffer): (CachedResourceStreamingClient::responseReceived): (CachedResourceStreamingClient::dataReceived): (CachedResourceStreamingClient::loadFinished): (ResourceHandleStreamingClient::create): Deleted. (): Deleted. (StreamingClient::StreamingClient): Deleted. (StreamingClient::~StreamingClient): Deleted. (StreamingClient::createReadBuffer): Deleted. (StreamingClient::handleResponseReceived): Deleted. (StreamingClient::handleDataReceived): Deleted. (StreamingClient::handleNotifyFinished): Deleted. (ResourceHandleStreamingClient::ResourceHandleStreamingClient): Deleted. (ResourceHandleStreamingClient::~ResourceHandleStreamingClient): Deleted. (ResourceHandleStreamingClient::cleanupAndStopRunLoop): Deleted. (ResourceHandleStreamingClient::invalidate): Deleted. (ResourceHandleStreamingClient::loadFailed): Deleted. (ResourceHandleStreamingClient::setDefersLoading): Deleted. (ResourceHandleStreamingClient::getOrCreateReadBuffer): Deleted. (ResourceHandleStreamingClient::willSendRequest): Deleted. (ResourceHandleStreamingClient::didReceiveResponse): Deleted. (ResourceHandleStreamingClient::didReceiveData): Deleted. (ResourceHandleStreamingClient::didReceiveBuffer): Deleted. (ResourceHandleStreamingClient::didFinishLoading): Deleted. (ResourceHandleStreamingClient::didFail): Deleted. (ResourceHandleStreamingClient::wasBlocked): Deleted. (ResourceHandleStreamingClient::cannotShowURL): Deleted. 2017-07-26 Brian Burg Remove WEB_TIMING feature flag https://bugs.webkit.org/show_bug.cgi?id=174795 Reviewed by Alex Christensen. * Configurations/FeatureDefines.xcconfig: * bindings/js/JSPerformanceEntryCustom.cpp: * dom/Document.cpp: (WebCore::Document::setReadyState): (WebCore::Document::finishedParsing): * dom/Document.h: (WebCore::Document::timing): * dom/DocumentTiming.h: * dom/EventTargetFactory.in: * loader/DocumentThreadableLoader.cpp: (WebCore::DocumentThreadableLoader::finishedTimingForWorkerLoad): (WebCore::DocumentThreadableLoader::loadRequest): * loader/DocumentThreadableLoader.h: * loader/ResourceTimingInformation.cpp: * loader/ResourceTimingInformation.h: * loader/SubresourceLoader.cpp: (WebCore::SubresourceLoader::didFinishLoading): (WebCore::SubresourceLoader::reportResourceTiming): * loader/SubresourceLoader.h: * loader/ThreadableLoaderClient.h: (WebCore::ThreadableLoaderClient::didFail): (WebCore::ThreadableLoaderClient::didFinishTiming): * loader/WorkerThreadableLoader.cpp: (WebCore::WorkerThreadableLoader::MainThreadBridge::didFinishTiming): * loader/WorkerThreadableLoader.h: * loader/cache/CachedResourceLoader.cpp: (WebCore::CachedResourceLoader::requestResource): (WebCore::CachedResourceLoader::revalidateResource): (WebCore::CachedResourceLoader::loadResource): * loader/cache/CachedResourceLoader.h: (WebCore::CachedResourceLoader::resourceTimingInformation): * page/DOMWindow.cpp: (WebCore::DOMWindow::~DOMWindow): (WebCore::DOMWindow::resetDOMWindowProperties): (WebCore::DOMWindow::nowTimestamp): (WebCore::DOMWindow::removeAllEventListeners): * page/DOMWindow.h: * page/GlobalPerformance.idl: * page/Performance.cpp: * page/Performance.h: * page/Performance.idl: * page/PerformanceEntry.cpp: * page/PerformanceEntry.h: * page/PerformanceEntry.idl: * page/PerformanceMark.h: * page/PerformanceMark.idl: * page/PerformanceMeasure.h: * page/PerformanceMeasure.idl: * page/PerformanceNavigation.cpp: * page/PerformanceNavigation.h: * page/PerformanceNavigation.idl: * page/PerformanceObserver.cpp: * page/PerformanceObserver.h: * page/PerformanceObserver.idl: * page/PerformanceObserverCallback.h: * page/PerformanceObserverCallback.idl: * page/PerformanceObserverEntryList.cpp: * page/PerformanceObserverEntryList.h: * page/PerformanceObserverEntryList.idl: * page/PerformanceResourceTiming.cpp: * page/PerformanceResourceTiming.h: * page/PerformanceResourceTiming.idl: * page/PerformanceTiming.cpp: * page/PerformanceTiming.h: * page/PerformanceTiming.idl: * page/PerformanceUserTiming.cpp: * page/PerformanceUserTiming.h: * platform/network/ResourceHandle.h: * platform/network/ResourceHandleInternal.h: * platform/network/cf/ResourceHandleCFNet.cpp: (WebCore::ResourceHandle::start): * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp: (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse): * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp: (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveResponse): * platform/network/curl/ResourceHandleCurl.cpp: (WebCore::ResourceHandleInternal::didFinish): (WebCore::ResourceHandleInternal::calculateWebTimingInformations): (WebCore::ResourceHandleInternal::dispatchSynchronousJob): * platform/network/mac/ResourceHandleMac.mm: (WebCore::ResourceHandle::createNSURLConnection): * platform/network/mac/WebCoreResourceHandleAsDelegate.mm: (-[WebCoreResourceHandleAsDelegate connection:didReceiveResponse:]): * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm: (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]): * platform/network/soup/ResourceHandleSoup.cpp: (WebCore::restartedCallback): (WebCore::sendRequestCallback): (WebCore::createSoupMessageForHandleAndRequest): (WebCore::ResourceHandle::sendPendingRequest): * platform/network/soup/SoupNetworkSession.cpp: (WebCore::SoupNetworkSession::SoupNetworkSession): * workers/WorkerGlobalScope.cpp: (WebCore::WorkerGlobalScope::WorkerGlobalScope): (WebCore::WorkerGlobalScope::~WorkerGlobalScope): (WebCore::WorkerGlobalScope::removeAllEventListeners): * workers/WorkerGlobalScope.h: 2017-07-26 Chris Dumez Pressing the Escape key should not be a valid user gesture to enter fullscreen https://bugs.webkit.org/show_bug.cgi?id=174864 Reviewed by Geoffrey Garen. Pressing the Escape key should not be a valid user gesture to enter fullscreen since this is the gesture to exit fullscreen already. Test: fullscreen/requestFullscreen-escape-key.html * dom/Document.cpp: (WebCore::Document::requestFullScreenForElement): * dom/UserGestureIndicator.cpp: (WebCore::UserGestureIndicator::UserGestureIndicator): * dom/UserGestureIndicator.h: (WebCore::UserGestureToken::create): (WebCore::UserGestureToken::gestureType): (WebCore::UserGestureToken::UserGestureToken): * page/EventHandler.cpp: (WebCore::EventHandler::internalKeyEvent): 2017-07-26 Nan Wang AX: Incorrect range from index and length in contenteditable with

tags https://bugs.webkit.org/show_bug.cgi?id=174856 Reviewed by Chris Fleizach. When asking for the string inside a text control with a given range, we sometimes get a wrong string at the line boundary due to a bad plain range to text marker conversion. To fix this, we should use the exsisting method on text controls to avoid this issue. Updated the test to test the problematic case. * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]): 2017-07-26 Daewoong Jang [Curl] Bug fix after r219606 https://bugs.webkit.org/show_bug.cgi?id=174845 Reviewed by Alex Christensen. * platform/network/curl/CurlContext.h: (WebCore::CurlSList::isEmpty): * platform/network/curl/ResourceHandleCurl.cpp: (WebCore::ResourceHandleInternal::didReceiveHeaderLine): (WebCore::ResourceHandleInternal::headerCallback): 2017-07-26 Zan Dobersek [EME][GStreamer] Multi-key support in the GStreamer ClearKey decryptor https://bugs.webkit.org/show_bug.cgi?id=174779 Reviewed by Xabier Rodriguez-Calvar. In the CENC decryptor, the key ID value is retrieved from the info structure on the GstProtectionMeta object. GstBuffer for that value is retrieved and passed to the setupCipher() function. In the ClearKey decryptor (which extends the CENC decryptor), the single GstBuffer object on the private instance that holds the key value is replaced with a Vector object that holds pairs of key ID and value GstBuffers. In the handleKeyResponse() implementation that Vector is emptied and then refilled with key ID and value pairs that are passed in through the drm-cipher-clearkey structure that's attached to the GstEvent that signalled new key information. In the ClearKey decryptor's setupCipher() implementation the passed-in key ID buffer is used to find a matching key ID and value pair stored on the private instance. If not found, an error is thrown. If found, the matching key value is used for decryption. * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp: (webKitMediaClearKeyDecryptorHandleKeyResponse): (webKitMediaClearKeyDecryptorSetupCipher): * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp: (webkitMediaCommonEncryptionDecryptTransformInPlace): (webKitMediaCommonEncryptionDecryptDefaultSetupCipher): * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.h: 2017-07-26 Zan Dobersek [EME][GStreamer] Handle ClearKey as a supported key system https://bugs.webkit.org/show_bug.cgi?id=174778 Reviewed by Xabier Rodriguez-Calvar. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: (WebCore::MediaPlayerPrivateGStreamerBase::supportsKeySystem): Return true for the 'org.w3.clearkey' key system when building with ENCRYPTED_MEDIA enabled. The underlying implementation will follow. 2017-07-26 Claudio Saavedra [WPE] Fix a potential crash in the platform pasteboard when reading a string https://bugs.webkit.org/show_bug.cgi?id=174859 Reviewed by Žan Doberšek. We shouldn't assume that the wpe_pasteboard_string struct will be filled in, so initialize it. * platform/wpe/PlatformPasteboardWPE.cpp: (WebCore::PlatformPasteboard::readString): Initialize the struct before passing it to wpe and early return if it's still empty. 2017-07-26 Javier Fernandez InsertOrderedList command applied to table cells inserts an extra BR before the table https://bugs.webkit.org/show_bug.cgi?id=174593 Reviewed by Darin Adler. Don't add BR when pruning empty blocks if it's the start of a paragraph. The function MoveParagraph is used for several operations and editing commands, like 'insertOrderedList'. When moving paragraphs we check out whether we should add a 'br' element to avoid undesired block collapse. However, we shouldn't do this when destination is the start of a paragraph. Tests: editing/inserting/insert-list-in-table-cell-01.html editing/inserting/insert-list-in-table-cell-02.html editing/inserting/insert-list-in-table-cell-03.html editing/inserting/insert-list-in-table-cell-04.html editing/inserting/insert-list-in-table-cell-05.html editing/inserting/insert-list-in-table-cell-06.html editing/inserting/insert-list-in-table-cell-07.html editing/inserting/insert-list-in-table-cell-08.html * editing/CompositeEditCommand.cpp: (WebCore::CompositeEditCommand::moveParagraphs): 2017-07-26 Zan Dobersek [WPE] WebGL2 support https://bugs.webkit.org/show_bug.cgi?id=174249 Reviewed by Alex Christensen. Implement WebGL2 support in GraphicsContext3DCairo for the WPE port, but keep the implementation specific to libepoxy (which WPE leverages by default). In the GraphicsContext3D::create() method, we first construct the GraphicsContext3D object that also ensures a current GL context on this thread. Only then can we determine through libepoxy whether the underlying GL library is able to support WebGL2. For WebGL2, the GLES3 support is required. The initial libepoxy implementation ensures this only in case of 'non-desktop GL' library of minimum version 3.0. This effectively translates to the only supported configuration being the EGL and OpenGL ES 3.0 (or higher) combination. If this cannot be ensured, we discard the existing GraphicsContext3D object and return null. WebGL2 can also be supported via OpenGL (i.e. 'desktop GL'), but this hasn't been tested yet. Implementation will in the future be extended to support that as required. In the GraphicsContext3D constructor itself, the ANGLEWebKitBridge constructor has to now receive the second argument, the desired shader specification that's used when parsing the provided shaders. This should be SH_WEBGL_SPEC for WebGL1, and SH_WEBGL2_SPEC for WebGL2. No new tests -- a small set of existing WebGL2 tests is unskipped and passing. * platform/graphics/cairo/GraphicsContext3DCairo.cpp: (WebCore::GraphicsContext3D::create): (WebCore::GraphicsContext3D::GraphicsContext3D): * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp: Add WebGL2-specific methods to the build. 2017-07-26 Nan Wang AX: should dispatch accessibilityPerformPressAction async on MacOS https://bugs.webkit.org/show_bug.cgi?id=174849 Reviewed by Chris Fleizach. If performing the accessibility press action results in a modal alert being displayed, it can cause VoiceOver to hang. To fix it, we should dispatch the action asynchronously. Updated tests to adapt to this change. * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper accessibilityPerformPressAction]): (-[WebAccessibilityObjectWrapper _accessibilityPerformPressAction]): 2017-07-25 Carlos Garcia Campos Icon loader error on startup https://bugs.webkit.org/show_bug.cgi?id=174787 Reviewed by Brady Eidson. This is a regression of the new icon loading, it happens with pages that shouldn't have a favicon, like about pages. IconController::startLoader() did several checks before starting the load that DocumentLoader::startIconLoading() is not doing. It checked that the frame is the main one, the document can have an icon (document url is not empty and not about:blank) and that favicon url is in HTTP family. We should do the same checks now before starting to load icons. * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::startIconLoading): 2017-07-25 Sam Weinig [WebIDL] Remove custom bindings for HTMLCanvasElement https://bugs.webkit.org/show_bug.cgi?id=174847 Reviewed by Darin Adler. * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSBindingsAllInOne.cpp: * bindings/js/JSHTMLCanvasElementCustom.cpp: Removed. Remove JSHTMLCanvasElementCustom. * html/HTMLCanvasElement.cpp: (WebCore::HTMLCanvasElement::getContext): (WebCore::HTMLCanvasElement::getContext2d): (WebCore::HTMLCanvasElement::getContextWebGL): (WebCore::HTMLCanvasElement::getContextWebGPU): * html/HTMLCanvasElement.h: * html/HTMLCanvasElement.idl: Move context picking code to HTMLCanvasElement. Give more exact types to remaining context getters. 2017-07-25 Chris Dumez Clean up ExceptionCode enumeration https://bugs.webkit.org/show_bug.cgi?id=174812 Reviewed by Darin Adler. Clean up ExceptionCode enumeration: - Updated comments to reflect the latest WebIDL specification - Drop special values given to some exception codes. Those legacy codes are already in the table inside DOMException.cpp. This also allows us to drop empty rows in the DOMException table - Drop NoException value in the enumeration and use std::optional when needed instead. * Modules/indexeddb/shared/IDBError.cpp: (WebCore::IDBError::IDBError): (WebCore::IDBError::name): (WebCore::IDBError::message): * Modules/indexeddb/shared/IDBError.h: (WebCore::IDBError::code): (WebCore::IDBError::encode): (WebCore::IDBError::decode): * dom/DOMException.cpp: * dom/ExceptionCode.h: * fileapi/FileReaderSync.cpp: (WebCore::errorCodeToException): (WebCore::FileReaderSync::startLoading): * xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::createRequest): * xml/XMLHttpRequest.h: 2017-07-25 Andy Estes [Apple Pay] Add "carteBancaire" as a supported payment network https://bugs.webkit.org/show_bug.cgi?id=174841 Reviewed by Alex Christensen. Tests: http/tests/ssl/applepay/ApplePaySession.html http/tests/ssl/applepay/ApplePaySessionV3.html * Modules/applepay/PaymentRequest.cpp: (WebCore::PaymentRequest::isValidSupportedNetwork): 2017-07-25 Daniel Bates Make StyleResolver::isValid{Cue, Region}StyleProperty() static, inline, non-member functions https://bugs.webkit.org/show_bug.cgi?id=174827 Reviewed by Simon Fraser. StyleResolver::isValid{Cue, Region}StyleProperty() access neither instance nor class data. Moreover, they are private member functions and hence cannot be used outside of StyleResolver's implementation. So, make these static, inline, non-member functions. * css/StyleResolver.cpp: (WebCore::isValidRegionStyleProperty): (WebCore::isValidCueStyleProperty): (WebCore::StyleResolver::CascadedProperties::addMatch): (WebCore::StyleResolver::isValidRegionStyleProperty): Deleted. (WebCore::StyleResolver::isValidCueStyleProperty): Deleted. * css/StyleResolver.h: 2017-07-25 Per Arne Vollan Dragged links are blurry on 1x displays. https://bugs.webkit.org/show_bug.cgi?id=174831 Reviewed by Simon Fraser. When the width and height of the drag image is a multiple of 2, the drag image is not blurry on a 1x display. This is a workaround which should be removed when is fixed. No new tests, since this is not straightforward to test with a layout test. * platform/mac/DragImageMac.mm: (WebCore::LinkImageLayout::LinkImageLayout): 2017-07-25 Matt Baker Web Inspector: Refactoring: extract async stack trace logic from InspectorInstrumentation https://bugs.webkit.org/show_bug.cgi?id=174738 Reviewed by Brian Burg. Relocate AsyncCallType from InspectorInstrumentation to the debugger agent. Plumbing for `requestAnimationFrame` notifications has been added to PageDebuggerAgent, which is responsible for managing async stack traces. * dom/ScriptedAnimationController.cpp: (WebCore::ScriptedAnimationController::registerCallback): (WebCore::ScriptedAnimationController::cancelCallback): (WebCore::ScriptedAnimationController::serviceScriptedAnimations): * inspector/InspectorInstrumentation.cpp: (WebCore::InspectorInstrumentation::didInstallTimerImpl): (WebCore::InspectorInstrumentation::didRemoveTimerImpl): (WebCore::InspectorInstrumentation::willFireTimerImpl): (WebCore::InspectorInstrumentation::didRequestAnimationFrameImpl): (WebCore::InspectorInstrumentation::didCancelAnimationFrameImpl): (WebCore::InspectorInstrumentation::willFireAnimationFrameImpl): (): Deleted. (WebCore::didScheduleAsyncCall): Deleted. * inspector/InspectorInstrumentation.h: (WebCore::InspectorInstrumentation::didRequestAnimationFrame): (WebCore::InspectorInstrumentation::didCancelAnimationFrame): (WebCore::InspectorInstrumentation::willFireAnimationFrame): Replaced Frame and Document pointers with references and moved pointer validation upstream. * inspector/PageDebuggerAgent.cpp: (WebCore::PageDebuggerAgent::didRequestAnimationFrame): (WebCore::PageDebuggerAgent::willFireAnimationFrame): (WebCore::PageDebuggerAgent::didCancelAnimationFrame): * inspector/PageDebuggerAgent.h: 2017-07-25 Said Abou-Hallawa Async image decoding for large images should be disabled after the first time a tile is painted https://bugs.webkit.org/show_bug.cgi?id=174451 Reviewed by Simon Fraser. Flashing because of DOM mutation can be fixed by disabling the asynchronous image decoding after the first time a tile was painted. We can detect this by consulting the tile repaintCount. If it is zero, then it is safe to use asynchronous image decoded. If the tile repaintCount is greater than zero, we are not sure if the renderer rectangle has an image drawn in it already or not. In this case we have to use the synchronous image decoding to avoid causing a flash. Tests: fast/images/async-image-background-change.html fast/images/async-image-src-change.html http/tests/multipart/multipart-async-image.html * html/shadow/MediaControlElements.cpp: (WebCore::MediaControlTextTrackContainerElement::createTextTrackRepresentationImage): * page/FrameView.cpp: (WebCore::FrameView::willPaintContents): (WebCore::FrameView::paintContentsForSnapshot): * page/PageOverlayController.cpp: (WebCore::PageOverlayController::paintContents): * page/PageOverlayController.h: * page/linux/ResourceUsageOverlayLinux.cpp: * page/mac/ServicesOverlayController.h: * page/mac/ServicesOverlayController.mm: (WebCore::ServicesOverlayController::Highlight::paintContents): * platform/graphics/BitmapImage.cpp: (WebCore::BitmapImage::draw): * platform/graphics/BitmapImage.h: * platform/graphics/GraphicsLayer.cpp: (WebCore::GraphicsLayer::paintGraphicsLayerContents): * platform/graphics/GraphicsLayer.h: * platform/graphics/GraphicsLayerClient.h: (WebCore::GraphicsLayerClient::paintContents): * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp: (WebCore::LayerClient::platformCALayerPaintContents): * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::platformCALayerPaintContents): * platform/graphics/ca/GraphicsLayerCA.h: * platform/graphics/ca/PlatformCALayer.h: * platform/graphics/ca/PlatformCALayerClient.h: (WebCore::PlatformCALayerClient::platformCALayerRepaintCount): * platform/graphics/ca/TileCoverageMap.cpp: (WebCore::TileCoverageMap::platformCALayerPaintContents): * platform/graphics/ca/TileCoverageMap.h: * platform/graphics/ca/TileGrid.cpp: (WebCore::TileGrid::platformCALayerPaintContents): (WebCore::TileGrid::platformCALayerRepaintCount): * platform/graphics/ca/TileGrid.h: * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm: (PlatformCALayer::drawLayerContents): * platform/graphics/ca/win/PlatformCALayerWin.cpp: (PlatformCALayer::drawLayerContents): * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp: (PlatformCALayerWinInternal::displayCallback): * platform/graphics/ca/win/WebTiledBackingLayerWin.cpp: (WebTiledBackingLayerWin::displayCallback): * platform/graphics/mac/WebLayer.mm: (-[WebLayer drawInContext:]): (-[WebSimpleLayer drawInContext:]): * rendering/PaintPhase.h: * rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::decodingModeForImageDraw): * rendering/RenderElement.h: * rendering/RenderLayer.cpp: (WebCore::RenderLayer::paintLayerContents): (WebCore::RenderLayer::paintForegroundForFragments): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::paintContents): * rendering/RenderLayerBacking.h: * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::paintContents): * rendering/RenderLayerCompositor.h: * rendering/RenderWidget.cpp: (WebCore::RenderWidget::paintContents): * testing/Internals.cpp: (WebCore::imageFromImageElement): (WebCore::bitmapImageFromImageElement): (WebCore::Internals::imageFrameIndex): (WebCore::Internals::setImageFrameDecodingDuration): (WebCore::Internals::resetImageAnimation): (WebCore::Internals::isImageAnimating): (WebCore::Internals::setClearDecoderAfterAsyncFrameRequestForTesting): (WebCore::Internals::imageDecodeCount): (WebCore::Internals::setLargeImageAsyncDecodingEnabledForTesting): * testing/Internals.h: * testing/Internals.idl: 2017-07-23 Sam Weinig [WebIDL] Add support for generating timer bindings https://bugs.webkit.org/show_bug.cgi?id=174766 Reviewed by Darin Adler. Adds a new non-standard type, ScheduledAction, which stands in for the standard (DOMString or Function). It would be good to move to that in future, but for now, this allows for forward momentum on removing custom bindings. * WebCore.xcodeproj/project.pbxproj: Add JSDOMConvertScheduledAction.h. * bindings/IDLTypes.h: Add IDLScheduledAction. * bindings/js/JSDOMConvertScheduledAction.h: Added. (WebCore::Converter::convert): Add conversion from JSValue -> ScheduledAction. This is moved from the old ScheduledAction create function. * bindings/js/JSDOMConvertVariadic.h: (WebCore::convertVariadicArguments): (WebCore::Detail::VariadicConverterBase::convert): Deleted. (WebCore::Detail::VariadicConverterBase>::convert): Deleted. * bindings/js/JSDOMConvertBase.h: * bindings/js/JSDOMConvertAny.h: (WebCore::VariadicConverter::convert): * bindings/js/JSDOMConvertInterface.h: (WebCore::VariadicConverter>::convert): Rename VariadicConverter to VariadicConverterDetails, and remove base class. Rename VariadicConverterBase to VariadicConverter, and move specializations to the file containing the base converter for that IDL type * bindings/js/JSDOMWindowCustom.cpp: (WebCore::JSDOMWindow::setTimeout): Deleted. (WebCore::JSDOMWindow::setInterval): Deleted. * bindings/js/JSWorkerGlobalScopeCustom.cpp: (WebCore::JSWorkerGlobalScope::setTimeout): Deleted. (WebCore::JSWorkerGlobalScope::setInterval): Deleted. Remove custom implementations of setTimeout and setInterval. * bindings/js/ScheduledAction.cpp: (WebCore::ScheduledAction::create): (WebCore::ScheduledAction::ScheduledAction): (WebCore::ScheduledAction::~ScheduledAction): (WebCore::ScheduledAction::addArguments): (WebCore::ScheduledAction::executeFunctionInContext): * bindings/js/ScheduledAction.h: (WebCore::ScheduledAction::ScheduledAction): Deleted. Rework ScheduledAction. Now has two create functions, one for the function form, one for the string form. These are now called by the Converter. Also, rather than extracting the arguments directly from the ExecState, allow the bindings to work as designed, and have the arguments come in as variadic arguments to setTimeout/setInterval and get added to the ScheduledAction if needed. Also, move ContentSecurityPolicy check out of construction, and into setTimeout/setInterval. * bindings/scripts/CodeGenerator.pm: (IsBuiltinType): Add ScheduledAction to the builtin list. * bindings/scripts/CodeGeneratorJS.pm: (AddToIncludesForIDLType): Add the correct include when ScheduledAction is used. (GenerateParametersCheck): Remove rule disallowing optional arguments before variadic arguments. That works just fine. (GetBaseIDLType): Add mapping of ScheduledAction -> IDLScheduledAction. (JSValueToNativeDOMConvertNeedsGlobalObject): Add ScheduledAction to the list of types that need a global object for conversion. * page/WindowOrWorkerGlobalScope.idl: Update interface to match spec and add FIXMEs for moving to TimerHandler. * page/DOMWindow.cpp: (WebCore::DOMWindow::setTimeout): (WebCore::DOMWindow::setInterval): * page/DOMWindow.h: * workers/WorkerGlobalScope.cpp: (WebCore::WorkerGlobalScope::setTimeout): (WebCore::WorkerGlobalScope::setInterval): * workers/WorkerGlobalScope.h: Update for new signatures. WorkerGlobalScope now has to return ExceptionOr even though it never throws, due to having one IDL file defining these. This is unfortunate and something we should look at addressing the future. 2017-07-25 Yoshiaki Jitsukawa [WinCairo] Fix build with AllInOnes disabled https://bugs.webkit.org/show_bug.cgi?id=174784 Reviewed by Alex Christensen. * PlatformWin.cmake: Add RenderThemeWin.cpp to WebCore_SOURCES * rendering/RenderingAllInOne.cpp: Remove #include "RenderThemeWin.cpp" * testing/MemoryInfo.h: Remove #include "JSDomWindow.h" * bindings/js/JSDOMGlobalObject.cpp: * bindings/js/JSDOMPromiseDeferred.cpp: * bindings/js/JSDOMWrapper.cpp: * bindings/js/JSImageDataCustom.cpp: * bindings/scripts/CodeGeneratorJS.pm: (GenerateCallWith): * dom/ScriptExecutionContext.cpp: * inspector/InspectorController.cpp: * inspector/InspectorTimelineAgent.cpp: * rendering/RenderMediaControls.cpp: * rendering/RenderMediaControls.h: * rendering/RenderThemeWin.cpp: * bindings/scripts/test/JS/JSTestObj.cpp: Update test results. 2017-07-25 Konstantin Tokarev Unreviewed, fix Mac CMake build after r219567 * PlatformMac.cmake: 2017-07-23 Darin Adler More NeverDestroyed and related cleanup https://bugs.webkit.org/show_bug.cgi?id=174745 Reviewed by Alex Christensen. * bindings/js/JSCustomElementInterface.cpp: (WebCore::JSCustomElementInterface::constructElementWithFallback): Use isNull() rather than comparing against nullAtom() since it's slightly more efficient. * css/MediaQueryEvaluator.cpp: (WebCore::prefersReducedMotionEvaluate): Use a switch statement for the three states of forcedPrefersReducedMotionAccessibilityValue. Also update to use Theme::singleton() instead of platformTheme(). * dom/QualifiedName.h: Removed some unneeded includes, minor style tweaks, and use isNull() rather than comparing against nullAtom() since it's slightly more efficient. * html/Autofill.cpp: (WebCore::AutofillData::createFromHTMLFormControlElement): Use isNull() rather than comparing against nullAtom() since it's slightly more efficient. * html/HTMLDocument.cpp: (WebCore::addLocalNameToSet): Deleted. (WebCore::createHtmlCaseInsensitiveAttributesSet): Deleted. (WebCore::HTMLDocument::isCaseSensitiveAttribute): Moved the case-sensitive attribute set in here and made it use makeNeverDestroyed. * html/HTMLNameCollection.cpp: (WebCore::WindowNameCollection::elementMatchesIfNameAttributeMatch): Formatted vertically and sorted so it's easier to see what it does. (WebCore::WindowNameCollection::elementMatches): Use boolean logic instead of multiple return statements to make this a little more straightforward. (WebCore::isObjectElementForDocumentNameCollection): Added. Calls the new isExposed function. The old code called this isDocNamedItem. (WebCore::DocumentNameCollection::elementMatchesIfIdAttributeMatch): Use isObjectElementForDocumentNameCollection to clean up logic. Also sorted classes. (WebCore::DocumentNameCollection::elementMatchesIfNameAttributeMatch): Use isObjectElementForDocumentNameCollection to clean up logic. Also sorted classes and formatted vertically. (WebCore::DocumentNameCollection::elementMatches): Write in terms of above functions for clarity. Efficiency is roughly the same. * html/HTMLObjectElement.cpp: (WebCore::HTMLObjectElement::HTMLObjectElement): Initialize data members in class definition instead of here. (WebCore::HTMLObjectElement::childrenChanged): Update for name change; function is now called updateExposedState rather than updateDocNamedItem. Also use m_useFallbackContent directly instead of through a function. (WebCore::HTMLObjectElement::renderFallbackContent): Ditto. (WebCore::preventsParentObjectFromExposure): Added. Replaces the old isRecognizedTagName function, and does almost the same thing, but the argument type is different and the param tag is now one of the tags exempted here. Also broke up into two overloads so we can handle the Element, Text, and other Node cases. (WebCore::shouldBeExposed): Added. Helper for the updateExposedState function that handles the logic of when the element should be exposed, separating it from what to do when the state changes. (WebCore::HTMLObjectElement::updateExposedState): Renamed from updateDocNamedItem. * html/HTMLObjectElement.h: Renamed isDocNamedItem -> isExposed, m_docNamedItem -> m_isExposed, updateDocNamedItem -> updateExposedState, stopped using bit fields for the two boolean data members, and initialized those data members here in the class definition. * platform/Theme.cpp: (WebCore::Theme::baselinePositionAdjustment): Moved here from header. (WebCore::Theme::controlFont): Ditto. (WebCore::Theme::controlSize): Ditto. (WebCore::Theme::minimumControlSize): Ditto. (WebCore::Theme::controlRequiresPreWhiteSpace): Ditto. (WebCore::Theme::paint): Ditto. (WebCore::Theme::inflateControlPaintRect): Ditto. (WebCore::Theme::userPrefersReducedMotion): Ditto. (WebCore::Theme::controlBorder): Fixed switch statement indentation. (WebCore::Theme::controlPadding): Ditto. * platform/Theme.h: Removed the many unnecessary includes. The one I was really after here was FontCascade.h. Replaced the platformTheme function with a singleton function, following our normal style. Also changed the return type to a reference rather than a pointer. Removed many unused function and data members. * platform/cocoa/ThemeCocoa.h: Tightened up implementation, removing unnecessary members and making overrides private. * platform/cocoa/ThemeCocoa.mm: Moved include in here. * platform/gamepad/glib/GamepadsGlib.cpp: (WebCore::sampleGamepads): Use NeverDestroyed instead of DEPRECATED_DEFINE_STATIC_LOCAL. * platform/graphics/FontCascade.cpp: (WebCore::useBackslashAsYenSignForFamily): Build the set in a cleaner way and use a NeverDestroyed set instead of a heap-allocated one. (WebCore::FontCascade::FontCascade): Moved initialization of data members to the class definition. * platform/graphics/FontCascade.h: Initialize GlyphOverflow and FonstCascade data members in the class definition. Remove the constructor for GlyphOverflow entirely. Added FIXME about the peculiar != operator we defined for GlyphOverflow. * platform/graphics/NamedImageGeneratedImage.cpp: (WebCore::NamedImageGeneratedImage::draw): Use Theme::singleton() instead of platformTheme(). (WebCore::NamedImageGeneratedImage::drawPattern): Ditto. * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp: (WebCore::CMTimeRangeStartKey): Use CFSTR directly instead of using DEPRECATED_DEFINE_STATIC_LOCAL. (WebCore::CMTimeRangeDurationKey): Ditto. (WebCore::CACFContextNeedsFlushNotification): Ditto. * platform/graphics/ca/win/LayerChangesFlusher.cpp: (WebCore::LayerChangesFlusher::singleton): Use NeverDestroyed instead of DEPRECATED_DEFINE_STATIC_LOCAL. * platform/graphics/ca/win/LayerChangesFlusher.h: Ditto. * platform/graphics/cg/ImageSourceCGWin.cpp: (WebCore::preferredExtensionForImageSourceType): Use HashMap constructor instead of writing out a lot of add calls. * platform/graphics/harfbuzz/HarfBuzzFace.cpp: (WebCore::harfBuzzFaceCache): Use NeverDestroyed instead of DEPRECATED_DEFINE_STATIC_LOCAL. * platform/graphics/win/FontCacheWin.cpp: (WebCore::FontCache::lastResortFallbackFont): Ditto. * platform/ios/ThemeIOS.h: Tightened up implementation, removing unnecessary members and making overrides private. * platform/ios/ThemeIOS.mm: (WebCore::Theme::singleton): Renamed from platformTheme. * platform/mac/ThemeMac.h: Tightened up implementation, removing unnecessary members and making overrides private. Removed unneeded WTF_MAKE_FAST_ALLOCATED since this is never allocated on the heap. Removed unused -[NSFont webCoreFamilyName] method. * platform/mac/ThemeMac.mm: (-[NSFont webCoreFamilyName]): Deleted. (WebCore::Theme::singleton): Renamed from platformTheme. * platform/mediastream/mac/MockRealtimeAudioSourceMac.h: Removed unneeded include of FontCascade.h. * platform/mediastream/mac/MockRealtimeVideoSourceMac.h: Ditto. * platform/mock/MockRealtimeAudioSource.h: Ditto. * platform/network/win/DownloadBundleWin.cpp: (WebCore::DownloadBundle::fileExtension): Use NeverDestroyed instead of DEPRECATED_DEFINE_STATIC_LOCAL. * platform/win/ClipboardUtilitiesWin.cpp: (WebCore::replaceNewlinesWithWindowsStyleNewlines): Use appendLiteral instead of DEPRECATED_DEFINE_STATIC_LOCAL. * platform/win/FileSystemWin.cpp: (WebCore::bundleName): Use NeverDestroyed instead of DEPRECATED_DEFINE_STATIC_LOCAL, and used a lambda to initialize rather than a boolean to control one-time code. (WebCore::storageDirectory): Removed unneeded use of DEPRECATED_DEFINE_STATIC_LOCAL for a prefix we are appending to a String. The + operator can handle a literal just as efficiently without first storing it in a String. * platform/wpe/ThemeWPE.cpp: (WebCore::Theme::singleton): Renamed from platformTheme. * platform/wpe/ThemeWPE.h: Tightened up implementation, removing unnecessary members and making overrides private. * rendering/RenderTheme.cpp: (WebCore::RenderTheme::RenderTheme): No need to initialize m_theme. (WebCore::RenderTheme::adjustStyle): Use Theme::singleton() instead of accessing it through m_theme. (WebCore::RenderTheme::paint): Ditto. (WebCore::RenderTheme::baselinePosition): Ditto. (WebCore::RenderTheme::adjustRepaintRect): Ditto. (WebCore::RenderTheme::setCustomFocusRingColor): Ditto. (WebCore::RenderTheme::platformTapHighlightColor): Ditto. * rendering/RenderTheme.h: Removed unneded m_theme and unneeded inclusion of Theme.h. * rendering/line/LineBreaker.h: Removed unneeded include of FontCascade.h. 2017-07-24 Chris Dumez ExceptionCode enumeration should use modern exception names https://bugs.webkit.org/show_bug.cgi?id=174794 Reviewed by Geoffrey Garen. ExceptionCode enumeration should use modern exception names consistently. This makes the code nicer and closer to the text of the specification. 2017-07-24 Andy Estes Consider implementing W3C Payment Request API https://bugs.webkit.org/show_bug.cgi?id=174796 Reviewed by Daniel Bates. Add Payment Request to features.json as "Under Consideration". * features.json: 2017-07-24 Konstantin Tokarev Unreviewed attempt to fix Mac cmake build * PlatformMac.cmake: 2017-07-24 Chris Dumez Make ExceptionCode a proper enumeration https://bugs.webkit.org/show_bug.cgi?id=174771 Reviewed by Sam Weinig. Make ExceptionCode a proper enumeration instead of a typedef to uint8_t. * Modules/fetch/FetchBody.h: (WebCore::FetchBody::formData): * Modules/indexeddb/shared/IDBError.h: (WebCore::IDBError::encode): (WebCore::IDBError::decode): * bindings/js/JSSubtleCryptoCustom.cpp: (WebCore::rejectWithException): * dom/Exception.h: * dom/ExceptionCode.h: * fileapi/FileReaderSync.cpp: (WebCore::errorCodeToExceptionCode): * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::texSubImage2D): (WebCore::WebGLRenderingContextBase::texImage2D): * xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::createRequest): * xml/XMLHttpRequest.h: 2017-07-24 Simon Fraser Change "client" coordinates back to match scrolling coordinates https://bugs.webkit.org/show_bug.cgi?id=174734 rdar://problem/33336930 Reviewed by Tim Horton. Baidu.com (which uses jQuery), and various iOS apps make the assumption that getBoundingClientRect() returns a rectangle that can be used to set or compare with the scroll position. With visual viewports, that assumption is no longer valid when the page is zoomed, or when the keyboard has caused the visual viewport to detach from the layout viewport. At this point the compatibility cost of shipping layout viewport-based client rects seems higher than the gain, so revert to the shipping behavior. This reverts r216803, and will re-introduce bugs that occurred on zoomed pages on macOS, many of which are noted in webkit.org/b/170981. * page/FrameView.cpp: (WebCore::FrameView::documentToClientOffset): 2017-07-24 Zan Dobersek [WPE] libepoxy headers can use EGL_CAST, which might not be defined by eglplatform.h https://bugs.webkit.org/show_bug.cgi?id=174780 Reviewed by Carlos Garcia Campos. Newer versions of libepoxy provide EGL definitions that already use the EGL_CAST macro. We'd like to compile on systems where the eglplatform.h header doesn't yet provide that macro that was added only recently (e.g. it's available in Mesa 17.1, but not before). To address that, the EpoxyEGL.h header is added that first includes the libepoxy's EGL header and then provides the EGL_CAST definition in case the eglplatform.h header doesn't. This header should be included in place of (which is included in this new header). The EpoxyEGL.h and EpoxyShims.h headers are also moved under the platform/graphics/epoxy/ directory, with the new directory added to the list of inclusion paths for WPE. * PlatformWPE.cmake: * platform/graphics/PlatformDisplay.cpp: * platform/graphics/cairo/CairoUtilities.cpp: * platform/graphics/cairo/ImageBufferCairo.cpp: * platform/graphics/egl/GLContextEGL.cpp: * platform/graphics/egl/GLContextEGLWPE.cpp: * platform/graphics/epoxy/EpoxyEGL.h: Added. * platform/graphics/epoxy/EpoxyShims.h: Renamed from Source/WebCore/platform/graphics/EpoxyShims.h. * platform/graphics/opengl/Extensions3DOpenGLES.cpp: * platform/graphics/wpe/PlatformDisplayWPE.cpp: 2017-07-24 Zan Dobersek [CoordinatedGraphics] Remove unused GLDefs.h header https://bugs.webkit.org/show_bug.cgi?id=174712 Reviewed by Michael Catanzaro. * platform/graphics/opengl/GLDefs.h: Remove this unused header. As far as my recollection goes it was used in the IPC-based CoordinatedGraphics subsystem, which has been removed already. 2017-07-11 Frederic Wang Add attribute allow-top-navigation-by-user-activation to iframe sandbox https://bugs.webkit.org/show_bug.cgi?id=171327 Reviewed by Chris Dumez. Tests: http/tests/security/frameNavigation/sandbox-ALLOWED-top-navigation-with-user-gesture-1.html http/tests/security/frameNavigation/sandbox-ALLOWED-top-navigation-with-user-gesture-2.html imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_allow_top_navigation_by_user_activation_without_user_gesture-expected.txt imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_allow_top_navigation-3-expected.txt * dom/Document.cpp: (WebCore::Document::canNavigate): Case 2 of conformance verification is refined to match the current specification: Top navigation is allowed when it is triggered by user activation and when allow-top-navigation-by-user-activation is set. Because we have additional "security origin" rules with respect to the specification we also add some early return to ensure that navigation is really allowed for this new case. * dom/SecurityContext.cpp: (WebCore::SecurityContext::isSupportedSandboxPolicy): Add allow-top-navigation-by-user-activation flag. (WebCore::SecurityContext::parseSandboxPolicy): Parse the new flag to allow top user navigation by user activation. Also, make sure that allow-top-navigation allows such navigation as defined by the specification. * dom/SecurityContext.h: Declare new sandboxing flag. 2017-07-23 Wenson Hsieh [iOS WK2] 5 DataInteractionTests are failing: observed selection rects after dropping don't match expected values https://bugs.webkit.org/show_bug.cgi?id=174769 Reviewed by Tim Horton. These tests began failing after r219541, due to a change in behavior of whether or not we call setIgnoreSelectionChanges(false, RevealSelection::No) or setIgnoreSelectionChanges(false, RevealSelection::Yes) when performing a text editing drop. Before r219541, we would not reveal the selection when performing an edit drag operation. This is because in WebPage::performDragControllerAction, we would begin ignoring selection changes by calling setIgnoreSelectionChanges(true). However, while taking a text indicator snapshot, we would stop ignoring selection in TextIndicator::createWithRange due to us calling setIgnoreSelectionChanges(false, RevealSelection::No) at the end of the function. Then, when we return to the scope of WebPage::performDragControllerAction and try to setIgnoreSelectionChanges(false), this is a no-op because we've already stopped ignoring selection changes. After r219541, switching to using TemporarySelectionChange means that TextIndicator::createWithRange now means we respect whether or not we were already ignoring selection before taking the snapshot, so we won't always setIgnoreSelectionChanges(false) at the end. This means that selection changes will now be correctly ignored when performing a drag operation, but this also means that we'll try to reveal the selection, since WebPage::performDragControllerAction calls setIgnoreSelectionChanges(false), for which RevealSelection::Yes is used by default. Revealing the selection in WebPage::performDragControllerAction was unintended in the first place, so we should revert to calling setIgnoreSelectionChanges(false, RevealSelection::No). To ensure this, we adopt TemporarySelectionChange here and pass only TemporarySelectionOptionIgnoreSelectionChanges, so that we won't additionally try to reveal selection after the drop. This is consistent with behavior prior to macOS 10.13 and iOS 11. Additionally, this patch also moves the call to ignore selection change from WebKit into WebCore, so that whether we ignore selection is consistent across both WebKit1 and WebKit2. * page/DragController.cpp: (WebCore::DragController::performDragOperation): 2017-07-23 Chris Dumez Drop ExceptionCodeDescription class https://bugs.webkit.org/show_bug.cgi?id=174757 Reviewed by Darin Adler. Drop ExceptionCodeDescription class now that there is only one exception type: DOMException. Instead, we now have static methods on DOMException to get the name / message for a given exception code. * CMakeLists.txt: * Modules/indexeddb/shared/IDBError.cpp: (WebCore::IDBError::name): (WebCore::IDBError::message): * Modules/quota/StorageErrorCallback.cpp: (WebCore::StorageErrorCallback::CallbackTask::CallbackTask): * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSDOMExceptionHandling.cpp: (WebCore::createDOMException): * dom/DOMAllInOne.cpp: * dom/DOMException.cpp: (WebCore::errorCodeFromName): (WebCore::DOMException::create): (WebCore::DOMException::DOMException): (WebCore::DOMException::name): (WebCore::DOMException::message): * dom/DOMException.h: * dom/ExceptionCodeDescription.cpp: Removed. * dom/ExceptionCodeDescription.h: Removed. * inspector/DOMEditor.cpp: (WebCore::populateErrorString): * inspector/InspectorDOMAgent.cpp: (WebCore::InspectorDOMAgent::toErrorString): * inspector/InspectorDOMStorageAgent.cpp: (WebCore::InspectorDOMStorageAgent::setDOMStorageItem): 2017-07-22 Dan Bernstein Fixed building for macOS 10.12 with the macOS 10.13 SDK after r219644. * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm: (WebCore::CDMSessionAVStreamSession::update): Suppress the objc-literal-conversion warning in one place where we are calling a class method on a Class and the compiler can’t tell which class it is, so it chooses wrong and emits a warning. 2017-07-22 Chris Dumez Merge ExceptionBase into DOMException and drop custom toString https://bugs.webkit.org/show_bug.cgi?id=174755 Reviewed by Sam Weinig. Merge ExceptionBase into DOMException and drop custom toString, now that DOMException is the only remaining exception type. * CMakeLists.txt: * Modules/mediastream/MediaStream.h: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSDOMExceptionHandling.cpp: (WebCore::retrieveErrorMessage): * dom/DOMAllInOne.cpp: * dom/DOMException.cpp: (WebCore::DOMException::DOMException): (WebCore::DOMException::initializeDescription): * dom/DOMException.h: (WebCore::DOMException::code): (WebCore::DOMException::name): (WebCore::DOMException::message): * dom/ExceptionBase.cpp: Removed. * dom/ExceptionBase.h: Removed. 2017-07-14 Filip Pizlo It should be easy to decide how WebKit yields https://bugs.webkit.org/show_bug.cgi?id=174298 Reviewed by Saam Barati. No new tests because the WebCore change is just a change to how we #include things. * inspector/InspectorPageAgent.h: * inspector/TimelineRecordFactory.h: * workers/Worker.h: * workers/WorkerGlobalScopeProxy.h: * workers/WorkerMessagingProxy.h: 2017-07-22 Said Abou-Hallawa REGRESSION(r219045): A partially loaded image may not be repainted when its complete frame finishes decoding https://bugs.webkit.org/show_bug.cgi?id=174230 Reviewed by Simon Fraser. Because of r219045, we now only repaint the CachedImageClinets which tried to draw the image but they could not because they have to wait for the image decoding to finish. This was done by keeping a HashSet of these clients and make CachedImage own it. This HashSet is cleared once the image frame finishes decoding and all the waited clients are repainted. But Multiple asynchronous image decoding requests are allowed for the same frame if new data is added to the image source. If we tried to draw the same image twice before it finishes decoding the first request, we will not be to record this second request since the HashSet will not add the same client twice. When he second request finishes decoding, CachedImage will not repaint any client since its HashSet is empty. To fix this problem we can do the following. When an image frame finishes decoding, CachedImage will keep its HashSet of pending drawing clients as long as the image frame is a partially loaded frame. * loader/cache/CachedImage.cpp: (WebCore::CachedImage::CachedImageObserver::imageFrameAvailable): (WebCore::CachedImage::imageFrameAvailable): * loader/cache/CachedImage.h: * platform/graphics/BitmapImage.cpp: (WebCore::BitmapImage::destroyDecodedData): (WebCore::BitmapImage::dataChanged): (WebCore::BitmapImage::setCurrentFrameDecodingStatusIfNecessary): (WebCore::BitmapImage::draw): (WebCore::BitmapImage::internalStartAnimation): (WebCore::BitmapImage::internalAdvanceAnimation): (WebCore::BitmapImage::imageFrameAvailableAtIndex): * platform/graphics/BitmapImage.h: * platform/graphics/ImageFrame.cpp: (WebCore::ImageFrame::decodingStatus): * platform/graphics/ImageFrame.h: Move DecodingStatus out of this class to ImageTypes.h to avoid adding other header files to ImageObvsever.h * platform/graphics/ImageFrameCache.cpp: (WebCore::ImageFrameCache::setNativeImage): (WebCore::ImageFrameCache::cacheMetadataAtIndex): (WebCore::ImageFrameCache::cacheNativeImageAtIndex): (WebCore::ImageFrameCache::cacheNativeImageAtIndexAsync): (WebCore::ImageFrameCache::requestFrameAsyncDecodingAtIndex): (WebCore::ImageFrameCache::frameDecodingStatusAtIndex): * platform/graphics/ImageFrameCache.h: * platform/graphics/ImageObserver.h: * platform/graphics/ImageSource.h: (WebCore::ImageSource::frameDecodingStatusAtIndex): * platform/graphics/ImageTypes.h: * platform/image-decoders/bmp/BMPImageReader.cpp: (WebCore::BMPImageReader::decodeBMP): * platform/image-decoders/gif/GIFImageDecoder.cpp: (WebCore::GIFImageDecoder::frameComplete): (WebCore::GIFImageDecoder::initFrameBuffer): * platform/image-decoders/jpeg/JPEGImageDecoder.cpp: (WebCore::JPEGImageDecoder::outputScanlines): (WebCore::JPEGImageDecoder::jpegComplete): * platform/image-decoders/png/PNGImageDecoder.cpp: (WebCore::PNGImageDecoder::rowAvailable): (WebCore::PNGImageDecoder::pngComplete): (WebCore::PNGImageDecoder::frameComplete): * platform/image-decoders/webp/WEBPImageDecoder.cpp: (WebCore::WEBPImageDecoder::decode): * rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::decodingModeForImageDraw): 2017-07-22 Timothy Horton Drag and Drop preview image for Twitter link is the wrong shape ​https://bugs.webkit.org/show_bug.cgi?id=174731 * dom/Range.cpp: (WebCore::Range::absoluteRectsForRangeInText): * page/TextIndicator.cpp: (WebCore::initializeIndicator): Apply some post-landing review feedback for r219756. 2017-07-21 Chris Dumez Drop IDBDatabaseException class https://bugs.webkit.org/show_bug.cgi?id=174743 Reviewed by Darin Adler. Drop IDBDatabaseException class and use DOMException directly. IDBDatabaseException was only an internal concept and was already exposed to the Web as a DOMException. This simplifies the code a bit and will allow for further simplification in a follow-up patch. No new tests, no Web-facing behavior change, except for some exception messages being slightly different. * CMakeLists.txt: * Modules/indexeddb/IDBCursor.cpp: (WebCore::IDBCursor::update): (WebCore::IDBCursor::advance): (WebCore::IDBCursor::continuePrimaryKey): (WebCore::IDBCursor::continueFunction): (WebCore::IDBCursor::deleteFunction): * Modules/indexeddb/IDBDatabase.cpp: (WebCore::IDBDatabase::createObjectStore): (WebCore::IDBDatabase::transaction): (WebCore::IDBDatabase::deleteObjectStore): * Modules/indexeddb/IDBDatabaseError.h: Removed. * Modules/indexeddb/IDBDatabaseException.cpp: Removed. * Modules/indexeddb/IDBDatabaseException.h: Removed. * Modules/indexeddb/IDBFactory.cpp: (WebCore::IDBFactory::cmp): * Modules/indexeddb/IDBIndex.cpp: (WebCore::IDBIndex::setName): (WebCore::IDBIndex::openCursor): (WebCore::IDBIndex::openKeyCursor): (WebCore::IDBIndex::count): (WebCore::IDBIndex::doCount): (WebCore::IDBIndex::get): (WebCore::IDBIndex::doGet): (WebCore::IDBIndex::getKey): (WebCore::IDBIndex::doGetKey): (WebCore::IDBIndex::getAll): (WebCore::IDBIndex::getAllKeys): * Modules/indexeddb/IDBKeyRange.cpp: (WebCore::IDBKeyRange::only): (WebCore::IDBKeyRange::lowerBound): (WebCore::IDBKeyRange::upperBound): (WebCore::IDBKeyRange::bound): (WebCore::IDBKeyRange::includes): * Modules/indexeddb/IDBObjectStore.cpp: (WebCore::IDBObjectStore::setName): (WebCore::IDBObjectStore::openCursor): (WebCore::IDBObjectStore::openKeyCursor): (WebCore::IDBObjectStore::get): (WebCore::IDBObjectStore::getKey): (WebCore::IDBObjectStore::putOrAdd): (WebCore::IDBObjectStore::doDelete): (WebCore::IDBObjectStore::deleteFunction): (WebCore::IDBObjectStore::clear): (WebCore::IDBObjectStore::createIndex): (WebCore::IDBObjectStore::index): (WebCore::IDBObjectStore::deleteIndex): (WebCore::IDBObjectStore::count): (WebCore::IDBObjectStore::doCount): (WebCore::IDBObjectStore::getAll): (WebCore::IDBObjectStore::getAllKeys): * Modules/indexeddb/IDBOpenDBRequest.cpp: (WebCore::IDBOpenDBRequest::fireErrorAfterVersionChangeCompletion): * Modules/indexeddb/IDBRequest.cpp: (WebCore::IDBRequest::result): (WebCore::IDBRequest::error): (WebCore::IDBRequest::uncaughtExceptionInEventHandler): * Modules/indexeddb/IDBTransaction.cpp: (WebCore::IDBTransaction::objectStore): (WebCore::IDBTransaction::abort): (WebCore::IDBTransaction::abortOnServerAndCancelRequests): (WebCore::IDBTransaction::didCreateIndexOnServer): (WebCore::IDBTransaction::putOrAddOnServer): * Modules/indexeddb/server/IndexValueStore.cpp: (WebCore::IDBServer::IndexValueStore::addRecord): * Modules/indexeddb/server/MemoryIDBBackingStore.cpp: (WebCore::IDBServer::MemoryIDBBackingStore::beginTransaction): (WebCore::IDBServer::MemoryIDBBackingStore::abortTransaction): (WebCore::IDBServer::MemoryIDBBackingStore::commitTransaction): (WebCore::IDBServer::MemoryIDBBackingStore::createObjectStore): (WebCore::IDBServer::MemoryIDBBackingStore::deleteObjectStore): (WebCore::IDBServer::MemoryIDBBackingStore::renameObjectStore): (WebCore::IDBServer::MemoryIDBBackingStore::clearObjectStore): (WebCore::IDBServer::MemoryIDBBackingStore::createIndex): (WebCore::IDBServer::MemoryIDBBackingStore::deleteIndex): (WebCore::IDBServer::MemoryIDBBackingStore::renameIndex): (WebCore::IDBServer::MemoryIDBBackingStore::deleteRange): (WebCore::IDBServer::MemoryIDBBackingStore::addRecord): (WebCore::IDBServer::MemoryIDBBackingStore::getRecord): (WebCore::IDBServer::MemoryIDBBackingStore::getAllRecords): (WebCore::IDBServer::MemoryIDBBackingStore::getIndexRecord): (WebCore::IDBServer::MemoryIDBBackingStore::getCount): (WebCore::IDBServer::MemoryIDBBackingStore::generateKeyNumber): (WebCore::IDBServer::MemoryIDBBackingStore::openCursor): (WebCore::IDBServer::MemoryIDBBackingStore::iterateCursor): * Modules/indexeddb/server/MemoryIndex.cpp: (WebCore::IDBServer::MemoryIndex::putIndexKey): * Modules/indexeddb/server/MemoryObjectStore.cpp: (WebCore::IDBServer::MemoryObjectStore::createIndex): (WebCore::IDBServer::MemoryObjectStore::deleteIndex): * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp: (WebCore::IDBServer::SQLiteIDBBackingStore::getOrEstablishDatabaseInfo): (WebCore::IDBServer::SQLiteIDBBackingStore::beginTransaction): (WebCore::IDBServer::SQLiteIDBBackingStore::abortTransaction): (WebCore::IDBServer::SQLiteIDBBackingStore::commitTransaction): (WebCore::IDBServer::SQLiteIDBBackingStore::createObjectStore): (WebCore::IDBServer::SQLiteIDBBackingStore::deleteObjectStore): (WebCore::IDBServer::SQLiteIDBBackingStore::renameObjectStore): (WebCore::IDBServer::SQLiteIDBBackingStore::clearObjectStore): (WebCore::IDBServer::SQLiteIDBBackingStore::createIndex): (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedHasIndexRecord): (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedPutIndexKey): (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedPutIndexRecord): (WebCore::IDBServer::SQLiteIDBBackingStore::deleteIndex): (WebCore::IDBServer::SQLiteIDBBackingStore::renameIndex): (WebCore::IDBServer::SQLiteIDBBackingStore::keyExistsInObjectStore): (WebCore::IDBServer::SQLiteIDBBackingStore::deleteUnusedBlobFileRecords): (WebCore::IDBServer::SQLiteIDBBackingStore::deleteRecord): (WebCore::IDBServer::SQLiteIDBBackingStore::deleteRange): (WebCore::IDBServer::SQLiteIDBBackingStore::updateAllIndexesForAddRecord): (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord): (WebCore::IDBServer::SQLiteIDBBackingStore::getBlobRecordsForObjectStoreRecord): (WebCore::IDBServer::SQLiteIDBBackingStore::getRecord): (WebCore::IDBServer::SQLiteIDBBackingStore::getAllObjectStoreRecords): (WebCore::IDBServer::SQLiteIDBBackingStore::getAllIndexRecords): (WebCore::IDBServer::SQLiteIDBBackingStore::getIndexRecord): (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedGetIndexRecordForOneKey): (WebCore::IDBServer::SQLiteIDBBackingStore::getCount): (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedGetKeyGeneratorValue): (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedSetKeyGeneratorValue): (WebCore::IDBServer::SQLiteIDBBackingStore::generateKeyNumber): (WebCore::IDBServer::SQLiteIDBBackingStore::revertGeneratedKeyNumber): (WebCore::IDBServer::SQLiteIDBBackingStore::maybeUpdateKeyGeneratorNumber): (WebCore::IDBServer::SQLiteIDBBackingStore::openCursor): (WebCore::IDBServer::SQLiteIDBBackingStore::iterateCursor): * Modules/indexeddb/server/SQLiteIDBTransaction.cpp: (WebCore::IDBServer::SQLiteIDBTransaction::begin): (WebCore::IDBServer::SQLiteIDBTransaction::commit): (WebCore::IDBServer::SQLiteIDBTransaction::abort): * Modules/indexeddb/server/UniqueIDBDatabase.cpp: (WebCore::IDBServer::UniqueIDBDatabase::performCurrentOpenOperation): (WebCore::IDBServer::UniqueIDBDatabase::deleteObjectStore): (WebCore::IDBServer::UniqueIDBDatabase::renameObjectStore): (WebCore::IDBServer::UniqueIDBDatabase::deleteIndex): (WebCore::IDBServer::UniqueIDBDatabase::renameIndex): (WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd): (WebCore::IDBServer::UniqueIDBDatabase::commitTransaction): (WebCore::IDBServer::UniqueIDBDatabase::abortTransaction): * Modules/indexeddb/shared/IDBError.cpp: (WebCore::IDBError::name): (WebCore::IDBError::message): (WebCore::IDBError::toDOMError): * Modules/indexeddb/shared/IDBError.h: (WebCore::IDBError::userDeleteError): (WebCore::IDBError::isNull): * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSDOMExceptionHandling.cpp: (WebCore::createDOMException): * dom/DOMException.cpp: (WebCore::DOMException::initializeDescription): Initialize description->code from using the actual error codes in the coreExceptions table, instead of initializing it using |ec|. |ec| is the index in the ExceptionCode enumeration and it matches the error code only for legacy exceptions. New exceptions such as DataError should have a code of 0. Without this change, w3c for IDB would start failing. * dom/ExceptionCodeDescription.cpp: (WebCore::ExceptionCodeDescription::ExceptionCodeDescription): * dom/ExceptionCodeDescription.h: 2017-07-21 Sam Weinig [WebIDL] Simplify XMLHttpRequest bindings by removing built-ins https://bugs.webkit.org/show_bug.cgi?id=174740 Reviewed by Chris Dumez. The behavior we were getting from XMLHttpRequest.js can be implemented with the [CachedAttribute] extended attribute. This reduces the number of JS -> C++ jumps required and makes the code more similar to other bindings that need caching of an IDL any value. * CMakeLists.txt: * DerivedSources.make: * xml/XMLHttpRequest.js: Removed. Remove XMLHttpRequest.js. * bindings/js/JSXMLHttpRequestCustom.cpp: (WebCore::JSXMLHttpRequest::response): (WebCore::JSXMLHttpRequest::retrieveResponse): Deleted. * xml/XMLHttpRequest.idl: Replace builtin with a [CachedAttribute] and [CustomGetter] for the response property. 2017-07-21 Timothy Horton Drag and Drop preview image for Twitter link is the wrong shape https://bugs.webkit.org/show_bug.cgi?id=174731 Reviewed by Zalan Bujtas. TextIndicator uses Range::borderAndTextQuads and ::absoluteTextRects in order to get the rects of the indicated text. Currently, these functions do not respect clipping, so clipped-out text (e.g. as seen inside links on Twitter) generates lots of meaningless indicated rects. * page/TextIndicator.cpp: (WebCore::estimatedBackgroundColorForRange): (WebCore::hasAnyIllegibleColors): Change adjustTextIndicatorDataOptionsForEstimatedColorsIfNecessary to instead be hasAnyIllegibleColors, and referred to in the same place as hasNonInlineOrReplacedElements, so that it follows the same upgrade path (leaving textRects empty, so that it is later filled in with the absoluteBoundingRect). This was a mistake in r219033, which instead would end up painting all content, but filling in textRects with the actual individual text rects. This alone changes the behavior on Twitter from lots of jagged misplaced rects to a too-large bounding rect. Combined with the following changes, the bounding rect is reduced to the right size: (WebCore::initializeIndicator): Adopt the new Range::borderAndTextQuads and ::absoluteTextRects parameter and opt-in to respecting clipping for text rects. * dom/DOMRectList.cpp: (WebCore::DOMRectList::DOMRectList): * dom/DOMRectList.h: (WebCore::DOMRectList::create): Add a DOMRectList constructor and create() that take FloatRects, similar to the one that takes FloatQuads, but without the boundingRect() calls. * dom/Document.h: * dom/Document.cpp: (WebCore::Document::convertAbsoluteToClientRects): Add convertAbsoluteToClientRects, similar to covertAbsoluteToClientQuads, except acting on rects instead of quads. * dom/Range.cpp: (WebCore::Range::absoluteRectsForRangeInText): (WebCore::Range::absoluteTextRects): (WebCore::Range::getClientRects): (WebCore::Range::borderAndTextRects): (WebCore::Range::boundingRect): (WebCore::Range::absoluteBoundingRect): (WebCore::Range::borderAndTextQuads): Deleted. * dom/Range.h: Replace borderAndTextQuads with borderAndTextRects, because all callers just ended up calling boundingBox() on the quads. Factor absoluteRectsForRangeInText out of absoluteTextRects and borderAndTextQuads, and teach it to optionally intersect the text rects with their renderer's absoluteClippedOverflowRect. 2017-07-21 Per Arne Vollan Round-tripping stroke-width styles through getComputedStyle cause the text to gain a stroke. https://bugs.webkit.org/show_bug.cgi?id=174701 Reviewed by Simon Fraser. The initial value of stroke-color should be transparent, see https://www.w3.org/TR/fill-stroke-3/#stroke-color. Also, there is no need to set the graphics context in text stroke mode, if the stroke color is not visible. Test: fast/css/round-trip-stroke-width-using-computed-style.html * rendering/TextPaintStyle.cpp: (WebCore::updateGraphicsContext): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::initialStrokeWidth): (WebCore::RenderStyle::initialStrokeColor): * rendering/style/StyleRareInheritedData.cpp: (WebCore::StyleRareInheritedData::StyleRareInheritedData): 2017-07-21 Timothy Horton Remove an inaccurate comment from RenderTextLineBoxes * rendering/RenderTextLineBoxes.cpp: (WebCore::RenderTextLineBoxes::absoluteRectsForRange): This comment has been wrong for at least 4 years. 2017-07-21 Timothy Horton TextIndicator::estimatedTextColorsForRange asserts inside HashSet code (inserting reserved value) https://bugs.webkit.org/show_bug.cgi?id=174733 Reviewed by Wenson Hsieh. * page/TextIndicator.cpp: (WebCore::estimatedTextColorsForRange): (WebCore::adjustTextIndicatorDataOptionsForEstimatedColorsIfNecessary): RGBA32 isn't a valid hash key, because we have no traits that define the empty or deleted values, nor do we have any bits we could feasibly use -- the full range of RGBA32 is easy to reach with various colors. Instead, hash Color directly. 2017-07-21 Nan Wang AX: Expose form validation on iOS as hint https://bugs.webkit.org/show_bug.cgi?id=174722 Reviewed by Chris Fleizach. Adding the validation message to the hint of the form control element. Test: accessibility/ios-simulator/form-control-validation-message.html * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::isShowingValidationMessage): (WebCore::AccessibilityObject::validationMessage): * accessibility/AccessibilityObject.h: * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper accessibilityHint]): (-[WebAccessibilityObjectWrapper accessibilityIsShowingValidationMessage]): * html/HTMLFormControlElement.cpp: (WebCore::HTMLFormControlElement::isShowingValidationMessage): * html/HTMLFormControlElement.h: 2017-07-21 Konstantin Tokarev [cmake][Mac] Unreviewed, fix linking WebKitSystemInterface After r219560 link_directories() in PlatformXXX.cmake files does not affect corresponding targets. * PlatformMac.cmake: 2017-07-21 Sam Weinig [WebIDL] Remove the need for the side map of DeprecatedCSSOMValue roots https://bugs.webkit.org/show_bug.cgi?id=174713 Reviewed by Andreas Kling. We used to not want to bloat the size of CSSValues with a pointer to the owner CSSStyleDeclaration, so, for GC purposes we need kept a mapping of them on DOMWrapperWorld that only got set if a wrapper was made. Now that we have DeprecatedCSSOMValue, a wrapper for CSSValue that only gets created for the bindings, we no longer need the side table, and simply have the DeprecatedCSSOMValue maintain a reference to the CSSStyleDeclaration. * bindings/js/DOMWrapperWorld.h: (WebCore::DOMWrapperWorld::wrappers): Remove m_deprecatedCSSOMValueRoots and make m_wrappers private with a getter. * bindings/js/JSCSSStyleDeclarationCustom.cpp: (WebCore::JSCSSStyleDeclaration::getPropertyCSSValue): Deleted. Remove custom implementation of getPropertyCSSValue, now that it no longer needs to update m_deprecatedCSSOMValueRoots. * bindings/js/JSDOMWindowBase.cpp: (WebCore::JSDOMWindowBase::fireFrameClearedWatchpointsForWindow): * bindings/js/JSDOMWrapperCache.h: (WebCore::getCachedWrapper): (WebCore::cacheWrapper): (WebCore::uncacheWrapper): * bindings/js/JSNodeCustom.cpp: (WebCore::getOutOfLineCachedWrapper): Use wrappers getter rather than direct member variable. * bindings/js/JSDeprecatedCSSOMValueCustom.cpp: (WebCore::JSDeprecatedCSSOMValueOwner::isReachableFromOpaqueRoots): Rather than checking the side table for roots, now get the root via the reference CSSStyleDeclaration. (WebCore::JSDeprecatedCSSOMValueOwner::finalize): Deleted. Remove custom finalize now that we don't have to remove ourself from m_deprecatedCSSOMValueRoots. * css/CSSStyleDeclaration.idl: Remove [Custom] from getPropertyCSSValue. * css/DeprecatedCSSOMValue.idl: Remove [JSCustomFinalize]. * css/CSSComputedStyleDeclaration.cpp: (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): * css/CSSImageValue.cpp: (WebCore::CSSImageValue::createDeprecatedCSSOMWrapper): * css/CSSImageValue.h: * css/CSSPrimitiveValue.cpp: (WebCore::CSSPrimitiveValue::createDeprecatedCSSOMPrimitiveWrapper): * css/CSSPrimitiveValue.h: * css/CSSStyleDeclaration.h: * css/CSSValue.cpp: (WebCore::CSSValue::createDeprecatedCSSOMWrapper): * css/CSSValue.h: * css/DeprecatedCSSOMCounter.h: * css/DeprecatedCSSOMPrimitiveValue.cpp: (WebCore::DeprecatedCSSOMPrimitiveValue::getCounterValue): (WebCore::DeprecatedCSSOMPrimitiveValue::getRectValue): (WebCore::DeprecatedCSSOMPrimitiveValue::getRGBColorValue): * css/DeprecatedCSSOMPrimitiveValue.h: (WebCore::DeprecatedCSSOMPrimitiveValue::create): (WebCore::DeprecatedCSSOMPrimitiveValue::DeprecatedCSSOMPrimitiveValue): * css/DeprecatedCSSOMRGBColor.h: * css/DeprecatedCSSOMRect.h: * css/DeprecatedCSSOMValue.h: (WebCore::DeprecatedCSSOMValue::owner): (WebCore::DeprecatedCSSOMValue::DeprecatedCSSOMValue): (WebCore::DeprecatedCSSOMComplexValue::create): (WebCore::DeprecatedCSSOMComplexValue::DeprecatedCSSOMComplexValue): * css/DeprecatedCSSOMValueList.h: (WebCore::DeprecatedCSSOMValueList::create): (WebCore::DeprecatedCSSOMValueList::DeprecatedCSSOMValueList): * css/PropertySetCSSStyleDeclaration.cpp: (WebCore::PropertySetCSSStyleDeclaration::wrapForDeprecatedCSSOM): * css/PropertySetCSSStyleDeclaration.h: * svg/SVGElement.cpp: (WebCore::SVGElement::getPresentationAttribute): Pass owning CSSStyleDeclaration to DeprecatedCSSOMValue and derived classes. 2017-07-21 Andreas Kling Use more references in event dispatch code https://bugs.webkit.org/show_bug.cgi?id=174681 Reviewed by Geoffrey Garen. Make EventListener::handleEvent() take a ScriptExecutionContext&, Event&. Then make everything build again. Various null checks and assertions disappear in the process. * bindings/js/JSErrorHandler.cpp: (WebCore::JSErrorHandler::handleEvent): * bindings/js/JSErrorHandler.h: * bindings/js/JSEventListener.cpp: (WebCore::JSEventListener::initializeJSFunction): (WebCore::JSEventListener::handleEvent): (WebCore::eventHandlerAttribute): * bindings/js/JSEventListener.h: (WebCore::JSEventListener::jsFunction): * bindings/js/JSLazyEventListener.cpp: (WebCore::JSLazyEventListener::initializeJSFunction): * bindings/js/JSLazyEventListener.h: * dom/EventListener.h: * dom/EventTarget.cpp: (WebCore::EventTarget::fireEventListeners): * html/HTMLPlugInElement.cpp: (WebCore::HTMLPlugInElement::defaultEventHandler): * html/ImageDocument.cpp: (WebCore::ImageEventListener::handleEvent): * inspector/CommandLineAPIHost.cpp: (WebCore::listenerEntriesFromListenerInfo): * inspector/InspectorDOMAgent.cpp: (WebCore::InspectorDOMAgent::buildObjectForEventListener): * inspector/InspectorIndexedDBAgent.cpp: * platform/Widget.h: (WebCore::Widget::handleEvent): * platform/cocoa/WebPlaybackSessionModelMediaElement.h: * platform/cocoa/WebPlaybackSessionModelMediaElement.mm: (WebCore::WebPlaybackSessionModelMediaElement::handleEvent): * platform/cocoa/WebVideoFullscreenModelVideoElement.h: * platform/cocoa/WebVideoFullscreenModelVideoElement.mm: (WebVideoFullscreenModelVideoElement::handleEvent): * svg/SVGTRefElement.cpp: (WebCore::SVGTRefTargetEventListener::handleEvent): * svg/animation/SVGSMILElement.cpp: (WebCore::ConditionEventListener::handleEvent): (WebCore::SVGSMILElement::handleConditionEvent): * svg/animation/SVGSMILElement.h: 2017-07-21 Zalan Bujtas iBooks: Overlapping/missing content at beginning/end of paragraph. https://bugs.webkit.org/show_bug.cgi?id=174717 Reviewed by Simon Fraser. By definiton simple and normal line layout should always produce the exact same lineboxes. It enables us not to force repaint while swapping between these 2 line layouts. However in certain cases (font size pixel rounding as an example) they don't agree on how much content fits the line and that could result in missing/overlapping content due to the lack of repaint. Unable to test. * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::ensureLineBoxes): 2017-07-21 Chris Dumez Drop make_dom_exceptions.pl script that we only have DOMException https://bugs.webkit.org/show_bug.cgi?id=174699 Reviewed by Darin Adler. Drop make_dom_exceptions.pl script that we only have DOMException. * CMakeLists.txt: * DerivedSources.make: * WebCore.xcodeproj/project.pbxproj: * WebCoreMacros.cmake: * bindings/js/JSDOMExceptionHandling.cpp: * css/FontFaceSet.cpp: * dom/DOMAllInOne.cpp: * dom/DOMExceptions.in: Removed. * dom/ExceptionCodeDescription.cpp: Added. (WebCore::ExceptionCodeDescription::ExceptionCodeDescription): * dom/ExceptionCodeDescription.h: Added. * dom/make_dom_exceptions.pl: Removed. * inspector/WebInjectedScriptHost.cpp: (WebCore::WebInjectedScriptHost::subtype): 2017-07-21 Said Abou-Hallawa [CG] An image should not invoke many system calls before confirming its format is supported https://bugs.webkit.org/show_bug.cgi?id=174692 Reviewed by Tim Horton. We should be careful when invoking system calls before confirming that the image type is available and it is one of the whitelist formats. Otherwise we will be calling the parsers of the unsupported formats. * loader/cache/CachedImage.cpp: (WebCore::CachedImage::setImageDataBuffer): The check isAllowedImageUTI() is now done in ImageDecoder::encodedDataStatus() which will return Error if there is an error in the data or "isAllowedImageUTI() returns false." * platform/graphics/BitmapImage.cpp: (WebCore::BitmapImage::dataChanged): Avoid calling canUseAsyncDecodingForLargeImages() before confirming the image type is available and it's supported by WebKit. canUseAsyncDecodingForLargeImages() tries to cache the first frame of the image to know its size. Asking the ImageFrameCache to destroy its decoded frames is not needed unless ImageFrameCache::decodedSize() is not zero. * platform/graphics/cg/ImageDecoderCG.cpp: (WebCore::ImageDecoder::encodedDataStatus): Avoid calling CGImageSourceGetStatus() before knowing the UTI of the image. When knowing it, we call CGImageSourceGetStatus() and if it returns kCGImageStatusIncomplete or kCGImageStatusComplete, we check whether isAllowedImageUTI() or not. If isAllowedImageUTI() returns false, return Error which will make the CachedImage cancel loading the rest of the image. 2017-07-21 Jeremy Jones AudioTrackPrivateMediaStreamCocoa shouldn't set AudioSession::setPreferredBufferSize https://bugs.webkit.org/show_bug.cgi?id=174707 rdar://problem/33446809 Reviewed by Eric Carlson. Manually tested for audio side effects. AudioChannel::copyFrom fails when AudioChannel lengths don't match. This happens because PlatformMediaSessionManager::updateSessionState() owns and sets AudioSession::setPreferredBufferSize(). However, AudioTrackPrivateMediaStreamCocoa::createAudioUnit, when it creates an input audio unit is setting AudioSession::setPreferredBufferSize() directly to its own arbitrary value. AudioSession::setPreferredBufferSize() should be managed by the higher level PlatformMediaSessionManager, and not modified by audio unit creation, in order to keep harmony within the audio pipeline. * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp: (WebCore::AudioTrackPrivateMediaStreamCocoa::createAudioUnit): 2017-07-21 Jeremy Jones Noise when AudioChannel lengths don't match. https://bugs.webkit.org/show_bug.cgi?id=174706 rdar://problem/33389856 Reviewed by Eric Carlson. When AudioChannel lengths don't match, copyFrom() returns early leaving uninitialized data in the audio buffer. This change zeros out the data, so there isn't objectionable noise sent to the speaker. * platform/audio/AudioChannel.cpp: (WebCore::AudioChannel::copyFrom): 2017-07-21 Sam Weinig [WebIDL] Make a few parameters non-nullable in inspector IDL files https://bugs.webkit.org/show_bug.cgi?id=174719 Reviewed by Joseph Pecoraro. * inspector/CommandLineAPIHost.cpp: (WebCore::CommandLineAPIHost::databaseId): (WebCore::CommandLineAPIHost::storageId): * inspector/CommandLineAPIHost.h: * inspector/CommandLineAPIHost.idl: * inspector/InspectorDOMStorageAgent.cpp: (WebCore::InspectorDOMStorageAgent::storageId): * inspector/InspectorDOMStorageAgent.h: * inspector/InspectorDatabaseAgent.cpp: (WebCore::InspectorDatabaseAgent::databaseId): * inspector/InspectorDatabaseAgent.h: * inspector/InspectorFrontendHost.cpp: (WebCore::InspectorFrontendHost::showContextMenu): (WebCore::InspectorFrontendHost::dispatchEventAsContextMenuEvent): * inspector/InspectorFrontendHost.h: * inspector/InspectorFrontendHost.idl: Remove nullability from arguments that should never be null. 2017-07-21 Brady Eidson Get rid of WebCore IconDatabase code. https://bugs.webkit.org/show_bug.cgi?id=174700 Reviewed by Tim Horton. No new tests (No behavior change). Tons of red. Very little green. No further explanation. * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * dom/Document.cpp: (WebCore::Document::implicitClose): * history/HistoryItem.cpp: (WebCore::HistoryItem::HistoryItem): (WebCore::HistoryItem::~HistoryItem): (WebCore::HistoryItem::reset): (WebCore::HistoryItem::setURLString): * inspector/InspectorNetworkAgent.cpp: (WebCore::InspectorNetworkAgent::willSendRequest): * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::~DocumentLoader): (WebCore::DocumentLoader::startIconLoading): (WebCore::DocumentLoader::iconLoadDecisionAvailable): Deleted. (WebCore::iconLoadDecisionCallback): Deleted. (WebCore::DocumentLoader::getIconLoadDecisionForIconURL): Deleted. (WebCore::DocumentLoader::continueIconLoadWithDecision): Deleted. (WebCore::iconDataCallback): Deleted. (WebCore::DocumentLoader::getIconDataForIconURL): Deleted. * loader/DocumentLoader.h: (WebCore::DocumentLoader::linkIcons): * loader/FrameLoader.cpp: (WebCore::FrameLoader::FrameLoader): (WebCore::FrameLoader::stop): * loader/FrameLoader.h: (WebCore::FrameLoader::subframeLoader): (WebCore::FrameLoader::icon): Deleted. * loader/FrameLoaderClient.h: * loader/archive/cf/LegacyWebArchive.cpp: (WebCore::LegacyWebArchive::create): * loader/icon/IconController.cpp: Removed. * loader/icon/IconController.h: Removed. * loader/icon/IconDatabase.cpp: Removed. * loader/icon/IconDatabase.h: Removed. * loader/icon/IconDatabaseBase.cpp: Removed. * loader/icon/IconDatabaseBase.h: Removed. * loader/icon/IconDatabaseClient.h: Removed. * loader/icon/IconLoader.cpp: (WebCore::IconLoader::IconLoader): (WebCore::IconLoader::startLoading): (WebCore::IconLoader::notifyFinished): * loader/icon/IconLoader.h: * loader/icon/IconRecord.cpp: Removed. * loader/icon/IconRecord.h: Removed. * loader/icon/PageURLRecord.cpp: Removed. * loader/icon/PageURLRecord.h: Removed. * testing/Internals.cpp: (WebCore::Internals::shortcutIconURLs): 2017-07-21 Chris Dumez Rename DOMCoreException class to DOMException https://bugs.webkit.org/show_bug.cgi?id=174698 Reviewed by Darin Adler. Rename DOMCoreException class to DOMException to match its Web-exposed name. * CMakeLists.txt: * DerivedSources.cpp: * DerivedSources.make: * Modules/quota/StorageErrorCallback.cpp: (WebCore::StorageErrorCallback::CallbackTask::CallbackTask): * Modules/quota/StorageErrorCallback.h: * Modules/quota/StorageErrorCallback.idl: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSDOMExceptionHandling.cpp: (WebCore::retrieveErrorMessage): (WebCore::createDOMException): * bindings/scripts/CodeGeneratorJS.pm: (GenerateOverloadDispatcher): * css/FontFaceSet.cpp: * css/FontFaceSet.h: * dom/DOMAllInOne.cpp: * dom/DOMException.cpp: Renamed from Source/WebCore/dom/DOMCoreException.cpp. (WebCore::DOMException::create): (WebCore::DOMException::DOMException): (WebCore::DOMException::initializeDescription): * dom/DOMException.h: Renamed from Source/WebCore/dom/DOMCoreException.h. (WebCore::DOMException::create): (WebCore::DOMException::DOMException): * dom/DOMException.idl: Renamed from Source/WebCore/dom/DOMCoreException.idl. * dom/DOMExceptions.in: * dom/make_dom_exceptions.pl: (generateImplementation): 2017-07-21 Sam Weinig Follow up to https://bugs.webkit.org/show_bug.cgi?id=174659. * inspector/InspectorFrontendHost.idl: Remove unnecessary JSGenerateToJSObject noticed in review. 2017-07-20 Chris Dumez Drop legacy SVGException type https://bugs.webkit.org/show_bug.cgi?id=174695 Reviewed by Darin Adler. Drop legacy SVGException type and use DOMException instead, as per the latest SVG specification. Both Chrome and Firefox no longer expose the SVGException type. * CMakeLists.txt: * DerivedSources.cpp: * DerivedSources.make: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSDOMExceptionHandling.cpp: (WebCore::createDOMException): * bindings/js/JSExceptionBase.cpp: (WebCore::toExceptionBase): * dom/DOMExceptions.in: * svg/SVGAllInOne.cpp: * svg/SVGCircleElement.cpp: * svg/SVGException.cpp: Removed. * svg/SVGException.h: Removed. * svg/SVGException.idl: Removed. * svg/SVGGraphicsElement.idl: * svg/SVGLocatable.cpp: (WebCore::SVGLocatable::getTransformToElement): * svg/SVGMatrixValue.h: * svg/SVGPathSegList.cpp: (WebCore::SVGPathSegList::getItem): (WebCore::SVGPathSegList::replaceItem): (WebCore::SVGPathSegList::removeItem): * svg/SVGPathSegList.h: * svg/SVGPathSegList.idl: * svg/properties/SVGAnimatedEnumerationPropertyTearOff.h: * svg/properties/SVGListProperty.h: 2017-07-20 Chris Dumez Hook up ITP quirks to the needsSiteSpecificQuirks setting https://bugs.webkit.org/show_bug.cgi?id=174691 Reviewed by Darin Adler. Hook up ITP quirks to the needsSiteSpecificQuirks setting to make it easier for Web-developers to test their fixes. * loader/ResourceLoadObserver.cpp: (WebCore::shouldEnableSiteSpecificQuirks): (WebCore::areDomainsAssociated): (WebCore::ResourceLoadObserver::logFrameNavigation): (WebCore::resourceNeedsSSOQuirk): (WebCore::ResourceLoadObserver::logSubresourceLoading): (WebCore::ResourceLoadObserver::logWebSocketLoading): 2017-07-20 Matt Lewis Unreviewed, rolling out r219700. This revision caused consistent timouts on iOS. Reverted changeset: "Turn tests at media/modern-media-controls/start-support back on" https://bugs.webkit.org/show_bug.cgi?id=174683 http://trac.webkit.org/changeset/219700 2017-07-20 David Quesada Add SPI to notify WKNavigationDelegate about client redirects https://bugs.webkit.org/show_bug.cgi?id=174680 rdar://problem/33184886 Reviewed by Brady Eidson. * loader/FrameLoader.cpp: (WebCore::FrameLoader::performClientRedirect): * loader/FrameLoader.h: Add a convenience method for NavigationScheduler that handles a FrameLoadRequest as a client redirect. Currently this means loading the request and informing the client about it. * loader/FrameLoaderClient.h: Add FrameLoaderClient::dispatchDidPerformClientRedirect() to inform the client when a client redirect occurs. * loader/NavigationScheduler.cpp: Removed ScheduledURLNavigation::fire(). This class was never instantiated directly, and all subclasses override fire(), so this was unused code. For ScheduledRedirects and ScheduledLocationChange, use FrameLoader's new method to load the request as a client redirect. 2017-07-20 Chris Dumez Drop legacy XPathException type https://bugs.webkit.org/show_bug.cgi?id=174679 Reviewed by Sam Weinig. Drop legacy XPathException type and use DOMException instead. Both Firefox and Chrome no longer expose XPathException. Test: fast/dom/DOMException/XPathException-obsolete.html * CMakeLists.txt: * DerivedSources.cpp: * DerivedSources.make: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSDOMExceptionHandling.cpp: (WebCore::createDOMException): * bindings/js/JSExceptionBase.cpp: (WebCore::toExceptionBase): * dom/DOMExceptions.in: * xml/XPathException.cpp: Removed. * xml/XPathException.h: Removed. * xml/XPathException.idl: Removed. * xml/XPathExpression.cpp: (WebCore::XPathExpression::evaluate): * xml/XPathParser.cpp: (WebCore::XPath::Parser::parseStatement): * xml/XPathResult.cpp: (WebCore::XPathResult::convertTo): (WebCore::XPathResult::numberValue): (WebCore::XPathResult::stringValue): (WebCore::XPathResult::booleanValue): (WebCore::XPathResult::singleNodeValue): (WebCore::XPathResult::snapshotLength): (WebCore::XPathResult::iterateNext): (WebCore::XPathResult::snapshotItem): 2017-07-20 Chris Dumez Unreviewed, rolling out r219706. Broke iOS build Reverted changeset: "Drop legacy XPathException type" https://bugs.webkit.org/show_bug.cgi?id=174679 http://trac.webkit.org/changeset/219706 2017-07-20 Chris Dumez Drop legacy XPathException type https://bugs.webkit.org/show_bug.cgi?id=174679 Reviewed by Sam Weinig. Drop legacy XPathException type and use DOMException instead. Both Firefox and Chrome no longer expose XPathException. Test: fast/dom/DOMException/XPathException-obsolete.html * CMakeLists.txt: * DerivedSources.cpp: * DerivedSources.make: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSDOMExceptionHandling.cpp: (WebCore::createDOMException): * bindings/js/JSExceptionBase.cpp: (WebCore::toExceptionBase): * dom/DOMExceptions.in: * xml/XPathException.cpp: Removed. * xml/XPathException.h: Removed. * xml/XPathException.idl: Removed. * xml/XPathExpression.cpp: (WebCore::XPathExpression::evaluate): * xml/XPathParser.cpp: (WebCore::XPath::Parser::parseStatement): * xml/XPathResult.cpp: (WebCore::XPathResult::convertTo): (WebCore::XPathResult::numberValue): (WebCore::XPathResult::stringValue): (WebCore::XPathResult::booleanValue): (WebCore::XPathResult::singleNodeValue): (WebCore::XPathResult::snapshotLength): (WebCore::XPathResult::iterateNext): (WebCore::XPathResult::snapshotItem): 2017-07-20 Chris Dumez Regression(ITP): May get frequently logged out of wsj.com https://bugs.webkit.org/show_bug.cgi?id=174661 Reviewed by Geoffrey Garen. Add the concept of associated domains in the ResourceLoadObserver. We previously ignore loads to and from the same domains. We now do the same if the to and from domains are associated (i.e. owned by the same entity). For now, only add domains owned by Dow Jones & Company, Inc. to the list, to address login issues on wsj.com. No new tests, verified manually on wsj.com. * loader/ResourceLoadObserver.cpp: (WebCore::areDomainsAssociated): (WebCore::ResourceLoadObserver::logFrameNavigation): (WebCore::ResourceLoadObserver::logSubresourceLoading): (WebCore::ResourceLoadObserver::logWebSocketLoading): 2017-07-20 Chris Dumez Replace calls to Vector::resize() with calls to more efficient shrink() / grow() when applicable https://bugs.webkit.org/show_bug.cgi?id=174660 Reviewed by Geoffrey Garen. Replace calls to Vector::resize() with calls to more efficient shrink() / grow() when applicable. This essentially replaces a branch to figure out if the new size is less or greater than the current size by an assertion. * Modules/gamepad/Gamepad.cpp: (WebCore::Gamepad::Gamepad): * Modules/webaudio/AudioContext.cpp: (WebCore::AudioContext::addReaction): * Modules/websockets/WebSocketChannel.cpp: (WebCore::WebSocketChannel::skipBuffer): * Modules/websockets/WebSocketDeflater.cpp: (WebCore::WebSocketDeflater::finish): * contentextensions/ContentExtensionCompiler.cpp: (WebCore::ContentExtensions::serializeSelector): * contentextensions/DFABytecodeCompiler.cpp: (WebCore::ContentExtensions::append): * crypto/gcrypt/CryptoAlgorithmAES_CBCGCrypt.cpp: (WebCore::gcryptEncrypt): (WebCore::gcryptDecrypt): * crypto/gcrypt/CryptoAlgorithmECDHGCrypt.cpp: (WebCore::gcryptDerive): * platform/gamepad/cocoa/GameControllerGamepadProvider.mm: (WebCore::GameControllerGamepadProvider::controllerDidConnect): * platform/gamepad/mac/HIDGamepadProvider.cpp: (WebCore::HIDGamepadProvider::deviceAdded): * platform/graphics/ImageBackingStore.h: (WebCore::ImageBackingStore::setSize): * platform/graphics/WOFFFileFormat.cpp: * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp: (WebCore::InbandMetadataTextTrackPrivateAVF::updatePendingCueEndTimes): (WebCore::InbandMetadataTextTrackPrivateAVF::flushPartialCues): * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp: (WebCore::InbandTextTrackPrivateAVF::resetCueValues): (WebCore::InbandTextTrackPrivateAVF::readNativeSampleBuffer): * platform/graphics/avfoundation/cf/InbandTextTrackPrivateAVCF.cpp: (WebCore::InbandTextTrackPrivateAVCF::readNativeSampleBuffer): * platform/graphics/cg/ImageBufferCG.cpp: (WebCore::cfData): * platform/image-decoders/bmp/BMPImageDecoder.cpp: (WebCore::BMPImageDecoder::frameBufferAtIndex): * platform/image-decoders/ico/ICOImageDecoder.cpp: (WebCore::ICOImageDecoder::decode): * platform/image-decoders/jpeg/JPEGImageDecoder.cpp: (WebCore::JPEGImageDecoder::frameBufferAtIndex): * platform/image-decoders/png/PNGImageDecoder.cpp: (WebCore::PNGImageDecoder::frameBufferAtIndex): (WebCore::PNGImageDecoder::readChunks): * platform/image-decoders/webp/WEBPImageDecoder.cpp: (WebCore::WEBPImageDecoder::frameBufferAtIndex): * platform/image-encoders/JPEGImageEncoder.cpp: (WebCore::compressRGBABigEndianToJPEG): * platform/text/DecodeEscapeSequences.h: (WebCore::URLEscapeSequence::decodeRun): * platform/text/SuffixTree.h: (WebCore::SuffixTree::Node::Node): * rendering/Grid.cpp: (WebCore::Grid::setNeedsItemsPlacement): * rendering/RenderTable.cpp: (WebCore::RenderTable::invalidateCachedColumns): 2017-07-20 Chris Dumez Regression(ITP): Can no longer log in on abc.go.com https://bugs.webkit.org/show_bug.cgi?id=174533 Reviewed by Geoffrey Garen. Add quirk for sp.auth.adobe.com which is used for SSO by web sites such as abc.go.com. This would otherwise cause adobe.com to be identified as a tracker and log in on abc.go.com would break. No new tests, tested manually on abc.go.com. * loader/ResourceLoadObserver.cpp: (WebCore::resourceNeedsSSOQuirk): (WebCore::ResourceLoadObserver::logSubresourceLoading): 2017-07-20 Antoine Quint Turn tests at media/modern-media-controls/start-support back on https://bugs.webkit.org/show_bug.cgi?id=174683 Reviewed by Dean Jackson. Turning those tests back on revealed a small bug that is unlikely to really affect content on the Web. In the case where the size of the video is known right away, without the need for loading its metadata, as is the case in the start-support-click-to-start.html test with a local media resource, all queued layouts are flushed at once and we may call the layout() method of the left ButtonsContainer which originally is set to contain the play/pause button, which would remove the play/pause button from the center of the media. So before we potentially set the play/pause button as the central button, we first assign the default button set for the two ButtonsContainer instances and only add the play/pause button when we're not showing the prominent play/pause button. * Modules/modern-media-controls/controls/inline-media-controls.js: (InlineMediaControls.prototype.layout): (InlineMediaControls.prototype._leftContainerButtons): 2017-07-20 Chris Dumez Drop legacy FileException type https://bugs.webkit.org/show_bug.cgi?id=174676 Reviewed by Alex Christensen. Drop legacy FileException type and use DOMException instead, as per the latest File API specification: - https://w3c.github.io/FileAPI/#ErrorAndException Both Firefox and Chrome no longer expose FileException. * CMakeLists.txt: * DerivedSources.cpp: * DerivedSources.make: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSDOMExceptionHandling.cpp: (WebCore::createDOMException): * dom/DOMExceptions.in: * fileapi/FileException.cpp: Removed. * fileapi/FileException.h: Removed. * fileapi/FileException.idl: Removed. * fileapi/FileReaderLoader.cpp: (WebCore::FileReaderLoader::FileReaderLoader): (WebCore::FileReaderLoader::failed): * fileapi/FileReaderLoader.h: (WebCore::FileReaderLoader::errorCode): * fileapi/FileReaderSync.cpp: (WebCore::errorCodeToExceptionCode): (WebCore::FileReaderSync::startLoading): 2017-07-20 Sam Weinig [WebIDL] Remove custom bindings for InspectorFrontendHost https://bugs.webkit.org/show_bug.cgi?id=174659 Reviewed by Chris Dumez. * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSBindingsAllInOne.cpp: * bindings/js/JSInspectorFrontendHostCustom.cpp: Removed. Remove JSInspectorFrontendHostCustom.cpp. * inspector/InspectorFrontendHost.cpp: (WebCore::populateContextMenu): (WebCore::InspectorFrontendHost::showContextMenu): * inspector/InspectorFrontendHost.h: * inspector/InspectorFrontendHost.idl: Re-implement showContextMenu by using an IDL defined ContextMenuItem dictionary and converting from that to a WebCore::ContextMenu in the implementation. 2017-07-20 Charlie Turner [GTK] Layout Test http/tests/media/hls/hls-progress.html is failing https://bugs.webkit.org/show_bug.cgi?id=141469 Reviewed by Xabier Rodriguez-Calvar. A work-around for getting progress information in a timely manner from live pipelines. We cannot rely on getting BUFFERING messages within the stalled time window (3s), so we have to poll for progress information somehow. Makes the following pass reliably http/tests/media/hls/hls-audio-tracks-has-audio.html passed unexpectedly http/tests/media/hls/hls-audio-tracks.html passed unexpectedly http/tests/media/hls/hls-progress.html passed unexpectedly * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::findHLSQueue): (WebCore::isHLSProgressing): (WebCore::MediaPlayerPrivateGStreamer::fillTimerFired): 2017-07-20 Andreas Kling Minor Node->Element type tightening fixes https://bugs.webkit.org/show_bug.cgi?id=174651 Reviewed by Sam Weinig. Tighten up some Node* into Element* or even better, Element&. * dom/Document.cpp: (WebCore::acceptsEditingFocus): Take a const Element&. (WebCore::Document::setFocusedElement): * editing/Editor.cpp: (WebCore::Editor::findEventTargetFrom): Return an Element*. (WebCore::Editor::findEventTargetFromSelection): Ditto. (WebCore::Editor::pasteAsPlainText): (WebCore::Editor::pasteAsFragment): (WebCore::Editor::dispatchCPPEvent): * editing/Editor.h: * page/DragController.cpp: (WebCore::DragController::dispatchTextInputEventFor): 2017-07-20 Brady Eidson WKHTTPCookieStore API tests fail on High Sierra. and https://bugs.webkit.org/show_bug.cgi?id=174666 Reviewed by Andy Estes. Covered by existing API tests. In r219567 I'd moved cookie storage observation off of NSHTTPCookieStorage and NSNotificationCenter to CFHTTPCookieStorage observation callbacks. This is because notifications were only sent for the default [NSHTTPCookieStorage sharedHTTPCookieStorage] and not any of the other ones we keep in flight. Unfortunately that SPI has been disabled in High Sierra. Fortunately we found a way we can get non-shared NSHTTPCookieStorages to send notifications that works everywhere. * platform/network/cocoa/CookieStorageObserver.h: * platform/network/cocoa/CookieStorageObserver.mm: (-[WebCookieObserverAdapter initWithObserver:]): (-[WebCookieObserverAdapter cookiesChangedNotificationHandler:]): (WebCore::CookieStorageObserver::create): (WebCore::CookieStorageObserver::CookieStorageObserver): (WebCore::CookieStorageObserver::~CookieStorageObserver): (WebCore::CookieStorageObserver::startObserving): Use a trick to call some SPI on non-shared NSHTTPCookieStorages to get them to send notifications. (WebCore::CookieStorageObserver::stopObserving): (WebCore::cookiesChanged): Deleted. * platform/network/cocoa/NetworkStorageSessionCocoa.mm: (WebCore::NetworkStorageSession::cookieStorageObserver): 2017-07-20 Miguel Gomez [GStreamer] Some layout tests issue "g_mutex_clear() called on uninitialised or locked mutex" and flaky crash in ~MediaPlayerPrivateGStreamerBase https://bugs.webkit.org/show_bug.cgi?id=173952 Reviewed by Carlos Garcia Campos. Adjust MediaPlayerPrivateGStreamerBase to avoid concurrence problems with the GStreamer thread when destroying the object. Covered by existent tests. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase): (WebCore::MediaPlayerPrivateGStreamerBase::repaint): (WebCore::MediaPlayerPrivateGStreamerBase::cancelRepaint): 2017-07-19 Zan Dobersek [EME] Push CDMInstance, CDMPrivate and associated types into the Platform layer https://bugs.webkit.org/show_bug.cgi?id=174496 Reviewed by Xabier Rodriguez-Calvar. Move the CDMInstance and CDMPrivate interfaces into the platform layer, enabling implementations of specific key systems at that level, as well as integration with the MediaPlayerPrivate stack without any layering violations. While the platform layer still uses the WebCore namespace, the two interface files have now been moved under the platform/encryptedmedia/ directory and out of the Modules/encryptedmedia/ directory where the Web-facing API implementation resides. The two interfaces integrated closely with the Web-facing enumerations and dictionaries: MediaKeyMessageType, MediaKeySessionType, MediaKeyStatus, MediaKeySystemConfiguration, MediaKeySystemCapability, MediaKeysRequirement and MediaKeysRestrictions. Definitions of these types are also moved to the platform layer without any changes (apart from renaming), and the previous types now alias against the types now located in the platform layer. No new tests -- no change in behavior. * CMakeLists.txt: * Modules/encryptedmedia/CDM.cpp: * Modules/encryptedmedia/CDM.h: * Modules/encryptedmedia/MediaKeyMessageType.h: * Modules/encryptedmedia/MediaKeySessionType.h: * Modules/encryptedmedia/MediaKeyStatus.h: * Modules/encryptedmedia/MediaKeySystemAccess.cpp: * Modules/encryptedmedia/MediaKeySystemAccess.h: * Modules/encryptedmedia/MediaKeySystemConfiguration.h: * Modules/encryptedmedia/MediaKeySystemMediaCapability.h: * Modules/encryptedmedia/MediaKeysRequirement.h: * Modules/encryptedmedia/MediaKeysRestrictions.h: * platform/encryptedmedia/CDMInstance.h: Renamed from Source/WebCore/Modules/encryptedmedia/CDMInstance.h. * platform/encryptedmedia/CDMKeyStatus.h: Copied from Source/WebCore/Modules/encryptedmedia/MediaKeyStatus.h. * platform/encryptedmedia/CDMKeySystemConfiguration.h: Copied from Source/WebCore/Modules/encryptedmedia/MediaKeySystemConfiguration.h. * platform/encryptedmedia/CDMMediaCapability.h: Copied from Source/WebCore/Modules/encryptedmedia/MediaKeySystemMediaCapability.h. * platform/encryptedmedia/CDMMessageType.h: Copied from Source/WebCore/Modules/encryptedmedia/MediaKeyMessageType.h. * platform/encryptedmedia/CDMPrivate.h: Renamed from Source/WebCore/Modules/encryptedmedia/CDMPrivate.h. * platform/encryptedmedia/CDMRequirement.h: Copied from Source/WebCore/Modules/encryptedmedia/MediaKeysRequirement.h. * platform/encryptedmedia/CDMRestrictions.h: Copied from Source/WebCore/Modules/encryptedmedia/MediaKeysRestrictions.h. * platform/encryptedmedia/CDMSessionType.h: Copied from Source/WebCore/Modules/encryptedmedia/MediaKeySessionType.h. 2017-07-19 Zan Dobersek Unreviewed follow-up to r219674. * page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp: Remove the AsyncScrollingCoordinator.h header include that was added by accident. 2017-07-19 Zan Dobersek [CMake] Clean up Web Crypto build targets https://bugs.webkit.org/show_bug.cgi?id=174253 Reviewed by Alex Christensen. Gather the common WebCrypto source files in CMakeLists.txt, including them in the build unconditionally and instead relying on ENABLE_SUBTLE_CRYPTO build guards to exclude the code from compilation if the feature is disabled. PlatformGTK.cmake, PlatformMac.cmake and PlatformWPE.cmake can then remove duplicated build targets. PlatformMac.cmake still lists all the Mac-specific Web Crypto build targets. PlatformGTK.cmake and PlatformWPE.cmake now include GCrypt.cmake if the USE_GCRYPT variable is enabled. Both ports at the moment enable that variable though as they by default leverage a libgcrypt-based CrpytoDigest implementation in the PAL library. The new GCrypt.cmake file adds the libgcrypt-specific Web Crypto build targets to the build and also sets up libgcrypt include directiories and libraries. No new tests -- no change in behavior. * CMakeLists.txt: * PlatformGTK.cmake: * PlatformMac.cmake: * PlatformWPE.cmake: * platform/GCrypt.cmake: Added. 2017-07-19 Sam Weinig [WebIDL] Remove custom bindings for CommandLineAPIHost https://bugs.webkit.org/show_bug.cgi?id=174642 Reviewed by Joseph Pecoraro. * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSBindingsAllInOne.cpp: * bindings/js/JSCommandLineAPIHostCustom.cpp: Removed. Remove JSCommandLineAPIHostCustom.cpp. * bindings/js/JSDOMConvertObject.h: (WebCore::JSConverter::convert): Add missing JSConverter specialization for IDLObject. * inspector/CommandLineAPIHost.cpp: (WebCore::CommandLineAPIHost::inspect): (WebCore::listenerEntriesFromListenerInfo): (WebCore::CommandLineAPIHost::inspectedObject): (WebCore::CommandLineAPIHost::databaseId): (WebCore::CommandLineAPIHost::storageId): (WebCore::CommandLineAPIHost::inspectImpl): Deleted. (WebCore::CommandLineAPIHost::getEventListenersImpl): Deleted. (WebCore::CommandLineAPIHost::databaseIdImpl): Deleted. (WebCore::CommandLineAPIHost::storageIdImpl): Deleted. * inspector/CommandLineAPIHost.h: * inspector/CommandLineAPIHost.idl: Replace custom bindings with modern bindings affordances: dictionaries, records and sequences. 2017-07-19 Zan Dobersek Unreviewed CoordGraphics build fix. * page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp: (WebCore::ScrollingCoordinatorCoordinatedGraphics::updateNodeViewportConstraints): This should be defined for the ScrollingCoordinatorCoordinatedGraphics class. Also fix the setFixedToViewport() call, fishing out the GraphicsLayer object from the ScrollingStateNode's LayerRepresentation. (WebCore::AsyncScrollingCoordinator::updateNodeViewportConstraints): Deleted. 2017-07-19 Chris Dumez Drop SQLException type https://bugs.webkit.org/show_bug.cgi?id=174665 Reviewed by Sam Weinig. Drop SQLException type. We never throw such exception. Also, Firefox and Chrome no longer expose this type. * CMakeLists.txt: * DerivedSources.cpp: * DerivedSources.make: * Modules/webdatabase/SQLException.cpp: Removed. * Modules/webdatabase/SQLException.h: Removed. * Modules/webdatabase/SQLException.idl: Removed. * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSDOMExceptionHandling.cpp: (WebCore::createDOMException): * bindings/js/JSExceptionBase.cpp: (WebCore::toExceptionBase): * dom/DOMExceptions.in: 2017-07-19 Wenson Hsieh Unreviewed, tweak a comment above TemporarySelectionOptionIgnoreSelectionChanges in Editor.cpp. The comment references the UI process, but it describes an entity in WebCore. This should have been generalized to instead refer to the client layer in general (i.e. WebKit1 or WebKit2). * editing/Editor.h: 2017-07-19 Simon Fraser getBoundingClientRects not updated for programmatic scrolls https://bugs.webkit.org/show_bug.cgi?id=174538 rdar://problem/33049012 Reviewed by Tim Horton. Baidu.com has two event handlers on its , and both query the input location with getBoundingClientRect() and the current pageYOffset (via jQuery), then try to scroll the input to the top of the screen. The bug is that programmatic scrolls did not immediately update the layout viewport rect, so the second call to getBoundingClientRect() would return stale coordinates, triggering an extra scroll. To fix this, undo the fix for r219320 which tried to keep getBoundingClientRect() current during unstable scroll updates by adding a shadow layout viewport rect. Instead, almost always update the layout viewport rect on FrameView, even during unstable visible rect updates, but not if content insets are being changed interactively, since changing viewport heights cause problems with bottom-fixed elements. Also, we need to compute a new layout viewport rect in FrameView::updateLayoutViewport() for programmatic scrolls. However, always updating the layout viewport triggered issues with the scrolling tree. The scrolling state tree fossilizes layer positions relative to a specific viewport rect, and that relationship has to be maintained. There are code paths that recompute fixed/sticky viewport constraints when the layout viewport has changed but we haven't done layout or recomputed layer positions (e.g. updating viewport-constrained layers via updateScrollCoordinatedLayersAfterFlush()) and in these cases using a new layout viewport for those computations results in an inconsistent scrolling tree. Fix this by not updating scrolling constraints every time we have to re-register scrolling nodes. updateScrollCoordinatedLayersAfterFlush() only needs to update the layer on the scrolling node (to handle tiled/non-tiled switches), so make updateScrollCoordinatedLayer() a little more fine-grained, and only update constraints when we've just computed layer geometry. This allows for different scrolling nodes to have constraints computed at different times, with different layout viewports, which happens. Two additional fixes were required to make bottom-fixed bars behave correctly. First, FrameView::computeLayoutViewportOrigin() had a bug where rounding of half-pixel values would cause it to fall into the if (visualViewport.height() > layoutViewport.height()) clause, but then fail to clamp for rubber-banding. Second, the FrameView::unscaledMaximumScrollPosition() was wrong after zooming on iOS, since it uses visibleSize() which is affected by page scale on iOS only (and the function wants scale-independent values). Fix with a hack that should be cleaned up via webkit.org/b/174648. Tested by existing tests. * page/FrameView.cpp: (WebCore::FrameView::computeUpdatedLayoutViewportRect): (WebCore::FrameView::computeLayoutViewportOrigin): (WebCore::FrameView::setLayoutViewportOverrideRect): (WebCore::FrameView::updateLayoutViewport): (WebCore::FrameView::unscaledMaximumScrollPosition): (WebCore::FrameView::documentToClientOffset): (WebCore::FrameView::setUnstableLayoutViewportRect): Deleted. * page/FrameView.h: * page/scrolling/AsyncScrollingCoordinator.cpp: (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll): (WebCore::AsyncScrollingCoordinator::reconcileScrollingState): (WebCore::AsyncScrollingCoordinator::reconcileViewportConstrainedLayerPositions): (WebCore::AsyncScrollingCoordinator::updateNodeLayer): (WebCore::AsyncScrollingCoordinator::updateNodeViewportConstraints): (WebCore::AsyncScrollingCoordinator::updateViewportConstrainedNode): Deleted. * page/scrolling/AsyncScrollingCoordinator.h: * page/scrolling/ScrollingCoordinator.cpp: (WebCore::operator<<): * page/scrolling/ScrollingCoordinator.h: (WebCore::ScrollingCoordinator::reconcileScrollingState): (WebCore::ScrollingCoordinator::updateNodeLayer): (WebCore::ScrollingCoordinator::updateNodeViewportConstraints): (WebCore::ScrollingCoordinator::updateViewportConstrainedNode): Deleted. * page/scrolling/ScrollingStateFixedNode.cpp: (WebCore::ScrollingStateFixedNode::updateConstraints): * page/scrolling/ScrollingStateStickyNode.cpp: (WebCore::ScrollingStateStickyNode::updateConstraints): (WebCore::ScrollingStateStickyNode::reconcileLayerPositionForViewportRect): * page/scrolling/ScrollingTree.cpp: (WebCore::ScrollingTree::commitTreeState): * page/scrolling/mac/ScrollingTreeFixedNode.mm: (WebCore::ScrollingTreeFixedNode::updateLayersAfterAncestorChange): * page/scrolling/mac/ScrollingTreeStickyNode.mm: (WebCore::ScrollingTreeStickyNode::updateLayersAfterAncestorChange): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateGeometry): * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayersAfterFlush): (WebCore::RenderLayerCompositor::updateBacking): (WebCore::RenderLayerCompositor::fixedRootBackgroundLayerChanged): (WebCore::RenderLayerCompositor::requiresCompositingForPosition): (WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus): (WebCore::RenderLayerCompositor::computeFixedViewportConstraints): (WebCore::RenderLayerCompositor::computeStickyViewportConstraints): (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer): (WebCore::RenderLayerCompositor::didAddScrollingLayer): * rendering/RenderLayerCompositor.h: 2017-07-19 Megan Gardner Don't write file URLs to iOS Pasteboard https://bugs.webkit.org/show_bug.cgi?id=174647 Reviewed by Wenson Hsieh. Tests updated to reflect the changes. We are no longer vending file URLs in Drag & Drop and Copy/Paste. * editing/ios/EditorIOS.mm: (WebCore::Editor::writeImageToPasteboard): * platform/ios/PlatformPasteboardIOS.mm: (WebCore::PlatformPasteboard::write): 2017-07-19 Myles C. Maxfield Setting the minimum font size preference doesn’t affect absolute line-height values, so lines overlap https://bugs.webkit.org/show_bug.cgi?id=174406 Reviewed by Simon Fraser. Reviewed by NOBODY. When the minimumFontSize API preference is set, we will increase the font size without increasing the line height. If the content specifies line-height as an absolute value, there can be two unfortunate results: - Adjacent lines in a paragraph can overlap - If the paragraph (or containin block or whatever) uses overflow: hidden, the first and last lines can be cut off and potentially indecipherable. Instead, we should use the minimum font size preference as a signal that we should increase the line-height as well as the font-size. Eventually, we will want to increase it by an amount proportional to the increase in font-size (which can be due to minimumFontSize, minimumLogicalFontSize, text autosizing, etc.). However, because minimumLogicalFontSize is on by default, this would cause a behavior change on many webpages which use small text, so such a change would be too risky right now. Instead, we can pretend that minimumFontSize is the only cause that text increases, and use this as the only signal to boost the corresponding line-height. Tests: fast/text/line-height-minimumFontSize-text-zoom.html fast/text/line-height-minimumFontSize-visual.html fast/text/line-height-minimumFontSize-zoom.html fast/text/line-height-minimumFontSize.html fast/text/line-height-minimumFontSize-autosize.html * css/StyleBuilderCustom.h: (WebCore::computeBaseSpecifiedFontSize): (WebCore::computeLineHeightMultiplierDueToFontSize): (WebCore::StyleBuilderCustom::applyValueLineHeight): (WebCore::StyleBuilderCustom::applyValueFill): (WebCore::StyleBuilderCustom::applyValueStroke): (WebCore::StyleBuilderCustom::applyValueContent): * rendering/TextAutoSizing.cpp: 2017-07-18 Myles C. Maxfield Setting the minimum font size preference doesn’t affect absolute line-height values, so lines overlap https://bugs.webkit.org/show_bug.cgi?id=174406 Reviewed by Simon Fraser. When the minimumFontSize API preference is set, we will increase the font size without increasing the line height. If the content specifies line-height as an absolute value, there can be two unfortunate results: - Adjacent lines in a paragraph can overlap - If the paragraph (or containin block or whatever) uses overflow: hidden, the first and last lines can be cut off and potentially indecipherable. Instead, we should use the minimum font size preference as a signal that we should increase the line-height as well as the font-size. Eventually, we will want to increase it by an amount proportional to the increase in font-size (which can be due to minimumFontSize, minimumLogicalFontSize, text autosizing, etc.). However, because minimumLogicalFontSize is on by default, this would cause a behavior change on many webpages which use small text, so such a change would be too risky right now. Instead, we can pretend that minimumFontSize is the only cause that text increases, and use this as the only signal to boost the corresponding line-height. Tests: fast/text/line-height-minimumFontSize-text-zoom.html fast/text/line-height-minimumFontSize-visual.html fast/text/line-height-minimumFontSize-zoom.html fast/text/line-height-minimumFontSize.html fast/text/line-height-minimumFontSize-autosize.html * css/StyleBuilderCustom.h: (WebCore::computeBaseSpecifiedFontSize): (WebCore::computeLineHeightMultiplierDueToFontSize): (WebCore::StyleBuilderCustom::applyValueLineHeight): (WebCore::StyleBuilderCustom::applyValueFill): (WebCore::StyleBuilderCustom::applyValueStroke): (WebCore::StyleBuilderCustom::applyValueContent): * rendering/TextAutoSizing.cpp: 2017-07-19 Chris Dumez DOMException should not have its own toString() https://bugs.webkit.org/show_bug.cgi?id=174630 Reviewed by Sam Weinig. DOMException should not have its own toString() and should use the one from Error.prototype.toString() instead: - https://heycam.github.io/webidl/#idl-DOMException No new tests, rebaselined existing tests. * dom/DOMCoreException.idl: 2017-07-19 Antoine Quint [iOS] REGRESSION: Scrubbing media using built-in controls does not pause media https://bugs.webkit.org/show_bug.cgi?id=174650 Reviewed by Dean Jackson. We would only pause when scrubbing on macOS because we only listened to "mousedown" events on the scrubber's backing element to identify that the user had started interacting with the scrubber. Implementing the same technique on iOS required a little more work than just listening to "touchstart" events on the same element. On top of that, we needed to make sure that we would only respond to "touchstart" events on the slider's thumb, and not on the track, since only on macOS should the user be able to click anywhere on the track to scrub. So we turn off pointer-events for the on iOS only, and turn them back on specifically for the thumb. There is also some finessing when dealing with touch events where we need to track the identifier of the touch that started the user interaction. So we keep track of it in an ivar and wait until we get a "touchend" event where the changedTouches list contains a touch with that same identifier to ensure the same touch that initiates and ends the scrubbing interaction. Finally, we fix another issue that was uncovered while turning back on the ScrubbingSupport tests where we would not trash the cached _value ivar when we initiated scrubbing, which was important since we would mistakenly use the pre-srubbing value during a scrub. * Modules/modern-media-controls/controls/slider.css: (.ios .slider > input): (.slider > input::-webkit-slider-thumb): * Modules/modern-media-controls/controls/slider.js: (Slider.prototype.handleEvent): (Slider.prototype._handleMousedownEvent): (Slider.prototype._interactionEndTarget): (Slider.prototype._handleTouchstartEvent): (Slider.prototype._valueWillStartChanging): (Slider.prototype._valueDidStopChanging): (Slider.prototype._handleMouseupEvent): (Slider.prototype._handleTouchendEvent): 2017-07-19 Nan Wang AX: Web page reloaded when a node is labelling multiple childnodes https://bugs.webkit.org/show_bug.cgi?id=174655 Reviewed by Chris Fleizach. When we are asking for the aria-labelledby attribute of a node and its sibling is also labelled by the same node, we get into an infinite loop in textUnderElement since we only ignore one child. Added checks for siblings to avoid such loop. Test: accessibility/mac/aria-labelledby-multiple-child-crash.html * accessibility/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::textUnderElement): 2017-07-19 Andy Estes Use a cast to work around clang's false -Wobjc-literal-conversion warnings https://bugs.webkit.org/show_bug.cgi?id=174631 Reviewed by Dan Bernstein. Instead of ignoring -Wobjc-literal-conversion, use a cast to work around rdar://problem/33383354. * platform/ios/PlatformPasteboardIOS.mm: (WebCore::PlatformPasteboard::write): 2017-07-19 Chris Dumez Make cross-origin properties enumerable https://bugs.webkit.org/show_bug.cgi?id=174576 Reviewed by Darin Adler. Makes cross-origin properties enumerable on Window and Location objects as per: - https://github.com/whatwg/html/pull/2777 This simplifies our code quite a bit. No new tests, updated existing tests. * bindings/js/JSDOMWindowCustom.cpp: (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess): (WebCore::JSDOMWindow::getOwnPropertySlotByIndex): (WebCore::JSDOMWindow::getOwnPropertyNames): * bindings/js/JSLocationCustom.cpp: (WebCore::getOwnPropertySlotCommon): (WebCore::JSLocation::getOwnPropertyNames): * bindings/scripts/CodeGeneratorJS.pm: (GenerateHeader): 2017-07-18 Carlos Alberto Lopez Perez [EME] Build failure with Clang-3.8 on InitDataRegistry.cpp https://bugs.webkit.org/show_bug.cgi?id=174628 Reviewed by Žan Doberšek. * Modules/encryptedmedia/InitDataRegistry.cpp: (WebCore::extractKeyIDsKeyids): Add an explicit cast to unsigned. 2017-07-19 Matt Lewis Unreviewed, rolling out r219646. The test added are failing on all platforms Reverted changeset: "Setting the minimum font size preference doesn’t affect absolute line-height values, so lines overlap" https://bugs.webkit.org/show_bug.cgi?id=174406 http://trac.webkit.org/changeset/219646 2017-07-19 Yusuke Suzuki [WTF] Implement WTF::ThreadGroup https://bugs.webkit.org/show_bug.cgi?id=174081 Reviewed by Mark Lam. * page/ResourceUsageThread.h: 2017-07-18 Andy Estes [Xcode] Enable CLANG_WARN_RANGE_LOOP_ANALYSIS https://bugs.webkit.org/show_bug.cgi?id=174631 Reviewed by Tim Horton. * Configurations/Base.xcconfig: * rendering/Grid.cpp: (WebCore::Grid::insert): * rendering/RenderTreeAsText.cpp: (WebCore::write): * rendering/SimpleLineLayoutCoverage.cpp: (WebCore::SimpleLineLayout::printSimpleLineLayoutCoverage): 2017-07-18 Yusuke Suzuki WTF::Thread should have the threads stack bounds. https://bugs.webkit.org/show_bug.cgi?id=173975 Reviewed by Mark Lam. When creating WebThread, we first allocate WebCore::ThreadGlobalData in UI thread and share it with WebThread. The problem is that WebCore::ThreadGlobalData has CachedResourceRequestInitiators. It allocates AtomicString, which requires WTFThreadData. In this patch, we call WTF::initializeThreading() before allocating WebCore::ThreadGlobalData. And we also call AtomicString::init() before calling WebCore::ThreadGlobalData since WebCore::ThreadGlobalData allocates AtomicString. * platform/ios/wak/WebCoreThread.mm: (StartWebThread): 2017-07-18 Myles C. Maxfield Setting the minimum font size preference doesn’t affect absolute line-height values, so lines overlap https://bugs.webkit.org/show_bug.cgi?id=174406 Reviewed by Simon Fraser. When the minimumFontSize API preference is set, we will increase the font size without increasing the line height. If the content specifies line-height as an absolute value, there can be two unfortunate results: - Adjacent lines in a paragraph can overlap - If the paragraph (or containin block or whatever) uses overflow: hidden, the first and last lines can be cut off and potentially indecipherable. Instead, we should use the minimum font size preference as a signal that we should increase the line-height as well as the font-size. Eventually, we will want to increase it by an amount proportional to the increase in font-size (which can be due to minimumFontSize, minimumLogicalFontSize, text autosizing, etc.). However, because minimumLogicalFontSize is on by default, this would cause a behavior change on many webpages which use small text, so such a change would be too risky right now. Instead, we can pretend that minimumFontSize is the only cause that text increases, and use this as the only signal to boost the corresponding line-height. Tests: fast/text/line-height-minimumFontSize-text-zoom.html fast/text/line-height-minimumFontSize-visual.html fast/text/line-height-minimumFontSize-zoom.html fast/text/line-height-minimumFontSize.html fast/text/line-height-minimumFontSize-autosize.html * css/StyleBuilderCustom.h: (WebCore::computeBaseSpecifiedFontSize): (WebCore::computeLineHeightMultiplierDueToFontSize): (WebCore::StyleBuilderCustom::applyValueLineHeight): (WebCore::StyleBuilderCustom::applyValueFill): (WebCore::StyleBuilderCustom::applyValueStroke): (WebCore::StyleBuilderCustom::applyValueContent): * rendering/TextAutoSizing.cpp: 2017-07-18 Zalan Bujtas Media controls are missing content in fullscreen when document has scroll offset. https://bugs.webkit.org/show_bug.cgi?id=174644 Reviewed by Simon Fraser. If a non-user initiated scrolling (result of resize for example) is processed asynchronously, it might leapfrog other, programatic scrollings and trigger unintentional scroll offsets (and turn into unwanted clippings). This patch ensures that both resize and top content inset change are translated into programatic scrolling. Unable to test full screen video. * page/FrameView.cpp: (WebCore::FrameView::setFrameRect): (WebCore::FrameView::topContentInsetDidChange): 2017-07-18 Andy Estes [Xcode] Enable CLANG_WARN_OBJC_LITERAL_CONVERSION https://bugs.webkit.org/show_bug.cgi?id=174631 Reviewed by Sam Weinig. * Configurations/Base.xcconfig: * platform/ios/PlatformPasteboardIOS.mm: (WebCore::PlatformPasteboard::write): 2017-07-18 Ali Juma Align quirky number parsing with other browsers https://bugs.webkit.org/show_bug.cgi?id=155874 Reviewed by Simon Fraser. Parse unit-less non-zero values for animation-duration and transition-duration as invalid time values in quirks mode. Test: fast/css/animation-transition-duration-quirksmode.html * css/parser/CSSPropertyParser.cpp: (WebCore::consumeAnimationValue): 2017-07-18 Chris Dumez HysteresisActivity cannot be used in the UIProcess https://bugs.webkit.org/show_bug.cgi?id=174643 Reviewed by Tim Horton. Port HysteresisActivity to RunLoop::Timer so that it can safely be used in the UIProcess as well. * platform/HysteresisActivity.h: 2017-07-18 Joseph Pecoraro Web Inspector: Modernize InjectedScriptSource https://bugs.webkit.org/show_bug.cgi?id=173890 Reviewed by Brian Burg. Covered by existing tests. * inspector/CommandLineAPIModuleSource.js: (CommandLineAPIImpl.prototype.copy): (CommandLineAPIImpl.prototype._inspect): Use RemoteObject, a new parameter. 2017-07-18 Ryosuke Niwa REGRESSION(r218910): Crash when password field changes to text field https://bugs.webkit.org/show_bug.cgi?id=174560 Reviewed by Zalan Bujtas. The crash was caused by textMarkerDataForFirstPositionInTextControl accessing a nullptr returned by getOrCreate. Unfortunately, in order to this fix bug while preserving the exact behavior would require synchronously creating a renderer for the editing host when the input type changed since we can't create an accessbility object out of a renderer-less node. Instead, revert back to pre-r218910 behavior of always using the text control element's axID when notifying the value change. While this is inconsistent with the way editing commands report content changes, I've since learned that VoiceOver has code to deal with this exact situation. Test: accessibility/mac/input-type-change-crash-2.html * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::textMarkerDataForFirstPositionInTextControl): 2017-07-18 Matt Baker Web Inspector: Refactoring: replace InspectorCanvasAgent::CanvasEntry with a helper class https://bugs.webkit.org/show_bug.cgi?id=174311 Reviewed by Devin Rousso. This patch adds a helper class for tracking canvases and their data. The current approach of defining a helper structure in the agent's header is awkward to use and maintain, and won't scale well as more canvas instrumentation points and data are added. * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: New file. * inspector/InspectorCanvas.cpp: Added. (WebCore::InspectorCanvas::create): (WebCore::InspectorCanvas::InspectorCanvas): (WebCore::InspectorCanvas::buildObjectForCanvas): * inspector/InspectorCanvas.h: Added. * inspector/InspectorCanvasAgent.cpp: (WebCore::InspectorCanvasAgent::InspectorCanvasAgent): (WebCore::InspectorCanvasAgent::enable): (WebCore::InspectorCanvasAgent::requestNode): (WebCore::InspectorCanvasAgent::requestContent): (WebCore::InspectorCanvasAgent::requestCSSCanvasClientNodes): (WebCore::InspectorCanvasAgent::resolveCanvasContext): (WebCore::InspectorCanvasAgent::frameNavigated): (WebCore::InspectorCanvasAgent::didCreateCSSCanvas): (WebCore::InspectorCanvasAgent::didChangeCSSCanvasClientNodes): (WebCore::InspectorCanvasAgent::didCreateCanvasRenderingContext): (WebCore::InspectorCanvasAgent::didChangeCanvasMemory): (WebCore::InspectorCanvasAgent::canvasDestroyed): (WebCore::InspectorCanvasAgent::canvasDestroyedTimerFired): (WebCore::InspectorCanvasAgent::clearCanvasData): (WebCore::InspectorCanvasAgent::unbindCanvas): (WebCore::InspectorCanvasAgent::assertInspectorCanvas): (WebCore::InspectorCanvasAgent::findInspectorCanvas): (WebCore::InspectorCanvasAgent::getCanvasEntry): Deleted. (WebCore::InspectorCanvasAgent::buildObjectForCanvas): Deleted. * inspector/InspectorCanvasAgent.h: * inspector/InspectorController.cpp: (WebCore::InspectorController::InspectorController): Remove unused constructor argument. 2017-07-18 Basuke Suzuki [Curl] Move detail implementation from ResourceHandle to ResourceHandleInternal https://bugs.webkit.org/show_bug.cgi?id=174641 After moving stuff from ResourceHandleManager to ResourceHandle on https://bugs.webkit.org/show_bug.cgi?id=173630, still there're many violation remains between ResourceHandle and ResourceHandleInternal classes. Many of implementation detail should be move to ResourceHandleInternal to improve build speed. Reviewed by Alex Christensen. * platform/network/ResourceHandle.h: * platform/network/ResourceHandleInternal.h: (WebCore::ResourceHandleInternal::ResourceHandleInternal): * platform/network/curl/ResourceHandleCurl.cpp: (WebCore::ResourceHandleInternal::~ResourceHandleInternal): (WebCore::ResourceHandle::start): (WebCore::ResourceHandle::cancel): (WebCore::ResourceHandleInternal::initialize): (WebCore::ResourceHandleInternal::applyAuthentication): (WebCore::ResourceHandleInternal::setupPUT): (WebCore::ResourceHandleInternal::setupPOST): (WebCore::ResourceHandleInternal::setupFormData): (WebCore::ResourceHandle::platformSetDefersLoading): (WebCore::ResourceHandleInternal::didFinish): (WebCore::ResourceHandleInternal::didFail): (WebCore::ResourceHandleInternal::calculateWebTimingInformations): (WebCore::ResourceHandleInternal::handleLocalReceiveResponse): (WebCore::ResourceHandleInternal::willPrepareSendData): (WebCore::ResourceHandleInternal::didReceiveHeaderLine): (WebCore::ResourceHandleInternal::didReceiveAllHeaders): (WebCore::ResourceHandleInternal::didReceiveContentData): (WebCore::ResourceHandleInternal::readCallback): (WebCore::ResourceHandleInternal::headerCallback): (WebCore::ResourceHandleInternal::writeCallback): (WebCore::ResourceHandle::platformLoadResourceSynchronously): (WebCore::ResourceHandleInternal::dispatchSynchronousJob): (WebCore::ResourceHandleInternal::handleDataURL): (WebCore::ResourceHandle::initialize): Deleted. (WebCore::ResourceHandle::applyAuthentication): Deleted. (WebCore::ResourceHandle::setupPUT): Deleted. (WebCore::ResourceHandle::setupPOST): Deleted. (WebCore::ResourceHandle::setupFormData): Deleted. (WebCore::ResourceHandle::didFinish): Deleted. (WebCore::ResourceHandle::didFail): Deleted. (WebCore::ResourceHandle::calculateWebTimingInformations): Deleted. (WebCore::ResourceHandle::handleLocalReceiveResponse): Deleted. (WebCore::ResourceHandle::willPrepareSendData): Deleted. (WebCore::ResourceHandle::didReceiveHeaderLine): Deleted. (WebCore::ResourceHandle::didReceiveAllHeaders): Deleted. (WebCore::ResourceHandle::didReceiveContentData): Deleted. (WebCore::ResourceHandle::readCallback): Deleted. (WebCore::ResourceHandle::headerCallback): Deleted. (WebCore::ResourceHandle::writeCallback): Deleted. (WebCore::ResourceHandle::dispatchSynchronousJob): Deleted. (WebCore::ResourceHandle::handleDataURL): Deleted. 2017-07-18 Andy Estes [Xcode] Enable CLANG_WARN_NON_LITERAL_NULL_CONVERSION https://bugs.webkit.org/show_bug.cgi?id=174631 Reviewed by Dan Bernstein. * Configurations/Base.xcconfig: 2017-07-18 Antoine Quint [macOS] Mouse pointer does not hide during fullscreen playback https://bugs.webkit.org/show_bug.cgi?id=174638 Reviewed by Dean Jackson. Test: media/modern-media-controls/css/webkit-cursor-visibility-auto-hide.html The user-agent stylesheet sets the "-webkit-cursor-visibility" to "auto-hide" for fullscreen