2014-10-17 Chris Dumez Avoid unnecessary isSVGFont() check in SimpleFontData::applyTransforms() https://bugs.webkit.org/show_bug.cgi?id=137836 Reviewed by Andreas Kling. Avoid unnecessary isSVGFont() check in SimpleFontData::applyTransforms(). This function is only called from WidthIterator::applyFontTransforms(), which already makes sure to call applyTransforms() if isSVGFont() returns false. This patch replaces the check with a simple assertion. No new tests, no behavior change. * platform/graphics/SimpleFontData.h: * svg/SVGFontData.h: 2014-10-16 Alexey Proskuryakov REGRESSION (r169024): Undetermined text is not displayed in the search field of Adobe Help Website https://bugs.webkit.org/show_bug.cgi?id=137679 rdar://problem/18450335 Reviewed by Enrica Casucci. Test: platform/mac/editing/input/selected-composed-text-painting.html * rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::paint): We do not paint selection beckground for unconfirmed text with underlines, so we should use a regular style for text painting, as well. 2014-10-14 Jer Noble REGRESSION (r159208): Crash when clicking scrubber after navigating away/back to video https://bugs.webkit.org/show_bug.cgi?id=137715 Reviewed by Darin Adler. Simple null-check of m_player in refreshCachedTime. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::refreshCachedTime): 2014-10-14 Zalan Bujtas REGRESSION (Safari 7.1/8.0): Border-radius and overflow hidden renders incorrectly. https://bugs.webkit.org/show_bug.cgi?id=137205 Reviewed by Simon Fraser. Child layer should not reset radius clipping behaviour. Test: fast/layers/parent-clipping-overflow-is-overwritten-by-child-clipping.html * rendering/RenderLayer.cpp: (WebCore::RenderLayer::calculateClipRects): 2014-10-14 Dan Bernstein URLs that start with http:/// and https:/// lose two slashes when parsed, causing assertion failure and inconsistent behavior https://bugs.webkit.org/show_bug.cgi?id=137718 Reviewed by Alexey Proskuryakov. Added cases to fast/loader/url-parse-1.html. * platform/URL.cpp: (WebCore::URL::parse): In hierarchical schemes other than file:, ignore any additional slashes after the ://, as prescribed by the authority-ignore-slashes state in the current URL spec. 2014-10-16 Chris Dumez Leverage the new RenderElement::m_isCSSAnimating flag in more places https://bugs.webkit.org/show_bug.cgi?id=137786 Reviewed by Simon Fraser. Leverage the new RenderElement::m_isCSSAnimating flag that was introduced in r174703 in more places, for performance. This avoids doing extra work for renderers on which we are not running animations on. This patch also updates the API a bit to use more references instead of pointers, making it clear the RenderElement cannot be null and thus avoiding unnecessary null checks. No new tests, no behavior change. * css/CSSComputedStyleDeclaration.cpp: (WebCore::computeRenderStyleForProperty): * page/animation/AnimationController.cpp: (WebCore::AnimationControllerPrivate::ensureCompositeAnimation): (WebCore::AnimationControllerPrivate::clear): (WebCore::AnimationControllerPrivate::updateAnimationTimerForRenderer): (WebCore::AnimationControllerPrivate::isRunningAnimationOnRenderer): (WebCore::AnimationControllerPrivate::isRunningAcceleratedAnimationOnRenderer): (WebCore::AnimationControllerPrivate::pauseAnimationAtTime): (WebCore::AnimationControllerPrivate::pauseTransitionAtTime): (WebCore::AnimationControllerPrivate::getAnimatedStyleForRenderer): (WebCore::AnimationController::cancelAnimations): (WebCore::AnimationController::updateAnimations): (WebCore::AnimationController::getAnimatedStyleForRenderer): (WebCore::AnimationController::notifyAnimationStarted): (WebCore::AnimationController::isRunningAnimationOnRenderer): (WebCore::AnimationController::isRunningAcceleratedAnimationOnRenderer): * page/animation/AnimationController.h: * page/animation/AnimationControllerPrivate.h: * rendering/RenderElement.cpp: (WebCore::RenderElement::willBeDestroyed): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::currentTransform): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateGeometry): (WebCore::RenderLayerBacking::notifyAnimationStarted): * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::requiresCompositingForAnimation): (WebCore::RenderLayerCompositor::isRunningAcceleratedTransformAnimation): 2014-10-14 Chris Dumez Introduce an isCSSAnimated flag on RenderElement for performance https://bugs.webkit.org/show_bug.cgi?id=137583 Reviewed by Simon Fraser. I noticed when profiling the ebay.com page load that isRunningAnimationOnRenderer() and isRunningAcceleratedAnimationOnRenderer() were called frequently, causing ~4.7 millions m_compositeAnimations HashMap lookups. This patch introduces an isCSSAnimated flag on RenderElement to return early if there is no animation on the renderer, thus avoiding HashMap lookups. This reduces the number of HashMap lookups from ~4.7 millions to ~68k. On my machine, I see the following performance improvements: - isRunning*AnimationOnRenderer() / computeCompositingRequirements() - before: ~45ms / ~90ms - after: ~4ms / ~30ms No new tests, no behavior change. * page/animation/AnimationController.cpp: (WebCore::AnimationControllerPrivate::ensureCompositeAnimation): (WebCore::AnimationControllerPrivate::clear): (WebCore::AnimationControllerPrivate::isRunningAnimationOnRenderer): (WebCore::AnimationControllerPrivate::isRunningAcceleratedAnimationOnRenderer): (WebCore::AnimationController::isRunningAnimationOnRenderer): (WebCore::AnimationController::isRunningAcceleratedAnimationOnRenderer): * rendering/RenderElement.cpp: (WebCore::RenderElement::RenderElement): * rendering/RenderElement.h: (WebCore::RenderElement::isCSSAnimating): (WebCore::RenderElement::setIsCSSAnimating): 2014-10-14 Youenn Fablet [XHR] Abort method execution when m_loader->cancel() in internalAbort() caused reentry https://bugs.webkit.org/show_bug.cgi?id=126975 Reviewed by Alexey Proskuryakov. Merging https://chromium.googlesource.com/chromium/blink/+/0d75daf2053631518606ae15daaece701a25b2c4 Ensuring new test from https://codereview.chromium.org/76133002/ is passing. Test: http/tests/xmlhttprequest/reentrant-cancel-abort.html * xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::open): exit early if internalAbort asks so (WebCore::XMLHttpRequest::abort): exit early if internalAbort asks so (WebCore::XMLHttpRequest::internalAbort): ask calling function to exit early if a new loader is created during the cancellation of the loader (potential reentrant case through window.onload callback) (WebCore::XMLHttpRequest::didTimeout): exit early if internalAbort asks so * xml/XMLHttpRequest.h: 2014-10-09 Simon Fraser Revert part of r174543 that broke grid layout tests. * css/CSSComputedStyleDeclaration.cpp: (WebCore::specifiedValueForGridTrackBreadth): 2014-10-09 Dean Jackson Computed style for clip is wrong with respect to auto https://bugs.webkit.org/show_bug.cgi?id=137567 Reviewed by Simon Fraser. Make sure that the computed style of clip returns the correct value when the input is "auto", or in this case "rect(auto, auto, auto, auto)". Before this patch it returned "rect(0px, 0px, 0px, 0px)" which was completely wrong. Test: fast/css/computed-clip-with-auto-rect.html * css/CSSComputedStyleDeclaration.cpp: (WebCore::autoOrZoomAdjustedValue): Helper function to make the correct keyword or length. (WebCore::specifiedValueForGridTrackBreadth): It can use the helper too. (WebCore::ComputedStyleExtractor::propertyValue): If the top/right/bottom/left is "auto", add that identifier to the output rectangle. 2014-10-09 Bear Travis [CSS Font Loading] Decrement the font loading count before notifying callbacks https://bugs.webkit.org/show_bug.cgi?id=137401 Reviewed by Alexey Proskuryakov. In the callbacks, it should appear that font load has completed. This is accessed through loading(), which relies on the current number of fonts loading via JS and CSS. Unskipping the failing test http/tests/webfont/fontloader-loading-attribute.html test which tests this. * css/FontLoader.cpp: (WebCore::LoadFontCallback::notifyLoaded): 2014-10-08 Myles C. Maxfield Text drawn with an SVG font has no spaces when word-rounding hacks are enabled https://bugs.webkit.org/show_bug.cgi?id=137463 Reviewed by Darin Adler. When rounding hacks are enabled, we use the "adjusted space width" instead of the regular space width. However, the SVG-font-specific implementation of the SimpleFontData constructor doesn't initialize this value, so it was getting set to an undefined value (which happened to be close to 0 in my tests). Test: svg/text/svg-font-word-rounding-hacks-spaces.html * css/CSSFontFaceSource.cpp: (WebCore::CSSFontFaceSource::getFontData): (WebCore::CSSFontFaceSource::ensureFontData): * loader/cache/CachedFont.cpp: (WebCore::CachedFont::ensureCustomFontData): (WebCore::CachedFont::getSVGFontById): * platform/graphics/SimpleFontData.h: * svg/SVGFontData.cpp: (WebCore::SVGFontData::initializeFontData): 2014-10-08 Darin Adler ASSERTION FAILED: underlyingStringIsValid() https://bugs.webkit.org/show_bug.cgi?id=137502 Reviewed by Anders Carlsson. * rendering/RenderTreeAsText.cpp: (WebCore::quoteAndEscapeNonPrintables): Take a StringView instead of a String. (WebCore::writeTextRun): Ditto. (WebCore::writeSimpleLine): Ditto. * rendering/RenderTreeAsText.h: Removed unneeded include, tweaked formatting, changed quoteAndEscapeNonPrintables to take a StringView. * rendering/SimpleLineLayoutFunctions.cpp: (WebCore::SimpleLineLayout::paintFlow): Tighten code using a modern for loop. (WebCore::SimpleLineLayout::showLineLayoutForFlow): Update to work with a StringView result for SimpleLineLayout::RunResolver::Run::text. * rendering/SimpleLineLayoutResolver.h: (WebCore::SimpleLineLayout::RunResolver::Run::text): Changed return type to StringView to fix the lifetime bug and also to improve performance by getting rid of the need to allocate and destroy a StringImpl object. 2014-10-07 Martin Hock Defer resolution of viewport size. https://bugs.webkit.org/show_bug.cgi?id=137376 rdar://problem/18558094 Reviewed by Benjamin Poulain. ViewportConfiguration should resolve the viewport size on configuration update. * dom/Document.cpp: (WebCore::Document::processViewport): Defer resolution of viewport size. * dom/ViewportArguments.cpp: (WebCore::finalizeViewportArguments): Deleted. * dom/ViewportArguments.h: * page/ViewportConfiguration.cpp: (WebCore::ViewportConfiguration::updateConfiguration): Resolve viewport size. (WebCore::ViewportConfiguration::viewportArgumentsLength): Resolves width or height based on viewport arguments. * page/ViewportConfiguration.h: 2014-10-06 David Hyatt REGRESSION (Simple Line Layout): Inline block baselines computed incorrectly https://bugs.webkit.org/show_bug.cgi?id=137461 Reviewed by Simon Fraser. Added fast/inline-block/simple-line-layout.html * rendering/SimpleLineLayoutFunctions.h: (WebCore::SimpleLineLayout::computeFlowFirstLineBaseline): (WebCore::SimpleLineLayout::computeFlowLastLineBaseline): Fix the baseline computation functions in simple line layout to use lineCount rather than runCount. 2014-10-06 Chris Fleizach AX: Performance: Certain Web site causes Safari to hang completely while entering form data https://bugs.webkit.org/show_bug.cgi?id=137420 Reviewed by Mario Sanchez Prada. If a website has multiple nested tables that are not "accessibility" tables, the performance of accessibility slows to a crawl because: 1) We are re-computing accessibilityIsIgnored many times. As a solution, we can enable the isIgnoredCache when updating children. 2) When asking if an object isTableCell, we'd go up the parent chain, asking each of those parents the same question, which exploded into calling this many times. As a solution, I've changed our determination of isTableCell to instead check if the parent is an accessibiltyTable which should be much faster. No new functionality. Existing tests cover changes. * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::updateChildrenIfNecessary): (WebCore::AccessibilityObject::accessibilityIsIgnored): * accessibility/AccessibilityTableCell.cpp: (WebCore::AccessibilityTableCell::parentTable): (WebCore::AccessibilityTableCell::isTableCell): 2014-10-19 Carlos Garcia Campos [GTK] Move GtkDragAndDropHelper from Platform to WebKit2 https://bugs.webkit.org/show_bug.cgi?id=137422 Reviewed by Martin Robinson. Remove ClipboardUtilitiesGtk and GtkDragAndDropHelper. * PlatformGTK.cmake: * platform/gtk/ClipboardUtilitiesGtk.cpp: Removed. * platform/gtk/ClipboardUtilitiesGtk.h: Removed. * platform/gtk/GtkDragAndDropHelper.cpp: Removed. * platform/gtk/GtkDragAndDropHelper.h: Removed. 2014-10-05 Lorenzo Tilve [GTK] Fix build when DRAG_SUPPORT is disabled https://bugs.webkit.org/show_bug.cgi?id=137361 Reviewed by Carlos Garcia Campos. Flag out unbuildable code without DRAG_SUPPORT. * platform/gtk/GtkDragAndDropHelper.cpp: * platform/gtk/GtkDragAndDropHelper.h: 2014-10-03 Tim Horton WKWebView snapshot of Daring Fireball has the wrong color in the obscured inset https://bugs.webkit.org/show_bug.cgi?id=137383 Reviewed by Sam Weinig. * rendering/RenderView.cpp: (WebCore::RenderView::paintBoxDecorations): Use documentBackgroundColor instead of baseBackgroundColor if backgroundShouldExtendBeyondPage is set. 2014-10-03 Bear Travis REGRESSION (r173531): Use after free in WebCore::RenderStyle::fontMetrics / WebCore::CSSPrimitiveValue::computeLengthDouble https://bugs.webkit.org/show_bug.cgi?id=136864 Reviewed by Andreas Kling. FontLoader previously called updateDocumentStyleIfNeeded, which would reset styles currently in use as part of the tabIndex calculation. The FontLoader should instead wait for pending stylesheets to load. Tests: fast/css/fontloader-tab-index.html * css/FontLoader.cpp: (WebCore::FontLoader::notifyWhenFontsReady): Do not immediately call loadingDone(). (WebCore::FontLoader::loadingDone): Wait for stylesheets to finish loading rather than updating document styles. * css/FontLoader.h: (WebCore::FontLoader::loading): Include JS font loads when testing for the loading state. 2014-10-02 Chris Dumez XMLHttpRequestProgressEventThrottle shouldn't throttle / defer progress events if there are no listeners https://bugs.webkit.org/show_bug.cgi?id=137346 Reviewed by Alexey Proskuryakov. Previously XMLHttpRequestProgressEventThrottle would throttle / defer progress events, which involves queueing events and starting timers, even if there were no listeners for those events (which is fairly common case). This patch updates XMLHttpRequestProgressEventThrottle to make sure there are actual progress event listeners *before* attempting to throttle and do extra processing, to avoid doing unnecessary work. This patch also makes XMLHttpRequestProgressEventThrottle::dispatchEvent() private as this method is only called from other dispatch methods of the class and never from the outside. No new tests, no behavior change. * xml/XMLHttpRequestProgressEventThrottle.cpp: (WebCore::XMLHttpRequestProgressEventThrottle::dispatchThrottledProgressEvent): (WebCore::XMLHttpRequestProgressEventThrottle::dispatchProgressEvent): 2014-10-02 Krzysztof Czech AX: Default orientation for aria scrollbars should be vertical https://bugs.webkit.org/show_bug.cgi?id=137341 Reviewed by Chris Fleizach. Default orientation for aria scrollbars regarding w3c spec should be vertical No new tests, covering by existing one. * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::orientation): 2014-10-02 Eva Balazsfalvi Fix minimal build warnings https://bugs.webkit.org/show_bug.cgi?id=137066 Reviewed by Daniel Bates. No new tests, no behavior change. * css/CSSParser.cpp: (WebCore::isValidKeywordPropertyAndValue): * html/parser/HTMLPreloadScanner.cpp: (WebCore::TokenPreloadScanner::StartTagScanner::processAttributes): * page/Page.cpp: (WebCore::Page::setPageScaleFactor): * platform/graphics/WidthIterator.cpp: (WebCore::WidthIterator::glyphDataForCharacter): * rendering/svg/SVGInlineTextBox.cpp: (WebCore::SVGInlineTextBox::prepareGraphicsContextForTextPainting): 2014-09-30 Yusuke Suzuki CSS JIT: Enable multiple stack references allocation by allocateUninitialized https://bugs.webkit.org/show_bug.cgi?id=135293 Reviewed by Benjamin Poulain. * cssjit/StackAllocator.h: (WebCore::StackAllocator::stackTop): Add stackTop method to check references are allocated easily. (WebCore::StackAllocator::allocateUninitialized): 2014-09-29 Brian J. Burg Web Inspector: InspectorValues should use references for out parameters https://bugs.webkit.org/show_bug.cgi?id=137190 Reviewed by Joseph Pecoraro. Clean up some call sites to explicitly check for cast success, and simplify some exceptional control flows. No new tests, no behavior changed. * inspector/CommandLineAPIHost.cpp: (WebCore::CommandLineAPIHost::inspectImpl): * inspector/InspectorCSSAgent.cpp: (WebCore::computePseudoClassMask): * inspector/InspectorDOMAgent.cpp: (WebCore::parseColor): (WebCore::parseConfigColor): (WebCore::parseQuad): (WebCore::InspectorDOMAgent::performSearch): (WebCore::InspectorDOMAgent::highlightConfigFromInspectorObject): (WebCore::InspectorDOMAgent::innerHighlightQuad): (WebCore::InspectorDOMAgent::highlightFrame): * inspector/InspectorDOMStorageAgent.cpp: (WebCore::InspectorDOMStorageAgent::findStorageArea): * inspector/InspectorIndexedDBAgent.cpp: Use NeverDestroyed instead of DEPRECATED_DEFINE_STATIC_LOCAL. * inspector/InspectorPageAgent.cpp: (WebCore::InspectorPageAgent::didClearWindowObjectInWorld): * inspector/InspectorReplayAgent.cpp: (WebCore::InspectorReplayAgent::replayToPosition): * inspector/InspectorResourceAgent.cpp: (WebCore::InspectorResourceAgent::willSendRequest): * inspector/InspectorStyleSheet.cpp: (WebCore::InspectorStyle::styleWithProperties): * inspector/InspectorStyleSheet.h: (WebCore::InspectorCSSId::InspectorCSSId): * inspector/InspectorTimelineAgent.cpp: (WebCore::InspectorTimelineAgent::startFromConsole): (WebCore::InspectorTimelineAgent::stopFromConsole): * inspector/InspectorWorkerAgent.cpp: 2014-10-17 Carlos Garcia Campos [GLIB] Add API to GMainLoopSource to schedule sources after a delay in microseconds https://bugs.webkit.org/show_bug.cgi?id=137782 Reviewed by Sergio Villar Senin. * platform/gtk/SharedTimerGtk.cpp: (WebCore::setSharedTimerFireInterval): Use microseconds instead of milliseconds. 2014-10-21 Carlos Garcia Campos [GTK] Several labels are white instead of black https://bugs.webkit.org/show_bug.cgi?id=137803 Reviewed by Martin Robinson. Recent GTK+ versions require to explicitly set the state before getting a color. * rendering/RenderThemeGtk.cpp: (WebCore::styleColor): Helper function to get a color from a GtkStylecontext that explicitly sets the state before getting the color. (WebCore::RenderThemeGtk::platformActiveSelectionBackgroundColor): Use styleColor(). (WebCore::RenderThemeGtk::platformInactiveSelectionBackgroundColor): Ditto. (WebCore::RenderThemeGtk::platformActiveSelectionForegroundColor): Ditto. (WebCore::RenderThemeGtk::platformInactiveSelectionForegroundColor): Ditto. (WebCore::RenderThemeGtk::platformActiveListBoxSelectionBackgroundColor): Ditto. (WebCore::RenderThemeGtk::platformInactiveListBoxSelectionBackgroundColor): Ditto. (WebCore::RenderThemeGtk::platformActiveListBoxSelectionForegroundColor): Ditto. (WebCore::RenderThemeGtk::platformInactiveListBoxSelectionForegroundColor): Ditto. (WebCore::RenderThemeGtk::systemColor): Ditto. 2014-10-11 Carlos Garcia Campos [GLIB] Split GMainLoopSource moving thread safe implementation to its own class GThreadSafeMainLoopSource https://bugs.webkit.org/show_bug.cgi?id=137485 Reviewed by Sergio Villar Senin. Use GThreadSafeMainLoopSource for GStreamer sources, since they can be used from different threads. Also update GMutexLocker usages, since it's now a template. * platform/audio/gstreamer/AudioFileReaderGStreamer.cpp: (WebCore::AudioFileReader::createBus): * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.h: * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: (WebCore::MediaPlayerPrivateGStreamerBase::updateTexture): (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint): (WebCore::MediaPlayerPrivateGStreamerBase::paint): * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h: * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h: * platform/graphics/gstreamer/VideoSinkGStreamer.cpp: (webkitVideoSinkTimeoutCallback): (webkitVideoSinkRender): (unlockBufferMutex): (webkitVideoSinkUnlockStop): (webkitVideoSinkStart): * platform/graphics/gstreamer/WebKitMediaSourceGStreamer.cpp: * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp: (webKitWebSrcGetProperty): (webKitWebSrcStop): (webKitWebSrcStart): (webKitWebSrcChangeState): (webKitWebSrcQueryWithParent): (webKitWebSrcGetUri): (webKitWebSrcSetUri): (webKitWebSrcNeedDataMainCb): (webKitWebSrcNeedDataCb): (webKitWebSrcEnoughDataMainCb): (webKitWebSrcEnoughDataCb): (webKitWebSrcSeekDataCb): (webKitWebSrcSetMediaPlayer): (StreamingClient::createReadBuffer): (StreamingClient::handleResponseReceived): (StreamingClient::handleDataReceived): (StreamingClient::handleNotifyFinished): (ResourceHandleStreamingClient::wasBlocked): (ResourceHandleStreamingClient::cannotShowURL): 2014-10-05 Carlos Garcia Campos [GTK] Do not generate a symlink in derived sources for every header in WebCore/bindings/gobject https://bugs.webkit.org/show_bug.cgi?id=137389 Reviewed by Martin Robinson. We only need a symlink for static sources that are included in public generated headers, because they are added with as so they need to be inside a webkitdom directory. Also use proper targets and commands to create the symlinks only when needed instead of for every build. * PlatformGTK.cmake: 2014-09-30 Carlos Garcia Campos [GTK] Move GtkPopupMenu implementation to WebPopupMenuProxyGtk https://bugs.webkit.org/show_bug.cgi?id=137193 Reviewed by Gustavo Noronha Silva. Remove GtkPopupMenu from platform. * PlatformGTK.cmake: * platform/gtk/GtkPopupMenu.cpp: Removed. * platform/gtk/GtkPopupMenu.h: Removed. 2014-09-29 Carlos Garcia Campos [GTK] Remove MainFrameScrollbarGtk.cpp https://bugs.webkit.org/show_bug.cgi?id=137211 Reviewed by Philippe Normand. This was only used by WebKit1. * PlatformGTK.cmake: * platform/gtk/MainFrameScrollbarGtk.cpp: Removed. * platform/gtk/MainFrameScrollbarGtk.h: Removed. 2014-09-29 Carlos Garcia Campos [GTK] Remove IntPointGtk.cpp and IntRectGtk.cpp https://bugs.webkit.org/show_bug.cgi?id=137209 Reviewed by Philippe Normand. IntPointGtk is unused and IntRectGtk is only required by GTK+2 and only used when building with GTK+2 in GtkInputMethodFilter.cpp that can be easily replaced. * PlatformGTK.cmake: * platform/graphics/IntPoint.h: * platform/graphics/IntRect.h: * platform/graphics/gtk/IntPointGtk.cpp: Removed. * platform/graphics/gtk/IntRectGtk.cpp: Removed. * platform/gtk/GtkInputMethodFilter.cpp: (WebCore::GtkInputMethodFilter::setCursorRect): 2014-09-29 Carlos Garcia Campos Unreviewed. Move sources not using GTK+ from WebCorePlatformGTK_SOURCES to WebCore_SOURCES. * PlatformGTK.cmake: 2014-09-28 Carlos Garcia Campos Unreviewed. Move RenderThemeGtk.h from platform/gtk to rendering. I forgot to move this file in r173111. * rendering/RenderThemeGtk.h: Renamed from Source/WebCore/platform/gtk/RenderThemeGtk.h. 2014-09-28 Carlos Garcia Campos [ATK] WebKitAccessibleWrapperAtk should not depend on GTK https://bugs.webkit.org/show_bug.cgi?id=137177 Reviewed by Martin Robinson. It's used to get the web view widget, but there's no GtkWidget in the web process and platformPageClient is always NULL. * PlatformGTK.cmake: Move accessibility sources to the WebCore sources list. * accessibility/atk/WebKitAccessibleWrapperAtk.cpp: (atkParentOfRootObject): Remove code to get view GtkWidget. * editing/atk/FrameSelectionAtk.cpp: Remove unneeded header include. 2014-09-28 Carlos Garcia Campos [GTK] Remove unused GtkPluginWidget https://bugs.webkit.org/show_bug.cgi?id=137176 Reviewed by Csaba Osztrogonác. It was only used by WebKit1. * PlatformGTK.cmake: * platform/gtk/GtkPluginWidget.cpp: Removed. * platform/gtk/GtkPluginWidget.h: Removed. 2014-09-28 Carlos Garcia Campos [cairo] GraphicsContext should not depend on GTK+ https://bugs.webkit.org/show_bug.cgi?id=137175 Reviewed by Martin Robinson. Remove the unused methods depending on GDK and simplify GraphicsContext::drawFocusRing() using only cairo API. * PlatformGTK.cmake: Move GraphicsContextCairo.cpp to the webcore sources. * platform/graphics/GraphicsContext.h: * platform/graphics/cairo/GraphicsContextCairo.cpp: (WebCore::GraphicsContext::drawFocusRing): Iterate the rectangles instead of creating a region for the rectangles and call gdk_cairo_region(). (WebCore::GraphicsContext::setGdkExposeEvent): Deleted. (WebCore::GraphicsContext::gdkExposeEvent): Deleted. (WebCore::GraphicsContext::gdkWindow): Deleted. * platform/graphics/cairo/GraphicsContextPlatformPrivateCairo.h: (WebCore::GraphicsContextPlatformPrivate::GraphicsContextPlatformPrivate): 2014-10-01 Chris Dumez Add basic caching for Document.cookie API https://bugs.webkit.org/show_bug.cgi?id=137225 Reviewed by Alexey Proskuryakov. While profiling the load of nytimes.com, I noticed that the site is accessing ~250 times document.cookie, just during page load. Accessing document.cookie is currently slow because we: - Call WebPlatformStrategies::cookiesForDOM() virtual function - Send a sync IPC message to the Network process to retrieve the cookies - The Network process gets the list of cookies from CFNetwork then serializes the result to send it back to the WebProcess - We unserialize the cookies into an NSList of cookies - We filter-out the cookies that are 'httpOnly' and construct a new NSList of cookies - We create a WTF String out of the cookies NSList In the case of nytimes.com, it turns out that up to 100 calls to document.cookie() are made in the same event loop iteration. This patch thus caches / freezes the cookies until we return to the event loop so that consecutive calls to document.cookie() are extremely fast. Doing so seems to be sufficient to achieve a ~87% cache hit for nytimes.com page load. The cookies cache is invalidated whenever: - document.cookie is set - we return to the event loop - a network resource is loaded synchronously as it may cause cookies to be set before we return to the event loop Test: http/tests/cookies/sync-xhr-set-cookie-invalidates-cache.html * dom/Document.cpp: (WebCore::Document::Document): (WebCore::Document::open): (WebCore::Document::cookie): (WebCore::Document::setCookie): (WebCore::Document::setCookieURL): (WebCore::Document::initSecurityContext): (WebCore::Document::setDOMCookieCache): (WebCore::Document::invalidateDOMCookieCache): (WebCore::Document::domCookieCacheExpiryTimerFired): (WebCore::Document::didLoadResourceSynchronously): * dom/Document.h: (WebCore::Document::domCookieCache): (WebCore::Document::isDOMCookieCacheValid): (WebCore::Document::setCookieURL): Deleted. * dom/ScriptExecutionContext.cpp: (WebCore::ScriptExecutionContext::didLoadResourceSynchronously): * dom/ScriptExecutionContext.h: * loader/ThreadableLoader.cpp: (WebCore::ThreadableLoader::loadResourceSynchronously): 2014-09-30 Said Abou-Hallawa Stack overflow with enormous SVG filter https://bugs.webkit.org/show_bug.cgi?id=63290 Prevent building an SVG filter if it has more than 200 FilterEffect nodes in its map regardless whether they will be connected to its lastEffect or not. Also discard any filter which has more 100 contributing FilterEffect nodes in its tree. Reviewed by Dean Jackson. Tests: svg/filters/svg-deeply-nested-crash.html * platform/graphics/filters/FilterEffect.cpp: (WebCore::collectEffects): (WebCore::FilterEffect::totalNumberOfEffectInputs): * platform/graphics/filters/FilterEffect.h: -- Add a method to return the total number of input FilterEffect's contributing to a FilterEffect. * rendering/svg/RenderSVGResourceFilter.cpp: (WebCore::RenderSVGResourceFilter::buildPrimitives): -- Do not build a filter if it has more than 200 FilterEffects in its map. (WebCore::RenderSVGResourceFilter::applyResource): -- Discard a filter after it was built if it has more than 100 FilterEffects in its tree. 2014-09-30 David Hyatt Remove a multicolumn ASSERT and replace with a guard. https://bugs.webkit.org/show_bug.cgi?id=137272 Reviewed by Alexey Proskuryakov. * rendering/RenderMultiColumnFlowThread.cpp: (WebCore::isValidColumnSpanner): For now remove the assert that is tripping and replace it with a guard until we can figure out why it's getting hit. 2014-08-01 Sergio Villar Senin Caret not shown at the end of line in overtype mode https://bugs.webkit.org/show_bug.cgi?id=135508 Reviewed by Ryosuke Niwa. When overtype mode is enabled we usually replace the 'normal' blinking caret shown in contenteditable elements by a block cursor that covers the next character to be replaced. The exception is the end of line where we fallback to the blinking caret even in overtype mode (as there is no next character to replace). We were not showing anything at the end of lines in overtype mode because the detection of the end of line was incorrect and not very understandable. Replaced the old code with a proper and clean end of line detection mechanism compatible with bidi text. Tests: editing/selection/block-cursor-overtype-mode-end-of-line-rtl.html editing/selection/block-cursor-overtype-mode-end-of-line.html * editing/FrameSelection.cpp: (WebCore::FrameSelection::updateAppearance): * editing/VisibleUnits.cpp: (WebCore::isLogicalEndOfLine): * editing/VisibleUnits.h: 2014-09-29 David Hyatt REGRESSION (r168046): Confused column spans when combined with dynamic animations https://bugs.webkit.org/show_bug.cgi?id=134048. Reviewed by Dean Jackson. Added fast/multicol/multicol-fieldset-span-changes.html * rendering/RenderMultiColumnFlowThread.cpp: (WebCore::RenderMultiColumnFlowThread::processPossibleSpannerDescendant): Refactor handling of insertions into the multicolumn flow thread into a helper function, processPossibleSpannerDescendant. This makes it easier to call the code from more than one place. (WebCore::RenderMultiColumnFlowThread::flowThreadDescendantInserted): Modify the nested columns span shifting code to avoid problems. The new code suppresses notifications and does the move of the spanner back into the original spot *before* removing the placeholder. This ensures that the placeholder parent still exists. The stale placeholder is then removed and destroyed after the spanner has been put back into place. (WebCore::RenderMultiColumnFlowThread::handleSpannerRemoval): (WebCore::RenderMultiColumnFlowThread::flowThreadRelativeWillBeRemoved): Refactor the removal notifications for spanners into a helper function so that it can be called to do cleanup from the code that cleans up stale placeholders on a shift. * rendering/RenderMultiColumnFlowThread.h: Modified to add the new helpers. 2014-09-29 Chris Fleizach AX: in an aria-labelledby computation, do not traverse into elements whose nameFrom value does not include 'contents' https://bugs.webkit.org/show_bug.cgi?id=136714 Reviewed by Darin Adler. There are certain ARIA elements that tell us we should not query their children when determining the name of the object. Those ones have the "nameFrom" property set to "author" instead of "contents." WebKit needs to honor that status. Test: accessibility/aria-namefrom-author.html Modified: accessibility/aria-labelledby-with-descendants.html * accessibility/AccessibilityNodeObject.cpp: (WebCore::shouldUseAccessiblityObjectInnerText): (WebCore::shouldAddSpaceBeforeAppendingNextElement): (WebCore::appendNameToStringBuilder): (WebCore::AccessibilityNodeObject::textUnderElement): (WebCore::accessibleNameForNode): (WebCore::AccessibilityNodeObject::accessibilityDescriptionForElements): * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::accessibleNameDerivesFromContent): (WebCore::initializeRoleMap): * accessibility/AccessibilityObject.h: 2014-09-27 Chris Dumez HTMLPlugInElement::isUserObservable() is causing layout https://bugs.webkit.org/show_bug.cgi?id=137156 Reviewed by Ryosuke Niwa. While profiling the page load of nytimes.com, I noticed that we were spending ~4-5% of cpu time in HTMLPlugInElement::isUserObservable(). The reason is that the function calls pluginWidget(), which causes a layout update in HTMLObjectElement::renderWidgetForJSBindings(), to make sure the plugin is loaded and its renderer is created. HTMLPlugInElement::isUserObservable() shouldn't need to do a layout. This patch does the following to address the problem: - Rename renderWidgetForJSBindings() to renderWidgetLoadingPlugin() because this function is not always called from the JS Bindings nowadays. The new name makes it clearer that this will load the plugin if needed (to make sure the renderer is created, and by doing a layout). - Add a PluginLoadingPolicy argument to HTMLPlugInElement::pluginWidget() to let the caller control if the plugin should be loaded or not. - Update the call to pluginWidget() in isUserObservable() so that we do not attempt to load the plugin (thus not causing a layout). No new tests, no behavior change. * WebCore.exp.in: * WebCore.order: * html/HTMLAppletElement.cpp: (WebCore::HTMLAppletElement::renderWidgetLoadingPlugin): (WebCore::HTMLAppletElement::renderWidgetForJSBindings): Deleted. * html/HTMLAppletElement.h: * html/HTMLEmbedElement.cpp: (WebCore::HTMLEmbedElement::renderWidgetLoadingPlugin): (WebCore::HTMLEmbedElement::renderWidgetForJSBindings): Deleted. * html/HTMLEmbedElement.h: * html/HTMLObjectElement.cpp: (WebCore::HTMLObjectElement::renderWidgetLoadingPlugin): (WebCore::HTMLObjectElement::renderWidgetForJSBindings): Deleted. * html/HTMLObjectElement.h: * html/HTMLPlugInElement.cpp: (WebCore::HTMLPlugInElement::pluginWidget): (WebCore::HTMLPlugInElement::isUserObservable): * html/HTMLPlugInElement.h: 2014-09-26 Brian J. Burg StorageTracker::deleteOrigin being called off the main thread (ASSERTs in inspector/test-harness-trivially-works.html test) https://bugs.webkit.org/show_bug.cgi?id=129642 Apply post-review comments from Alexey Proskuryakov. * storage/StorageAreaSync.cpp: (WebCore::StorageAreaSync::deleteEmptyDatabase): Make a thread-safe isolated copy of the string. 2014-09-25 Brian J. Burg StorageTracker::deleteOrigin being called off the main thread (ASSERTs in inspector/test-harness-trivially-works.html test) https://bugs.webkit.org/show_bug.cgi?id=129642 Reviewed by Brady Eidson. When tearing down the inspector frontend's page, we trigger a threading violation in StorageAreaSync's final sync code underneath StorageAreaSync::deleteEmptyDatabase(). No new tests. Regression is covered by inspector/test-harness-trivially-works.html. * storage/StorageAreaSync.cpp: (WebCore::StorageAreaSync::deleteEmptyDatabase): add a missing callOnMainThread() when calling StorageTracker::deleteOriginWithIdentifier(). 2014-09-25 Javier Fernandez ASSERTION FAILED: columnCount in WebCore::CSSParser::parseGridTemplateAreasRow https://bugs.webkit.org/show_bug.cgi?id=136945 Reviewed by Sergio Villar Senin. Checking out whether the grid-template-areas value contains a white-space only string, which is not valid as it does not produce a cell token. Test: fast/css-grid-layout/grid-template-areas-empty-string-crash.html * css/CSSParser.cpp: (WebCore::CSSParser::parseGridTemplateAreasRow): 2014-09-24 Christophe Dumez Use tighter typing for render objects in RenderGeometryMap https://bugs.webkit.org/show_bug.cgi?id=137102 Reviewed by Ryosuke Niwa. Use tighter typing for render objects in RenderGeometryMap for clarity and efficiency. In particular, using RenderElement type instead of RenderObject in canMapBetweenRenderers() allows us to call the faster RenderElement::style() instead of RenderObject::style(). No new tests, no behavior change. * rendering/RenderGeometryMap.cpp: (WebCore::canMapBetweenRenderers): (WebCore::RenderGeometryMap::pushMappingsToAncestor): 2014-09-24 Darin Adler Old Turkic characters behave as left-to-right instead of right-to-left, because they are encoded as surrogate pairs. https://bugs.webkit.org/show_bug.cgi?id=70029 Reviewed by Dan Bernstein. Test: fast/text/international/old-turkic-direction.html * CMakeLists.txt: Added InlineIterator.cpp. * WebCore.vcxproj/WebCore.vcxproj: Ditto. * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto. * WebCore.xcodeproj/project.pbxproj: Ditto. * rendering/RenderingAllInOne.cpp: Ditto. * rendering/InlineIterator.cpp: Added. (WebCore::InlineIterator::surrogateTextDirection): New function used to compute the direction when a surrogate pair is involved. * rendering/InlineIterator.h: Made the characterAt function private. (WebCore::InlineIterator::previousInSameNode): Took out unneeded range check. A zero will underflow and become a large number and the characterAt function will return 0 in that case. (WebCore::InlineIterator::direction): Added code to check U16_IS_SINGLE before calling u_charDirection, and call surrogateTextDirection instead. 2014-09-24 Christophe Dumez Unreviewed build fix after r173941. Rename shadow to m_shadow. * rendering/TextPainter.h: (WebCore::ShadowApplier::shadowIsCompletelyCoveredByText): 2014-09-22 Myles C. Maxfield REGRESSION: Text with a zero offset, zero blur shadow vanishes https://bugs.webkit.org/show_bug.cgi?id=136801 Reviewed by Darin Adler. This patch performs some cleanup regarding TextPainter's shadow logic and handles an additional case of empty shadows. Previously, there was tight coupling between applyShadowToGraphicalContext() and paintTextWithShadows(), as they both used a collection of variables to determine how shadows are to be drawn. This complexity has been moved into a helper class, ShadowApplier, which performs what applyShadowToGraphicsContext() used to do, and cleans up correctly in its destructor. This removes the tight coupling mentioned earlier. Test: fast/text/empty-shadow.html * rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::applyShadowToGraphicsContext): Moved to ShadowApplier. * rendering/InlineTextBox.h: Deleted applyShadowToGraphicsContext signature. * rendering/TextPainter.cpp: (WebCore::ShadowApplier::ShadowApplier): Perform the contents of applyShadowToGraphicsContext() (WebCore::ShadowApplier::~ShadowApplier): Undo the work done previously (WebCore::paintTextWithShadows): Create a ShadowApplier to do the relevant shadow work. In addition, refactor some boolean flags to more meaningful ones with relation to the computation at hand. (WebCore::isEmptyShadow): Moved to TextPainter.h, named shadowIsCompletelyCoveredByText() * rendering/TextPainter.h: (WebCore::ShadowApplier::ShadowApplier): Moved from InlineTextBox::applyShadowToGraphicsContext(). (WebCore::ShadowApplier::extraOffset): Getter. (WebCore::ShadowApplier::~ShadowApplier): Moved from TextPainter::paintTextWithShadows(). (WebCore::isLastShadowIteration): Helper function. (WebCore::shadowIsCompletelyCoveredByText): Determines whether or not we should not draw the shadow. * rendering/svg/SVGInlineTextBox.cpp: (WebCore::SVGInlineTextBox::paintTextWithShadows): Update to use ShadowApplier. 2014-09-23 Benjamin Poulain The style resolution cache applies properties incorrectly whenever direction != ltr https://bugs.webkit.org/show_bug.cgi?id=137052 Reviewed by Andreas Kling. The optimization r135021 introduced a bug whenever the direction of subtree is not uniform in the whole page. When StyleResolver::applyMatchedProperties() resolves the style, some properties are resolved differently based on the writing-mode and the direction. In isCacheableInMatchedPropertiesCache(), the cases for writing-mode are already handled by not caching any style with anything else than the default. The direction was ignored, causing the bugs solved here. Tests: css3/flexbox/flex-flow-2.html fast/css/style-resolver-cache-direction-1.html fast/css/style-resolver-cache-direction-2.html fast/css/style-resolver-cache-direction-3.html * css/StyleResolver.cpp: (WebCore::isCacheableInMatchedPropertiesCache): 2014-09-22 Simon Fraser Ensure that layout is up-to-date before hit-testing via RenderView https://bugs.webkit.org/show_bug.cgi?id=136651 Reviewed by David Hyatt. Ensure that layout is up-to-date before we do hit-testing via the RenderView. Previously, RenderLayer::hitTest() called updateLayout(), but it's better to push that responsibility onto RenderView before entering the RenderLayer tree. Make callers a little more consistent in getting the RenderView via Frame::contentRenderer(), though perhaps we should remove that and just call Document::renderView() everywhere. * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::press): Hit test via the RenderView, rather than doing so on the RenderView's layer, to ensure that we updateLayout(). * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::accessibilityHitTest): This code calls hitTest() on arbitrary layers, so needs to explicitly update layout. * editing/FrameSelection.cpp: (WebCore::FrameSelection::contains): * page/EventHandler.cpp: (WebCore::EventHandler::eventMayStartDrag): (WebCore::EventHandler::updateSelectionForMouseDrag): (WebCore::EventHandler::hitTestResultAtPoint): The explicit updateLayout() is no longer needed. (WebCore::EventHandler::updateCursor): (WebCore::EventHandler::handleWheelEvent): (WebCore::EventHandler::hoverTimerFired): (WebCore::hitTestResultInFrame): * page/Frame.cpp: (WebCore::Frame::contentRenderer): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::hitTest): * rendering/RenderView.cpp: (WebCore::RenderView::hitTest): Here's where we ensure that layout is up-to-date. 2014-09-19 Brent Fulgham Latching in iframes is not working as expected https://bugs.webkit.org/show_bug.cgi?id=136729 Reviewed by Simon Fraser. Test: platform/mac/fast/scrolling/scrolling-iframe-100pct.html Correct latching behavior by moving the concept of latching from the event handler to the main frame. The event handlers are per-document, and can improperly latch to the iframe element (rather than the scrollable content of the iframe) resulting in incorrect behavior. Also move the wheel event delta tracking to the main frame, as this is similarly "top-level" in nature. * WebCore.vcxproj/WebCore.vcxproj: Add new LatchedState class. * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto. * WebCore.xcodeproj/project.pbxproj: Ditto. * page/EventHandler.cpp: (WebCore::EventHandler::EventHandler): Update constructor after moving some members to the new LatchedState object. (WebCore::EventHandler::clear): Call 'clear' on the LatchedState class. (WebCore::EventHandler::platformRecordWheelEvent): Update for new LatchedState class. (WebCore::EventHandler::handleWheelEvent): Ditto. (WebCore::EventHandler::clearLatchedState): Ditto. (WebCore::EventHandler::defaultWheelEventHandler): Ditto. * page/EventHandler.h: * page/LatchedState.cpp: Added. (WebCore::LatchedState::LatchedState): (WebCore::LatchedState::~LatchedState): (WebCore::LatchedState::clear): (WebCore::LatchedState::setWheelEventElement): (WebCore::LatchedState::setWidgetIsLatched): (WebCore::LatchedState::setPreviousWheelScrolledElement): (WebCore::LatchedState::setScrollableContainer): * page/LatchedState.h: Added. (WebCore::LatchedState::wheelEventElement): (WebCore::LatchedState::frame): (WebCore::LatchedState::setFrame): (WebCore::LatchedState::widgetIsLatched): (WebCore::LatchedState::previousWheelScrolledElement): (WebCore::LatchedState::scrollableContainer): (WebCore::LatchedState::startedGestureAtScrollLimit): (WebCore::LatchedState::setStartedGestureAtScrollLimit): * page/MainFrame.cpp: (WebCore::MainFrame::MainFrame): Update for new members (LatchedState and WheelEventDeltaTracker) * page/MainFrame.h: * page/mac/EventHandlerMac.mm: (WebCore::EventHandler::platformPrepareForWheelEvents): Use mainFrame-located latching information. (WebCore::EventHandler::platformRecordWheelEvent): Use mainFrame-located wheel event delta tracking. (WebCore::EventHandler::platformCompleteWheelEvent): Make sure to use the latched frame as well as the latched element so that events get routed properly. (WebCore::EventHandler::platformCompletePlatformWidgetWheelEvent): Update for new mainFrame location for latched state information. 2014-09-19 Simon Fraser Provide a default argument for the most commonly used HitTestRequest variant https://bugs.webkit.org/show_bug.cgi?id=136653 Reviewed by Darin Adler. Make the default HitTestRequest flags be ReadOnly | Active | DisallowShadowContent and change call sites using the default flags to use a HitTestRequest temporary. * dom/TreeScope.cpp: (WebCore::nodeFromPoint): * editing/FrameSelection.cpp: (WebCore::FrameSelection::contains): * page/DragController.cpp: (WebCore::elementUnderMouse): * page/EventHandler.cpp: (WebCore::EventHandler::handleMouseDraggedEvent): (WebCore::EventHandler::handleMousePressEvent): * rendering/HitTestRequest.h: (WebCore::HitTestRequest::HitTestRequest): 2014-09-19 Chris Dumez Minimize virtual function calls in MarkupAccumulator https://bugs.webkit.org/show_bug.cgi?id=136957 Reviewed by Benjamin Poulain. This patch minimizes the number of virtual function calls in MarkupAccumulator by: - De-virtualizing MarkupAccumulator::appendString(), which is never overridden - Having MarkupAccumulator::appendEndTag() virtual function take an Element in argument instead of a Node, as it only applies to Element. Also add a non-virtual overload that takes a Node in argument and that does the isElementNode() check so that we don't need to explicitly do the check at each call site. No new tests, no behavior change. * editing/MarkupAccumulator.cpp: (WebCore::MarkupAccumulator::appendEndTag): (WebCore::MarkupAccumulator::shouldSelfClose): (WebCore::MarkupAccumulator::appendEndMarkup): * editing/MarkupAccumulator.h: (WebCore::MarkupAccumulator::appendEndTag): * page/PageSerializer.cpp: (WebCore::SerializerMarkupAccumulator::appendEndTag): 2014-09-19 Benjamin Poulain Add a size check for CSSSelector https://bugs.webkit.org/show_bug.cgi?id=136882 Reviewed by Christophe Dumez. * css/CSSSelector.cpp: 2014-10-07 Carlos Garcia Campos [SOUP] TLS errors should take precedence over HTTP authentication https://bugs.webkit.org/show_bug.cgi?id=137300 Reviewed by Sergio Villar Senin. Handle TLS errors in got-headers callback to make sure it happens before starting the authentication process. * platform/network/soup/ResourceHandleSoup.cpp: (WebCore::handleUnignoredTLSErrors): Refactored to receive the soup message. (WebCore::gotHeadersCallback): Return early and cancel the request in case of TLS errors. (WebCore::sendRequestCallback): Do not handle TLS errors here, the request should have already been cancelled at this point in case of TLS errors. 2014-09-19 Dean Jackson Multithreaded WebGL is a bad idea - remove it https://bugs.webkit.org/show_bug.cgi?id=136964 Reviewed by Brent Fulgham. We should not allow multithreaded GL access. Remove the feature. * html/canvas/WebGLRenderingContext.cpp: (WebCore::WebGLRenderingContext::create): * page/Settings.in: * platform/graphics/GraphicsContext3D.h: (WebCore::GraphicsContext3D::Attributes::Attributes): * platform/graphics/mac/GraphicsContext3DMac.mm: (WebCore::GraphicsContext3D::GraphicsContext3D): 2014-09-26 Lorenzo Tilve [GTK] Fix support for the initial-letter CSS property to first-letter https://bugs.webkit.org/show_bug.cgi?id=137108 Reviewed by Alejandro G. Castro. Add support for cap-height to the font system. * platform/graphics/freetype/SimpleFontDataFreeType.cpp: (WebCore::SimpleFontData::platformInit): 2014-09-22 Alexey Proskuryakov WebSocket crash when a connection is closed from server side https://bugs.webkit.org/show_bug.cgi?id=137009 rdar://problem/18333977 rdar://problem/12708225 Reviewed by Brady Eidson. I don't think that this can be tested with our test server. * Modules/websockets/WebSocketChannel.cpp: (WebCore::WebSocketChannel::WebSocketChannel): Added logging. (WebCore::WebSocketChannel::~WebSocketChannel): Ditto. (WebCore::WebSocketChannel::close): Protect self, because startClosingHandshake can release the last reference. (WebCore::WebSocketChannel::fail): Added an assertion that the channel is always closed after this function. (WebCore::WebSocketChannel::startClosingHandshake): Protect self, and don't change the stack from closed back to closing if after failing to send closing handshake. (WebCore::WebSocketChannel::processOutgoingFrameQueue): Protect self. 2014-09-22 David Hyatt Bad cast in isValidColumnSpanner. https://bugs.webkit.org/show_bug.cgi?id=133380. Reviewed by Simon Fraser. Added fast/multicol/multicol-crazy-nesting.html * rendering/RenderMultiColumnFlowThread.cpp: (WebCore::isValidColumnSpanner): The crawl up the chain looking for unsplittable objects should use containing blocks and not be casting to parent boxes. You can have an inline in the parent chain, so this was not the right way to walk up the tree. 2014-09-22 David Hyatt ASSERT in RenderMultiColumnSet::requiresBalancing. https://bugs.webkit.org/show_bug.cgi?id=136376. Reviewed by David Kilzer. Added fast/multicol/multicol-selection.html. * rendering/RenderMultiColumnFlowThread.cpp: (WebCore::isValidColumnSpanner): Don't allow an object to become a spanner if it does not have the flow thread as its containing block. Otherwise the flow thread won't get notified of spanner placeholder insertions, and so the spanner ends up orphaned. 2014-09-22 Eva Balazsfalvi REGRESSION(r173631): It broke the !ENABLE(VIDEO) build https://bugs.webkit.org/show_bug.cgi?id=136946 Reviewed by Jer Noble. No new tests required, no new functionality. * page/DragController.cpp: (WebCore::DragController::startDrag): 2014-09-22 Mihnea Ovidenie [CSS Regions] Assertion failure and null dereference crash when using animations and regions https://bugs.webkit.org/show_bug.cgi?id=136918 Reviewed by Andrei Bucur. In some situations, for instance when an image has an attached animation, the style change caused by the animation triggers a geometry update for the backing store associated with the image's layer. This may occur before the layout for the image has finished. Moreover, if the image in such situation - having a composited layer - is displayed in a region, sicne the layout did not finish yet, the mappings between the layers of the elements collected in the named flow and the regions associated with the named flow are not updated and cannot be used. Therefore in those situations, we have to bail out early and use these mappings only after the layout has finished. This patch also changes RenderLayerBacking method updateAfterDescendents -> updateAfterDescendants. Test: fast/regions/animated-image-in-region.html * rendering/RenderFlowThread.cpp: (WebCore::RenderFlowThread::cachedRegionForCompositedLayer): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::calculateClipRects): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateAfterDescendants): * rendering/RenderLayerBacking.h: * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree): (WebCore::RenderLayerCompositor::updateLayerTreeGeometry): (WebCore::RenderLayerCompositor::updateCompositingDescendantGeometry): 2014-09-21 Christophe Dumez Fix post-mortem nits for r173724 https://bugs.webkit.org/show_bug.cgi?id=136986 Reviewed by Darin Adler. Fix post-mortem nits for r173724. No new tests, no behavior change. * editing/EditingStyle.cpp: (WebCore::HTMLAttributeEquivalent::attributeValueAsCSSValue): (WebCore::HTMLFontSizeEquivalent::attributeValueAsCSSValue): Use nullptr instead of 0. * editing/SplitElementCommand.cpp: (WebCore::SplitElementCommand::doUnapply): Use getIdAttribute() / setIdAttribute(). * rendering/RenderTableCell.cpp: (WebCore::RenderTableCell::computePreferredLogicalWidths): Use fastHasAttribute() for nowrap and do an early return to avoid calling styleOrColLogicalWidth() if the nowrap attribute is missing. 2014-09-19 Eva Balazsfalvi REGRESSION(r173464): It broke the !ENABLE(PICTURE_SIZES) build https://bugs.webkit.org/show_bug.cgi?id=136942 Reviewed by Simon Fraser. * html/HTMLImageElement.cpp: (WebCore::HTMLImageElement::parseAttribute): 2014-09-17 Philippe Normand [GStreamer] Cannot play Vimeo video https://bugs.webkit.org/show_bug.cgi?id=134969 Reviewed by Sergio Villar Senin. Ensure the GStreamer HTTP source element also sends cookies when it's sending its requests. Some streaming platforms such as Vimeo do server-side cookie checks on incoming requests before serving media data. Test: http/tests/media/hls/video-cookie.html * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp: (webKitWebSrcStart): Set first-party cookie URL to the request so the ResourceLoader properly sets cookies in the HTTP request. 2014-09-18 Carlos Garcia Campos [GTK] Dot not allow to create delete-on-destroy GMainLoopSources https://bugs.webkit.org/show_bug.cgi?id=136923 Reviewed by Gustavo Noronha Silva. * platform/gtk/GtkDragAndDropHelper.cpp: (WebCore::GtkDragAndDropHelper::handleDragLeave): Use GMainLoopSource::scheduleAndDeleteOnDestroy(). 2014-09-18 Roger Fong [Windows] Media tests all fail because they cannot find localized strings. * rendering/RenderThemeSafari.cpp: (WebCore::RenderThemeSafari::mediaControlsScript): Make sure to use localized strings files in RenderThemeSafari. 2014-09-18 Simon Fraser Remove generator/yield terminology in RenderInline's GeneratorContext https://bugs.webkit.org/show_bug.cgi?id=119278 Reviewed by Sam Weinig. Get rid of the icky Generator/yield syntax used for collecting rects in RenderInline. Just replace the operator() with an explicit addRect(). Also some drive-by nullptr cleanup, and removing default arguments from addChildIgnoringContinuation() calls. * rendering/RenderInline.cpp: (WebCore::RenderInline::willBeDestroyed): (WebCore::RenderInline::styleDidChange): (WebCore::RenderInline::splitInlines): (WebCore::RenderInline::addChildToContinuation): (WebCore::RenderInline::generateLineBoxRects): (WebCore::RenderInline::generateCulledLineBoxRects): * rendering/RenderInline.h: 2014-09-18 Jeremy Jones Improve fullscreen video rotation animation. https://bugs.webkit.org/show_bug.cgi?id=136870 Reviewed by Simon Fraser. Instead of setting the frame on the video layer, set position and bounds separately. This allows the position to be synchronized with the rest of the animation. When using a fencePort to synchronize animations, if the fence times out, pivoting around the center provides a better fallback. * platform/ios/WebVideoFullscreenInterfaceAVKit.mm: (-[WebAVVideoLayer setVideoSublayer:]): added (-[WebAVVideoLayer videoSublayer]): added (-[WebAVVideoLayer setBounds:]): set position and bounds insted of frame. (WebVideoFullscreenInterfaceAVKit::setupFullscreen): use setVideoSublayer * platform/ios/WebVideoFullscreenModelVideoElement.mm: (WebVideoFullscreenModelVideoElement::setVideoFullscreenLayer): set bounds and anchorPoint instead of frame (WebVideoFullscreenModelVideoElement::setVideoLayerFrame): set bounds instead of frame. 2014-09-17 Myles C. Maxfield Text laid out with the SVG -> OTF font converter does not have the same metrics as with the SVG font code path https://bugs.webkit.org/show_bug.cgi?id=136907 Reviewed by Darin Adler. There are three things that are causing text laid out with the SVG -> OTF font converter to not have metrics that measure our existing SVG codepath. They are: 1. Creating a font with a 0 ascent or descent makes OS X think that something is wrong with the font, and take a different codepath when trying to parse ascent and descent information. This patch checks for this condition and sets the ascent/descent to 1 FUnit instead (which is generally much smaller than a pixel). 2. Our SVG font codepath hardcodes a line gap of 1/10th of the font size for every font. This patch makes the font converter obey this. 3. The converter was not allowing for default glyph advances as per the SVG font specification. This patch does so. No new tests yet, but they will come soon! I promise! * svg/SVGToOTFFontConversion.cpp: (WebCore::SVGToOTFFontConverter::appendHHEATable): (WebCore::SVGToOTFFontConverter::SVGToOTFFontConverter): 2014-09-18 Daniel Bates REGRESSION (r168921): SVG elements may be unnecessarily rebuilt https://bugs.webkit.org/show_bug.cgi?id=136373 Reviewed by David Kilzer. Fixes an issue where a SVG element may be unnecessarily rebuilt. In particular, it is unnecessary to rebuild a SVG element that will be removed from the document. Test: svg/custom/remove-subtree-including-use-with-child-textpath-that-references-earlier-path.html * svg/SVGDocumentExtensions.cpp: (WebCore::SVGDocumentExtensions::removeAllElementReferencesForTarget): Modified to remove a SVG element from the list of elements to be rebuilt. 2014-09-18 Joseph Pecoraro Unreviewed rollout r173731. Broke multiple builds. * WebCore.exp.in: * inspector/InspectorController.cpp: (WebCore::InspectorController::connectFrontend): (WebCore::InspectorController::show): * inspector/InspectorController.h: * page/PageDebuggable.cpp: (WebCore::PageDebuggable::connect): * page/PageDebuggable.h: * testing/Internals.cpp: (WebCore::Internals::openDummyInspectorFrontend): 2014-09-18 Beth Dakin ASSERT in RenderBox::instrinsicScrollbarLogicalWidth opening the inspector https://bugs.webkit.org/show_bug.cgi?id=136929 Reviewed by Simon Fraser. This is a regression from http://trac.webkit.org/changeset/173668 This code is wrong after that change because it assumes that overflow:scroll will always have a scrollbar. That is no longer the case. We need to check to make sure it’s an overflow:scroll that does NOT have overflow:auto behavior. * rendering/RenderBox.cpp: (WebCore::RenderBox::instrinsicScrollbarLogicalWidth): 2014-09-18 Joseph Pecoraro Web Inspector: Should be able to attach a debugger to a JSContext before anything is executed https://bugs.webkit.org/show_bug.cgi?id=136893 Reviewed by Timothy Hatcher. Automatic inspection is currently disabled for web pages. This just updates the interfaces that changed. * WebCore.exp.in: * inspector/InspectorController.cpp: (WebCore::InspectorController::connectFrontend): (WebCore::InspectorController::show): * inspector/InspectorController.h: * page/PageDebuggable.cpp: (WebCore::PageDebuggable::connect): * page/PageDebuggable.h: * testing/Internals.cpp: (WebCore::Internals::openDummyInspectorFrontend): 2014-09-18 Chris Dumez Use fastHasAttribute() / fastGetAttribute() when possible https://bugs.webkit.org/show_bug.cgi?id=136900 Reviewed by Benjamin Poulain. Use fastHasAttribute() / fastGetAttribute() when possible, that is when the attribute is not SVG-animated or the |style| attribute, to avoid synchronizing attributes unnecessarily. Also avoid calling hasAttribute(xxxAttr) then getAttribute(xxxAttr) as it causes 2 linear searches. It is best to call getAttribute(xxxAttr) directly and check if it returns the nullAtom. No new tests, no behavior change. Element::fastAttributeLookupAllowed() is there as a safety set for debug builds. * accessibility/AccessibilityListBoxOption.cpp: (WebCore::AccessibilityListBoxOption::isEnabled): * accessibility/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::alternativeTextForWebArea): (WebCore::AccessibilityNodeObject::hierarchicalLevel): * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::contentEditableAttributeIsEnabled): * dom/Document.cpp: (WebCore::Document::hasManifest): * dom/DocumentOrderedMap.cpp: (WebCore::keyMatchesLabelForAttribute): * dom/DocumentStyleSheetCollection.cpp: (WebCore::DocumentStyleSheetCollection::collectActiveStyleSheets): * dom/Element.cpp: (WebCore::Element::imageSourceURL): (WebCore::Element::pseudo): (WebCore::Element::spellcheckAttributeState): * editing/ApplyStyleCommand.cpp: (WebCore::ApplyStyleCommand::removeEmbeddingUpToEnclosingBlock): * editing/EditingStyle.cpp: (WebCore::HTMLAttributeEquivalent::attributeValueAsCSSValue): (WebCore::HTMLFontSizeEquivalent::attributeValueAsCSSValue): * editing/SplitElementCommand.cpp: (WebCore::SplitElementCommand::doUnapply): * html/HTMLAnchorElement.cpp: (WebCore::HTMLAnchorElement::draggable): (WebCore::HTMLAnchorElement::sendPings): * html/HTMLAppletElement.cpp: (WebCore::HTMLAppletElement::updateWidget): * html/HTMLBodyElement.cpp: (WebCore::HTMLBodyElement::addSubresourceAttributeURLs): * html/HTMLButtonElement.cpp: (WebCore::HTMLButtonElement::value): * html/HTMLDocument.cpp: (WebCore::HTMLDocument::dir): * html/HTMLEmbedElement.cpp: (WebCore::HTMLEmbedElement::imageSourceURL): (WebCore::HTMLEmbedElement::addSubresourceAttributeURLs): * html/HTMLFieldSetElement.cpp: (WebCore::HTMLFieldSetElement::~HTMLFieldSetElement): (WebCore::updateFromControlElementsAncestorDisabledStateUnder): (WebCore::HTMLFieldSetElement::disabledAttributeChanged): (WebCore::HTMLFieldSetElement::disabledStateChanged): (WebCore::HTMLFieldSetElement::childrenChanged): (WebCore::HTMLFieldSetElement::didMoveToNewDocument): * html/HTMLFormControlElement.cpp: (WebCore::HTMLFormControlElement::computeIsDisabledByFieldsetAncestor): * html/HTMLFormElement.cpp: (WebCore::HTMLFormElement::action): * html/HTMLFrameElement.cpp: (WebCore::HTMLFrameElement::noResize): * html/HTMLFrameElementBase.cpp: (WebCore::HTMLFrameElementBase::location): * html/HTMLHRElement.cpp: (WebCore::HTMLHRElement::collectStyleForPresentationAttribute): * html/HTMLHtmlElement.cpp: (WebCore::HTMLHtmlElement::insertedByParser): * html/HTMLImageElement.cpp: (WebCore::HTMLImageElement::altText): (WebCore::HTMLImageElement::alt): (WebCore::HTMLImageElement::draggable): (WebCore::HTMLImageElement::src): (WebCore::HTMLImageElement::addSubresourceAttributeURLs): * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::finishParsingChildren): (WebCore::HTMLInputElement::altText): (WebCore::HTMLInputElement::reset): * html/HTMLLabelElement.cpp: (WebCore::HTMLLabelElement::control): * html/HTMLLinkElement.cpp: (WebCore::HTMLLinkElement::process): (WebCore::HTMLLinkElement::rel): * html/HTMLMetaElement.cpp: (WebCore::HTMLMetaElement::content): (WebCore::HTMLMetaElement::httpEquiv): * html/HTMLObjectElement.cpp: (WebCore::HTMLObjectElement::imageSourceURL): (WebCore::HTMLObjectElement::addSubresourceAttributeURLs): * html/HTMLOptGroupElement.cpp: (WebCore::HTMLOptGroupElement::groupLabelText): * html/HTMLProgressElement.cpp: (WebCore::HTMLProgressElement::max): * html/HTMLScriptElement.cpp: (WebCore::HTMLScriptElement::sourceAttributeValue): (WebCore::HTMLScriptElement::charsetAttributeValue): (WebCore::HTMLScriptElement::languageAttributeValue): (WebCore::HTMLScriptElement::forAttributeValue): (WebCore::HTMLScriptElement::eventAttributeValue): * html/HTMLTableCellElement.cpp: (WebCore::HTMLTableCellElement::addSubresourceAttributeURLs): * html/HTMLTableElement.cpp: (WebCore::HTMLTableElement::rules): (WebCore::HTMLTableElement::summary): (WebCore::HTMLTableElement::addSubresourceAttributeURLs): * html/HTMLTableSectionElement.cpp: (WebCore::HTMLTableSectionElement::align): (WebCore::HTMLTableSectionElement::ch): (WebCore::HTMLTableSectionElement::vAlign): * html/HTMLTextAreaElement.cpp: (WebCore::HTMLTextAreaElement::maxLength): * html/SearchInputType.cpp: (WebCore::SearchInputType::searchEventsShouldBeDispatched): * loader/FormSubmission.cpp: (WebCore::FormSubmission::create): * page/Frame.cpp: (WebCore::Frame::matchLabelsAgainstElement): * page/PageSerializer.cpp: (WebCore::PageSerializer::serializeFrame): * platform/win/PasteboardWin.cpp: (WebCore::Pasteboard::writeImageToDataObject): * rendering/HitTestResult.cpp: (WebCore::HitTestResult::altDisplayString): * rendering/RenderSearchField.cpp: (WebCore::RenderSearchField::autosaveName): * rendering/RenderTableCell.cpp: (WebCore::RenderTableCell::computePreferredLogicalWidths): * rendering/svg/RenderSVGResourceClipper.cpp: (WebCore::RenderSVGResourceClipper::drawContentIntoMaskImage): 2014-09-18 Chris Dumez Have LiveNodeLists / HTMLCollections's elementMatches() take a reference https://bugs.webkit.org/show_bug.cgi?id=136902 Reviewed by Darin Adler. Have LiveNodeLists / HTMLCollections's elementMatches() take a reference in argument instead of a pointer as the Element can never be null. No new tests, no behavior change. * dom/ClassNodeList.h: (WebCore::ClassNodeList::elementMatches): * dom/DocumentOrderedMap.cpp: (WebCore::keyMatchesWindowNamedItem): (WebCore::keyMatchesDocumentNamedItem): * dom/Element.cpp: (WebCore::Element::updateNameForDocument): (WebCore::Element::updateIdForDocument): * dom/LiveNodeList.cpp: (WebCore::LiveNodeList::namedItem): * dom/LiveNodeList.h: (WebCore::CachedLiveNodeList::collectionBegin): (WebCore::CachedLiveNodeList::collectionLast): (WebCore::CachedLiveNodeList::collectionTraverseForward): (WebCore::CachedLiveNodeList::collectionTraverseBackward): * dom/NameNodeList.h: (WebCore::NameNodeList::elementMatches): * dom/TagNodeList.h: (WebCore::TagNodeList::elementMatches): (WebCore::HTMLTagNodeList::elementMatches): * html/HTMLCollection.cpp: (WebCore::isMatchingElement): * html/HTMLNameCollection.cpp: (WebCore::WindowNameCollection::elementMatchesIfNameAttributeMatch): (WebCore::WindowNameCollection::elementMatches): (WebCore::DocumentNameCollection::elementMatchesIfIdAttributeMatch): (WebCore::DocumentNameCollection::elementMatchesIfNameAttributeMatch): (WebCore::DocumentNameCollection::elementMatches): * html/HTMLNameCollection.h: * html/LabelsNodeList.cpp: (WebCore::LabelsNodeList::elementMatches): * html/LabelsNodeList.h: * html/RadioNodeList.cpp: (WebCore::RadioNodeList::checkElementMatchesRadioNodeListFilter): (WebCore::RadioNodeList::elementMatches): * html/RadioNodeList.h: 2014-09-18 Carlos Garcia Campos Remove unused methods from MediaPlayerClient https://bugs.webkit.org/show_bug.cgi?id=136884 Reviewed by Eric Carlson. Remove unused methods from MediaPlayerClient that introduce dependencies on WebCore types. * html/HTMLMediaElement.cpp: * html/HTMLMediaElement.h: * platform/graphics/MediaPlayer.h: (WebCore::MediaPlayerClient::mediaPlayerOwningDocument): Deleted. (WebCore::MediaPlayerClient::mediaPlayerHostWindow): Deleted. (WebCore::MediaPlayerClient::mediaPlayerWindowClipRect): Deleted. 2014-09-17 Iago Toral and Zan Dobersek [GTK] Add Wayland support to GLContextEGL https://bugs.webkit.org/show_bug.cgi?id=136829 Reviewed by Martin Robinson. * platform/graphics/egl/GLContextEGL.cpp: (WebCore::sharedEGLDisplay): Special-case the shared EGL display initialization for the GTK port when running under Wayland. In that case the pointer to the native wl_display object should be passed to eglGetDisplay(). If not running under Wayland we should fall back to using the shared X11 display (if support for that display system is enabled) or the EGL_DEFAULT_DISPLAY. 2014-09-17 Daniel Bates Unreviewed, rolling out r173695. Broke building third-party Legacy WebKit apps; will investigate offline Reverted changeset: "[iOS] Make WebCore build with public iOS SDK" https://bugs.webkit.org/show_bug.cgi?id=136487 http://trac.webkit.org/changeset/173695 2014-09-17 Roger Fong Speculative fix for a fast\dom\html-collections-named-getter failing only in Debug builds. * dom/Node.cpp: (WebCore::Document::invalidateNodeListAndCollectionCaches): 2014-09-17 Benjamin Poulain Add parsing for :nth-child(An+B of selector) https://bugs.webkit.org/show_bug.cgi?id=136845 Reviewed by Antti Koivisto. Add support for parsing :nth-child(of). The implementation of selector matching will be in a follow up, there are enough edge cases here already. Spec here: http://dev.w3.org/csswg/selectors4/#the-nth-child-pseudo Test: fast/css/parsing-css-nth-child-of.html * css/CSSParser.cpp: (WebCore::CSSParser::detectFunctionTypeToken): (WebCore::CSSParser::realLex): The parser generate two new kinds of tokens: -NTHCHILDFUNCTION, matching the "nth-child" identifier. -NTHCHILDSELECTORSEPARATOR, matching the "of" keyword separating An+B from the selector list. NTHCHILDFUNCTION is used to extend the new syntax only for :nth-child() and not all the "nth" functions (e.g. :nth-of-type()). NTHCHILDSELECTORSEPARATOR exists for two reasons: -We must clear the "parsingMode" before parsing selectorList. If we failed to do that, the complex selectors would be parsed in NthChildMode, which has all kind of bad side effects. -The second reason is differentiacting "of" for all the other identifiers. Arguably, this could have been done in the grammar, but it is clearer this way since we already need the branches for the parsingMode. * css/CSSGrammar.y.in: Those are pretty much duplicates of the existing FUNCTION rules but supporting the new syntax. * css/CSSParserValues.cpp: (WebCore::selectorListMatchesPseudoElement): (WebCore::CSSParserSelector::matchesPseudoElement): Matching pseudo elements does not make much sense for those selectorList (e.g. :nth-child(2n of ::before)). Add helper function to fail parsing of those cases. * css/CSSParserValues.h: * css/CSSSelector.cpp: (WebCore::CSSSelector::selectorText): * css/CSSSelector.h: (WebCore::CSSSelector::selectorList): Updated serialization code for CSS OM. 2014-09-17 Benjamin Poulain CSS value in whitespace-separated list attribute selector (~=) mishandles tab/newline/etc. https://bugs.webkit.org/show_bug.cgi?id=136807 Reviewed by Antti Koivisto. The spec defines selector lists as token separated by white space. The definition of white space for CSS Selectors is: "White space in Selectors consists of the code points SPACE (U+0020), TAB (U+0009), LINE FEED (U+000A), CARRIAGE RETURN (U+000D), and FORM FEED (U+000C) can occur in whitespace. Other space-like code points, such as EM SPACE (U+2003) and IDEOGRAPHIC SPACE (U+3000), are never part of white space." The old code was only matching SPACE (U+0020) which is buggy. This patch adds support for the other caracters. Tests: fast/selectors/attr-list-01.html fast/selectors/attribute-list-with-whitespace-in-selector.html fast/selectors/attribute-list-with-whitespace-in-value.html * css/SelectorChecker.cpp: (WebCore::attributeValueMatches): * cssjit/SelectorCompiler.cpp: (WebCore::SelectorCompiler::constructFragments): (WebCore::SelectorCompiler::attributeValueSpaceSeparetedListContains): Add the missing checks. * html/track/VTTRegion.cpp: (WebCore::VTTRegion::setRegionSettings): (WebCore::VTTRegion::parseSettingValue): * html/track/WebVTTParser.cpp: (WebCore::WebVTTParser::hasRequiredFileIdentifier): (WebCore::WebVTTParser::collectTimingsAndSettings): * html/track/WebVTTParser.h: While looking for affected code, I discovered WebVTT redefines isHTMLSpace(). I cleaned that code. 2014-09-17 Gavin Barraclough Aways have a PageThrottler (sometimes have a UserActivity::Impl) https://bugs.webkit.org/show_bug.cgi?id=136892 Reviewed by Geoffrey Garen. Some instances of Page have a PageThrottler to track activity on the Page, and some do not. (Specifically, those created from WebPage in WK2 do, those related to WK1, SVG & inspector do not). We do this for three reasons: * We do not need to take AppNap assertions on WK1. * Some Pages do not track their visibility correctly, and would always claim to be visible. * Page VisibilityState is not set until after construction, so if we instantiate Creating the entire PageThrottler lazily has the drawback that we have to check for its existence at numerous points throughout the code, and we'll miss activity that occurs between the Page being created & the PageThrottler added to it (really a theoretical problem right now, since they're currently always created pretty much back to back). Instead, Page should always have a PageThrottler, & instead make the UserActivity::Impl on the PageThrottler be added later. * WebCore.exp.in: - createPageThrottler -> enablePageThrottler * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::parseAttribute): - Page::pageThrottler now returns a reference rather than a pointer * loader/FrameLoader.cpp: (WebCore::FrameLoader::started): - Page::pageThrottler now returns a reference rather than a pointer * page/Page.cpp: (WebCore::Page::Page): - instantiate PageThrottler in constructor (WebCore::Page::enablePageThrottler): - renamed from createPageThrottler, instead of creating the PageThrottler this method now instruct PageThrottler to create a UserActivity::Impl (WebCore::Page::setViewState): - m_pageThrottler is not a pointer (WebCore::Page::createPageThrottler): Deleted. - renamed to enablePageThrottler * page/Page.h: (WebCore::Page::pageThrottler): - now returns a reference * page/PageThrottler.cpp: (WebCore::PageThrottler::PageThrottler): - no longer instantiate m_activity (WebCore::PageThrottler::createUserActivity): - lazily instantiate m_activity, call updateUserActivity (WebCore::PageThrottler::updateUserActivity): - m_activity may not yet be instantiated; added early return * page/PageThrottler.h: - m_activity becomes a std::unique_ptr, added createUserActivity 2014-09-17 Daniel Bates [iOS] Make WebCore build with public iOS SDK https://bugs.webkit.org/show_bug.cgi?id=136487 Reviewed by David Kilzer. Add headers that wrap Mac and iOS SPIs and update WebCore source files to include these headers instead of the corresponding actual SPI header(s). * WebCore.vcxproj/WebCore.vcxproj: * WebCore.vcxproj/WebCore.vcxproj.filters: * WebCore.vcxproj/WebCoreCG.props: * WebCore.vcxproj/copyForwardingHeaders.cmd: * WebCore.xcodeproj/project.pbxproj: * bindings/objc/DOMInternal.mm: * bridge/objc/objc_instance.mm: * platform/audio/ios/MediaSessionManagerIOS.mm: * platform/cocoa/DisplaySleepDisablerCocoa.cpp: * platform/cocoa/MemoryPressureHandlerCocoa.mm: * platform/graphics/SimpleFontData.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: * platform/graphics/ca/mac/PlatformCALayerMac.mm: * platform/graphics/cg/BitmapImageCG.cpp: * platform/graphics/cg/ColorCG.cpp: * platform/graphics/cg/GraphicsContextCG.cpp: * platform/graphics/cg/ImageSourceCG.cpp: * platform/graphics/cg/PDFDocumentImage.cpp: * platform/graphics/cocoa/FontPlatformDataCocoa.mm: * platform/graphics/ios/FontCacheIOS.mm: * platform/graphics/ios/FontServicesIOS.mm: * platform/graphics/ios/SimpleFontDataIOS.mm: * platform/graphics/mac/FontMac.mm: * platform/graphics/mac/GlyphPageTreeNodeMac.cpp: * platform/graphics/mac/MediaPlayerProxy.h: * platform/graphics/mac/SimpleFontDataMac.mm: * platform/ios/LegacyTileCache.mm: * platform/ios/LegacyTileGrid.mm: * platform/ios/LegacyTileGridTile.mm: * platform/ios/PlatformEventFactoryIOS.mm: * platform/ios/PlatformScreenIOS.mm: * platform/ios/WebEvent.mm: * platform/ios/WebVideoFullscreenInterfaceAVKit.mm: * platform/ios/wak/WAKAppKitStubs.h: * platform/ios/wak/WAKView.h: * platform/ios/wak/WKGraphics.h: * platform/ios/wak/WKGraphics.mm: * platform/ios/wak/WebCoreThread.mm: * platform/network/ios/QuickLook.mm: * platform/spi/ca/CALayerSPI.h: Added. * platform/spi/ca/CATiledLayerSPI.h: Added. * platform/spi/cf/CFLocaleSPI.h: Modified to use EXTERN_C. * platform/spi/cf/CFNetworkConnectionCacheSPI.h: Ditto. Also changed header visibility from private to project. * platform/spi/cf/CFURLRequestSPI.h: Ditto. Also modified to unconditionally include header . * platform/spi/cg/CGColorTransformSPI.h: Added. * platform/spi/cg/CGContextSPI.h: Added. * platform/spi/cg/CGFloatSPI.h: Added. * platform/spi/cg/CGFontGlyphSupportSPI.h: Added. * platform/spi/cg/CGFontInfoSPI.h: Added. * platform/spi/cg/CGFontRenderingSPI.h: Added. * platform/spi/cg/CGFontUnicodeSupportSPI.h: Added. * platform/spi/cg/CGImageSPI.h: Added. * platform/spi/cg/CGSRegionSPI.h: Added. * platform/spi/cocoa/DispatchSPI.h: Added. * platform/spi/cocoa/IOPMLibSPI.h: Added. * platform/spi/cocoa/MachVMSPI.h: Added. * platform/spi/cocoa/NSFileManagerSPI.h: Added. * platform/spi/cocoa/NSGeometrySPI.h: Added. * platform/spi/cocoa/NSPointerFunctionsSPI.h: Added. * platform/spi/cocoa/dyldSPI.h: Added. * platform/spi/ios/AVPlayerControllerSPI.h: Added. * platform/spi/ios/AVPlayerViewControllerSPI.h: Added. * platform/spi/ios/AVValueTimingSPI.h: Added. * platform/spi/ios/AVVideoLayerSPI.h: Added. * platform/spi/ios/CTFontDescriptorSPI.h: Added. * platform/spi/ios/CTFontSPI.h: Added. * platform/spi/ios/CUICatalogSPI.h: Added. * platform/spi/ios/CUIStyleEffectConfigurationSPI.h: Added. * platform/spi/ios/MPAVRoutingControllerSPI.h: Added. * platform/spi/ios/MobileGestaltSPI.h: Added. * platform/spi/ios/QLPreviewConverterSPI.h: Added. * platform/spi/ios/QuickLookSPI.h: Added. * rendering/RenderThemeIOS.mm: 2014-09-17 Gavin Barraclough DOM timer throttling for hidden plugins https://bugs.webkit.org/show_bug.cgi?id=136197 Reviewed by Geoff Garen & Andreas Kling. For non-visible web pages we slow timers (since they can't be driving animations, etc). We should do the same for plugins. There are a few steps to this: - JSPluginElementFunctions notifies DOMTimer when script interacts with a plugin. - DOMTimerFireState keeps a record of events that occur while a timer is firing. - DOMTimer::fired detects timers that interact with invisible/inaudible plugins, and flags itself for throtting. - DOMTimer::intervalClampedToMinimum sets timer intervals appropriately. * bindings/js/JSPluginElementFunctions.cpp: (WebCore::pluginScriptObject): - notify DOMTimer when script interacts with a plugin. * html/HTMLPlugInElement.cpp: (WebCore::HTMLPlugInElement::isDetectable): * html/HTMLPlugInElement.h: - added isDetectable, to check for visible / audible plugins. * page/DOMTimer.cpp: (WebCore::DOMTimerFireState::DOMTimerFireState): (WebCore::DOMTimerFireState::~DOMTimerFireState): - track current DOMTimerFireState. (WebCore::DOMTimer::DOMTimer): - initialize m_throttleState. (WebCore::DOMTimer::scriptDidInteractWithPlugin): - if interaction with a plugin occurs while a timer is firing, record on the DOMTimerFireState. (WebCore::DOMTimer::fired): - set DOMTimerFireState, and update m_throttleState accordingly. (WebCore::DOMTimer::updateTimerIntervalIfNecessary): - remove redundant check of maxTimerNestingLevel (covered by intervalClampedToMinimum). (WebCore::DOMTimer::intervalClampedToMinimum): - Also take m_throttleState into account when throttling. * page/DOMTimer.h: - added scriptDidInteractWithPlugin, m_throttleState. * platform/audio/AudioHardwareListener.h: - enum -> enum class. * plugins/PluginViewBase.h: (WebCore::PluginViewBase::audioHardwareActivity): - expose audioHardwareActivity on PluginViewBase (previously available in subclass). 2014-09-16 Gavin Barraclough Exclude page visibility from PageThrottler's hysteresis https://bugs.webkit.org/show_bug.cgi?id=136866 Reviewed by Geoff Garen. Including visibility in the hysteresis mechanism has the effect of prolonging the visually idle timeout, and causing the page hide event to be run at foreground priority. Neither of these are particularly desirable. Instead separate visibility from the rest of the page activities we track (and apply hysteresis to), and feed this directly into determination of the UserActivity state. * page/PageThrottler.cpp: (WebCore::PageThrottler::PageThrottler): - when the PageThrottler is instantiated call updateUserActivity to set initial UserActivity. (WebCore::PageThrottler::incrementActivityCount): - simplified - when m_activityCount becomes non-zero, start m_hysteresis. (WebCore::PageThrottler::decrementActivityCount): - simplified - when m_activityCount becomes zero, stop m_hysteresis. (WebCore::PageThrottler::updateUserActivity): - end the UserActivity (allow AppNap) if visually idle and no page activity is taking place. (WebCore::PageThrottler::setViewState): - when the visually idle state changed call updateUserActivity to update the UserActivity. (WebCore::PageThrottler::started): (WebCore::PageThrottler::stopped): - when the hysteresis state changed call updateUserActivity to update the UserActivity. (WebCore::PageThrottler::updateHysteresis): Deleted. - removed: simplified the hysteresis trigger, we now incorporate visually idle state in updateUserActivity. * page/PageThrottler.h: - removed updateHysteresis, added updateUserActivity. * platform/HysteresisActivity.h: (WebCore::HysteresisActivity::state): - determine the curent state of the HysteresisActivity - started, waiting, or stopped. 2014-09-17 Carlos Garcia Campos [GTK] Fix runtime critical warnings when writing to the clipboard after r173687 https://bugs.webkit.org/show_bug.cgi?id=136891 Reviewed by Philippe Normand. * platform/gtk/PasteboardHelper.cpp: (WebCore::PasteboardHelper::writeClipboardContents): Check passed callback is not null before trying to ref/unref it since g_closure_ref/unref are not null safe. 2014-09-17 Zan Dobersek [GTK] Add a helper function for display system deduction https://bugs.webkit.org/show_bug.cgi?id=136849 Reviewed by Martin Robinson. getDisplaySystemType() is a helper function that checks the type of the default GdkDisplay object and initializes a static variable to the corresponding value. It then returns the value of that variable. When building with the GTK+2 API (still the case with the GTK+2 plugin process) we default to X11. The function is declared and implemented in GtkUtilities files. * platform/gtk/GtkUtilities.cpp: (WebCore::widgetIsOnscreenToplevelWindow): (WebCore::getDisplaySystemType): * platform/gtk/GtkUtilities.h: 2014-09-16 Yusuke Suzuki filterRootById accidentally clears inAdjacentChain flag https://bugs.webkit.org/show_bug.cgi?id=136851 Reviewed by Benjamin Poulain. Test: fast/selectors/filter-root-node-with-selector-contains-adjacents.html * dom/SelectorQuery.cpp: (WebCore::filterRootById): 2014-09-16 Carlos Garcia Campos [GTK] Fix layering violations in PasteboardGtk https://bugs.webkit.org/show_bug.cgi?id=136802 Reviewed by Darin Adler. Refactor the Pasteboard code moving the WebCore parts to the Editor. * PlatformGTK.cmake: Add new file to compilation. * editing/Editor.cpp: (WebCore::Editor::performCutOrCopy): (WebCore::Editor::copyImage): * editing/Editor.h: * editing/gtk/EditorGtk.cpp: Added. (WebCore::createFragmentFromPasteBoardData): (WebCore::Editor::pasteWithPasteboard): (WebCore::getImageAndURLForElement): (WebCore::Editor::writeImageToPasteboard): (WebCore::Editor::writeSelectionToPasteboard): * page/DragController.cpp: (WebCore::DragController::startDrag): * page/gtk/DragControllerGtk.cpp: (WebCore::DragController::declareAndWriteDragImage): * platform/Pasteboard.h: * platform/gtk/DataObjectGtk.cpp: Remove range member, the caller should call setText() + setMarkup() intead. (WebCore::DataObjectGtk::setText): (WebCore::DataObjectGtk::setMarkup): (WebCore::DataObjectGtk::clearText): (WebCore::DataObjectGtk::clearMarkup): (WebCore::DataObjectGtk::clearAllExceptFilenames): * platform/gtk/DataObjectGtk.h: (WebCore::DataObjectGtk::hasText): (WebCore::DataObjectGtk::hasMarkup): (WebCore::DataObjectGtk::clearImage): (WebCore::DataObjectGtk::text): (WebCore::DataObjectGtk::markup): (WebCore::DataObjectGtk::setRange): Deleted. * platform/gtk/GtkDragAndDropHelper.h: * platform/gtk/PasteboardGtk.cpp: (WebCore::PasteboardImage::PasteboardImage): (WebCore::PasteboardImage::~PasteboardImage): (WebCore::Pasteboard::write): (WebCore::Pasteboard::writeSelection): Deleted. (WebCore::getURLForImageElement): Deleted. (WebCore::Pasteboard::writeImage): Deleted. (WebCore::Pasteboard::documentFragment): Deleted. * platform/gtk/PasteboardHelper.cpp: (WebCore::displayFromFrame): Deleted. (WebCore::PasteboardHelper::getPrimarySelectionClipboard): Deleted. * platform/gtk/PasteboardHelper.h: 2014-09-16 Carlos Garcia Campos DragData should not depend on Clipboard, DocumentFragment, and Document https://bugs.webkit.org/show_bug.cgi?id=21358 Reviewed by Darin Adler. Refactor DragData to not depend on Frame, DocumentFragment, Document and Range. DragData::asFragment() has been moved to DragController and implemented in the platform specific file. DragData methods using Frame has been reworked in Mac to not use Frame, since all other ports were ignoreing the frame parameter. * page/DragController.cpp: (WebCore::DragController::documentFragmentFromDragData): Make it a static member to be able to use createFragmentFromDragData(). (WebCore::DragController::performDragOperation): Update to DragData API changes. (WebCore::DragController::dispatchTextInputEventFor): Ditto. (WebCore::DragController::concludeEditDrag): Ditto. (WebCore::documentFragmentFromDragData): Deleted. * page/DragController.h: * page/efl/DragControllerEfl.cpp: (WebCore::DragController::createFragmentFromDragData): Move DragData::asFragment() implementation here. * page/gtk/DragControllerGtk.cpp: (WebCore::DragController::dragOperation): (WebCore::DragController::createFragmentFromDragData): Ditto. * page/mac/DragControllerMac.mm: (WebCore::DragController::dragOperation): (WebCore::DragController::createFragmentFromDragData): Ditto. * page/win/DragControllerWin.cpp: (WebCore::DragController::createFragmentFromDragData): Ditto. * platform/DragData.h: * platform/efl/DragDataEfl.cpp: (WebCore::DragData::asPlainText): Remove Frame parameter. (WebCore::DragData::containsURL): Ditto. (WebCore::DragData::asURL): Ditto. (WebCore::DragData::asFragment): Deleted. * platform/gtk/DragDataGtk.cpp: (WebCore::DragData::asPlainText): Remove Frame parameter. (WebCore::DragData::containsCompatibleContent): (WebCore::DragData::containsURL): Ditto. (WebCore::DragData::asURL): Ditto. (WebCore::DragData::asFragment): Deleted. * platform/mac/DragDataMac.mm: (WebCore::DragData::asPlainText): Same implementation as the Editor. (WebCore::DragData::containsURL): Remove Frame parameter. (WebCore::DragData::asURL): Use URLByCanonicalizingURL() instead of using the Editor client. (WebCore::DragData::asFragment): Deleted. * platform/win/DragDataWin.cpp: (WebCore::DragData::containsURL): Remove Frame parameter. (WebCore::DragData::asURL): Ditto. (WebCore::DragData::asPlainText): Ditto. (WebCore::DragData::containsCompatibleContent): (WebCore::DragData::asFragment): Deleted. 2014-09-16 Chris Dumez Rename Node::childNode(index) to traverseToChildAt(index) for clarity https://bugs.webkit.org/show_bug.cgi?id=136825 Reviewed by Benjamin Poulain. Rename Node::childNode(index) to traverseToChildAt(index) to make it clearer that the method is actually traversing the children and thus potentially expensive. This patch also avoids calling traverseToChildAt() in a couple of easily avoidable cases. No new tests, no behavior change. * WebCore.exp.in: * WebCore.order: Remove symbol for ContainerNode::childNode() as it was renamed. It does not seem we need to expose ContainerNode::traverseToChildAt(). * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::stringForVisiblePositionRange): (WebCore::AccessibilityObject::lengthForVisiblePositionRange): * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper arrayOfTextForTextMarkers:attributed:]): * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper doAXAttributedStringForTextMarkerRange:]): Mechanical renaming. * dom/ContainerNode.cpp: (WebCore::ContainerNode::traverseToChildAt): (WebCore::ContainerNode::childNode): Deleted. * dom/ContainerNode.h: (WebCore::Node::traverseToChildAt): (WebCore::Node::childNode): Deleted. * dom/Node.h: - Rename Node / ContainerNode's childNode(index) to traverseToChildAt(index) to make it clear that it is actually traversing the children and thus potentially expensive. - Clean up the implementation of ContainerNode::traverseToChildAt() to avoid the use of an extra |i| variable. * dom/Position.cpp: (WebCore::Position::computeNodeBeforePosition): Avoid calling traverseToChildAt(-1). Relying on the unsigned argument wrapping and the method returning null in this case is a bit obscure and causes unnecessary traversal of all children. (WebCore::Position::computeNodeAfterPosition): (WebCore::Position::previous): (WebCore::Position::next): Mechanical renaming and update variable names to stop using abbreviations as per coding style. * dom/PositionIterator.h: (WebCore::PositionIterator::PositionIterator): * dom/Range.cpp: (WebCore::Range::insertNode): (WebCore::Range::checkNodeWOffset): (WebCore::Range::firstNode): (WebCore::Range::pastLastNode): * dom/RangeBoundaryPoint.h: (WebCore::RangeBoundaryPoint::set): * editing/BreakBlockquoteCommand.cpp: (WebCore::BreakBlockquoteCommand::doApply): * editing/CompositeEditCommand.cpp: (WebCore::CompositeEditCommand::removeChildrenInRange): * editing/DeleteSelectionCommand.cpp: (WebCore::DeleteSelectionCommand::handleGeneralDelete): * editing/InsertParagraphSeparatorCommand.cpp: (WebCore::InsertParagraphSeparatorCommand::doApply): * editing/TextIterator.cpp: (WebCore::nextInPreOrderCrossingShadowBoundaries): (WebCore::TextIterator::node): (WebCore::SimplifiedBackwardsTextIterator::SimplifiedBackwardsTextIterator): * editing/VisibleUnits.cpp: (WebCore::nextLinePosition): * editing/cocoa/HTMLConverter.mm: (WebCore::editingAttributedStringFromRange): Mechanical renaming. * inspector/DOMPatchSupport.cpp: (WebCore::DOMPatchSupport::innerPatchChildren): Iterate over children while incrementing the |i| variable to avoid calling traverseToChildAt(index) repeatedly and thus traversing the children from the beginning every time. 2014-09-16 Joseph Pecoraro Web Inspector: Reduce a bit of churn setting initial remote inspection state https://bugs.webkit.org/show_bug.cgi?id=136875 Reviewed by Timothy Hatcher. * bindings/js/JSDOMGlobalObject.cpp: (WebCore::JSDOMGlobalObject::finishCreation): We no longer need to toggle this state. 2014-09-16 Enrica Casucci Should have an editing behavior specific for IOS. https://bugs.webkit.org/show_bug.cgi?id=136876 Reviewed by Sam Weinig. This patch introduces a new editing behavior type to be able to perform editing tasks that are specific to iOS. All the existing EditingBehavior methods return the same boolean value for for Mac and iOS. A new one has been introduced to support a specific behavior in the DeleteSelectionCommand. * editing/DeleteSelectionCommand.cpp: (WebCore::DeleteSelectionCommand::doApply): * editing/EditingBehavior.h: (WebCore::EditingBehavior::shouldConsiderSelectionAsDirectional): (WebCore::EditingBehavior::shouldCenterAlignWhenSelectionIsRevealed): (WebCore::EditingBehavior::shouldToggleStyleBasedOnStartOfSelection): (WebCore::EditingBehavior::shouldAlwaysGrowSelectionWhenExtendingToBoundary): (WebCore::EditingBehavior::shouldSelectOnContextualMenuClick): (WebCore::EditingBehavior::shouldExtendSelectionByWordOrLineAcrossCaret): (WebCore::EditingBehavior::shouldRebalanceWhiteSpacesInSecureField): * editing/EditingBehaviorTypes.h: * editing/FrameSelection.cpp: (WebCore::FrameSelection::positionForPlatform): * page/Settings.cpp: (WebCore::editingBehaviorTypeForPlatform): * testing/InternalSettings.cpp: (WebCore::InternalSettings::setEditingBehavior): 2014-09-16 Commit Queue Unreviewed, rolling out r173670. https://bugs.webkit.org/show_bug.cgi?id=136871 Creates layering violation (Requested by enrica on #webkit). Reverted changeset: "Move HTMLConverter from editing/cocoa to platform/cocoa." https://bugs.webkit.org/show_bug.cgi?id=136474 http://trac.webkit.org/changeset/173670 2014-09-16 Eric Carlson [Mac] MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput doesn't work with rotated movies https://bugs.webkit.org/show_bug.cgi?id=136872 Reviewed by Tim Horton. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithImageGenerator): Add logging. (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput): Apply the video track preferred transform. 2014-09-16 Enrica Casucci Move HTMLConverter from editing/cocoa to platform/cocoa. https://bugs.webkit.org/show_bug.cgi?id=136474 Reviewed by Benjamin Poulain. This is a platform specific class and it belongs to the platform folder. * WebCore.xcodeproj/project.pbxproj: * editing/cocoa: Removed. * editing/cocoa/HTMLConverter.h: Removed. * editing/cocoa/HTMLConverter.mm: Removed. * platform/cocoa/HTMLConverter.h: Copied from editing/cocoa/HTMLConverter.h. * platform/cocoa/HTMLConverter.mm: Copied from editing/cocoa/HTMLConverter.mm. 2014-09-16 Enrica Casucci Remove PLATFORM(IOS) from WebCore/editing (Part 3). https://bugs.webkit.org/show_bug.cgi?id=136474 Reviewed by Benjamin Poulain. This is the updated version of the patch that was landed in r173340. This patch removes the use of PLATFORM(IOS) from TextAffinity.h and removes the assumption that EAffinity values match NSSelectionAffinity values. It also removes the includes in TextAffinity.h, creating the need to include explicitly the files when necessary. * editing/TextAffinity.h: (kit): Deleted. (core): Deleted. * editing/cocoa/HTMLConverter.mm: * page/mac/WebCoreFrameView.h: 2014-09-16 Beth Dakin overflow:scroll should not leave space for a scroll corner with overlay scrollbars https://bugs.webkit.org/show_bug.cgi?id=136861 Reviewed by Sam Weinig. overflow:scroll should behave like overflow:auto when the scrollbar will render as an overlay scrollbar. Re-name hasAutoVerticalScrollbar()/Horizontal to hasVerticalScrollbarWithAutoBehavior()/Horizontal, and return true for overflow:scroll scrollbars that will render as overlay scrollbars. * rendering/RenderBox.cpp: (WebCore::RenderBox::hasVerticalScrollbarWithAutoBehavior): (WebCore::RenderBox::hasHorizontalScrollbarWithAutoBehavior): * rendering/RenderBox.h: (WebCore::RenderBox::scrollsOverflowX): (WebCore::RenderBox::scrollsOverflowY): (WebCore::RenderBox::hasAutoVerticalScrollbar): Deleted. (WebCore::RenderBox::hasAutoHorizontalScrollbar): Deleted. Re-name overflowRequiresScrollbar() to styleRequiresScrollbar() and also re-name overflowDefinesAutomaticScrollbar() to styleDefinesAutomaticScrollbar(), and make these functions take into account the fact that overflow:scroll should act like overflow:auto when the scrollbar will render as an overlay scrollbar. * rendering/RenderLayer.cpp: (WebCore::styleRequiresScrollbar): (WebCore::styleDefinesAutomaticScrollbar): (WebCore::RenderLayer::updateScrollbarsAfterLayout): (WebCore::RenderLayer::calculateClipRects): 2014-09-16 peavo@outlook.com [Curl] Sometimes incomplete or empty content can be loaded from cache. https://bugs.webkit.org/show_bug.cgi?id=136855 Reviewed by Alex Christensen. Sometimes, when two requests with the same url are started at the same time, there is a possibility of loading incomplete or empty content from the cache. This happens because the method CurlCacheEntry::isLoading() is returning the wrong status in the time period between the headers are received, and the content data is received. This can be fixed by using a flag for the load status, instead of checking whether the content file is open. * platform/network/curl/CurlCacheEntry.cpp: (WebCore::CurlCacheEntry::CurlCacheEntry): Initialize loading flag. (WebCore::CurlCacheEntry::isLoading): Return loading flag. (WebCore::CurlCacheEntry::didFail): Call new method to set loading flag. (WebCore::CurlCacheEntry::didFinishLoading): Ditto. (WebCore::CurlCacheEntry::setIsLoading): Added new method to set loading flag. * platform/network/curl/CurlCacheEntry.h: Added loading flag and new method to set it. * platform/network/curl/CurlCacheManager.cpp: (WebCore::CurlCacheManager::didReceiveResponse): Call new method to set loading flag. 2014-09-16 Chris Dumez Rename Node::nodeIndex() to computeNodeIndex() for clarity https://bugs.webkit.org/show_bug.cgi?id=136826 Reviewed by Benjamin Poulain. Rename Node::nodeIndex() to computeNodeIndex() to make it clear that index is being computed and that calling this method is potentially expensive. No new tests, no behavior change. * WebCore.exp.in: * WebCore.order: Rename exported symbol for Node::nodeIndex() as well. * dom/Document.cpp: (WebCore::Document::caretRangeFromPoint): * dom/Node.cpp: (WebCore::Node::computeNodeIndex): (WebCore::Node::nodeIndex): Deleted. * dom/Node.h: * dom/NodeWithIndex.h: (WebCore::NodeWithIndex::index): Clean up implementation to reduce the scope of the Node variable and to follow coding style (variable naming, spacing, star placement). * dom/Position.cpp: (WebCore::Position::computeOffsetInContainerNode): (WebCore::Position::previous): (WebCore::Position::next): (WebCore::Position::upstream): (WebCore::Position::downstream): * dom/Position.h: (WebCore::positionInParentBeforeNode): (WebCore::positionInParentAfterNode): * dom/Range.cpp: (WebCore::Range::compareNode): (WebCore::Range::intersectsNode): (WebCore::Range::processContents): (WebCore::Range::insertNode): (WebCore::Range::setStartAfter): (WebCore::Range::setEndBefore): (WebCore::Range::setEndAfter): (WebCore::Range::setStartBefore): * dom/RangeBoundaryPoint.h: (WebCore::RangeBoundaryPoint::ensureOffsetIsValid): * editing/ApplyStyleCommand.cpp: (WebCore::ApplyStyleCommand::mergeStartWithPreviousIfIdentical): (WebCore::ApplyStyleCommand::mergeEndWithNextIfIdentical): * editing/DeleteSelectionCommand.cpp: (WebCore::DeleteSelectionCommand::handleGeneralDelete): * editing/Editor.cpp: (WebCore::Editor::avoidIntersectionWithDeleteButtonController): * editing/FrameSelection.cpp: (WebCore::FrameSelection::selectFrameElementInParentIfFullySelected): * editing/ReplaceSelectionCommand.cpp: (WebCore::ReplaceSelectionCommand::doApply): * editing/TextIterator.cpp: (WebCore::TextIterator::range): (WebCore::SimplifiedBackwardsTextIterator::handleReplacedElement): (WebCore::SimplifiedBackwardsTextIterator::handleNonTextNode): * editing/htmlediting.cpp: (WebCore::updatePositionForNodeRemoval): * html/HTMLTextFormControlElement.cpp: (WebCore::setContainerAndOffsetForRange): * page/DOMSelection.cpp: (WebCore::DOMSelection::getRangeAt): (WebCore::DOMSelection::containsNode): (WebCore::DOMSelection::shadowAdjustedOffset): * rendering/RenderBlock.cpp: (WebCore::positionForPointRespectingEditingBoundaries): * rendering/RenderTreeAsText.cpp: (WebCore::nodePosition): 2014-09-16 Jer Noble Videos with controls enabled never receive 'dragstart' events. https://bugs.webkit.org/show_bug.cgi?id=136837 Reviewed by Eric Carlson. Fixes a crash regression introduced by r173631. Node::contains() has an interesting property of returning false if `this` is NULL. Rather than depending on this behavior, explicitly NULL-check state.source and bail early. * page/DragController.cpp: (WebCore::DragController::startDrag): 2014-09-16 Csaba Osztrogonác URTBF after r173659. After r173659 convertToIntLength() is used only inside ENABLE(DASHBOARD_SUPPORT), so it became unused function and caused build failure if ENABLE(DASHBOARD_SUPPORT) is false. Source/WebCore/css/StyleResolver.cpp:1471:15: error: 'WebCore::Length WebCore::convertToIntLength(const WebCore::CSSPrimitiveValue*, const WebCore::CSSToLengthConversionData&)' defined but not used [-Werror=unused-function] cc1plus: all warnings being treated as errors * css/StyleResolver.cpp: Missing ENABLE(DASHBOARD_SUPPORT) guard added. 2014-09-14 Darin Adler Scroll snap properties don't handle inherit and initial propertly. https://bugs.webkit.org/show_bug.cgi?id=136643 Reviewed by Beth Dakin. Restructured scroll snap code both to handle inherit and initial, and to reduce the total code size a bit, fixing a few minor bugs along the way. Updated the regression tests to cover the new parts. * css/CSSComputedStyleDeclaration.cpp: (WebCore::addValuesForNamedGridLinesAtIndex): Use a modern for loop. (WebCore::scrollSnapDestination): Changed to take a LengthSize. Also streamlined. (WebCore::scrollSnapPoints): Changed to to take a ScrollSnapPoints. Also streamlined and added code to handle the "uses elements" case; serialize that as an identifier, not the string "elements", fixing a minor bug. (WebCore::scrollSnapCoordinates): Changed to take a Vector. Also streamlined and added code to handle the empty vector case; serialize that as an identifier, not the string "none", fixing a minor bug. (WebCore::ComputedStyleExtractor::getFontSizeCSSValuePreferringKeyword): Use nullptr. (WebCore::counterToCSSValue): Use nullptr. (WebCore::ComputedStyleExtractor::styledNode): Use nullptr. (WebCore::ComputedStyleExtractor::propertyValue): Use nullptr. Moved CSS_SCROLL_SNAP to a more appropriate section of the switch statement. Made it just call through to the functions above in a more straightforward way. (WebCore::CSSComputedStyleDeclaration::getPropertyValue): Reversed logic to use early return and to call emptyString. (WebCore::CSSComputedStyleDeclaration::item): Use emptyString. (WebCore::ComputedStyleExtractor::getCSSPropertyValuesForSidesShorthand): Use nullptr. (WebCore::CSSComputedStyleDeclaration::parentRule): Use nullptr. (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): Use nullptr. (WebCore::CSSComputedStyleDeclaration::getPropertyPriority): Use emptyString. (WebCore::CSSComputedStyleDeclaration::getPropertyShorthand): Use emptyString. * css/DeprecatedStyleBuilder.cpp: (WebCore::ApplyPropertyMarqueeIncrement::applyValue): Use the switch statement for the invalid value as well as for the valid values, rather than a separate if statement. Call convertToLength directly rather than through a StyleResolver static member function. * css/PropertySetCSSStyleDeclaration.cpp: (WebCore::PropertySetCSSStyleDeclaration::getPropertyValue): Fixed a formatting mistake. * css/StyleResolver.cpp: (WebCore::convertToIntLength): Made this function local to this file instead of a static member function. (WebCore::convertToFloatLength): Ditto. (WebCore::StyleResolver::parseSnapCoordinate): Added. Used to keep snap point parsing code small. (WebCore::StyleResolver::parseSnapCoordinatePair): Ditto. (WebCore::StyleResolver::parseSnapPoints): Added. Parses an entire snap points property. (WebCore::StyleResolver::applyProperty): Removed various bits of redundant code that were not using the primitiveValue value already in a local variable. Added the HANDLE_INHERIT_AND_INITIAL to all the scroll snap properties and updated since the RenderStyle structure now more closely matches the CSS properties. * css/StyleResolver.h: Updated for above changes, and removed a redundant "private:". * page/scrolling/AxisScrollSnapOffsets.cpp: (WebCore::appendChildSnapOffsets): Use auto& instead of SnapCoordinate since that type is now gone. Updated since coordinates are now LengthSize. (WebCore::updateFromStyle): Changed to take a reference instead of a pointer and also to fetch the data from RenderStyle in a new way that more closely matches the CSS properties. (WebCore::updateSnapOffsetsForScrollableArea): Ditto. Also moved some memory allocation inside if statements so we don't wastefully allocate and destroy. * rendering/style/RenderStyle.cpp: Added an include of StyleScrollSnapPoints.h now that the header doesn't include them. Moved the conditional includes out of the main include paragraph (even though I don't think conditional includes are usually a good idea). (WebCore::RenderStyle::initialScrollSnapPointsX): Added. (WebCore::RenderStyle::initialScrollSnapPointsY): Added. (WebCore::RenderStyle::initialScrollSnapDestination): Added. (WebCore::RenderStyle::initialScrollSnapCoordinates): Added. (WebCore::RenderStyle::scrollSnapPointsX): Added. (WebCore::RenderStyle::scrollSnapPointsY): Added. (WebCore::RenderStyle::scrollSnapDestination): Added. (WebCore::RenderStyle::scrollSnapCoordinates): Added. (WebCore::RenderStyle::setScrollSnapPointsX): Added. (WebCore::RenderStyle::setScrollSnapPointsY): Added. (WebCore::RenderStyle::setScrollSnapDestination): Added. (WebCore::RenderStyle::setScrollSnapCoordinates): Added. * rendering/style/RenderStyle.h: Replaced the include of StyleScrollSnapPoints.h with a forward declaration of ScrollSnapPoints. Removed getters and setters for the old style properties and replaced them with new ones that match the CSS properties more closely. Tweaked formatting a bit. Added initial value functions for the the scroll snap properties. * rendering/style/StyleRareNonInheritedData.cpp: Added include of StyleScrollSnapPoints.h now that RenderStyle.h doesn't include it. (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): Updated since m_scrollSnapType is now unsigned instead of ScrollSnapType. * rendering/style/StyleRareNonInheritedData.h: Fixed type of m_scrollSnapType to be unsigned instead of ScrollSnapType. This should have been causing problems on Windows, but I think we got lucky and had no detectable problems. * rendering/style/StyleScrollSnapPoints.cpp: (WebCore::ScrollSnapPoints::ScrollSnapPoints): Added. (WebCore::operator==): Added overloads for both ScrollSnapPoints and also for StyleScrollSnapPoints; using a free function for both since both have public data. (WebCore::defaultScrollSnapDestination): Added, replaces a static member function. (WebCore::StyleScrollSnapPoints::StyleScrollSnapPoints): Updated both the default constructor and the copy constructor for the new design. * rendering/style/StyleScrollSnapPoints.h: Added a ScrollSnapPoints struct for the type of the snap-points-x and snap-points-y CSS properties. Changed the data members of StyleScrollSnapPoints to match the various CSS properties rather than breaking out all the data into separate data members. (WebCore::StyleScrollSnapPoints::defaultRepeatOffset): Deleted. Replaced by the default constructor for ScrollSnapPoints. (WebCore::StyleScrollSnapPoints::defaultDestinationOffset): Deleted. Replaced by a function inside the .cpp file. 2014-09-16 Youenn Fablet [GStreamer] http/tests/media/video-auth.html is failing https://bugs.webkit.org/show_bug.cgi?id=126619 Reviewed by Philippe Normand. Test: http/tests/media/video-auth-cors.html Use stored credentials when retrieving videos following image loading behavior (i.e. stored credentials are always used except when in cors anonymous mode), except that requesting credentials from user remains disabled for cross-origin requests. Patch is covered by http/tests/media/video-auth.html. * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp: (CachedResourceStreamingClient::CachedResourceStreamingClient): Enable using stored credentials except when using cors anonymous mode. 2014-09-16 Jinho Bang Add version of drawFocusIfNeeded that take a Path2D parameter. https://bugs.webkit.org/show_bug.cgi?id=136846 Reviewed by Dirk Schulze. Tests: fast/canvas/draw-focus-if-needed-with-path.html * html/canvas/CanvasRenderingContext2D.cpp: (WebCore::CanvasRenderingContext2D::drawFocusIfNeeded): (WebCore::CanvasRenderingContext2D::drawFocusIfNeededInternal): * html/canvas/CanvasRenderingContext2D.h: * html/canvas/CanvasRenderingContext2D.idl: 2014-09-15 Iago Toral and Zan Dobersek [GTK] Add WaylandDisplay https://bugs.webkit.org/show_bug.cgi?id=136216 Reviewed by Martin Robinson. Add the WaylandDisplay class. This class is used in the LayerTreeHostGtk, in the WebProcess, and controls the connection to the nested Wayland compositor in the UIProcess. Only one instance of the class is used in the WebProcess, accessible via the static WaylandDisplay::instance() method. The WaylandDisplay constructor performs the EGL initialization while also querying the Wayland register, resulting in initializing client-side objects that can interact with the wl_compositor and wl_webkitgtk interfaces implemented in the nested Wayland compositor. The single class instance is only deemed properly initialized if it picked up the Wayland interface objects and has properly acquired the EGL display and config. WaylandDisplay::createSurface() is called by the LayerTreeHostGtk during its own initialization. The method creates a new wl_surface object via the wl_compositor interface and a new wl_egl_window object that's based on that surface. For the wl_egl_window object, we fall back to a width or height of 1 in case the passed-in value for either is 0. This avoids problems in Mesa where widths or heights of 0 are not supported. We associate the created surface with the passed-in widget ID, as provided by LayerTreeHostGtk, via the wl_webkitgtk interface. This enables proper mapping of Wayland surfaces and the GtkWidgets in the UIProcess and makes it possible for the nested Wayland compositor to correctly determine which GtkWidget has to be redrawn after some surface has been committed. WaylandDisplay::createSharingGLContext() creates a new GLContextEGL object that's to be used as a sharing context. The method creates a new surface via the wl_compositor interface and uses it to create a dummy native EGL window that's 1x1px in size. The GLContextEGL object is then created through the static GLContextEGL::createWindowContext() method. * PlatformGTK.cmake: * platform/graphics/wayland/WaylandDisplay.cpp: Added. (WebCore::WaylandDisplay::globalCallback): (WebCore::WaylandDisplay::globalRemoveCallback): (WebCore::WaylandDisplay::instance): (WebCore::WaylandDisplay::WaylandDisplay): (WebCore::WaylandDisplay::createSurface): (WebCore::WaylandDisplay::createSharingGLContext): * platform/graphics/wayland/WaylandDisplay.h: Added. (WebCore::WaylandDisplay::nativeDisplay): (WebCore::WaylandDisplay::eglDisplay): * platform/graphics/wayland/WaylandSurface.cpp: (WebCore::WaylandSurface::~WaylandSurface): Assert that the WaylandDisplay instance is present before going on to destroy the surface resources. 2014-09-15 Chris Dumez Rename LiveNodeLists / HTMLCollections's nodeMatches() to elementMatches() https://bugs.webkit.org/show_bug.cgi?id=136844 Reviewed by Sam Weinig. Rename LiveNodeLists / HTMLCollections's nodeMatches() to elementMatches() for clarity as the argument is an Element. No new tests, no behavior change. * dom/ClassNodeList.h: (WebCore::ClassNodeList::elementMatches): (WebCore::ClassNodeList::nodeMatches): Deleted. * dom/DocumentOrderedMap.cpp: (WebCore::keyMatchesWindowNamedItem): (WebCore::keyMatchesDocumentNamedItem): * dom/Element.cpp: (WebCore::Element::updateNameForDocument): (WebCore::Element::updateIdForDocument): * dom/LiveNodeList.cpp: (WebCore::LiveNodeList::namedItem): * dom/LiveNodeList.h: (WebCore::CachedLiveNodeList::collectionBegin): (WebCore::CachedLiveNodeList::collectionLast): (WebCore::CachedLiveNodeList::collectionTraverseForward): (WebCore::CachedLiveNodeList::collectionTraverseBackward): * dom/NameNodeList.h: (WebCore::NameNodeList::elementMatches): (WebCore::NameNodeList::nodeMatches): Deleted. * dom/TagNodeList.h: (WebCore::TagNodeList::elementMatches): (WebCore::HTMLTagNodeList::elementMatches): (WebCore::TagNodeList::nodeMatches): Deleted. (WebCore::HTMLTagNodeList::nodeMatches): Deleted. * html/HTMLCollection.cpp: (WebCore::isMatchingElement): * html/HTMLNameCollection.cpp: (WebCore::WindowNameCollection::elementMatchesIfNameAttributeMatch): (WebCore::WindowNameCollection::elementMatches): (WebCore::DocumentNameCollection::elementMatchesIfIdAttributeMatch): (WebCore::DocumentNameCollection::elementMatchesIfNameAttributeMatch): (WebCore::DocumentNameCollection::elementMatches): (WebCore::WindowNameCollection::nodeMatchesIfNameAttributeMatch): Deleted. (WebCore::WindowNameCollection::nodeMatches): Deleted. (WebCore::DocumentNameCollection::nodeMatchesIfIdAttributeMatch): Deleted. (WebCore::DocumentNameCollection::nodeMatchesIfNameAttributeMatch): Deleted. (WebCore::DocumentNameCollection::nodeMatches): Deleted. * html/HTMLNameCollection.h: * html/LabelsNodeList.cpp: (WebCore::LabelsNodeList::elementMatches): (WebCore::LabelsNodeList::nodeMatches): Deleted. * html/LabelsNodeList.h: * html/RadioNodeList.cpp: (WebCore::RadioNodeList::elementMatches): (WebCore::RadioNodeList::nodeMatches): Deleted. * html/RadioNodeList.h: 2014-09-15 Chris Dumez Use an AtomicString as key for caching ClassNodeList objects https://bugs.webkit.org/show_bug.cgi?id=136830 Reviewed by Benjamin Poulain. Use an AtomicString as key for caching ClassNodeList objects instead of a String. ClassNodeList is the only type using a String instead of an AtomicString as key in the cache HashTable. This brings some complexity. I believe this was done to avoid unnecessarily atomizing the String, for performance reasons. However, at the moment, the String gets atomized anyway when constructing the ClassNodeList object. This is because the ClassNodeList::m_classNames member is of SpaceSplitString type and the SpaceSplitString constructor takes an AtomicString in argument. Using an AtomicString to cache ClassNodeLists simplifies the code quite a bit and decreases the size of NodeListsNodeData as well. Test: fast/dom/getElementsByClassName/conflict-tag-name.html * WebCore.order: Remove symbol corresponding to addCacheWithName() as it was removed. * dom/ClassNodeList.cpp: (WebCore::ClassNodeList::~ClassNodeList): Update the constructor to take an AtomicString in argument instead of a String, for clarity. The String gets atomized when initializing m_classNames anyway. (WebCore::ClassNodeList::ClassNodeList): Call removeCacheWithAtomicName() instead of removeCacheWithName() now that m_originalClassNames is an AtomicString. * dom/ClassNodeList.h: Use AtomicString instead of String type for classNames, in both the constructor argument and the m_originalClassNames data member. * dom/ContainerNode.cpp: (WebCore::ContainerNode::getElementsByClassName): Call addCacheWithAtomicName() instead of addCacheWithName() now that addCacheWithName() has been removed. * dom/Node.cpp: (WebCore::NodeListsNodeData::invalidateCaches): Stop invalidating m_nameCaches as this HashMap no longer exists. * dom/NodeRareData.h: (WebCore::NodeListsNodeData::NodeListCacheMapEntryHash::hash): (WebCore::NodeListsNodeData::NodeListCacheMapEntryHash::equal): (WebCore::NodeListsNodeData::isEmpty): (WebCore::NodeListsNodeData::adoptDocument): (WebCore::NodeListsNodeData::namedNodeListKey): (WebCore::NodeListsNodeData::deleteThisAndUpdateNodeRareDataIfAboutToRemoveLastList): (WebCore::NodeListsNodeData::addCacheWithName): Deleted. (WebCore::NodeListsNodeData::removeCacheWithName): Deleted. - Drop addCacheWithName() / removeCacheWithName() now that no NodeList uses a String as HashMap key. - Drop m_nameCaches now that ClassNodeLists are cached in m_atomicNameCaches instead. - Remove StringType template parameter and hardcode AtomicString instead. 2014-09-15 Chris Dumez Return early in SelectorChecker::checkOne() if selector.isAttributeSelector() is true https://bugs.webkit.org/show_bug.cgi?id=136838 Reviewed by Benjamin Poulain. Return early in SelectorChecker::checkOne() if selector.isAttributeSelector() is true and the selector matched. Previously, we were only returning early if the selector did not match and we were falling through if it did. This means that we ended up doing the 2 if() checks below in the method unnecessarily: - selector.m_match == CSSSelector::PseudoClass - selector.m_match == CSSSelector::PseudoElement No new tests, no behavior change. * css/SelectorChecker.cpp: (WebCore::SelectorChecker::checkOne): 2014-09-15 Chris Dumez Un-inline the Node constructor https://bugs.webkit.org/show_bug.cgi?id=136842 Reviewed by Benjamin Poulain. Un-inline the Node constructor as it does not seem to impact performance, based on my testing: http://dromaeo.com/?id=226992,226998 This reduces the stripped binary size by ~4Kb. No new tests, no behavior change. * dom/Document.h: (WebCore::Node::Node): Deleted. * dom/Node.cpp: (WebCore::Node::Node): 2014-09-15 Shivakumar JM Web Core: Websocket state should be set to closed in didReceiveMessage call back. https://bugs.webkit.org/show_bug.cgi?id=136219 Reviewed by Alexey Proskuryakov. Set the Websocket state to closed in didReceiveMessage call back. Test: http/tests/websocket/tests/hybi/error-event-ready-state.html * Modules/websockets/WebSocket.cpp: (WebCore::WebSocket::didReceiveMessageError): 2014-09-15 Jon Honeycutt Naming clean-up. Rubber-stamped by Andy Estes. * html/HTMLFormElement.cpp: (WebCore::HTMLFormElement::requestAutocomplete): (WebCore::HTMLFormElement::finishRequestAutocomplete): Remove superfluous "AutocompleteResult". * html/HTMLFormElement.h: Ditto. 2014-09-15 Alexey Proskuryakov Crash when logging in to optionshouse.com https://bugs.webkit.org/show_bug.cgi?id=136834 Reviewed by Anders Carlsson. No test, because I couldn't make one. I don't have a way to reproduce first-hand. * platform/network/cf/SocketStreamHandleCFNet.cpp: (WebCore::SocketStreamHandle::readStreamCallback): (WebCore::SocketStreamHandle::writeStreamCallback): 2014-09-15 Jer Noble Unreviewed build fix for 32-bit builds. Make casts from unsigned long long -> size_t explicit, rather than implicit. Also make CARingBuffer be protected by USING_MEDIA_TOOLBOX so ports without that flag won't try to compile unused code. * platform/audio/mac/CARingBuffer.cpp: (WebCore::CARingBuffer::fetch): * platform/audio/mac/CARingBuffer.h: * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm: (WebCore::AudioSourceProviderAVFObjC::provideInput): 2014-09-15 Jer Noble Unreviewed logic fix from r173631. Logic for includeShadowDOM was reversed. * page/DragController.cpp: (WebCore::DragController::startDrag): 2014-09-15 Jer Noble Videos with controls enabled never receive 'dragstart' events. https://bugs.webkit.org/show_bug.cgi?id=136837 Reviewed by Simon Fraser. When initiating a drag, the DragController checks whether the hit-tested element at a drag location is a child of the drag source, and bails if early if that is not the case. For a