2015-05-12 Carlos Garcia Campos Unreviewed. Fix the build with RESOURCE_TIMING disabled. * loader/ThreadableLoader.cpp: (WebCore::ThreadableLoaderOptions::isolatedCopy): 2015-05-11 Zan Dobersek Clean up redundant resources in case of failure in GLContextEGL context creation methods https://bugs.webkit.org/show_bug.cgi?id=144878 Reviewed by Martin Robinson. GLContextEGL::createWindowContext() and GLContextEGL::createPixmapContext() methods should clean up the freshly-created resources when prematurely returning due to a failure. * platform/graphics/egl/GLContextEGL.cpp: (WebCore::GLContextEGL::createWindowContext): (WebCore::GLContextEGL::createPixmapContext): 2015-05-11 Antti Koivisto WebContent crash under com.apple.WebCore: WebCore::WebKitCSSResourceValue::isCSSValueNone const + 6 https://bugs.webkit.org/show_bug.cgi?id=144870 rdar://problem/20727702 Reviewed by Simon Fraser. No repro but we are seeing null pointer crashes like this: Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 com.apple.WebCore 0x00007fff92da5706 WebCore::WebKitCSSResourceValue::isCSSValueNone() const + 6 1 com.apple.WebCore 0x00007fff93382b48 WebCore::MaskImageOperation::isCSSValueNone() const + 24 2 com.apple.WebCore 0x00007fff92e0475e WebCore::FillLayer::hasNonEmptyMaskImage() const + 30 * platform/graphics/MaskImageOperation.cpp: (WebCore::MaskImageOperation::MaskImageOperation): (WebCore::MaskImageOperation::isCSSValueNone): This would crash like this if both m_styleImage and m_cssMaskImageValue are null. There are no obvious guarantees that this doesn't happen. Two of the constructor variants allow it and there is setImage which may turn m_styleImage null later too. Fix by making null m_cssMaskImageValue always signify CSSValueNone. (WebCore::MaskImageOperation::cssValue): 2015-05-11 Chris Fleizach AX: Crash at WebCore::AccessibilityMenuList::addChildren() https://bugs.webkit.org/show_bug.cgi?id=144860 Reviewed by Mario Sanchez Prada. There were some unsafe pointer accesses in AccessibilityMenuList code that needed to be cleaned up. Test: accessibility/menu-list-crash2.html * accessibility/AccessibilityMenuList.cpp: (WebCore::AccessibilityMenuList::addChildren): 2015-05-11 Zan Dobersek Reduce TransformationMatrix copies in WebKitCSSMatrix operations https://bugs.webkit.org/show_bug.cgi?id=144795 Reviewed by Darin Adler. Instead of copying the TransformationMatrix member, performing the operation on it and then copying it again when creating the new WebKitCSSMatrix object, copy it just once by first creating the new WebKitCSSMatrix object and then performing the operation on that object's TransformationMatrix directly. * css/WebKitCSSMatrix.cpp: (WebCore::WebKitCSSMatrix::multiply): (WebCore::WebKitCSSMatrix::translate): (WebCore::WebKitCSSMatrix::scale): (WebCore::WebKitCSSMatrix::rotate): (WebCore::WebKitCSSMatrix::rotateAxisAngle): (WebCore::WebKitCSSMatrix::skewX): (WebCore::WebKitCSSMatrix::skewY): 2015-05-08 Alexey Proskuryakov Crashes in SocketStreamHandleBase::close https://bugs.webkit.org/show_bug.cgi?id=144767 rdar://problem/20486538 Reviewed by Brady Eidson. This is a speculative fix, I could not reproduce the crash. * Modules/websockets/WebSocketChannel.cpp: (WebCore::WebSocketChannel::processFrame): Normally, processOutgoingFrameQueue() closes the handle in the end when called in OutgoingFrameQueueClosing state. But there is no definitive protection against processing two CLOSE frames, in which case we'd try to close the handle twice. * platform/network/cf/SocketStreamHandleCFNet.cpp: (WebCore::SocketStreamHandle::readStreamCallback): Passing empty data to the client results in the socket being closed, which makes no sense here. 2015-05-07 Zalan Bujtas REGRESSION (r164449): Subpixel rendering: http://www.apple.com/iphone-6/ "Faster wireless." image displays vertical black line on 1x displays at specific window width. https://bugs.webkit.org/show_bug.cgi?id=144723 rdar://problem/18307094 Reviewed by Simon Fraser. This patch ensures that the backing store's graphics layer is always positioned on a device pixel boundary. While calculating the backing store's graphics layer location, its ancestor layer's compositing bounds is taken into account. However the compositing bounds is an unsnapped value, so in order to place the graphics layer properly, we need to pixel align the ancestor compositing bounds before using it to adjust the child's graphics layer position. Test: compositing/ancestor-compositing-layer-is-on-subpixel-position.html * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateGeometry): 2015-05-07 Yoav Weiss Fix sizes crash and add invalid value tests. https://bugs.webkit.org/show_bug.cgi?id=144739 Reviewed by Darin Adler. Make sure that only CSS length are allowed when the sizes parser is calling computeLength. Also make sure that for invalid lengths, the 100vw default is used instead. Test: fast/dom/HTMLImageElement/sizes/image-sizes-invalids.html * css/SourceSizeList.cpp: (WebCore::computeLength): (WebCore::defaultLength): (WebCore::parseSizesAttribute): 2015-05-06 David Hyatt Avoid copies in scrollOffsetForFixedPosition() and inline it. https://bugs.webkit.org/show_bug.cgi?id=144709 Reviewed by Simon Fraser. * page/FrameView.cpp: (WebCore::FrameView::frameScaleFactor): Added so that scrollOffsetForFixedPosition() can be inlined without having to reference Frame's implementation. (WebCore::FrameView::scrollOffsetForFixedPosition): Deleted. Moved this to the header. * page/FrameView.h: Inline scrollOffsetForFixedPosition() and get rid of all the copying it was doing. 2015-05-06 David Hyatt RenderLayer::currentTransform computes a pixel snapped rect it doesn't use. https://bugs.webkit.org/show_bug.cgi?id=144708 Reviewed by Simon Fraser. * rendering/RenderLayer.cpp: (WebCore::RenderLayer::currentTransform): Only compute a pixel snapped rect if we actually end up needing it. The common case is that this rect is not needed, so pushing it inside the two if statements speeds up the common case. 2015-05-06 David Hyatt Optimize topLeftLocationOffset() addition in updateLayerPosition https://bugs.webkit.org/show_bug.cgi?id=144704 Reviewed by Dean Jackson. * page/FrameView.cpp: (WebCore::FrameView::FrameView): * page/FrameView.h: Move the hasFlippedBlocks bit to FrameView instead of RenderView. Works better for inlining the check in any renderer header, and it also makes more sense conceptually, since the RenderView itself could be a flipped block. * rendering/RenderBox.cpp: (WebCore::RenderBox::layoutOverflowRectForPropagation): Change over to the FrameView bit. * rendering/RenderBox.h: (WebCore::RenderBox::applyTopLeftLocationOffset): Add a new inlined function that can apply the top left location offset to a point without multiple LayoutSize creations and copies. It invokes a helper for flipping that is not inlined only in the case where actual flipped blocks exist in the render tree. * rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::updateFromStyle): Set the bit on the FrameView now instead of the RenderView. * rendering/RenderLayer.cpp: (WebCore::RenderLayer::updateLayerPosition): Call the new applyTopLeftLocationOffset function so that the point can have offsets added in without any extra copies. (WebCore::RenderLayer::calculateClipRects): * rendering/RenderLineBoxList.cpp: (WebCore::RenderLineBoxList::rangeIntersectsRect): Switch over to the bit on the FrameView. * rendering/RenderView.cpp: (WebCore::RenderView::RenderView): * rendering/RenderView.h: Get rid of the bit on the RenderView. 2015-05-06 David Hyatt Optimize relativePositionOffset() to avoid doing unnecessary work https://bugs.webkit.org/show_bug.cgi?id=144698 Reviewed by Simon Fraser. * rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::relativePositionOffset): Patch relativePositionOffset to avoid doing unnecessary work in the common case where all values of top/left/right/bottom are either auto or fixed. We no longer fetch containingBlock() into a local always, but instead just invoke the function only when necessary. Also avoid computing the percentage-relative maximum for the top/right/bottom/left lengths when they are fixed values, since that maximum won't be examined at all. 2015-05-05 Žan Doberšek EventHandler::m_eventHandlerWillResetCapturingMouseEventsElement is incorrectly initialized https://bugs.webkit.org/show_bug.cgi?id=144583 Reviewed by Daniel Bates. * page/EventHandler.cpp: (WebCore::EventHandler::EventHandler): The m_eventHandlerWillResetCapturingMouseEventsElement is a boolean, so initialize it to false, instead of to nullptr. 2015-05-04 Zalan Bujtas RenderWidget::setWidgetGeometry() can end up destroying *this*. https://bugs.webkit.org/show_bug.cgi?id=144601 Reviewed by Andreas Kling. This is a speculative fix to ensure we don't crash on an invalid *this* renderer while flattening the current iframe. Calling RenderWidget::setWidgetGeometry() can result in destroying the current renderer. While it is not a issue in case of normal layout flow as widget positions are updated at post layout, frame flattening initiates this action in the middle of layout. This patch re-introduces refcount model for RenderWidgets so that the renderer is protected during layout when frame flattening is in use. * rendering/RenderFrameBase.cpp: (WebCore::RenderFrameBase::layoutWithFlattening): Let's be paranoid about child view. * rendering/RenderObject.cpp: (WebCore::RenderObject::destroy): * rendering/FrameView.cpp: (WebCore::FrameView::layout): * rendering/RenderView.h: * rendering/RenderWidget.cpp: (WebCore::RenderWidget::~RenderWidget): * rendering/RenderWidget.h: (WebCore::RenderWidget::ref): (WebCore::RenderWidget::deref): 2015-05-04 Chris Dumez Crash at com.apple.WebKit.WebContent at com.apple.WebCore: WebCore::createWindow + 185 https://bugs.webkit.org/show_bug.cgi?id=144597 Reviewed by Andreas Kling. Test: fast/dom/Window/window-open-activeWindow-null-frame.html In our implementation of window.open(), we make sure that the window which window.open() is called has a frame. However, we did not have the same check for the activeDOMWindow (i.e. the lexicalGlobalObject) causing us to crash in WebCore::createWindow() when dereferencing it. This patch updates WebCore::createWindow() takes a reference to the openerFrame instead of a pointer to make it clear the implementation expects it to be non-null. A null check is then added for the frame at the call site: DOMWindow::createWindow(). * inspector/InspectorFrontendClientLocal.cpp: (WebCore::InspectorFrontendClientLocal::openInNewTab): * loader/FrameLoader.cpp: (WebCore::isDocumentSandboxed): (WebCore::FrameLoader::submitForm): (WebCore::createWindow): Take a reference to openerFrame instead of a pointer as the implementation expects it to be non-null. * loader/FrameLoader.h: * page/DOMWindow.cpp: (WebCore::DOMWindow::createWindow): Add null check for activeFrame before passing it to WebCore::createWindow(). 2015-05-04 Chris Dumez REGRESSION (r178156): CSS Parser incorrectly rejects valid calc() in padding-right property https://bugs.webkit.org/show_bug.cgi?id=144584 Reviewed by Darin Adler. The CSS parser was rejecting calculated values at parsing time if it considered the value was negative and the CSS property did not allow negative values. However, doing so at this point will not always work because we don't necessarily know the font-size yet (for e.g. for calc(0.5em - 2px). Also, rejecting negative calculated values is not the right behavior as the the specification. The specification says we should clamp: http://dev.w3.org/csswg/css-values-3/#calc-range This patch updates validateCalculationUnit() to stop marking the value as invalid if it is negative. Instead, let the CSSCalcValue's permitted range clamp the value as needed. This bug was causing the bottom graphic on aldentrio.com to not be rendered properly. Test: fast/css/negative-calc-values.html fast/css/padding-calc-value.html * css/CSSParser.cpp: (WebCore::CSSParser::validateCalculationUnit): 2015-05-04 Csaba Osztrogonác [ARM] Don't compare unsigned chars to EOF (-1) https://bugs.webkit.org/show_bug.cgi?id=144439 Reviewed by Geoffrey Garen. * platform/linux/MemoryPressureHandlerLinux.cpp: (WebKit::nextToken): Don't cast return value of fgetc() to char. 2015-05-03 Carlos Garcia Campos [GTK] API tests crashing on debug builds due to extra unref https://bugs.webkit.org/show_bug.cgi?id=144508 Reviewed by Mario Sanchez Prada. The problem is that we were assuming that when a new DOMWindow is created, the DOM object cache was notified about the previous DOMWindow being destroyed before objects for the new DOMWindow are added to the cache. However, that's not always the case and we only create a DOMWindowObserver for the first DOMWindow. We need to keep a pointer to the DOMWindow being observed to clear() the cache and create a new DOMWindowObserver when it changes in the Frame. Fixes crashes in several unit tests in debug builds. * bindings/gobject/DOMObjectCache.cpp: 2015-05-01 Andreas Kling Reproducible crash removing name attribute from node Reviewed by Darin Adler. The problem here was with HTMLImageElement::getNameAttribute(), which relies on Element::hasName() to avoid slow attribute lookups when the attribute is already known not to be present. Unfortunately hasName() uses an ElementData flag that wasn't getting updated until after the call to parseAttribute(). This patch fixes the issue by moving the code that updates the hasName() flag before the parseAttribute() virtual dispatch. Test: fast/dom/HTMLImageElement/remove-name-id-attribute-from-image.html * dom/Element.cpp: (WebCore::Element::attributeChanged): 2015-05-01 Dan Bernstein WebCore part of Back/forward navigation to an error page in Safari breaks the back-forward list https://bugs.webkit.org/show_bug.cgi?id=144501 Reviewed by Darin Adler. Test: TestWebKitAPI/Tests/WebKit2Cocoa/LoadAlternateHTMLString.mm Normally, loading substitute data (such as an error page) creates a new back-forward list item. FrameLoader has a mechanism that detects when a substitute data load occurs during handling of a provisional load error and prevents the creation of a new back-forwards list item in that case if the unreachable URL is the same as the failing provisional URL. This mechanism was broken in WebKit2, where handling the provisional load error is asynchronous. The fix is to capture some state (namely, the failing provisional URL) when dispatching the load error and allow it to be restored when loading the substitute data. * loader/FrameLoader.cpp: (WebCore::FrameLoader::FrameLoader): Removed initialization of m_delegateIsHandlingProvisionalLoadError. (WebCore::FrameLoader::shouldReloadToHandleUnreachableURL): Instead of checking m_delegateIsHandlingProvisionalLoadError and if true using the provisional document loader’s URL, check m_provisionalLoadErrorBeingHandledURL. (WebCore::FrameLoader::checkLoadCompleteForThisFrame): Instead of checking and setting m_delegateIsHandlingProvisionalLoadError, use m_provisionalLoadErrorBeingHandledURL. * loader/FrameLoader.h: (WebCore::FrameLoader::provisionalLoadErrorBeingHandledURL): Added this getter. The client can call this from its override of dispatchDidFailProvisionalLoad and store the result. (WebCore::FrameLoader::setProvisionalLoadErrorBeingHandledURL): Added this setter. The client can call this prior to loading substitute data if it’s done as part of handling a previously-dispatched didFailProvisionalLoad. 2015-04-30 Oliver Hunt DOM bindings should not be using a reference type to point to a temporary object https://bugs.webkit.org/show_bug.cgi?id=144474 Reviewed by Beth Dakin. The DOM bindings will currently try and use a local reference to point to a temporary object. This currently works as a by product of the compiler's stack layout. This patch removes the dependency on undefined behaviour by ensuring that we use a value rather than reference type. * bindings/scripts/CodeGeneratorJS.pm: (GenerateParametersCheck): (GetNativeTypeForCallbacks): 2015-04-30 Brady Eidson Build fix after r183646 for less enlightened platforms. Unreviewed. * Modules/webdatabase/DatabaseBackendBase.cpp: (WebCore::fullyQualifiedInfoTableName): Windows doesn’t have stpcpy :( 2015-04-30 Brady Eidson Javascript using WebSQL can create their own WebKit info table. and https://bugs.webkit.org/show_bug.cgi?id=144466 Reviewed by Alex Christensen. Test: storage/websql/alter-to-info-table.html * Modules/webdatabase/DatabaseBackendBase.cpp: (WebCore::DatabaseBackendBase::databaseInfoTableName): Return the info table name. (WebCore::fullyQualifiedInfoTableName): Append "main." to the info table name. (WebCore::DatabaseBackendBase::DatabaseBackendBase): Use the fully qualified name. (WebCore::DatabaseBackendBase::performOpenAndVerify): Ditto. (WebCore::DatabaseBackendBase::getVersionFromDatabase): Ditto. (WebCore::DatabaseBackendBase::setVersionInDatabase): Ditto. 2015-04-29 David Hyatt Avoid containingBlock() calls when no writing mode flipping is needed. https://bugs.webkit.org/show_bug.cgi?id=144407 Reviewed by Simon Fraser. Add a bool to RenderView that indicates whether or not any flipped blocks have been added to the view. Once tainted, the view just stays dirty forever. If no flipped blocks are ever seen, we can then optimize away calls to containingBlock(). The motivation for this patch is to improve layer position updating, which makes many calls to topLeftLocationOffset(), one of the functions that can be optimized by this change. * rendering/RenderBox.cpp: (WebCore::RenderBox::layoutOverflowRectForPropagation): * rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::updateFromStyle): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::calculateClipRects): * rendering/RenderLineBoxList.cpp: (WebCore::RenderLineBoxList::rangeIntersectsRect): * rendering/RenderView.cpp: (WebCore::RenderView::RenderView): * rendering/RenderView.h: 2015-04-29 Hyungwook Lee Fix crash in WebCore::LogicalSelectionOffsetCaches::ContainingBlockInfo::setBlock(). https://bugs.webkit.org/show_bug.cgi?id=140261 Reviewed by Darin Adler. We need to check whether RenderObject is valid in RenderView::fooSubtreeSelection functions because invalid object has caused a crash. This patch adds isValidObjectForNewSelection(), and use it. * rendering/RenderView.cpp: (WebCore::isValidObjectForNewSelection): (WebCore::RenderView::clearSubtreeSelection): (WebCore::RenderView::applySubtreeSelection): 2015-04-27 Daniel Bates Form control may be associated with the wrong HTML Form element after form id change https://bugs.webkit.org/show_bug.cgi?id=133456 Reviewed by Andy Estes. Fixes an issue where a form control may be associated with the wrong HTML Form element after the id of the HTML Form element associated with the form control is changed when there is more than one HTML Form element with the same id in the document. Specifically, a form control that has an HTML form attribute value X will always be associated with some HTML Form element f where f.id = X regardless of whether f.id is subsequently changed. Tests: fast/forms/change-form-id-to-be-unique-then-submit-form.html fast/forms/change-form-id-to-be-unique.html * dom/Element.cpp: (WebCore::Element::attributeChanged): Notify observers when the id of an element changed. (WebCore::Element::updateId): Added parameter NotifyObservers (defaults to NotifyObservers::Yes), as to whether we should notify observers of the id change. (WebCore::Element::updateIdForTreeScope): Ditto. (WebCore::Element::willModifyAttribute): Do not notify observers of the id change immediately. As indicated by the name of this method, we plan to modify the DOM attribute id of the element, but we have not actually modified it when this method is called. Instead we will notify observers in Element::attributeChanged(), which is called after the DOM attribute id is modified. (WebCore::Element::cloneAttributesFromElement): Ditto. * dom/Element.h: Defined enum class NotifyObservers. * dom/TreeScope.cpp: (WebCore::TreeScope::addElementById): Added boolean parameter notifyObservers (defaults to true) as to whether we should dispatch a notification to all observers. (WebCore::TreeScope::removeElementById): Ditto. * dom/TreeScope.h: 2015-04-27 Yoav Weiss Fix viewport units in Media Queries https://bugs.webkit.org/show_bug.cgi?id=144260 Reviewed by Darin Adler. This patch makes sure that viewport units are considered "length units" in the context of Media Queries, by having MediaQueryExp use the unit logic that is in CSSPrimitiveValue. It does that by turning the relevant methods in CSSPrimitiveValue into static. It also makes sure that the logic for "resolution units" is not maintained separately in MediaQueryExp, to avoid similiar issues in the future with resolution units. Test: fast/media/mq-viewport-units.html * css/CSSPrimitiveValue.h: (WebCore::CSSPrimitiveValue::isViewportPercentageLength): Added a static variant. (WebCore::CSSPrimitiveValue::isLength): Added a static variant. (WebCore::CSSPrimitiveValue::isResolution): Added a static variant. * css/MediaQueryExp.cpp: (WebCore::featureWithValidPositiveLenghtOrNumber): Call CSSPrimitiveValue's length unit logic. (WebCore::featureWithValidDensity): Call CSSPrimitiveValue's resolution unit logic. 2015-05-01 Martin Robinson [GTK] New CORS tests from r183280 fail on WebKitGTK+ https://bugs.webkit.org/show_bug.cgi?id=144469 Reviewed by Sergio Villar Senin. No new tests. This causes failing tests to pass. * platform/network/soup/ResourceHandleSoup.cpp: (WebCore::doRedirect): Clear the origin header on cross-origin redirects. 2015-04-24 Brady Eidson Origin header is preserved on cross-origin redirects. https://bugs.webkit.org/show_bug.cgi?id=144157. Reviewed by Sam Weinig. Tests: http/tests/security/cors-post-redirect-301.html http/tests/security/cors-post-redirect-302.html http/tests/security/cors-post-redirect-307.html http/tests/security/cors-post-redirect-308.html * platform/network/cf/ResourceHandleCFNet.cpp: (WebCore::ResourceHandle::willSendRequest): Always clear any origin header for cross-origin redirects. * platform/network/mac/ResourceHandleMac.mm: (WebCore::ResourceHandle::willSendRequest): Ditto. 2015-04-24 Carlos Garcia Campos [SOUP] Use a webkit subdirectory for the disk cache https://bugs.webkit.org/show_bug.cgi?id=144048 Reviewed by Martin Robinson. Add a static method to SoupNetworkSession to clear a soup cache given its directory. * platform/network/soup/SoupNetworkSession.cpp: (WebCore::strIsNumeric): (WebCore::SoupNetworkSession::clearCache): * platform/network/soup/SoupNetworkSession.h: 2015-04-23 Chris Dumez [WK2] WebDiagnosticLoggingClient is leaking https://bugs.webkit.org/show_bug.cgi?id=144089 Reviewed by Darin Adler. WebDiagnosticLoggingClient is leaking. It is constructed inside WebPage constructor but there is no code destroying it. This patch adds a new xxxDestroyed() virtual function to DiagnosticLoggingClient and that is overriden in WebDiagnosticLoggingClient to call "delete this". This is the same pattern as for other WK2 clients (e.g. WebFrameLoaderClient, WebProgressTrackerClient). * loader/EmptyClients.h: * page/DiagnosticLoggingClient.h: * page/MainFrame.cpp: (WebCore::MainFrame::~MainFrame): 2015-04-22 Antti Koivisto CrashTracer: WebProcess at com.apple.WebCore: WebCore::toScriptElementIfPossible + 4 https://bugs.webkit.org/show_bug.cgi?id=144050 rdar://problem/15534973 Reviewed by Chris Dumez. We are seeing null Element pointer crashes with this stack: 47 com.apple.WebCore: WebCore::toScriptElementIfPossible + 4 <== 47 com.apple.WebCore: WebCore::ScriptRunner::timerFired + 452 47 com.apple.WebCore: WebCore::ThreadTimers::sharedTimerFiredInternal + 175 The most likely cause seems to be that this code ASSERT(m_pendingAsyncScripts.contains(scriptElement)); m_scriptsToExecuteSoon.append(m_pendingAsyncScripts.take(scriptElement)); in ScriptRunner::notifyScriptReady fails to find scriptElement and we are left with a null entry in m_scriptsToExecuteSoon. However I haven't managed to repro this or find the exact path how this could happen. The related code is fragile with lot of state (in ScriptElement class) and involves many opportunities for re-entry via scripts. No repro, no test case. * dom/ScriptRunner.cpp: (WebCore::ScriptRunner::timerFired): Paper this over by adding a null check. We could check m_pendingAsyncScripts.take() above but this also covers possibility this is caused by something else. 2015-04-21 Jinwoo Song [Cairo] Implement Path::addPath https://bugs.webkit.org/show_bug.cgi?id=130580 Reviewed by Dirk Schulze. Add support for addPath method for ports using cairo. This patch is originally authored by Jae Hyun Park . Test: fast/canvas/canvas-path-addPath.html * platform/graphics/cairo/PathCairo.cpp: (WebCore::Path::addPath): Implement addPath for cairo. 2015-04-21 Chris Dumez Use ASSERT_WITH_SECURITY_IMPLICATION() for NoEventDispatchAssertion https://bugs.webkit.org/show_bug.cgi?id=143971 Reviewed by Darin Adler. Use ASSERT_WITH_SECURITY_IMPLICATION() for NoEventDispatchAssertion as firing JS events can cause arbitrary JS execution which often leads to security bugs when event firing is forbidden. For e.g. firing events from ActiveDOMObject::suspend() means JS can construct or destroy ActiveDOMObjects while we are iterating over them. * dom/ContainerNode.cpp: (WebCore::dispatchChildInsertionEvents): (WebCore::dispatchChildRemovalEvents): * dom/ContainerNodeAlgorithms.h: (WebCore::ChildNodeInsertionNotifier::notify): * dom/Document.cpp: (WebCore::Document::dispatchWindowEvent): (WebCore::Document::dispatchWindowLoadEvent): * dom/Element.cpp: (WebCore::Element::dispatchFocusInEvent): (WebCore::Element::dispatchFocusOutEvent): * dom/EventDispatcher.cpp: (WebCore::EventDispatcher::dispatchEvent): * dom/EventTarget.cpp: (WebCore::EventTarget::fireEventListeners): * dom/Node.cpp: (WebCore::Node::dispatchSubtreeModifiedEvent): (WebCore::Node::dispatchDOMActivateEvent): * dom/ScriptExecutionContext.cpp: (WebCore::ScriptExecutionContext::canSuspendActiveDOMObjectsForPageCache): (WebCore::ScriptExecutionContext::suspendActiveDOMObjects): (WebCore::ScriptExecutionContext::resumeActiveDOMObjects): (WebCore::ScriptExecutionContext::stopActiveDOMObjects): (WebCore::ScriptExecutionContext::willDestroyActiveDOMObject): * dom/WebKitNamedFlow.cpp: (WebCore::WebKitNamedFlow::dispatchRegionOversetChangeEvent): 2015-04-20 Simon Fraser REGRESSION (r177494): -webkit-mask-image: with data URI fails on non-local files https://bugs.webkit.org/show_bug.cgi?id=141857 Reviewed by Dirk Schulze. r177494 regressed loading of data URIs in masks with remote content, triggering a cross-domain error which occurs because the mask loading happened via a separate SVGDocument. Fix by checking for data URIs at parsing time, which is what we used to do. Test: http/tests/css/data-uri-mask.html * css/CSSParser.cpp: (WebCore::CSSParser::parseMaskImage): * svg/SVGURIReference.h: (WebCore::SVGURIReference::isExternalURIReference): 2015-04-17 Bem Jones-Bey Large values for line-height cause integer overflow in RenderStyle::computedLineHeight https://bugs.webkit.org/show_bug.cgi?id=143863 Reviewed by Rob Buis. When we compute huge values for line-height through percentage or CSS calc, we'll overflow the integer and later on ShapeOutsideInfo::computeDeltasForContainingBlockLine will ASSERT because it expects non-negative line height. So for the computed line-height, clamp to an integer range to avoid overflow. Note that the code path for percentages here is safe because LayoutUnit clamps to an int on conversion. This is based on a Blink patch by Rob Buis. Test: fast/shapes/shape-outside-floats/shape-outside-negative-line-height-crash.html * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::computedLineHeight): Clamp line-height to an int to avoid overflow. 2015-04-17 Zalan Bujtas RenderTableCell::computeCollapsed*Border() should check if the cell is still attached to the render tree. https://bugs.webkit.org/show_bug.cgi?id=143887 rdar://problem/20568989 Reviewed by Simon Fraser. Detached table cell has no access to its parent table. This is a speculative fix to avoid dereferencing the invalid table pointer. * rendering/RenderTableCell.cpp: (WebCore::RenderTableCell::computeCollapsedStartBorder): (WebCore::RenderTableCell::computeCollapsedEndBorder): (WebCore::RenderTableCell::computeCollapsedBeforeBorder): (WebCore::RenderTableCell::computeCollapsedAfterBorder): 2015-04-17 Carlos Garcia Campos [SOUP] Redirect to non HTTP destination is broken https://bugs.webkit.org/show_bug.cgi?id=143866 Reviewed by Sergio Villar Senin. This is because we are passing true unconditionally as isHTTPFamilyRequest parameter of createSoupRequestAndMessageForHandle in continueAfterWillSendRequest. We don't actually need to pass isHTTPFamilyRequest parameter to createSoupRequestAndMessageForHandle, since it can simply check that from the given request. Covered by unit tets and also cache/disk-cache/disk-cache-redirect-to-data.html. * platform/network/soup/ResourceHandleSoup.cpp: (WebCore::continueAfterWillSendRequest): (WebCore::createSoupRequestAndMessageForHandle): (WebCore::ResourceHandle::start): 2015-04-16 Brady Eidson Media element can manipulate DOM during Document destruction. rdar://problem/20553898 and https://bugs.webkit.org/show_bug.cgi?id=143780 Reviewed by Jer Noble. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::configureMediaControls): Bail if the element has no active document. 2015-04-15 Simon Fraser We should dump GraphicsLayer's anchorPoint z component https://bugs.webkit.org/show_bug.cgi?id=143815 Reviewed by Tim Horton. We didn't include the z component of a layer's anchor point when dumping. Dump if it's non-zero (to avoid having to change lots of test output). No test with non-zero z appears to dump layers. * platform/graphics/GraphicsLayer.cpp: (WebCore::GraphicsLayer::dumpProperties): * rendering/style/RenderStyle.cpp: (WebCore::requireTransformOrigin): Remove a FIXME which, on further consideration, is wrong. 2015-04-15 Alexey Proskuryakov No thread safety when passing ThreadableLoaderOptions from a worker thread https://bugs.webkit.org/show_bug.cgi?id=143790 Reviewed by Geoffrey Garen. * loader/ThreadableLoader.h: * loader/ThreadableLoader.cpp: (WebCore::ThreadableLoaderOptions::isolatedCopy): Added. * loader/WorkerThreadableLoader.cpp: (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge): Don't just send a structure with strings to a different thread, that's bad. * platform/CrossThreadCopier.h: I think that this is dead code, but for this bug, just removing a clearly wrong specialization. 2015-04-13 Joonghun Park Use std::unique_ptr instead of PassOwnPtr|OwnPtr for ResourceResponse https://bugs.webkit.org/show_bug.cgi?id=143056 Reviewed by Gyuyoung Kim. No new tests, no behavior changes. * loader/WorkerThreadableLoader.cpp: (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge): (WebCore::WorkerThreadableLoader::MainThreadBridge::didReceiveResponse): * platform/CrossThreadCopier.h: * platform/network/ResourceResponseBase.cpp: (WebCore::ResourceResponseBase::adopt): (WebCore::ResourceResponseBase::copyData): * platform/network/ResourceResponseBase.h: * platform/network/cf/ResourceResponse.h: (WebCore::ResourceResponse::doPlatformCopyData): (WebCore::ResourceResponse::doPlatformAdopt): * platform/network/curl/ResourceResponse.h: (WebCore::ResourceResponse::doPlatformCopyData): (WebCore::ResourceResponse::doPlatformAdopt): * platform/network/soup/ResourceResponse.h: (WebCore::ResourceResponse::doPlatformCopyData): (WebCore::ResourceResponse::doPlatformAdopt): 2015-03-05 Joonghun Park Use std::unique_ptr instead of PassOwnPtr|OwnPtr for ResourceRequest https://bugs.webkit.org/show_bug.cgi?id=142349 Reviewed by Darin Adler. No new tests, no behavior changes. * loader/WorkerThreadableLoader.cpp: (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge): * loader/cache/MemoryCache.cpp: (WebCore::MemoryCache::removeRequestFromSessionCaches): * platform/CrossThreadCopier.h: * platform/network/ResourceRequestBase.cpp: (WebCore::ResourceRequestBase::adopt): (WebCore::ResourceRequestBase::copyData): * platform/network/ResourceRequestBase.h: * platform/network/cf/ResourceRequest.h: * platform/network/cf/ResourceRequestCFNet.cpp: (WebCore::ResourceRequest::doPlatformCopyData): (WebCore::ResourceRequest::doPlatformAdopt): * platform/network/curl/ResourceRequest.h: (WebCore::ResourceRequest::doPlatformCopyData): (WebCore::ResourceRequest::doPlatformAdopt): * platform/network/soup/ResourceRequest.h: (WebCore::ResourceRequest::doPlatformCopyData): (WebCore::ResourceRequest::doPlatformAdopt): 2015-04-14 Zalan Bujtas Make inline continuation style change logic consistent. https://bugs.webkit.org/show_bug.cgi?id=143737 rdar://problem/20486596 Reviewed by Simon Fraser. Do not force RenderBlock type-casting on the first sibling of the continuation's container. The first sibling of the container of a continuation should be handled as the rest of the siblings. Test: fast/inline/inline-with-column-span-and-remove-block-child-crash.html * rendering/RenderInline.cpp: (WebCore::updateStyleOfAnonymousBlockContinuations): (WebCore::RenderInline::styleDidChange): 2015-04-14 Brady Eidson Media elements not in a page shouldn't load. https://bugs.webkit.org/show_bug.cgi?id=143720 Reviewed by Jer Noble. No new tests (Theoretical problem noticed in code review). * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::loadResource): Make sure the frame is in a page. 2015-04-13 Chris Dumez Regression: Scrolling on popsci.com spends too much time in FrameView::viewportsContentsChanged() https://bugs.webkit.org/show_bug.cgi?id=143675 Reviewed by Simon Fraser. Optimize resumeVisibleImageAnimationsIncludingSubframes() so that the FrameViews' windowClipRect gets computed less often: - Cache the FrameView's windowClipRect before resuming image animations in subframes as calling windowClipRect() on those subframes' view is going to call windowClipRect() on their ancestors. This avoids a lot of unnecessary windowClipRect recomputations in deep frame trees. - Stop traversing the Frame tree if the current frame does not have a content renderer, as this means the subframes won't have one either. - Stop traversing the Frame tree if the current frame's view has an empty windowClipRect() as this means the windowClipRect will be empty for those subframes as well. On popsci.com, this cuts down the number of uncached windowClipRect() calls by approximately half. I see viewportsContentsChanged() at ~0.4% when scrolling on popsci.com after this change. * page/FrameView.cpp: (WebCore::FrameView::resumeVisibleImageAnimationsIncludingSubframes): (WebCore::FrameView::windowClipRect): * page/FrameView.h: * rendering/RenderView.cpp: (WebCore::RenderView::resumePausedImageAnimationsIfNeeded): * rendering/RenderView.h: 2015-04-13 Said Abou-Hallawa Canvas drawImage() has a security hole when the image isn't yet fully loaded. https://bugs.webkit.org/show_bug.cgi?id=58681. Reviewed by Darin Adler. There is a race condition which may happen if an image from a different origin is drawn on a canvas before it finishes loading. The check to taint the canvas comes before drawing it. This check returns false if the image is not completely loaded because we check the URL of the resource response. If after this check and before the drawing, the image finishes loading, the canvas will not be tainted but the image will be drawn. The fix is to move the check to taint the canvas after drawing the image. The only problem with this solution is basically the opposite of this bug: we will become stricter than before with images which are from a different origin and before they finish loading. The image has not finished loading, so we do not draw it. Before we check for tainting, the image finishes loading. So we decide to taint the canvas even the image is not drawn. But this should not be a security issue anymore. I personally do not know if it is even a correctness issue or not. Test: http/tests/canvas/canvas-tainted-after-draw-image.html * html/canvas/CanvasRenderingContext2D.cpp: (WebCore::CanvasRenderingContext2D::drawImage): 2015-04-13 Simon Fraser Fixed position element is truncated if moved onscreen by a transform https://bugs.webkit.org/show_bug.cgi?id=143655 rdar://problem/15020044 Reviewed by Darin Adler. Our "don't do layout if transform changes" code was too aggressive. If an element changes between having a transform and not having one, we really need to do a layout since so much else depends on transforms. In this particular case, we clip position:fixed elements to the viewport if they are not transformed, and were failing to re-evaluate this when a transform was added. Doing a layout fixes this. Test: compositing/geometry/fixed-transformed.html * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::changeRequiresLayout): * rendering/style/StyleTransformData.h: (WebCore::StyleTransformData::hasTransform): 2015-04-13 Darin Adler Remove needless recreation of URL in NavigationScheduler::scheduleLocationChange https://bugs.webkit.org/show_bug.cgi?id=143662 Reviewed by Sam Weinig. * loader/NavigationScheduler.cpp: (WebCore::NavigationScheduler::scheduleLocationChange): Removed unnecessary code to convert a URL to a String and then back into a URL. 2015-04-12 Simon Fraser Selects don't scroll at some aspect ratios https://bugs.webkit.org/show_bug.cgi?id=143649 rdar://problem/19365694 Reviewed by Darin Adler. Fix width/height flip in RenderListBox which caused us to fail to scroll when the list was wider than the scroll height. We're generally confused about RenderListBox scroll offsets (webkit.org/b/143648) but this fixes the immediate problem. Test: fast/forms/listbox-visible-size.html * rendering/RenderListBox.h: 2015-04-09 Myles C. Maxfield Text-combine erroneously draws vertically after non-layout-causing style change https://bugs.webkit.org/show_bug.cgi?id=143461 Reviewed by Darin Adler. RenderCombineText::styleDidChange() unconditionally uncombines its text. Layout then recombines it. However, if there is a style change that does not cause layout, the RenderCombineText will be left uncombined until the next layout. Test: fast/text/text-combine-style-change-no-layout.html * rendering/RenderCombineText.cpp: (WebCore::RenderCombineText::styleDidChange): 2015-04-08 Bem Jones-Bey [CSS Shapes] Properly handle negative reference box widths and center coordinates https://bugs.webkit.org/show_bug.cgi?id=142610 Reviewed by Rob Buis. Fix a few cases where values that should not be negative end up that way. This patch is based on a couple of Blink patches by Rob Buis. Tests: fast/shapes/shape-outside-floats/shape-outside-floats-circle-negative-radius-crash.html fast/shapes/shape-outside-floats/shape-outside-floats-ellipse-negative-width-crash.html * rendering/shapes/ShapeOutsideInfo.cpp: (WebCore::ShapeOutsideInfo::computeDeltasForContainingBlockLine): A negative margin box width means that the shape has no extent, so clamp to zero. * rendering/style/BasicShapes.cpp: (WebCore::BasicShapeCircle::floatValueForRadiusInBox): When computing the radii, take the absolute value, since the radii is based on the distance, which is always positive. (WebCore::BasicShapeEllipse::floatValueForRadiusInBox): Ditto. 2015-04-08 ChangSeok Oh Fill list style background with same color with that of list background. https://bugs.webkit.org/show_bug.cgi?id=143483 Reviewed by Simon Fraser. LayoutListMarker does not have a node so its selectionBackgroundColor alway returns the default theme color for selection. We can make it more natural by filling the same color with that of LayoutListItem into it. Tests: fast/backgrounds/selection-background-color-of-image-list-style.html fast/backgrounds/selection-background-color-of-list-style.html * rendering/RenderListMarker.cpp: (WebCore::RenderListMarker::paint): 2015-04-08 Carlos Garcia Campos [GTK] Crash in DOMObjectCache when a wrapped object owned by the cache is unreffed by the user https://bugs.webkit.org/show_bug.cgi?id=143521 Reviewed by Martin Robinson. This is a case we claim to support, but it only works if the object has only one reference. In that case, when the user unrefs it, the weak ref notify callback removes the object from the cache. However, if the object has more than one ref, the cache doesn't know the user unreffed it, and when clearing the cache we try to remove more references than what the object actually has, causing a crash in g_object_unref. * bindings/gobject/DOMObjectCache.cpp: (WebKit::DOMObjectCacheData::clearObject): 2015-04-08 Philippe Normand [GStreamer] compress property for the HTTP source element https://bugs.webkit.org/show_bug.cgi?id=143518 Reviewed by Carlos Garcia Campos. Added a compress property so the default behavior or not requesting content encoded to the server can be overridden if needed. This is useful for adaptive streaming playback. * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp: (webKitWebSrcSetProperty): (webKitWebSrcGetProperty): (webKitWebSrcStart): 2015-04-07 Philippe Normand [GStreamer] extra-headers and keep-alive properties for HTTP source element https://bugs.webkit.org/show_bug.cgi?id=143480 Reviewed by Carlos Garcia Campos. Keep the resource loader around when persistent HTTP connection support is enabled. The keep-alive property is set to false by default. Also before sending the HTTP request we now check the contents of the extra-headers GstStructure and set additional headers based on the structure contents. Patch inspired by GStreamer's souphttpsrc element. * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp: (webkit_web_src_init): (webKitWebSrcFinalize): (webKitWebSrcSetProperty): (webKitWebSrcGetProperty): (webKitWebSrcStop): Clear resource loader only for non-persistent connections. (webKitWebSrcSetExtraHeader): Utility function to append headers to an existing request based on a GValue contents. (webKitWebSrcProcessExtraHeaders): Parse a GValue and set headers based on its contents. (webKitWebSrcStart): Extra headers and persistent connection support. The resource loader is now lazily initialized here. 2015-04-06 Žan Doberšek FileList constructor should move the passed-in Vector<> rvalue reference into the member variable https://bugs.webkit.org/show_bug.cgi?id=143412 Reviewed by Darin Adler. * fileapi/FileList.h: (WebCore::FileList::FileList): An explicit move of the passed-in rvalue reference into the member variable is required, otherwise a copy is performed since an rvalue reference is just an lvalue. 2015-04-06 Žan Doberšek UserScript, UserStyleSheet constructors should take in Vector rvalue references https://bugs.webkit.org/show_bug.cgi?id=143411 Reviewed by Darin Adler. Have the UserScript and UserStyleSheet constructors take in Vector rvalue references for the whitelist and blacklist parameters. Both classes store these Vector objects, so the referenced objects can simply be moved into the member variable. Because the constructor is now demanding an rvalue, it's up to the caller to move in the desired object if possible, or create an explicit copy otherwise. * page/UserScript.h: (WebCore::UserScript::UserScript): * page/UserStyleSheet.h: (WebCore::UserStyleSheet::UserStyleSheet): 2015-04-05 Darin Adler FrameView code uses page() without null checking https://bugs.webkit.org/show_bug.cgi?id=143425 rdar://problem/18920601 Reviewed by Anders Carlsson. While we don't have tests that cover this, we are seeing crashes coming in that indicate the shouldEnableSpeculativeTilingDuringLoading function is being called when the page is null. This patch adds null checks to all the places in FrameView that use page() without doing null checking. * page/FrameView.cpp: (WebCore::FrameView::layout): If page is null, don't try to do the auto-sizing logic that involves the textAutosizingWidth value from the page. (WebCore::FrameView::setFixedVisibleContentRect): Get settings from the frame rather than the page to avoid possible null-dereference. (WebCore::FrameView::scrollPositionChanged): Check the page for null when getting the event throttling delay. (WebCore::FrameView::updateLayerFlushThrottling): Check the page for null, and return early if it is null. (WebCore::shouldEnableSpeculativeTilingDuringLoading): Check the page for null, and return false if it is null. (WebCore::FrameView::performPostLayoutTasks): Guard the code that calls didLayout on the page client by a check if the page is null. (WebCore::FrameView::pagination): Don't call Page::pagination on a null page here. (WebCore::FrameView::visibleContentScaleFactor): Use a scale factor of 1 if the page is null. (WebCore::FrameView::setVisibleScrollerThumbRect): Don't call through to the page client if the page is null. (WebCore::FrameView::scrollbarStyleChanged): Ditto. (WebCore::FrameView::setScrollPinningBehavior): Check the page for null before asking it for the scrolling coordinator. 2015-04-01 Zalan Bujtas Lots of time spent querying table cell borders, when there are none. https://bugs.webkit.org/show_bug.cgi?id=143277 Reviewed by Simon Fraser. This patch speeds up collapsed border queries by using existing collapsed border cache to calculate repaint rects and by introducing a fast path for zero width collapsed borders. It reduces the number of calls to recompute collapsed borders from 36 000 to 1 600, while loading a page with a table of 400 rows (1 cell per row). When scrolling the same page all the way down to the bottom, the number of calls to recompute collapsed borders falls from 290 000 to 0. Covered by existing tests. * rendering/RenderTable.cpp: (WebCore::RenderTable::styleDidChange): This moves invalidation time from RenderTable::layout() to styleDidChange(). (WebCore::RenderTable::invalidateCollapsedBorders): (WebCore::RenderTable::recalcCollapsedBorders): * rendering/RenderTable.h: (WebCore::RenderTable::collapsedBordersAreValid): (WebCore::RenderTable::invalidateCollapsedBorders): Deleted. * rendering/RenderTableCell.cpp: (WebCore::RenderTableCell::RenderTableCell): (WebCore::RenderTableCell::willBeRemovedFromTree): Invalidate caches so that when repaint rect is calculated, we don't end up using stale values. (WebCore::RenderTableCell::styleDidChange): Same as willBeRemovedFromTree. (WebCore::RenderTableCell::collapsedStartBorder): Check if collapsed border is zero -also query cache. (WebCore::RenderTableCell::collapsedEndBorder): (WebCore::RenderTableCell::collapsedBeforeBorder): (WebCore::RenderTableCell::collapsedAfterBorder): (WebCore::RenderTableCell::cachedCollapsedLeftBorder): (WebCore::RenderTableCell::cachedCollapsedRightBorder): (WebCore::RenderTableCell::cachedCollapsedTopBorder): (WebCore::RenderTableCell::cachedCollapsedBottomBorder): (WebCore::RenderTableCell::paintCollapsedBorders): (WebCore::RenderTableCell::cellAtLeft): Deleted. (WebCore::RenderTableCell::cellAtRight): Deleted. (WebCore::RenderTableCell::cellAtTop): Deleted. (WebCore::RenderTableCell::cellAtBottom): Deleted. * rendering/RenderTableCell.h: (WebCore::RenderTableCell::invalidateHasEmptyCollapsedBorders): * rendering/RenderTableCol.cpp: (WebCore::RenderTableCol::styleDidChange): * rendering/RenderTableRow.cpp: (WebCore::RenderTableRow::styleDidChange): (WebCore::RenderTableRow::addChild): * rendering/RenderTableSection.cpp: (WebCore::RenderTableSection::styleDidChange): (WebCore::RenderTableSection::clearCachedCollapsedBorders): This is just an extra safety to invalidate collapsed border cache. This is always called together with RenderTable::invalidateCollapsedBorders() -and that should prevent the RenderCells to use the cache. (WebCore::RenderTableSection::removeCachedCollapsedBorders): (WebCore::RenderTableSection::setCachedCollapsedBorder): (WebCore::RenderTableSection::cachedCollapsedBorder): * rendering/RenderTableSection.h: 2015-02-17 Zalan Bujtas Minor RenderTable* class cleanups. https://bugs.webkit.org/show_bug.cgi?id=141707 Reviewed by Andreas Kling. Use in-class initializer where possible. Remove redundant code. Move multiline implementations out of class declaration. No change in functionality. * rendering/RenderTableCaption.cpp: (WebCore::RenderTableCaption::insertedIntoTree): (WebCore::RenderTableCaption::willBeRemovedFromTree): (WebCore::RenderTableCaption::containingBlockLogicalWidthForContent): Deleted. * rendering/RenderTableCaption.h: * rendering/RenderTableCell.cpp: (WebCore::RenderTableCell::RenderTableCell): * rendering/RenderTableCell.h: (WebCore::RenderTableCell::colSpan): (WebCore::RenderTableCell::rowSpan): (WebCore::RenderTableCell::setCol): (WebCore::RenderTableCell::col): (WebCore::RenderTableCell::section): (WebCore::RenderTableCell::table): (WebCore::RenderTableCell::rowIndex): (WebCore::RenderTableCell::styleOrColLogicalWidth): (WebCore::RenderTableCell::logicalHeightForRowSizing): (WebCore::RenderTableCell::isBaselineAligned): (WebCore::RenderTableCell::borderAdjoiningTableStart): (WebCore::RenderTableCell::borderAdjoiningTableEnd): (WebCore::RenderTableCell::borderAdjoiningCellBefore): (WebCore::RenderTableCell::borderAdjoiningCellAfter): * rendering/RenderTableCol.cpp: (WebCore::RenderTableCol::RenderTableCol): * rendering/RenderTableCol.h: (WebCore::RenderTableCol::enclosingColumnGroupIfAdjacentBefore): (WebCore::RenderTableCol::enclosingColumnGroupIfAdjacentAfter): * rendering/RenderTableRow.h: (WebCore::RenderTableRow::setRowIndex): (WebCore::RenderTableRow::rowIndex): (WebCore::RenderTableRow::borderAdjoiningTableStart): (WebCore::RenderTableRow::borderAdjoiningTableEnd): (WebCore::RenderTableRow::table): (WebCore::RenderTableSection::firstRow): (WebCore::RenderTableSection::lastRow): * rendering/RenderTableSection.cpp: (WebCore::RenderTableSection::RenderTableSection): (WebCore::RenderTableSection::dirtiedRows): (WebCore::RenderTableSection::dirtiedColumns): (WebCore::RenderTableSection::paintObject): (WebCore::RenderTableSection::nodeAtPoint): * rendering/RenderTableSection.h: (WebCore::CellSpan::CellSpan): (WebCore::RenderTableSection::borderAdjoiningTableStart): (WebCore::RenderTableSection::borderAdjoiningTableEnd): (WebCore::RenderTableSection::cellAt): (WebCore::RenderTableSection::primaryCellAt): (WebCore::RenderTableSection::rowRendererAt): (WebCore::RenderTableSection::outerBorderLeft): (WebCore::RenderTableSection::outerBorderRight): (WebCore::RenderTableSection::outerBorderTop): (WebCore::RenderTableSection::outerBorderBottom): (WebCore::RenderTableSection::numRows): (WebCore::RenderTableSection::recalcCellsIfNeeded): (WebCore::RenderTableSection::rowBaseline): (WebCore::RenderTableSection::fullTableRowSpan): (WebCore::CellSpan::start): Deleted. (WebCore::CellSpan::end): Deleted. 2015-04-01 Carlos Alberto Lopez Perez [CMake][GTK] Use the right variable to include the Wayland headers. https://bugs.webkit.org/show_bug.cgi?id=143304 Reviewed by Carlos Garcia Campos. No new tests, no behavior changes. * PlatformGTK.cmake: Use the right variable WAYLAND_INCLUDE_DIRS. 2015-03-31 Said Abou-Hallawa border-image with 'fill' keyword does not fill the middle area unless the border width is greater than zero. https://bugs.webkit.org/show_bug.cgi?id=142650. Reviewed by Simon Fraser. The decoration of a RenderBox, a RenderTable or an InlineFlowBox should be drawn if its RenderStyle has a non-zero width border or the border-image has the keyword fill. Tests: fast/borders/border-image-fill-inline-no-border.html fast/borders/border-image-fill-no-border.html * rendering/InlineFlowBox.cpp: (WebCore::InlineFlowBox::paintBoxDecorations): * rendering/RenderBox.cpp: (WebCore::RenderBox::paintBoxDecorations): * rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::hasBoxDecorationStyle): * rendering/RenderTable.cpp: (WebCore::RenderTable::paintBoxDecorations): * rendering/style/BorderData.h: (WebCore::BorderData::hasFill): * rendering/style/RenderStyle.h: 2015-03-31 Beth Dakin REGRESSION (r173484): Reducing content of scrollable region does not reset scroll position https://bugs.webkit.org/show_bug.cgi?id=138525 -and corresponding- rdar://problem/18166043 Reviewed by Simon Fraser. The change that caused this regression was correct. That change does not allow RenderLayer to update scroll position after a layout if a rubber-band is currently happening. The change caused this regression because all of the member variables in ScrollController that attempt to keep track of the current state of the scroll gesture (m_inScrollGesture, m_momentumScrollInProgress, and m_snapRubberbandTimerIsActive) all indicated that a momentum scroll gesture was still in action for this div even though it very much is not when the bug happens. Those variables were never properly re-set because the PlatformWheelEventPhaseEnded events never got dispatched to the ScrollController, which brought the investigation back to Element. We must still dispatch events that have zero delta so that the default event handlers can handle them, but we should stopPropagation() so that these events are not sent to the DOM. Websites will break if they get wheel events with no delta. * dom/Element.cpp: (WebCore::Element::dispatchWheelEvent): 2015-03-29 Benjamin Poulain `currentColor` computes to the same colour on all elements, even if 'color' is inherited differently https://bugs.webkit.org/show_bug.cgi?id=133420 Reviewed by Darin Adler. When resolving a style with the help of the property cache, we were completely ignoring currentColor. Since you can set currentColor on properties that are not inherited, those properties would just be copied from the cached style, which may have a completely different inherited color. This pacth fixes the issue by preventing any MatchResult from hitting the cache if it contains any non-inherited property that would require resolution by the cache: -Using the inherit value. -Using the currentColor value. Tests: fast/css/currentColor-on-before-after-pseudo-elements.html fast/css/currentColor-style-update-reftest.html fast/css/currentColor-value-style-update.html * css/ElementRuleCollector.cpp: (WebCore::ElementRuleCollector::addElementStyleProperties): (WebCore::ElementRuleCollector::matchAuthorRules): (WebCore::ElementRuleCollector::matchUserRules): (WebCore::ElementRuleCollector::matchUARules): * css/StyleResolver.cpp: (WebCore::StyleResolver::MatchResult::addMatchedProperties): (WebCore::StyleResolver::styleForKeyframe): (WebCore::StyleResolver::pseudoStyleForElement): (WebCore::StyleResolver::styleForPage): (WebCore::StyleResolver::findFromMatchedPropertiesCache): (WebCore::StyleResolver::addToMatchedPropertiesCache): (WebCore::extractDirectionAndWritingMode): (WebCore::StyleResolver::applyMatchedProperties): (WebCore::StyleResolver::CascadedProperties::addStyleProperties): (WebCore::StyleResolver::CascadedProperties::addMatches): * css/StyleResolver.h: (WebCore::StyleResolver::MatchResult::matchedProperties): 2015-03-29 Darin Adler HTMLCollection caches incorrect length if item(0) is called before length on an empty collection https://bugs.webkit.org/show_bug.cgi?id=143203 rdar://problem/18460462 Reviewed by Antti Koivisto. Test: fast/dom/htmlcollection-length-after-item-2.html * dom/CollectionIndexCache.h: (CollectionIndexCache::nodeAt): If we hit the end looking for index 0, cache a length of 0, not a length of 1. 2015-03-28 Simon Fraser Optimize RenderLayer::intersectsDamageRect() slightly https://bugs.webkit.org/show_bug.cgi?id=143186 Reviewed by Zalan Bujtas. We can early return from RenderLayer::intersectsDamageRect() if the damageRect is empty, since nothing will intersect with the empty rect. Slight performance gain when scrolling overflow-scroll with lots of nested, clipping layers. * rendering/RenderLayer.cpp: (WebCore::RenderLayer::calculateClipRects): 2015-03-27 Jer Noble HTMLMediaElement will fire 'seeked' before seek completes, leading to currentTime discontinuities. https://bugs.webkit.org/show_bug.cgi?id=143132 Reviewed by Eric Carlson. When seeking, if the ready state rises to >= HAVE_CURRENT_DATA, we will fire the 'seeked' event and continue playback. However, if a media engine updates the ready state before its seek operation actually completes, the currentTime it returns may still be the time before the seek. Wait until both the ready state rises to HAVE_CURRENT_DATA and m_player->seeking() returns false before firing the 'seeked' event. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::parseAttribute): 2015-03-26 Geoffrey Garen Make some more objects use FastMalloc https://bugs.webkit.org/show_bug.cgi?id=143122 Reviewed by Csaba Osztrogonác. * Modules/geolocation/GeolocationController.h: * Modules/geolocation/NavigatorGeolocation.h: * Modules/indexeddb/DOMWindowIndexedDatabase.h: * Modules/notifications/NotificationController.h: * Modules/webdatabase/DatabaseServer.h: * css/CSSFontFaceSource.h: * html/HTMLMediaSession.h: * inspector/InspectorIndexedDBAgent.h: * inspector/InspectorReplayAgent.h: * page/CaptionUserPreferencesMediaAF.h: * page/PageConsoleClient.h: * page/PageDebuggable.h: * page/animation/CSSPropertyAnimation.cpp: * page/mac/ServicesOverlayController.h: * platform/RemoteCommandListener.h: * platform/Timer.h: * platform/audio/MediaSessionManager.h: * platform/mac/SystemSleepListenerMac.h: * platform/mac/ThemeMac.h: * rendering/svg/RenderSVGResourceSolidColor.h: * replay/ReplayController.h: 2015-03-27 Said Abou-Hallawa FEMorphology::platformApplyGeneric() should bail out if the radius is less than or equal to zero. https://bugs.webkit.org/show_bug.cgi?id=142885. Reviewed by Dean Jackson. FEMorphology class implementation code clean up. Tests: svg/filters/feMorphology-radius-cases.svg * platform/graphics/filters/FEMorphology.cpp: (WebCore::shouldSupersedeExtremum): Reuse code instead of repeating it and use < and > instead of =< and >=. (WebCore::pixelArrayIndex): Returns the array index of a pixel in an image buffer, given: position(x, y), image width and the color channel. (WebCore::columnExtremum): Returns the extremum of a column of pixels. (WebCore::kernelExtremum): Returns the extremum of a filter kernel. (WebCore::FEMorphology::platformApplyGeneric): Apply some code clean-up. The kernel size should be equal to radius of the filter. The extra pixel was causing the resulted image to be asymmetric in some cases. (WebCore::FEMorphology::platformApplyDegenerate): (WebCore::FEMorphology::platformApplySoftware): After applying scaling, we still need to check the resulted radius is negative (overflow case) or less than one (zero radius case) and treat these cases differently. (WebCore::FEMorphology::morphologyOperator): Deleted. (WebCore::FEMorphology::radiusX): Deleted. (WebCore::FEMorphology::radiusY): Deleted. * platform/graphics/filters/FEMorphology.h: (WebCore::FEMorphology::morphologyOperator): (WebCore::FEMorphology::radiusX): (WebCore::FEMorphology::radiusY): Move a single line functions from the source file to the header file. 2015-03-26 Myles C. Maxfield Crash when laying out (char)0 https://bugs.webkit.org/show_bug.cgi?id=143103 Reviewed by Dean Jackson. We currently cache a character -> Font mapping in a HashMap. However, keys in Hashmaps can't be 0. This patch simply skips the cache in this case. No new tests, for now. I'm having trouble creating a test because the site that causes this bug generates their page using script, and the script is all minified, and difficult to understand. I will contact the owner of the site and ask for and unminified version of their sources. However, I don't want to that to block this tiny fix from going in. * platform/graphics/Font.cpp: (WebCore::Font::systemFallbackFontForCharacter): 2015-03-24 Zhuo Li Scripts running in isolated world should not subject to a page's CSP about 'eval'. https://bugs.webkit.org/show_bug.cgi?id=141316. Reviewed by Geoffrey Garen. * bindings/js/ScriptController.cpp: (WebCore::ScriptController::initScript): We should not impose the main world Content Security Policy onto the isolated world. 2015-03-31 Carlos Garcia Campos [GTK] DnD icon/widget has odd background https://bugs.webkit.org/show_bug.cgi?id=143217 Reviewed by Martin Robinson. Remove DragIcon class since it's no longer needed with GTK+3 and the GTK+2 code there is unused. GTK+ knows what to do with a cairo surface, I guess we migrated the GTK+2 code to GTK+3 without realizing that using the surface was enough. * PlatformGTK.cmake: * platform/gtk/DragIcon.cpp: Removed. * platform/gtk/DragIcon.h: Removed. 2015-03-26 Zalan Bujtas Inline continuation code should not take anonymous containing wrapper granted. https://bugs.webkit.org/show_bug.cgi?id=133312 Reviewed by Dave Hyatt. It's wrong to assume that when RenderInline is part of an inline continuation, its containing block is an anonymous wrapper and its sibling might be a block level renderer. When the inline continuation is no longer needed, for example when the block level renderer that initiated the continuation is detached from the render tree, the inline renderes still continue to form continuation.(however they no longer require anonymous wrappers) Test: fast/inline/crash-when-position-property-is-changed-and-no-longer-in-continuation.html * rendering/RenderInline.cpp: (WebCore::updateStyleOfAnonymousBlockContinuations): (WebCore::RenderInline::styleDidChange): 2015-03-24 Yoav Weiss Stop image from displaying when src attribute is removed or emptied https://bugs.webkit.org/show_bug.cgi?id=142677 Reviewed by Chris Dumez. Previously, we ignored empty attribute as failed URL, and didn't update the renderer when an image was removed. This patch fixes that. Tests: fast/dom/HTMLImageElement/image-empty-src.html fast/dom/HTMLImageElement/image-remove-src.html * loader/ImageLoader.cpp: (WebCore::ImageLoader::updateFromElement): 2015-03-23 Yoav Weiss Update empty image canvas tests and fix a related bug https://bugs.webkit.org/show_bug.cgi?id=142694 Reviewed by Chris Dumez. During the work on https://bugs.webkit.org/show_bug.cgi?id=142677 we encountered an issue with canvas tests related to empty image handling when drawn or used as a pattern. After updating these tests, an issue with pattern handling was encountered. The spec, as well as Chrome's implementation, say that when an empty image is used as a pattern, createPattern should return null. See https://html.spec.whatwg.org/multipage/scripting.html#fill-and-stroke-styles:check-the-usability-of-the-image-argument Instead, createPattern returned an exception in this case. This patch fixes that and makes sure that it returns a null when image loading hasn't started. Tests: canvas/philip/tests/2d.drawImage.incomplete.emptysrc.html canvas/philip/tests/2d.drawImage.incomplete.nosrc.html canvas/philip/tests/2d.drawImage.incomplete.removedsrc.html canvas/philip/tests/2d.pattern.image.incomplete.emptysrc.html canvas/philip/tests/2d.pattern.image.incomplete.removedsrc.html * html/canvas/CanvasRenderingContext2D.cpp: (WebCore::CanvasRenderingContext2D::createPattern): Return "null" if image is not fully decodeable. 2015-03-20 Yusuke Suzuki REGRESSION (r179429): Potential Use after free in JavaScriptCore`WTF::StringImpl::ref + 83 https://bugs.webkit.org/show_bug.cgi?id=142410 Reviewed by Geoffrey Garen. The same issues are found in the existing code; PropertyName does not have ownership. This patch rewrite the point that should have ownership to Identifier. * bindings/js/JSDOMWindowCustom.cpp: (WebCore::JSDOMWindow::getOwnPropertySlotByIndex): (WebCore::JSDOMWindow::putByIndex): * bindings/js/ReadableStreamJSSource.cpp: (WebCore::getInternalSlotFromObject): * bindings/scripts/CodeGeneratorJS.pm: (GenerateImplementation): * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp: (WebCore::JSTestCustomNamedGetter::getOwnPropertySlotByIndex): * bindings/scripts/test/JS/JSTestEventTarget.cpp: (WebCore::JSTestEventTarget::getOwnPropertySlotByIndex): * bindings/scripts/test/JS/JSTestInterface.cpp: (WebCore::JSTestInterface::putByIndex): 2015-03-19 Enrica Casucci REGRESSION (r109593): Clicking after last inline element could cause a crash. https://bugs.webkit.org/show_bug.cgi?id=142880 rdar://problem/17222294 Reviewed by Ryosuke Niwa. Test: editing/selection/click-after-last-inline-crash.html * rendering/RootInlineBox.cpp: (WebCore::RootInlineBox::closestLeafChildForLogicalLeftPosition): 2015-03-18 Manuel Rego Casasnovas Unreviewed. GTK build fix after r181720. * rendering/RenderImage.cpp: (WebCore::RenderImage::styleDidChange): 2015-03-18 Said Abou-Hallawa Switching between two SVG images with no intrinsic sizes causes them to get the default SVG size instead of the container size. https://bugs.webkit.org/show_bug.cgi?id=142805. Reviewed by Darin Adler. The bug happens due to wrong logic in RenderImage::imageDimensionsChanged(). This function decides to setNeedsLayout() if the intrinsic size of the image changes. If the size does not change, it only repaints the image rectangle. When switching the src of the an image between two SVG images and both of them have no intrinsic size, we do not updateInnerContentRect() and this means an SVGImageForContainer is not going to be created for this image. When the image is drawn, it is drawn directly from the SVGImage. And this means the drawing has to be scaled by container_size / SVG_default_intrinsic_size After figuring out that I need to updateInnerContentRect() to fix this bug, I found out Blink has already changed this code to do the same thing. But they also did more clean-up in this function. Here is the link https://codereview.chromium.org/114323004. I think their change seems correct although they did not say what exactly they were trying to fix. The plan for repaintOrMarkForLayout(), which is the new name of this function, is the following: -- setNeedLayout() if the intrinsic size changes and it affects the size of the image. -- updateInnerContentRect() if the intrinsic size did not change but the image has exiting layout. -- repaint the image rectangle if layout is not needed. This change also removes the call to computeLogicalWidthInRegion(), which is almost running a layout for the image. This call figures out whether the image needs to setNeedsLayout(). This call is unnecessary; the image needs to run a layout if the intrinsic size has changed and it affects the size of the image. Test: svg/as-image/svg-no-intrinsic-size-switching.html * rendering/RenderImage.cpp: (WebCore::RenderImage::styleDidChange): Change the function call. (WebCore::RenderImage::imageChanged): Rename local variable and change the function call. (WebCore::RenderImage::updateIntrinsicSizeIfNeeded): Simplify this function. Call setIntrinsicSize() with the new size unless the image is in error state. (WebCore::RenderImage::repaintOrMarkForLayout): This a better name for this function since it is called even if the intrinsic size was not changed. (WebCore::RenderImage::imageDimensionsChanged): Deleted. * rendering/RenderImage.h: Rename imageDimensionsChanged() and change the updateIntrinsicSizeIfNeeded() to return void. * rendering/svg/RenderSVGForeignObject.cpp: (WebCore::RenderSVGForeignObject::paint): Code cleanup. This function can only handle the paint phases PaintPhaseForeground and PaintPhaseSelection. Use this information to simplify the logic and order of painting there. 2015-03-18 Simon Fraser Avoid repaints when changing transform on an element with multiple background images https://bugs.webkit.org/show_bug.cgi?id=142841 Reviewed by Zalan Bujtas. Replace the cheap test for changed images in RenderElement::updateFillImages() with an exhaustive test that walks the entire list of background images, since any ensuing repaint is way more expensive than a slightly more expensive check here. Test: fast/repaint/multiple-backgrounds-style-change.html * rendering/RenderElement.cpp: (WebCore::RenderElement::updateFillImages): * rendering/style/FillLayer.cpp: (WebCore::layerImagesIdentical): See if both images are the same (either none or both mask images, and same image pointer). (WebCore::FillLayer::imagesIdentical): Walk the two FillLayer lists, checking the images on each one. Returns false if we reach the end of one list before the other, or the images are different. * rendering/style/FillLayer.h: New static function; static because it compares two FillLayer lists, and I think that makes more sense than a member function. 2015-03-18 Anders Carlsson Pass cookies by reference in CookieHash functions https://bugs.webkit.org/show_bug.cgi?id=142839 Reviewed by Sam Weinig. * platform/Cookie.h: (WebCore::CookieHash::hash): (WebCore::CookieHash::equal): 2015-03-18 Manuel Rego Casasnovas Flex and grid items should be painted as inline-blocks https://bugs.webkit.org/show_bug.cgi?id=142266 Reviewed by Darin Adler. Based on Blink r157004 by . https://src.chromium.org/viewvc/blink?revision=157004&view=revision Both flexbox and grid specs define that the painting order of flex/grid items is the same as inline blocks. See http://dev.w3.org/csswg/css-flexbox/#painting and http://dev.w3.org/csswg/css-grid/#z-order. Extracted inline blocks painting code from InlineElementBox and moved to a helper method that will be reused for flexboxes and grids. Tests: css3/flexbox/flex-item-text-background-not-interleaved.html fast/css-grid-layout/grid-item-text-background-not-interleaved.html * rendering/InlineElementBox.cpp: (WebCore::InlineElementBox::paint): Move code to RenderElement::paintAsInlineBlock(). * rendering/RenderBlock.cpp: (WebCore::RenderBlock::paintChild): Add new argument to paint children as inline blocks. * rendering/RenderBlock.h: Define PaintType enmu and modify paintChild() signature to add the new argument. * rendering/RenderElement.cpp: (WebCore::paintPhase): Paint element in a phase. (WebCore::RenderElement::paintAsInlineBlock): Code extracted from InlineElementBox::paint(). * rendering/RenderElement.h: Add new method signature. * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::paintChildren): Call RenderBlock::paintChild() with the new argument. * rendering/RenderGrid.cpp: (WebCore::RenderGrid::paintChildren): Ditto. 2015-03-20 Carlos Garcia Campos [GTK] Crash due to empty drag image during drag-and-drop https://bugs.webkit.org/show_bug.cgi?id=142671 Reviewed by Philippe Normand. Return early from ImageBuffer constructor if an empty size is given. This is a speculative fix for a crash while starting a drag and drop operation, that I haven't been able to reproduce. * platform/graphics/cairo/ImageBufferCairo.cpp: (WebCore::ImageBuffer::ImageBuffer): 2015-03-19 Carlos Garcia Campos [GTK] Scrollbars look bad with GTK+ 3.16 https://bugs.webkit.org/show_bug.cgi?id=140800 Reviewed by Sergio Villar Senin. Take margin into account when rendering scrollbars. This fixes the huge scrollbars rendered with GTK+ 3.16. We don't need to check the GTK+ version because in previous versions the marging were 0, so the same code just works. * platform/gtk/ScrollbarThemeGtk.cpp: (WebCore::adjustRectAccordingToMargin): (WebCore::ScrollbarThemeGtk::paintTrackBackground): (WebCore::ScrollbarThemeGtk::paintThumb): 2015-03-17 Carlos Garcia Campos [GTK] Wrong transfer annotations used in GObject DOM bindings https://bugs.webkit.org/show_bug.cgi?id=142780 Reviewed by Gustavo Noronha Silva. We are using transfer none for all methods returning a GObject DOM Object. That's not true. Only objects derived from Node are automatically released by the DOM object cache and can be transfer none. All other objects are added to the cache only to avoid creating the same wrapper twice for the same core object, but caller should release the returned reference. * bindings/gobject/WebKitDOMCustomUnstable.h: * bindings/scripts/CodeGeneratorGObject.pm: (GetTransferTypeForReturnType): (GenerateFunction): 2015-03-17 Carlos Garcia Campos [GTK] WebKitDOM objects leaking https://bugs.webkit.org/show_bug.cgi?id=118788 Reviewed by Darin Adler and Sergio Villar Senin. Use a DOMwindowObserver class, derived from DOMWindowProperty to be notified when the window object is detached from the frame to clear the DOM objects associated to that frame in that case too. * bindings/gobject/DOMObjectCache.cpp: 2015-03-17 Zan Dobersek [CMake] Use a forwarding header for ANGLE's ShaderLang.h to avoid picking up ANGLE's EGL headers https://bugs.webkit.org/show_bug.cgi?id=142530 Reviewed by Darin Adler. Include the ANGLE's ShaderLang.h through the new forwarding header. This allows us to not list Source/ThirdParty/ANGLE/include in the list of inclusion directories and thus avoid ANGLE's EGL and GLES2/GLES3 headers, defaulting to the system-provided headers instead. Source/ThirdParty/ANGLE/include/KHR is still used because ANGLE's khrplatform.h is required by the ShaderLang.h header. Source/ThirdParty/ANGLE/src is not used for the whole WebCore library anymore, only the ANGLESupport library. * CMakeLists.txt: * platform/graphics/ANGLEWebKitBridge.h: * platform/graphics/cairo/GraphicsContext3DCairo.cpp: 2015-03-16 Joanmarie Diggs AX: Crash viewing http://www.last.fm/ https://bugs.webkit.org/show_bug.cgi?id=142309 Reviewed by Chris Fleizach. The crash occurs when a not-yet-rendered object emits a children-changed signal. If an assistive technology is listening, AT-SPI2 will attempt to create and cache the state set for the child being added and the creation of the state set assumes a rendered object. Test: platform/gtk/accessibility/no-notification-for-unrendered-iframe-children.html * accessibility/atk/AXObjectCacheAtk.cpp: (WebCore::AXObjectCache::attachWrapper): 2015-03-16 Brady Eidson Addressing additional review feedback after http://trac.webkit.org/changeset/181565 https://bugs.webkit.org/show_bug.cgi?id=142604 Reviewed by Darin Adler. * loader/icon/IconController.cpp: (WebCore::IconController::startLoader): Null check page() 2015-03-16 Brady Eidson URLs visited during private browsing show up in WebpageIcons.db rdar://problem/11254910 and https://bugs.webkit.org/show_bug.cgi?id=142733 Patch by Sam Weinig. Reviewed by Brady Eidson. * loader/icon/IconController.cpp: (WebCore::IconController::startLoader): Bail early here if the page is using an ephemeral session. (WebCore::IconController::continueLoadWithDecision): Instead of here. 2015-03-16 Max Stepin Add APNG support https://bugs.webkit.org/show_bug.cgi?id=17022 Reviewed by Carlos Garcia Campos. Test: fast/images/animated-png.html * platform/image-decoders/ImageDecoder.h: (WebCore::ImageFrame::divide255): (WebCore::ImageFrame::overRGBA): * platform/image-decoders/png/PNGImageDecoder.cpp: (WebCore::frameHeader): (WebCore::readChunks): (WebCore::PNGImageReader::PNGImageReader): (WebCore::PNGImageDecoder::PNGImageDecoder): (WebCore::PNGImageDecoder::frameBufferAtIndex): (WebCore::PNGImageDecoder::headerAvailable): (WebCore::PNGImageDecoder::rowAvailable): (WebCore::PNGImageDecoder::pngComplete): (WebCore::PNGImageDecoder::readChunks): (WebCore::PNGImageDecoder::frameHeader): (WebCore::PNGImageDecoder::init): (WebCore::PNGImageDecoder::clearFrameBufferCache): (WebCore::PNGImageDecoder::initFrameBuffer): (WebCore::PNGImageDecoder::frameComplete): (WebCore::PNGImageDecoder::processingStart): (WebCore::PNGImageDecoder::processingFinish): (WebCore::PNGImageDecoder::fallbackNotAnimated): * platform/image-decoders/png/PNGImageDecoder.h: (WebCore::PNGImageDecoder::frameCount): (WebCore::PNGImageDecoder::repetitionCount): (WebCore::PNGImageDecoder::isComplete): 2015-03-15 Simon Fraser Remove a redundant repaint when a layer becomes composited https://bugs.webkit.org/show_bug.cgi?id=142711 Reviewed by Anders Carlsson. RenderLayerCompositor::computeCompositingRequirements() doesn't need to call repaintOnCompositingChange() when a layer is going to become composited, because updateBacking() does exactly the same thing. I used an assertion and ran the tests to ensure this wasn't a behavior change. * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::computeCompositingRequirements): 2015-03-14 Adenilson Cavalcanti RenderBlock::imageChange() calling const methods on exit https://bugs.webkit.org/show_bug.cgi?id=142648 Reviewed by Brent Fulgham. No new tests, no change on behavior. * rendering/RenderBlock.cpp: (WebCore::RenderBlock::imageChanged): Deleted. * rendering/RenderBlock.h: 2015-03-13 Joonghun Park Fix Debug build error 'comparison is always true due to limited range of data type [-Werror=type-limits]' https://bugs.webkit.org/show_bug.cgi?id=142652 Reviewed by Csaba Osztrogonác. No new tests, no behavior changes. Now CSSPropertyID type is uint16_t, so propertyID >= 0 check is needed no more. * css/CSSPrimitiveValue.cpp: (WebCore::propertyName): * css/makeprop.pl: 2015-03-12 Sebastian Dröge Stop using single-include headers that are only available since GStreamer >= 1.2. https://bugs.webkit.org/show_bug.cgi?id=142537 Reviewed by Philippe Normand. * platform/audio/gstreamer/AudioDestinationGStreamer.cpp: * platform/audio/gstreamer/AudioFileReaderGStreamer.cpp: * platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp: * platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp: * platform/graphics/gstreamer/GStreamerUtilities.cpp: * platform/graphics/gstreamer/GStreamerUtilities.h: * platform/graphics/gstreamer/ImageGStreamer.h: Instead of using single-include headers for the GStreamer libraries, directly include the headers we need. The single-include headers were only added in 1.2, and this would be the only reason why we would depend on 1.2. 2015-03-11 Geoffrey Garen Users of Heap::deprecatedReportExtraMemory should switch to reportExtraMemoryAllocated+reportExtraMemoryVisited https://bugs.webkit.org/show_bug.cgi?id=142595 Reviewed by Andreas Kling. Fixed this bug for canvas. * html/HTMLCanvasElement.cpp: (WebCore::HTMLCanvasElement::memoryCost): Factored out the helper function required by our IDL generator. (WebCore::HTMLCanvasElement::createImageBuffer): Use reportExtraMemoryAllocated. * html/HTMLCanvasElement.h: * html/HTMLCanvasElement.idl: Adopt the IDL for reporting cost in the right way during GC. This will match our reportExtraMemoryAllocated with a reportExtraMemoryVisited during GC. 2015-03-11 Commit Queue Unreviewed, rolling out r179340 and r179344. https://bugs.webkit.org/show_bug.cgi?id=142598 Caused images to stay alive forever when navigating away from the page before they finish loading. (Requested by kling on #webkit). Reverted changesets: "CachedImage: ensure clients overrides imageChanged instead of notifyFinished" https://bugs.webkit.org/show_bug.cgi?id=140722 http://trac.webkit.org/changeset/179340 "HTMLImageLoader: fix build failure on assert condition after r179340" https://bugs.webkit.org/show_bug.cgi?id=140722 http://trac.webkit.org/changeset/179344 2015-03-12 Geoffrey Garen REGRESSION: Crash under Heap::reportExtraMemoryAllocatedSlowCase for media element https://bugs.webkit.org/show_bug.cgi?id=142636 Reviewed by Mark Hahnenberg. This was a pre-existing bug that I made a lot worse in . * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::parseAttribute): Compare size before subtracting rather than subtracting and then comparing to zero. The latter technique is not valid for unsigned integers, which will happily underflow into giant numbers. * Modules/mediasource/SourceBuffer.cpp: (WebCore::SourceBuffer::reportExtraMemoryAllocated): This code was technically correct, but I took the opportunity to clean it up a bit. There's no need to do two checks here, and it smells bad to check for a negative unsigned integer. 2015-03-11 Geoffrey Garen Many users of Heap::reportExtraMemory* are wrong, causing lots of memory growth https://bugs.webkit.org/show_bug.cgi?id=142593 Reviewed by Andreas Kling. Adopt deprecatedReportExtraMemory as a short-term fix for runaway memory growth in these cases where we have not adopted reportExtraMemoryVisited. Long-term, we should use reportExtraMemoryAllocated+reportExtraMemoryVisited. That's tracked by https://bugs.webkit.org/show_bug.cgi?id=142595. Using IOSDebug, I can see that the canvas stress test @ http://jsfiddle.net/fvyw4ba0/, which used to keep > 1000 1MB NonVolatile GPU allocations live, now keeps about 10 live. * Modules/mediasource/SourceBuffer.cpp: (WebCore::SourceBuffer::reportExtraMemoryAllocated): * bindings/js/JSDocumentCustom.cpp: (WebCore::toJS): * bindings/js/JSImageDataCustom.cpp: (WebCore::toJS): * bindings/js/JSNodeListCustom.cpp: (WebCore::createWrapper): * dom/CollectionIndexCache.cpp: (WebCore::reportExtraMemoryAllocatedForCollectionIndexCache): * html/HTMLCanvasElement.cpp: (WebCore::HTMLCanvasElement::createImageBuffer): * html/HTMLImageLoader.cpp: (WebCore::HTMLImageLoader::imageChanged): * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::parseAttribute): * xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::dropProtection): 2015-03-11 Geoffrey Garen Refactored the JSC::Heap extra cost API for clarity and to make some known bugs more obvious https://bugs.webkit.org/show_bug.cgi?id=142589 Reviewed by Andreas Kling. Updated for renames to JSC extra cost APIs. Added FIXMEs to our 10 use cases that are currently wrong, including canvas, which is the cause of https://bugs.webkit.org/show_bug.cgi?id=142457. * Modules/mediasource/SourceBuffer.cpp: (WebCore::SourceBuffer::appendBufferInternal): (WebCore::SourceBuffer::sourceBufferPrivateAppendComplete): (WebCore::SourceBuffer::reportExtraMemoryAllocated): (WebCore::SourceBuffer::reportExtraMemoryCost): Deleted. * Modules/mediasource/SourceBuffer.h: * bindings/js/JSDocumentCustom.cpp: (WebCore::toJS): * bindings/js/JSImageDataCustom.cpp: (WebCore::toJS): * bindings/js/JSNodeListCustom.cpp: (WebCore::createWrapper): * bindings/scripts/CodeGeneratorJS.pm: (GenerateImplementation): * dom/CollectionIndexCache.cpp: (WebCore::reportExtraMemoryAllocatedForCollectionIndexCache): (WebCore::reportExtraMemoryCostForCollectionIndexCache): Deleted. * dom/CollectionIndexCache.h: (WebCore::Iterator>::computeNodeCountUpdatingListCache): * html/HTMLCanvasElement.cpp: (WebCore::HTMLCanvasElement::createImageBuffer): * html/HTMLCollection.h: (WebCore::CollectionNamedElementCache::didPopulate): * html/HTMLImageLoader.cpp: (WebCore::HTMLImageLoader::imageChanged): * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::parseAttribute): * xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::dropProtection): 2015-03-11 Myles C. Maxfield Inline block children do not have correct baselines if their children are also block elements https://bugs.webkit.org/show_bug.cgi?id=142559 Reviewed by Darin Adler. Perform the same computation on child block elements as child inline elements. Test: fast/text/baseline-inline-block-block-children.html * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::inlineBlockBaseline): 2015-03-11 Carlos Alberto Lopez Perez [CMake][GStreamer] Building EFL or GTK with ENABLE_VIDEO and without ENABLE_WEB_AUDIO is broken. https://bugs.webkit.org/show_bug.cgi?id=142577 Reviewed by Carlos Garcia Campos. No new tests, this is a build fix. * PlatformEfl.cmake: Include GSTREAMER_AUDIO_LIBRARIES on the link step both for ENABLE_VIDEO and ENABLE_WEB_AUDIO. * PlatformGTK.cmake: Idem. 2015-03-10 Carlos Garcia Campos [GTK] GL_MAX_VARYING_FLOATS is not defined in OpenGL ES 2 https://bugs.webkit.org/show_bug.cgi?id=142529 Reviewed by Žan Doberšek. Do not use GL_MAX_VARYING_FLOATS when platform is GTK+ and using OpenGL ES 2. * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp: (WebCore::GraphicsContext3D::checkVaryingsPacking): 2015-03-10 José Dapena Paz Unreviewed. Fix GTK+ build with OpenGL ES 2 enabled. Remove USE(OPENGL) ifdef from GLContext.cpp, since there's nothing specific to OpenGL in that file, and everything depending on configure options is already protected by USE(GLX) and USE(EGL) ifdefs. This is causing linking issues when building with OpenGL ES 2, because the header doesn't have the ifdef, and the cpp file is not compiled leaving all the interface undefined. Rubber-stamped by Carlos Garcia Campos. * platform/graphics/GLContext.cpp: 2015-03-10 Carlos Garcia Campos and José Dapena Paz [GTK] Add a configure option to build with OpenGL ES 2 https://bugs.webkit.org/show_bug.cgi?id=142498 Reviewed by Martin Robinson. Build GLES or GL specific files depending on the build options. * PlatformGTK.cmake: 2015-03-10 Zan Dobersek Shrink the CSSPropertyID enum type https://bugs.webkit.org/show_bug.cgi?id=142456 Reviewed by Sam Weinig. Specify uint16_t as the base type for the CSSPropertyID enum. This is enough to cover all of the CSS properties (429 at this moment, with static_assert covering future changes). It halves the enum type size, from 4 bytes to 2, reducing the size of various CSSPropertyID containers. No new tests -- no change in behavior. * css/CSSPrimitiveValue.cpp: (WebCore::propertyName): Remove the unnecessary propertyID < 0 check. * css/makeprop.pl: 2015-03-09 Myles C. Maxfield REGRESSION(r176978): Inline-blocks with overflowing contents have ascents that are too large https://bugs.webkit.org/show_bug.cgi?id=141783 Reviewed by David Hyatt. When we have an inline-block element, and we want to find its baseline (to lay out other elements on the same line) we loop through the element's children and ask them what their baselines are. The children use the location of the top of their last line to compute this value. However, if the child has overflow-y, this might not be the correct calculation. This behavior is in the spec: "The baseline of an 'inline-block' is the baseline of its last line box in the normal flow, unless it has either no in-flow line boxes or if its 'overflow' property has a computed value other than 'visible', in which case the baseline is the bottom margin edge." -- http://www.w3.org/TR/CSS21/visudet.html#leading However, we believe that a better policy is, when overflow is not "visible," to place the baseline at the bottom of the block if the contents overflowed in the Y direction, and to place it at the bottom of the last line if the contents did not overflow in the Y direction. This is partially consistent with previous behavior, and isn't too far from the spec to cause too many breakages. Test: fast/css/inline-block-tricky-baselines.html fast/text/baseline-inline-block.html * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::inlineBlockBaseline): 2015-03-08 Chris Dumez Crash in WebCore::NotificationCenter::stop() https://bugs.webkit.org/show_bug.cgi?id=142444 Reviewed by Darin Adler. Rework the patch in r181219 so that we do not need a Ref protector in NotificationCenter::stop(). Instead, we put the client in a local variable and null out m_client *before* calling NotificationClient::clearNotifications(). No new tests, already covered by: http/tests/notifications/event-listener-crash.html * Modules/notifications/NotificationCenter.cpp: (WebCore::NotificationCenter::stop): 2015-03-07 Chris Dumez Crash in WebCore::NotificationCenter::stop() https://bugs.webkit.org/show_bug.cgi?id=142444 Reviewed by Andreas Kling. A use-after-free would sometimes cause us to crash in NotificationCenter::stop(). After investigation, it turns out that NotificationCenter::stop() calls NotificationClient::clearNotifications() which will destroy the Notification objects, all of which hold a strong reference to the NotificationCenter. If at this point, only Notifications are ref'ing the NotificationCenter, this means that the NotificationCenter will get destroyed right after the call to NotificationClient::clearNotifications(). However, we reset m_client to null after calling clearNotifications() and it causes us to crash in this case. The issue is addressed by adding a Ref protector in NotificationCenter::stop() so that we make sure the NotificationCenter lives at least until the end of the method execution. I was able to consistently reproduce the crash by doing: Tools/Scripts/run-webkit-tests -1 --debug --repeat-each=30 -g http/tests/notifications/event-listener-crash.html No new tests, already covered by: http/tests/notifications/event-listener-crash.html * Modules/notifications/NotificationCenter.cpp: (WebCore::NotificationCenter::stop): 2015-03-06 Brent Fulgham Setting scroll-snap-desination to (100% 100%) locks up WebKit https://bugs.webkit.org/show_bug.cgi?id=142414 Reviewed by Dean Jackson. Tested by css3/scroll-snap/scroll-snap-desination-lock-up.html. Correct an infinite loop that is triggered when you combine a repeating (100%) scroll-snap-point-{x,y} along with a 100% scroll-snap-destination value. * page/scrolling/AxisScrollSnapOffsets.cpp: (WebCore::updateFromStyle): Make sure we break out of the loop properly when the scroll-snap-point-{x,y} step is the same as the scroll-snap-destination. 2015-03-05 Chris Dumez Document::recalcStyle() shouldn't call viewportContentsChanged() if there is a pending layout https://bugs.webkit.org/show_bug.cgi?id=142140 Reviewed by Darin Adler. Stop calling FrameView::viewportContentsChanged() in Document::recalcStyle() if there is a layout pending to avoid doing unncessary work. If there is a layout pending, we don't need to do anything because viewportContentsChanged() will be called after layout. We only need to call FrameView::viewportContentsChanged() in Document::recalcStyle() if a style recalc does not cause a layout. For e.g. a '-webkit-transform' could make an animated GIF visible without causing a layout, in which case we need to resume the animated GIF after style recalc. No new tests, already covered by: fast/images/animated-gif-webkit-transform.html * dom/Document.cpp: (WebCore::Document::recalcStyle): 2015-03-05 Commit Queue Unreviewed, rolling out r180846. https://bugs.webkit.org/show_bug.cgi?id=142368 Caused missing image banners in iTunes store pages (Requested by smfr on #webkit). Reverted changeset: "FrameView::layoutTimerFired() should update style if needed before doing layout" https://bugs.webkit.org/show_bug.cgi?id=141688 http://trac.webkit.org/changeset/180846 2015-03-05 Sandy Perez Fix the build when NEON_INTRINSICS is enabled https://bugs.webkit.org/show_bug.cgi?id=142361 Reviewed by Csaba Osztrogonác. * platform/graphics/cpu/arm/filters/FEBlendNEON.h: (WebCore::FEBlend::platformApplySoftware): * platform/graphics/filters/FEGaussianBlur.cpp: (WebCore::standardBoxBlur): 2015-03-05 Carlos Garcia Campos [SOUP] Check TLS errors as soon as they are set in the SoupMessage https://bugs.webkit.org/show_bug.cgi?id=142244 Reviewed by Sergio Villar Senin. Connect to the notify::tls-errors signal of SoupMessage to cancel the load earlier in case of TLS failure, preventing any private data from being sent to the server before the TLS errors are checked. * platform/network/soup/ResourceHandleSoup.cpp: (WebCore::tlsErrorsChangedCallback): (WebCore::gotHeadersCallback): (WebCore::createSoupMessageForHandleAndRequest): 2015-03-05 Grzegorz Czajkowski TextCheckingParagraph::isEmpty() is sufficient to check whether paragraph is empty https://bugs.webkit.org/show_bug.cgi?id=142276 Reviewed by Darin Adler. TextCheckingParagraph::isEmpty() already calls TextCheckingParagraph::isRangeEmpty(). There is no need to call them both at the caller site. No new tests. No behavior change. * editing/Editor.cpp: (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges): Update caller site. * editing/TextCheckingHelper.cpp: (WebCore::TextCheckingParagraph::isEmpty): Avoid using helepers here to get rid of them as they are no longer needed outside TextCheckingParagraph. * editing/TextCheckingHelper.h: (WebCore::TextCheckingParagraph::isTextEmpty): Deleted. (WebCore::TextCheckingParagraph::isRangeEmpty): Deleted. Do not expose isTextEmpty() and isRangeEmpty(). 2015-03-04 Dean Jackson REGRESSION (r179597): Can't see power saver banner for plugins https://bugs.webkit.org/show_bug.cgi?id=142312 Reviewed by Brent Fulgham. We were being a bit too restrictive when deciding a child should not create a renderer. All shadow root children of the snapshotted plugin need one. * html/HTMLPlugInImageElement.cpp: (WebCore::HTMLPlugInImageElement::childShouldCreateRenderer): Test if we're part of the shadow tree. 2015-03-04 Philippe Normand [GStreamer] the GST_SCHEDULING_FLAG_BANDWIDTH_LIMITED should be wrapped by a ifdef https://bugs.webkit.org/show_bug.cgi?id=142274 Reviewed by Carlos Garcia Campos. Don't handle scheduling queries if building against versions of GStreamer older than 1.2.0. * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp: (webKitWebSrcQueryWithParent): 2015-03-06 Said Abou-Hallawa Setting any of the element plugin controlling attributes does not have any affect. https://bugs.webkit.org/show_bug.cgi?id=141936. Reviewed by Simon Fraser. When setting any of the element plugin controlling attributes dynamically we need to mark the the element to be dirty by calling setNeedsStyleRecalc(), so it has to recreate its renderer when needed. Tests: fast/css/image-object-hover-inherit.html svg/as-object/svg-in-object-dynamic-attribute-change.html * dom/Element.h: Delete unimplemented function. * html/HTMLObjectElement.cpp: (WebCore::HTMLObjectElement::parseAttribute): Mark the element dirty by calling setNeedsStyleRecalc() when one of the plugin controlling attributes gets changed. We have to clear m_useFallbackContent because the attribute's new value might fix the object rendering. * html/HTMLObjectElement.h: Add a function to clear m_useFallbackContent. 2015-03-03 Commit Queue Unreviewed, rolling out r180683. https://bugs.webkit.org/show_bug.cgi?id=142249 Broke fast/css/acid2-pixel.html (Requested by ap on #webkit). Reverted changeset: "Setting any of the element plugin controlling attributes does not have any affect." https://bugs.webkit.org/show_bug.cgi?id=141936 http://trac.webkit.org/changeset/180683 2015-03-02 Carlos Garcia Campos [SOUP] Use SoupMessage::starting instead of SoupSession::request-started https://bugs.webkit.org/show_bug.cgi?id=142164 Reviewed by Sergio Villar Senin. SoupSession::request-started is deprecated in libsoup 2.50. Both signals are equivalent, but SoupMessage::starting is also emitted for resources loaded from the disk cache. This fixes web timing calculations for cached resources, since we were not initializing m_requestStart. * platform/network/soup/ResourceHandleSoup.cpp: (WebCore::startingCallback): (WebCore::createSoupMessageForHandleAndRequest): * platform/network/soup/SoupNetworkSession.cpp: (WebCore::SoupNetworkSession::SoupNetworkSession): 2015-03-03 Carlos Garcia Campos [SOUP] Synchronous XMLHttpRequests can time out when we reach the max connections limit https://bugs.webkit.org/show_bug.cgi?id=141508 Reviewed by Sergio Villar Senin. Use SOUP_MESSAGE_IGNORE_CONNECTION_LIMITS flag when loading a synchronous message instead of increasing the maximum number of connections allowed if the soup version is recent enough. The current solution of increasing/decreasing the limits doesn't always work, because connections are not marked as IDLE in libsoup until the message is unqueued, but we don't wait for the message to be unqueued to finish our loads in WebKit, we finish them as soon as we have finished reading the stream. This causes that synchronous loads keep blocked in the nested main loop until the timeout of 10 seconds is fired and the load fails. Also marked WebCoreSynchronousLoader class as final, the virtual methods as override and removed the unsused method isSynchronousClient. * platform/network/soup/ResourceHandleSoup.cpp: (WebCore::createSoupMessageForHandleAndRequest): (WebCore::WebCoreSynchronousLoader::WebCoreSynchronousLoader): (WebCore::WebCoreSynchronousLoader::isSynchronousClient): Deleted. (WebCore::WebCoreSynchronousLoader::didReceiveResponse): (WebCore::WebCoreSynchronousLoader::didReceiveData): (WebCore::WebCoreSynchronousLoader::didReceiveBuffer): (WebCore::WebCoreSynchronousLoader::didFinishLoading): (WebCore::WebCoreSynchronousLoader::didFail): (WebCore::WebCoreSynchronousLoader::didReceiveAuthenticationChallenge): (WebCore::WebCoreSynchronousLoader::shouldUseCredentialStorage): 2015-02-28 Simon Fraser FrameView::layoutTimerFired() should update style if needed before doing layout https://bugs.webkit.org/show_bug.cgi?id=141688 Reviewed by Andreas Kling. If the style recalc timer has been scheduled to fire after the layout timer, when the layout timer fires, we might as well just do the style recalc too. The call to updateStyleIfNeeded() will cancel the pending style recalc timer. This doesn't have much impact on the number of layouts (measured via PLT) but seems like a reasonable thing to do. * page/FrameView.cpp: (WebCore::FrameView::layoutTimerFired): 2015-02-27 Andreas Kling Use NeverDestroyed for JS wrapper owners. Reviewed by Chris Dumez. Using NeverDestroyed puts these objects in BSS which is preferable since that prevents them from pinning down entire malloc pages forever. * bindings/scripts/CodeGeneratorJS.pm: (GenerateHeader): Use NeverDestroyed instead of DEPRECATED_DEFINE_STATIC_LOCAL. * bindings/scripts/test/JS/*: Rebaseline bindings tests for this change. 2015-02-27 Zalan Bujtas Use after free in WebCore::RenderNamedFlowFragment::restoreRegionObjectsOriginalStyle https://bugs.webkit.org/show_bug.cgi?id=138366 Reviewed by Dave Hyatt. This patch ensures that we clean up RenderNamedFlowFragment::m_renderObjectRegionStyle when embedded flow content is getting destroyed. In m_renderObjectRegionStyle hash map, we store style information about the named flow's descendant children. When a child is being detached from the tree, it removes itself from this hashmap. We do it by traversing up on the ancestor chain and call removeFlowChildInfo() on the parent flow. However in case of embedded flows (for example multicolumn content inside a region), we need to check whether the parent flow is inside a flow too and continue the cleanup accordingly. Test: fast/regions/region-with-multicolumn-embedded-crash.html * rendering/RenderObject.cpp: (WebCore::RenderObject::removeFromRenderFlowThreadIncludingDescendants): 2015-02-26 Said Abou-Hallawa Setting any of the element plugin controlling attributes does not have any affect. https://bugs.webkit.org/show_bug.cgi?id=141936. Reviewed by Zalan Bujtas. When setting any of the element plugin controlling attributes dynamically we need to mark the the element to be dirty by calling setNeedsStyleRecalc(), so it has to recreate its renderer when needed. Test: svg/as-object/svg-in-object-dynamic-attribute-change.html * dom/Element.h: Delete unimplemented function. * html/HTMLObjectElement.cpp: (WebCore::HTMLObjectElement::parseAttribute): Dirty the element by calling setNeedsStyleRecalc() when one of the plugin controlling attributes gets changed. We have to clear the m_useFallbackContent because the attribute's new value might fix the object rendering. * html/HTMLObjectElement.h: Add a function to clear m_useFallbackContent. * html/HTMLPlugInImageElement.cpp: (WebCore::HTMLPlugInImageElement::willRecalcStyle): We might need to reconstruct the object renderer in the image case. This can happen if the image was rendering fallback content and the attribute's new value fixes the object rendering. 2015-02-26 Said Abou-Hallawa Cleanup RenderSVGResourceClipper class. https://bugs.webkit.org/show_bug.cgi?id=142032. Reviewed by Darin Adler. This is a follow up for r180643: . It includes cleanup for RenderSVGResourceClipper class. * rendering/svg/RenderSVGResourceClipper.cpp: (WebCore::RenderSVGResourceClipper::applyClippingToContext): (WebCore::RenderSVGResourceClipper::drawContentIntoMaskImage): * rendering/svg/RenderSVGResourceClipper.h: Change ClipperData to be a typedef instead of a class and rename it to ClipperMaskImage. The purpose of having it a class even though it includes only one member was because we wanted it to be WTF_MAKE_FAST_ALLOCATED. We do not need to allocate it as a separate object on the heap anymore. (WebCore::RenderSVGResourceClipper::addRendererToClipper): Instead of doing double hash table lookups by calling HashMap::contains() and then HashMap::get(), we can use HashMap::add() instead. 2015-02-25 Said Abou-Hallawa Horizontal and vertical lines are clipped completely if clip-path is included in the tag but the referenced element is defined later. https://bugs.webkit.org/show_bug.cgi?id=141776. Reviewed by Dean Jackson. Tests: svg/clip-path/clip-path-line-use-before-defined-expected.svg svg/clip-path/clip-path-line-use-before-defined.svg * rendering/svg/RenderSVGResourceClipper.cpp: (WebCore::RenderSVGResourceClipper::applyClippingToContext): Ensure the renderer is added to m_clipper if it does not exist. The same renderer might have been added to m_clipper in resourceBoundingBox(). (WebCore::RenderSVGResourceClipper::addRendererToClipper): Add the renderer to m_clipper if it does not exist. Return the associated ClipperData. (WebCore::RenderSVGResourceClipper::resourceBoundingBox): If the clipper is referenced before it is defined, add the renderer to m_clipper. While doing the layout() for the clipper, we can check if m_clipper has values or not. If it does have, we are going to mark the clipper for client invalidation which is done by the SVG root. * rendering/svg/RenderSVGResourceClipper.h: * rendering/svg/RenderSVGResourceContainer.h: (WebCore::RenderSVGResourceContainer::selfNeedsClientInvalidation): Define a new function selfNeedsClientInvalidation() which controls marking the clipper for client invalidation. In RenderSVGResourceClipper, override it so it checks m_clipper to force clients validation even if it the first time we do layout for this clipper. * rendering/svg/RenderSVGResourceContainer.cpp: (WebCore::RenderSVGResourceContainer::layout): Call the virtual function selfNeedsClientInvalidation() to check whether we need to mark the clipper for client invalidation. * svg/SVGElement.cpp: Delete unneeded header file. 2015-02-25 Beth Dakin REGRESSION (r180018 ): Holding a rubber-band in place can get stuck https://bugs.webkit.org/show_bug.cgi?id=142020 -and corresponding- rdar://problem/19945216 Reviewed by Tom Horton. It was a mistaken assumption that it was necessary to return false in the zero- delta case. That is clearly conceptually wrong since false represents the DOM doing something special with the event, which is clearly not the case if we never even send the event to the DOM. Returning true will allow the rest of the scrolling machinery the ability to handle the event. * dom/Element.cpp: (WebCore::Element::dispatchWheelEvent): 2015-02-25 Joanmarie Diggs AX: Implement support for ARIA 1.1 'searchbox' role https://bugs.webkit.org/show_bug.cgi?id=142004 Reviewed by Chris Fleizach. Add a new accessible SearchFieldRole to handle both the ARIA role and the "search" input type. No new tests. Instead, added a new test case to roles-exposed.html for the mapping, and updated roles-computedRoleString.html because there is now a one-to-one mapping between the "search" input type and an ARIA role. * accessibility/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::determineAccessibilityRole): (WebCore::AccessibilityNodeObject::isSearchField): * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::isARIATextControl): (WebCore::AccessibilityObject::isARIAInput): (WebCore::initializeRoleMap): * accessibility/AccessibilityObject.h: * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::determineAccessibilityRole): * accessibility/atk/WebKitAccessibleWrapperAtk.cpp: (atkRole): * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper accessibilityCanFuzzyHitTest]): (-[WebAccessibilityObjectWrapper accessibilityTraits]): (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]): * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (createAccessibilityRoleMap): 2015-02-24 Joanmarie Diggs AX: Implement support for ARIA 1.1 'switch' role https://bugs.webkit.org/show_bug.cgi?id=141986 Reviewed by Chris Fleizach. Map the role to ATK_ROLE_TOGGLE_BUTTON for Gtk and Efl; on the Mac, to AXCheckBox with a subrole of AXSwitch. Ensure it looks and acts like a widget to accessibility APIs (supports and emits notifications when toggled, doesn't have children, exposes a name and description when provided). Tests: accessibility/aria-switch-checked.html accessibility/aria-switch-sends-notification.html accessibility/aria-switch-text.html * accessibility/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::canHaveChildren): (WebCore::AccessibilityNodeObject::isChecked): (WebCore::AccessibilityNodeObject::visibleText): (WebCore::AccessibilityNodeObject::title): * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::isARIAInput): (WebCore::AccessibilityObject::actionVerb): (WebCore::initializeRoleMap): (WebCore::AccessibilityObject::supportsChecked): (WebCore::AccessibilityObject::checkboxOrRadioValue): * accessibility/AccessibilityObject.h: (WebCore::AccessibilityObject::isSwitch): * accessibility/atk/AXObjectCacheAtk.cpp: (WebCore::AXObjectCache::postPlatformNotification): * accessibility/atk/WebKitAccessibleWrapperAtk.cpp: (atkRole): * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper accessibilityCanFuzzyHitTest]): (-[WebAccessibilityObjectWrapper accessibilityTraits]): (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]): * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (createAccessibilityRoleMap): (-[WebAccessibilityObjectWrapper subrole]): (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]): 2015-02-24 Yusuke Suzuki REGRESSION(r179429): Can't type comments in Facebook https://bugs.webkit.org/show_bug.cgi?id=141859 Reviewed by Brent Fulgham. Enable SymbolEnabled runtime flag in inspector context. * ForwardingHeaders/runtime/RuntimeFlags.h: Added. * WebCore.order: * WebCore.vcxproj/WebCore.vcxproj: * WebCore.vcxproj/WebCore.vcxproj.filters: * bindings/js/JSDOMWindowBase.cpp: (WebCore::JSDOMWindowBase::javaScriptRuntimeFlags): (WebCore::JSDOMWindowBase::javaScriptExperimentsEnabled): Deleted. * bindings/js/JSDOMWindowBase.h: * bindings/js/JSWorkerGlobalScopeBase.cpp: (WebCore::JSWorkerGlobalScopeBase::javaScriptRuntimeFlags): (WebCore::JSWorkerGlobalScopeBase::javaScriptExperimentsEnabled): Deleted. * bindings/js/JSWorkerGlobalScopeBase.h: * inspector/InspectorFrontendClientLocal.cpp: (WebCore::InspectorFrontendClientLocal::InspectorFrontendClientLocal): * page/Settings.h: * page/Settings.in: 2015-02-24 Joanmarie Diggs [GTK] Layout Test accessibility/roles-exposed.html is failing https://bugs.webkit.org/show_bug.cgi?id=141960 Reviewed by Martin Robinson. The test was failing because Gtk now uses GtkColorChooserDialog for the color input, making the input field a button which results in the color chooser dialog appearing. As a side effect of this change, the input now has an accessible role of ColorWell, which is currently mapped to ATK_ROLE_COLOR_CHOOSER (which is by definition the dialog which results upon activating the button input field). Changed the Gtk platform mapping to ATK_ROLE_BUTTON, leaving the Efl mapping as-is. No new tests. Instead, updated and unskipped failing test. * accessibility/atk/WebKitAccessibleWrapperAtk.cpp: (atkRole): 2015-02-26 Michael Catanzaro [FreeType] REGRESSION(r180563): Introduced crashes https://bugs.webkit.org/show_bug.cgi?id=142044 Reviewed by Martin Robinson. No new tests, should be caught by any woff font test. Use optionsPattern, not m_pattern, when m_pattern may be null. * platform/graphics/freetype/FontPlatformDataFreeType.cpp: (WebCore::FontPlatformData::initializeWithFontFace): 2015-02-24 Michael Catanzaro [GTK] Fonts loaded via @font-face look bad https://bugs.webkit.org/show_bug.cgi?id=140994 Reviewed by Martin Robinson. We've had several complaints that woff fonts look bad on some websites. This seems to be a combination of multiple issues. For one, we don't look at Fontconfig settings at all when creating a web font. This commit changes FontPlatformData::initializeWithFontFace to instead use sane default settings from Fontconfig when loading a web font, rather than accepting the default settings from GTK+, which are normally overridden by Fontconfig when loading system fonts. However, we will hardcode the hinting setting for web fonts to always force use of the light autohinter, so that we do not use a font's native hints. This avoids compatibility issues when fonts with poor native hinting are only tested in browsers that do not use the native hints. It also allows us to sidestep future security vulnerabilities in FreeType's bytecode interpreter. The net result of this is that there should be little noticable difference if you have GTK+ set to use slight hinting (which forces use of the autohinter) unless you have customized Fontconfig configuration, but a dramatic improvement with particular fonts if you use medium or full hinting. This should reduce complaints about our font rendering on "fancy sites." No new tests, since the affected fonts we've found are not freely redistributable. * platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp: (WebCore::FontCustomPlatformData::FontCustomPlatformData): Force web fonts to be autohinted. * platform/graphics/freetype/FontPlatformDataFreeType.cpp: (WebCore::getDefaultCairoFontOptions): Renamed to disambiguate. (WebCore::getDefaultFontconfigOptions): Added. (WebCore::FontPlatformData::initializeWithFontFace): Always call FontPlatformData::setCairoOptionsFromFontConfigPattern. If the FontPlatformData was not created with an FcPattern (e.g. because this is a web font), call getDefaultFontconfigOptions to get a sane default FcPattern. (WebCore::FontPlatformData::setOrientation): Renamed call to getDefaultCairoFontOptions. (WebCore::getDefaultFontOptions): Deleted. 2015-02-24 Dhi Aurrahman Always serialize :lang()'s arguments to strings https://bugs.webkit.org/show_bug.cgi?id=141944 Reviewed by Benjamin Poulain. As specified in [1] :lang()'s arguments are always serialized to strings. [1] http://dev.w3.org/csswg/cssom/#serializing-selectors Related tests are updated. * css/CSSGrammar.y.in: * css/CSSParserValues.cpp: (WebCore::CSSParserSelector::setLangArgumentList): * css/CSSParserValues.h: (WebCore::CSSParserString::init): (WebCore::CSSParserString::clear): (WebCore::CSSParserString::tokenType): Deleted. (WebCore::CSSParserString::setTokenType): Deleted. * css/CSSSelector.cpp: (WebCore::appendLangArgumentList): (WebCore::CSSSelector::setLangArgumentList): * css/CSSSelector.h: (WebCore::CSSSelector::langArgumentList): * css/SelectorCheckerTestFunctions.h: (WebCore::matchesLangPseudoClass): * cssjit/SelectorCompiler.cpp: (WebCore::SelectorCompiler::addPseudoClassType): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsInLanguage): 2015-02-24 Antti Koivisto Give TemporaryChange for m_inLoadPendingImages assertion a name so it actually does something. * css/StyleResolver.cpp: (WebCore::StyleResolver::loadPendingImages): 2015-02-23 Brent Fulgham EventHandler references deleted Scrollbar https://bugs.webkit.org/show_bug.cgi?id=141931 Reviewed by Tim Horton. Tested by scrollbars/overflow-custom-scrollbar-crash.html Update the EventHandler class to use a WeakPtr to reference the last used Scrollbar, rather than retaining the Scrollbar and artificially extending its life. This keeps the EventHandler state in proper sync with the state of the render tree, and avoids cases where we have destroyed a ScrollableArea (and Scrollbar) but are still sending messages to a fake zombie version of the element. * page/EventHandler.cpp: (WebCore::EventHandler::clear): (WebCore::EventHandler::handleMousePressEvent): (WebCore::EventHandler::updateMouseEventTargetNode): (WebCore::EventHandler::updateLastScrollbarUnderMouse): * page/EventHandler.h: * platform/Scrollbar.cpp: (WebCore::Scrollbar::Scrollbar): Initialize WeakPtrFactory. * platform/Scrollbar.h: (WebCore::Scrollbar::createWeakPtr): Added, 2015-02-23 Shivakumar JM Default value of HTMLSelectElement size IDL attribute should be 0. https://bugs.webkit.org/show_bug.cgi?id=141795 Reviewed by Andreas Kling. Default value of HTMLSelectElement size IDL attribute should be 0. As in spec: http://www.w3.org/html/wg/drafts/html/master/forms.html#the-select-element, also this matches the behavior of Chrome, IE and Gecko. Test: fast/dom/select-size.html * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::parseAttribute): 2015-02-23 Said Abou-Hallawa Drawing an SVG image into a canvas using drawImage() ignores globalAlpha. https://bugs.webkit.org/show_bug.cgi?id=141729. Reviewed by Daniel Bates. Fix a build break which is caused by http://trac.webkit.org/changeset/180511/trunk. Two functions of GraphicsContext were made inline but they were kept WEBCORE_EXPORT. * platform/graphics/GraphicsContext.h: (WebCore::GraphicsContext::paintingDisabled): (WebCore::GraphicsContext::updatingControlTints): 2015-02-23 Said Abou-Hallawa Drawing an SVG image into a canvas using drawImage() ignores globalAlpha. https://bugs.webkit.org/show_bug.cgi?id=141729. Reviewed by Simon Fraser. When drawing an SVG image and the drawing context is set to be transparent, make sure this transparency is applied to the compositing layer. Test: svg/canvas/canvas-global-alpha-svg.html * platform/graphics/GraphicsContext.cpp: (WebCore::GraphicsContext::setAlpha): Make setAlpha() calls the platform function and sets 'm_state.alpha' to the input value. (WebCore::GraphicsContext::alpha): Add a new function 'alpha()' which returns the value of the global alpha. * platform/graphics/GraphicsContext.h: (WebCore::GraphicsContextState::GraphicsContextState): Add a new member 'alpha' to the context state since the getter function CGContextGetAlpha is defined only in a private header file. Also move single line functions from the source file to the header file. * platform/graphics/cairo/GraphicsContextCairo.cpp: (WebCore::GraphicsContext::setPlatformAlpha): (WebCore::GraphicsContext::setAlpha): Deleted. * platform/graphics/cg/GraphicsContextCG.cpp: (WebCore::GraphicsContext::setPlatformAlpha): (WebCore::GraphicsContext::setAlpha): Deleted. Rename setAlpha() to setPlatformAlpha() in the platform files. Add setAlpha() to the core file. setAlpha() will set the value of 'm_state.alpha' and call setPlatformAlpha(). * svg/graphics/SVGImage.cpp: (WebCore::SVGImage::draw): If the drawing context is transparent, apply its global alpha value to the compositing layer. 2015-02-23 Philippe Normand [GStreamer] Redundant track language notifications https://bugs.webkit.org/show_bug.cgi?id=141908 Reviewed by Žan Doberšek. Invoke languageChanged only if the language code actually changed. * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp: (WebCore::TrackPrivateBaseGStreamer::notifyTrackOfTagsChanged): 2015-02-22 Dean Jackson Print a console warning when HTMLCanvasElement exceeds the maximum size https://bugs.webkit.org/show_bug.cgi?id=141861 Reviewed by Simon Fraser. Add a warning if we ever try to create a canvas that is too big. No test because: 1. We can't ref-test against console messages. 2. The output is platform specific. * html/HTMLCanvasElement.cpp: (WebCore::HTMLCanvasElement::createImageBuffer): 2015-02-20 Zalan Bujtas Invalid assert in CompositeEditCommand::insertNodeAfter/insertNodeBefore https://bugs.webkit.org/show_bug.cgi?id=141854 Reviewed by Ryosuke Niwa. Inserting content before/after the body as the result of editing is a valid operation. This assert was originally introduced to cover cases where edited content would get moved out of body. However, asserting such operation properly is not possible atm. Test: editing/inserting/insert-as-body-sibling.html * editing/CompositeEditCommand.cpp: (WebCore::CompositeEditCommand::insertNodeBefore): (WebCore::CompositeEditCommand::insertNodeAfter): 2015-02-20 Dhi Aurrahman Language ranges containing asterisks must be quoted as strings https://bugs.webkit.org/show_bug.cgi?id=141659 Reviewed by Benjamin Poulain. As specified in [1], the language ranges containing asterisks must be quoted as strings. [1] http://dev.w3.org/csswg/selectors-4/#the-lang-pseudo. * css/CSSGrammar.y.in: * css/CSSParser.cpp: (WebCore::CSSParser::realLex): 2015-02-18 Andreas Kling REGRESSION(r179347): Clearing the PageCache no longer clears the PageCache. Reviewed by Anders Carlsson. Once again we've fallen into the TemporaryChange trap: TemporaryChange(m_member, temporaryValue); The code above doesn't actually do anything. Since the TemporaryChange local is not named, it immediately goes out of scope and restores the original value of m_member. Unless someone knows a C++ trick to prevent these, we'll need to add a style checker pass to catch bugs like this. Whatever we do will be done separately from this bug. Test: fast/history/page-cache-clearing.html * history/PageCache.cpp: (WebCore::PageCache::pruneToSizeNow): Name the local so it lives longer. * testing/Internals.cpp: (WebCore::Internals::clearPageCache): (WebCore::Internals::pageCacheSize): * testing/Internals.h: * testing/Internals.idl: Add a way to clear the page cache and query its size from window.internals to facilitate writing a simple test for this bug. 2015-02-18 Alexey Proskuryakov Roll out r180280. Crashes under IDBDatabase::closeConnection. https://bugs.webkit.org/show_bug.cgi?id=141745 rdar://problem/19816412 * Modules/indexeddb/IDBDatabase.cpp: (WebCore::IDBDatabase::closeConnection): 2015-02-18 Zalan Bujtas REGRESSION(r174761) Dangling spanner pointer in RenderMultiColumnSpannerPlaceholder. https://bugs.webkit.org/show_bug.cgi?id=138224 Reviewed by Dave Hyatt. It's wrong to call flowThreadRelativeWillBeRemoved(child). RenderMultiColumnFlowThread::removeFlowChildInfo() does not mean that the child is actually about to be removed. Should this introduce any regressions, we need to deal with those separately. Test: fast/multicol/crash-when-spanner-gets-moved-around.html * rendering/RenderMultiColumnFlowThread.cpp: (WebCore::RenderMultiColumnFlowThread::removeFlowChildInfo): Deleted. * rendering/RenderMultiColumnFlowThread.h: 2015-02-18 Alexey Proskuryakov Crashes under IDBDatabase::closeConnection. https://bugs.webkit.org/show_bug.cgi?id=141745 rdar://problem/19816412 Reviewed by David Kilzer. * Modules/indexeddb/IDBDatabase.cpp: (WebCore::IDBDatabase::closeConnection): Add a missing protector. 2015-02-18 Myles C. Maxfield Justified ruby can cause lines to grow beyond their container https://bugs.webkit.org/show_bug.cgi?id=141732 Reviewed by David Hyatt. After we re-layout RenderRubyRuns, this can change the environment upon which ruby's overhang calculation is sensitive to. Before this patch, we would recalculate the overhang after the RenderRubyRun gets relaid out. However, doing such causes the effective width of the RenderRubyRun to change, which causes out subsequent justification calculations to be off. Therefore, we have a cycle; the amount of ruby overhang can change the justification in a line, and the layout of the line affects the ruby overhang calculation. Instead of performing a layout in a loop until it converges, this patch simply observes that having a flush right edge is more valuable than having a perfectly correct overhang. It therefore simply removes the secondary overhang calculation. Test: fast/text/ruby-justification-flush.html * rendering/RenderBlockFlow.h: * rendering/RenderBlockLineLayout.cpp: (WebCore::RenderBlockFlow::updateRubyForJustifiedText): (WebCore::RenderBlockFlow::computeExpansionForJustifiedText): (WebCore::RenderBlockFlow::computeInlineDirectionPositionsForSegment): 2015-02-17 Chris Dumez Slight CachedPage class clean up https://bugs.webkit.org/show_bug.cgi?id=141693 Reviewed by Andreas Kling. Slight CachedPage class clean up: - Drop unnecessary m_timeStamp data member - Protect m_needsCaptionPreferencesChanged data member with #if ENABLE(VIDEO_TRACK) - Merge destroy() method into the destructor as this is the only caller - Update clear() to reset 2 data members that were missing 2015-02-17 Carlos Garcia Campos Use HashMap::add instead of get/contains + set in DOMObjectCache https://bugs.webkit.org/show_bug.cgi?id=141558 Rubber-stamped by Žan Doberšek. * bindings/gobject/DOMObjectCache.cpp: (WebKit::getOrCreateDOMObjectCacheFrameObserver): (WebKit::DOMObjectCache::put): 2015-02-17 Carlos Garcia Campos [GTK] GObject DOM bindings object are cached forever https://bugs.webkit.org/show_bug.cgi?id=141558 Reviewed by Sergio Villar Senin. Rework the DOMObjectCache to avoid having to manually clear the objects when the frame is destroyed, using a FrameDestructionObserver instead. When a new object associated to a Frame is added to the cache, a FrameDestructionObserver is created for the frame if needed, and the DOM object is tracked by the observer too. When the frame is detached from the page all its objects are cleared, and if the aren't additional references, the object is finalized and removed from the cache normally. This patch also simplifies and modernizes the code to make it easier to read an maintain. * bindings/gobject/DOMObjectCache.cpp: (WebKit::DOMObjectCacheData::DOMObjectCacheData): Add constructor to initialize its members and simplify the callers. (WebKit::DOMObjectCacheData::clearObject): Remove the references added by the cache, ensuring the GObject is not finalized until the method returns. (WebKit::DOMObjectCacheData::refObject): Adds a reference owned by the cache. (WebKit::domObjectCacheFrameObservers): Map a frame to a FrameDestructionObserver. (WebKit::getOrCreateDOMObjectCacheFrameObserver): Create a new FrameDestructionObserver for the given Frame or return the existing one. (WebKit::domObjects): Map wrapped object to wrapper object. (WebKit::DOMObjectCache::forget): Remove the wrapped object from the cache. (WebKit::DOMObjectCache::get): Return the wrapped object if it is in the cache, increasing the cache references. (WebKit::DOMObjectCache::put): Add the wrapper object to the cache for the given wrapped object. If it's a Node and has a frame add the node to the FrameDestructionObserver corresponding to the frame. (WebKit::getFrameFromHandle): Deleted. (WebKit::weakRefNotify): Deleted. (WebKit::DOMObjectCache::clearByFrame): Deleted. (WebKit::DOMObjectCache::~DOMObjectCache): Deleted. * bindings/gobject/DOMObjectCache.h: 2015-02-17 ChangSeok Oh REGRESSION(r180050): It broke the !ENABLE(CSS_GRID_LAYOUT) build https://bugs.webkit.org/show_bug.cgi?id=141647 Reviewed by Csaba Osztrogonác. No new tests since this just fixes a build break. * dom/Position.cpp: Add a build guard ENABLE(CSS_GRID_LAYOUT) for RenderGrid. (WebCore::Position::isCandidate): 2015-02-16 Chris Dumez Keep all memory cache resources in ListHashSets https://bugs.webkit.org/show_bug.cgi?id=141667 Reviewed by Andreas Kling. Keep all memory cache resources in ListHashSets instead of manual linked lists. This simplifies the code a lot and is also more efficient for retrieving / removing particular CachedResources. * loader/cache/CachedResource.cpp: (WebCore::CachedResource::CachedResource): * loader/cache/CachedResource.h: * loader/cache/MemoryCache.cpp: (WebCore::MemoryCache::pruneDeadResourcesToSize): (WebCore::MemoryCache::removeFromLRUList): (WebCore::MemoryCache::insertInLRUList): (WebCore::MemoryCache::dumpLRULists): (WebCore::MemoryCache::lruListFor): Deleted. * loader/cache/MemoryCache.h: 2015-02-16 Benjamin Poulain CSS JIT: finish :nth-last-child() https://bugs.webkit.org/show_bug.cgi?id=141629 Reviewed by Andreas Kling. This patch adds the matcher for :nth-child(An+B of selector list) and fix a small bug I discovered while working on it. The matcher is straightforward: count the next siblings matching the selector, nothing fancy. While working on it I noticed I forgot the test for IsParsingChildrenFinished on the simple version of :nth-last-child(). I add it in both matcher, write a couple of tests, the first part of the tests now succeed, but the second part fails... What happened is: 1) We interupt the parsing to execute the JavaScript. From there, we force the style resolution to get the computed style. 2) When resolving the style, the early check for isFinishedParsingChildren() quits the function early. This is done *before* we marked the parent for :nth-last-child() style resolution. 3) After the script, parsing resume and the following elements are added. 4) When resolving the style, only the new elements are marked dirty, the elements pending their :nth-last-child() style never get udpated. To fix the problem, I moved the test for FinishedParsingChildren after the parent marking. Honestly, those early return for FinishedParsingChildren need to be refined and they should be tested properly. We should not do this kind of things for Query for example. Tests: fast/selectors/nth-last-child-cannot-match-during-parsing-1.html fast/selectors/nth-last-child-cannot-match-during-parsing-2.html fast/selectors/nth-last-child-of-cannot-match-during-parsing-1.html fast/selectors/nth-last-child-of-cannot-match-during-parsing-2.html fast/selectors/nth-last-child-of-register-requirement.html * css/SelectorChecker.cpp: (WebCore::SelectorChecker::checkOne): Fix the tree marking. * cssjit/SelectorCompiler.cpp: (WebCore::SelectorCompiler::addPseudoClassType): The fragment creation was already done, all I had to do was accept the compile. (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatching): :nth-child() and :nth-last-child() with a selector list are heavier than :not() and :matches(), move them accordingly. (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthLastChild): More the early return after the tree marking. (WebCore::SelectorCompiler::setParentAffectedByLastChildOf): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthLastChildOf): New matcher, nothing optimized yet. 2015-02-16 Tim Horton Adopt CAMachPort-as-layer-contents https://bugs.webkit.org/show_bug.cgi?id=141687 Reviewed by Simon Fraser. No new tests, just a performance bump. * platform/cocoa/MachSendRight.h: (WebCore::MachSendRight::operator bool): Add an operator bool() that checks if the underlying port is nonnull. * platform/spi/cocoa/QuartzCoreSPI.h: Add some SPI. 2015-02-15 Sam Weinig Add experimental element support https://bugs.webkit.org/show_bug.cgi?id=141626 Reviewed by Tim Horton. Adds scaffolding for an experimental implementation of an element which can represent a file attachment (e.g. NSTextAttachment in NSAttributedString parlance). The implementation is guarded by both an #ifdef (ENABLE(ATTACHMENT_ELEMENT)) and a setting (Settings::attachmentElementEnabled()). Tests: fast/attachment/attachment-disabled-dom.html fast/attachment/attachment-disabled-rendering.html fast/attachment/attachment-dom.html fast/attachment/attachment-rendering.html * Configurations/FeatureDefines.xcconfig: Add new ENABLE_ATTACHMENT_ELEMENT macro. * CMakeLists.txt: * WebCore.vcxproj/WebCore.vcxproj: * WebCore.xcodeproj/project.pbxproj: Add new files. * dom/make_names.pl: Add support for checking a setting to determine if a particular tag should be exposed. * html/HTMLAttachmentElement.cpp: Added. * html/HTMLAttachmentElement.h: Added. Stub out the basics of the new element. * html/HTMLElementsAllInOne.cpp: Add HTMLAttachmentElement.cpp. * html/HTMLTagNames.in: Add 'attachment'. * page/Settings.in: Add attachmentElementEnabled setting. * rendering/RenderAttachment.cpp: Added. * rendering/RenderAttachment.h: Added. Stub out the basics of the new render. We will probably want to replace this with a non-replaced render, but this will do as a placeholder for now. * rendering/RenderObject.h: (WebCore::RenderObject::isAttachment): Add predicate for type casting. * rendering/RenderingAllInOne.cpp: Add RenderAttachment.cpp. 2015-02-16 Andreas Kling GC (almost) immediately when navigating under memory pressure. Reviewed by Geoffrey Garen. Since the PageCache is already disabled in memory pressure situations, we know that detaching the old window shell on navigation is basically guaranteed to generate a bunch of garbage, we can soften the memory peak a bit by doing a GC right away instead of scheduling one for soon(tm). * bindings/js/GCController.cpp: (WebCore::GCController::GCController): (WebCore::GCController::garbageCollectSoon): (WebCore::GCController::garbageCollectOnNextRunLoop): (WebCore::GCController::gcTimerFired): * bindings/js/GCController.h: Add a GCController::garbageCollectOnNextRunLoop() complement to the "soon" and "now" options. There was already a zero timer in here for non-CF builds, so I just used that same timer to implement this and have the non-CF code path call garbageCollectOnNextRunLoop(). * bindings/js/ScriptController.cpp: (WebCore::collectGarbageAfterWindowShellDestruction): (WebCore::ScriptController::~ScriptController): (WebCore::ScriptController::clearWindowShell): Under system memory pressure conditions, schedule a full GC on next runloop iteration instead of just asking for it to happen soon. We do it on next runloop to ensure that there's no pointer to the window object on the stack. 2015-02-16 Enrica Casucci Emoji sequences do not render properly. https://bugs.webkit.org/show_bug.cgi?id=141661 rdar://problem/19820463 Reviewed by Sam Weinig. Emoji sequences and emoji with variations should be rendered using the Complex code path and should be treated as graphemes. This change modifies advanceByCombiningCharacterSequence to add this logic. Test: fast/text/emoji.html * WebCore.xcodeproj/project.pbxproj: * platform/graphics/FontCascade.cpp: (WebCore::FontCascade::characterRangeCodePath): * platform/graphics/mac/ComplexTextController.cpp: (WebCore::advanceByCombiningCharacterSequence): Implements a simple logic to treat emoji sequences and emoji with variations as graphemes. * platform/text/CharacterProperties.h: Added. (WebCore::isEmojiGroupCandidate): (WebCore::isEmojiModifier): (WebCore::isVariationSelector): * rendering/RenderText.cpp: (WebCore::isEmojiGroupCandidate): Deleted. (WebCore::isEmojiModifier): Deleted. 2015-02-16 Zalan Bujtas RenderTableRow should check if it has access to its ancestor chain. https://bugs.webkit.org/show_bug.cgi?id=141668 Reviewed by Andreas Kling. Preventive fix. * rendering/RenderTableRow.cpp: (WebCore::RenderTableRow::styleDidChange): (WebCore::RenderTableRow::addChild): * rendering/RenderTableRow.h: 2015-02-16 Jer Noble [iOS] Build fix: declare undeclared identifier 'credential'. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::WebCoreNSURLAuthenticationChallengeClient::receivedCredential): 2015-02-16 Jer Noble [iOS] Unable to play .mp4 file over http with basic http authentication https://bugs.webkit.org/show_bug.cgi?id=141503 rdar://problem/15799844 Reviewed by Alexey Proskuryakov. On iOS, CFNetwork is used for authentication, so the NSURLAuthenticationChallenge provided by AVAssetResourceLoader needs to be shoehorned into a AuthenticationChallenge object by way of CFURLAuthChallengeRef. Create a new class, WebCoreNSURLAuthenticationChallengeClient, whose sole purpose is to take AuthenticationChallengeClient callbacks and pass them along to a NSURLAuthenticationChallenge sender. Create a NSURLAuthenticationChallenge out of the CF version through an SPI, and add that SPI to a new header. Drive-by fix: take two of our existing SPI calls and move them into that same header. * WebCore.xcodeproj/project.pbxproj: Add CFNSURLConnectionSPI.h to project. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::WebCoreNSURLAuthenticationChallengeClient::create): Factory. (WebCore::WebCoreNSURLAuthenticationChallengeClient::WebCoreNSURLAuthenticationChallengeClient): Simple constructor. (WebCore::WebCoreNSURLAuthenticationChallengeClient::receivedCredential): Pass to m_challenge. (WebCore::WebCoreNSURLAuthenticationChallengeClient::receivedRequestToContinueWithoutCredential): Ditto. (WebCore::WebCoreNSURLAuthenticationChallengeClient::receivedCancellation): Ditto. (WebCore::WebCoreNSURLAuthenticationChallengeClient::receivedRequestToPerformDefaultHandling): Ditto. (WebCore::WebCoreNSURLAuthenticationChallengeClient::receivedChallengeRejection): Ditto. (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForResponseToAuthenticationChallenge): Create an AuthenticationChallenge out of the nsChallenge and client and pass it up to the HTMLMediaElement. * platform/network/mac/AuthenticationMac.mm: * platform/spi/cocoa/CFNSURLConnectionSPI.h: Added. 2015-02-16 Said Abou-Hallawa Revert a change in SVGRenderSupport::mapLocalToContainer committed for fixing . https://bugs.webkit.org/show_bug.cgi?id=138439 Reviewed by Darin Adler. The change http://trac.webkit.org/changeset/164861 was ported from Blink but it was was revert later because it broke Chrome SVG rendering. It also broke the WebKit SVG text search highlighting. Tests: svg/transforms/svg-geometry-crash.html: This test was added by the blamed change. A new but correct solution is required to fix the assertion. * rendering/svg/SVGRenderSupport.h: * rendering/svg/SVGRenderSupport.cpp: Notice that TransformState.applyTransform() does matrix-left-multiplication, i.e. state = transform * state. But operator*() of AffineTransform and MatrixTransform does right multiply, i.e. this = this * transform. (WebCore::SVGRenderSupport::localToParentTransform): Have the calculation of the SVG localToParentTransform in one shared function. (WebCore::SVGRenderSupport::mapLocalToContainer): Revert the Blink change. If the parent is the SVG root, the transform state should be equal to transform = svg_to_css_mapping * local_to_parent_mapping * transform. (WebCore::SVGRenderSupport::pushMappingToContainer): Get the localToParent transform to be pushed in the geometryMap. If the parent is the SVG root, localToParent = svg_to_css_mapping * local_to_parent_mapping. The original code was doing the opposite and this is the cause of the assertion which was fixed wrongly by reversing the correct multiplication order in SVGRenderSupport::mapLocalToContainer(). 2015-02-16 Zalan Bujtas RenderTableCell can't access its parent while in detached state. https://bugs.webkit.org/show_bug.cgi?id=141639 rdar://problem/19850760 Reviewed by Simon Fraser. Null check against ancestor chain so that certain methods in RenderTableCell can be called even if the renderer is not yet attached. Test: fast/table/table-cell-crash-when-detached-state.html * rendering/RenderTableCell.cpp: (WebCore::RenderTableCell::borderLeft): (WebCore::RenderTableCell::borderRight): (WebCore::RenderTableCell::borderTop): (WebCore::RenderTableCell::borderBottom): (WebCore::RenderTableCell::borderStart): (WebCore::RenderTableCell::borderEnd): (WebCore::RenderTableCell::borderBefore): (WebCore::RenderTableCell::borderAfter): * rendering/RenderTableCell.h: 2015-02-16 David Hyatt Add ifdefs to avoid adjusting Ruby selection rects to avoid overlap on iOS. https://bugs.webkit.org/show_bug.cgi?id=141651 Reviewed by Simon Fraser. * rendering/RootInlineBox.cpp: (WebCore::RootInlineBox::selectionTop): (WebCore::RootInlineBox::selectionBottom): 2015-02-16 David Kilzer SoftLinking.h: Update copyright and license; clean up whitespace * platform/mac/SoftLinking.h: 2015-02-12 David Hyatt text-underline-position:under has multiple correctness issues https://bugs.webkit.org/show_bug.cgi?id=141528 Reviewed by Dean Jackson. Added a bunch of new tests in fast/text * rendering/InlineFlowBox.cpp: (WebCore::InlineFlowBox::maxLogicalBottomForTextDecorationLine): (WebCore::InlineFlowBox::minLogicalTopForTextDecorationLine): (WebCore::InlineFlowBox::computeMaxLogicalBottom): Deleted. * rendering/InlineFlowBox.h: These functions have been re-written to take an enclosing renderer that specified the decoration. This way they can properly limit the bottom/top computation to only line boxes that are contained inside the renderer. * rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::paintDecoration): Tweak the call to get the decoration colors now that quirks mode has been removed. * rendering/RenderElement.cpp: (WebCore::RenderElement::enclosingRendererWithTextDecoration): * rendering/RenderElement.h: New function that finds the enclosing renderer that specified a text decoration. For now this is only used in the "under" position computation, but soon we'll be using it everywhere. * rendering/RenderObject.cpp: (WebCore::RenderObject::getTextDecorationColors): * rendering/RenderObject.h: Remove the quirks mode argument, since we were always passing true anyway (making the argument dead). * rendering/RootInlineBox.cpp: (WebCore::RootInlineBox::maxLogicalBottom): Deleted. * rendering/RootInlineBox.h: Get rid of these functions and just have InlineTextBoxStyle's computeUnderLineOffset function call the InlineFlowBox functions directly. * style/InlineTextBoxStyle.cpp: (WebCore::computeUnderlineOffset): Re-written to fetch the enclosingRendererWithTextDecoration so that it can be passed to the logical top/bottom computation to limit which line boxes get included. 2015-02-16 Brent Fulgham FEGaussianBlur::calculateUnscaledKernelSize does unspeakable things with signed and unsigned values https://bugs.webkit.org/show_bug.cgi?id=141596 Reviewed by Zalan Bujtas. No new tests. Covered by css3/filters/huge-blur-value.html Avoid overflowing the signed integer values by not converting from unsigned until the maximum size has been clamped to the expected max. * platform/graphics/filters/FEGaussianBlur.cpp: (WebCore::FEGaussianBlur::calculateUnscaledKernelSize): 2015-02-13 Sergio Villar Senin [CSS Grid Layout] Invalid initialization of track sizes with non spanning grid items https://bugs.webkit.org/show_bug.cgi?id=140763 Reviewed by Antti Koivisto. Content sized tracks with non-spanning grid items were not properly sized because the growth limit was sometimes infinity (-1) after calling resolveContentBasedTrackSizingFunctions() when it should not. This patch adds an special initialization phase for non-spanning grid items as the new track sizing algorithm describes. Granted, that was handled in the old algorithm in distributeSpaceToTracks() as a special case. The problem is that it regressed after the optimization added in r173868 because that method is no longer called when the space to distribute is 0. That's why we could fix this by allowing calls to distributeSpaceToTracks() with spaceToDistribute>=0 but by fixing it with an explicit initialization our implementation becomes closer to the new algorithm and the initialization is now explicit in the code instead of a side effect of calling distributeSpaceToTracks() with no space to be distributed. It also brings a slight performance improvement as we save sorts and hash lookups. I also took the change to add caching to several GridTrackSize methods that were hot on the profiler (each one accounted for ~1% of the total time, now they account for ~0.3% each). Test: fast/css-grid-layout/grid-initialize-span-one-items.html * rendering/RenderGrid.cpp: (WebCore::GridItemWithSpan::span): New helper method for ASSERTs. (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions): Exclude non spanning grid items from the calls to resolveContentBasedTrackSizingFunctionsForItems(). (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForNonSpanningItems): New method to resolve track sizes only using non-spanning grid items. (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForItems): Ensure that it isn't called for non-spanning grid items. * rendering/RenderGrid.h: * rendering/style/GridTrackSize.h: (WebCore::GridTrackSize::GridTrackSize): Cache return values. (WebCore::GridTrackSize::setLength): Ditto. (WebCore::GridTrackSize::setMinMax): Ditto. (WebCore::GridTrackSize::cacheMinMaxTrackBreadthTypes): New method that caches the return values for hasXXXTrackBreadth() methods. (WebCore::GridTrackSize::hasMinOrMaxContentMinTrackBreadth): Use the cached return value. (WebCore::GridTrackSize::hasMaxContentMaxTrackBreadth): Ditto. (WebCore::GridTrackSize::hasMinContentMaxTrackBreadth): Ditto. (WebCore::GridTrackSize::hasMinOrMaxContentMaxTrackBreadth): Ditto. (WebCore::GridTrackSize::hasMaxContentMinTrackBreadth): Ditto. (WebCore::GridTrackSize::hasMinContentMinTrackBreadth): Ditto. (WebCore::GridTrackSize::hasMinContentMinTrackBreadthAndMinOrMaxContentMaxTrackBreadth): Ditto. (WebCore::GridTrackSize::hasMaxContentMinTrackBreadthAndMaxContentMaxTrackBreadth): Ditto. 2015-02-16 Milan Crha [GTK] Loading page into WebView shows g_closure_unref warning https://bugs.webkit.org/show_bug.cgi?id=127474 Reviewed by Carlos Garcia Campos. * bindings/gobject/GObjectEventListener.cpp: (WebCore::GObjectEventListener::gobjectDestroyed): 2015-02-13 Sergio Villar Senin [CSS Grid Layout] Remove the usage of Length(Undefined) in GridLength https://bugs.webkit.org/show_bug.cgi?id=141562 Reviewed by Chris Dumez. From Blink r164154 by The patch simplifies some of the logic in creating and applying GridLength and GridTrackSize values to RenderStyles by using the constructors for initialisation instead of deferring to setters. The rationale behind this change is that neither of createGridTrackSize() nor createGridTrackBreadth() should be able to fail, so these are changed to return objects directly instead of taking an out reference (note that in general failing in applying properties is incorrect and we should catch these in the parser). The quirk value across to the Lengths was also removed because it doesn't apply to Grid. * css/CSSPropertyNames.in: * css/StyleBuilderConverter.h: (WebCore::StyleBuilderConverter::createGridTrackBreadth): Return a GridLength instead of a bool. (WebCore::StyleBuilderConverter::createGridTrackSize): Return a GridTrackSize instead of a bool. (WebCore::StyleBuilderConverter::createGridTrackList): Do not create temporary GridTrackSizes with undefined Lengths. (WebCore::StyleBuilderConverter::convertGridTrackSize): Ditto. * rendering/style/GridLength.h: (WebCore::GridLength::GridLength): It now requires a mandatory Length argument. (WebCore::GridLength::length): Deleted. (WebCore::GridLength::setFlex): Deleted. * rendering/style/GridTrackSize.h: (WebCore::GridTrackSize::GridTrackSize): It now requires a mandatory GridLength argument. (WebCore::GridTrackSize::length): Removed no longer valid ASSERTs. (WebCore::GridTrackSize::minTrackBreadth): Ditto. (WebCore::GridTrackSize::maxTrackBreadth): Ditto. (WebCore::GridTrackSize::setLength): Deleted. (WebCore::GridTrackSize::setMinMax): Deleted. * rendering/style/RenderStyle.h: 2015-02-13 Grzegorz Czajkowski Removing text node does not remove its associated markers https://bugs.webkit.org/show_bug.cgi?id=140999 Reviewed by Ryosuke Niwa. Removing text node via script does not remove its markers. For example, running the following script: will cause that DocumentMarkerController still stores the markers for detached node. The same issue occurs when the text gets cleared, for example, No new tests. Internals marker APIs operate on text node attached to the element. To test it we could expose document().markers().hasMarkers() but there is no more useful cases where it could be used. Another obstacle is that we are in isInShadowTree() so that there is no possible to register on "DOMSubtreeModified" event. Test cases attached to the bug: 1. input.value = "" https://bug-140999-attachments.webkit.org/attachment.cgi?id=245704 2. elem.removeChild(textNode) https://bug-140999-attachments.webkit.org/attachment.cgi?id=246515 Remove markers when text nodes are about to remove. * dom/Document.cpp: (WebCore::Document::nodeChildrenWillBeRemoved): Fixes input.value = "" (WebCore::Document::nodeWillBeRemoved): Fixes elem.removeChild(textNode) 2015-02-15 David Kilzer REGRESSION (r180082): WebCore Debug builds fail on Mavericks due to weak export symbols This should fix the build, but leaves a FIXME list in WebCore.unexp. * Configurations/WebCore.unexp: Add weak externals with a FIXME statement so they can be removed later. It's more important to fix the build first. * Configurations/WebCore.xcconfig: Change XCODE_VERSION_MINOR to XCODE_VERSION_MAJOR since the internal bots use version 5.1.1 which still has the error. 2015-02-15 Brian J. Burg Web Inspector: remove unused XHR replay code https://bugs.webkit.org/show_bug.cgi?id=141622 Reviewed by Timothy Hatcher. XHR Replay functionality became unused with the last frontend rewrite. Remove instrumentation and data storage classes only used by this feature. * inspector/InspectorInstrumentation.cpp: (WebCore::InspectorInstrumentation::documentThreadableLoaderStartedLoadingForClientImpl): Deleted. (WebCore::InspectorInstrumentation::willLoadXHRImpl): Deleted. (WebCore::InspectorInstrumentation::didFailXHRLoadingImpl): Deleted. * inspector/InspectorInstrumentation.h: (WebCore::InspectorInstrumentation::documentThreadableLoaderStartedLoadingForClient): Deleted. (WebCore::InspectorInstrumentation::willLoadXHR): Deleted. (WebCore::InspectorInstrumentation::didFailXHRLoading): Deleted. * inspector/InspectorResourceAgent.cpp: (WebCore::InspectorResourceAgent::didLoadResourceFromMemoryCache): (WebCore::InspectorResourceAgent::didFinishXHRLoading): (WebCore::InspectorResourceAgent::documentThreadableLoaderStartedLoadingForClient): Deleted. (WebCore::InspectorResourceAgent::willLoadXHR): Deleted. (WebCore::InspectorResourceAgent::didFailXHRLoading): Deleted. (WebCore::InspectorResourceAgent::replayXHR): Deleted. * inspector/InspectorResourceAgent.h: * inspector/NetworkResourcesData.cpp: (WebCore::NetworkResourcesData::clear): (WebCore::XHRReplayData::create): Deleted. (WebCore::XHRReplayData::XHRReplayData): Deleted. (WebCore::NetworkResourcesData::xhrReplayData): Deleted. (WebCore::NetworkResourcesData::setXHRReplayData): Deleted. (WebCore::NetworkResourcesData::reuseXHRReplayData): Deleted. * inspector/NetworkResourcesData.h: (WebCore::XHRReplayData::method): Deleted. (WebCore::XHRReplayData::url): Deleted. (WebCore::XHRReplayData::async): Deleted. (WebCore::XHRReplayData::formData): Deleted. (WebCore::XHRReplayData::headers): Deleted. (WebCore::XHRReplayData::includeCredentials): Deleted. (WebCore::NetworkResourcesData::ResourceData::xhrReplayData): Deleted. (WebCore::NetworkResourcesData::ResourceData::setXHRReplayData): Deleted. * loader/DocumentThreadableLoader.cpp: (WebCore::DocumentThreadableLoader::loadRequest): * xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::createRequest): (WebCore::XMLHttpRequest::internalAbort): (WebCore::XMLHttpRequest::sendForInspectorXHRReplay): Deleted. * xml/XMLHttpRequest.h: 2015-02-15 Said Abou-Hallawa Crash when accessing an item in SVGTransformList and then removing a previous item from this list. https://bugs.webkit.org/show_bug.cgi?id=141550. Reviewed by David Kilzer. * svg/properties/SVGMatrixTearOff.h: (WebCore::SVGMatrixTearOff::create): Fix a compilation error on the release build. The ASSERT() here references a parameter which is not used anywhere else. We need to change it to ASSERT_UNUSED(). 2015-02-15 Said Abou-Hallawa Crash when accessing an item in SVGTransformList and then removing a previous item from this list. https://bugs.webkit.org/show_bug.cgi?id=141550. Reviewed by Darin Adler. Tests: LayoutTests/svg/dom/SVGTransformList-basics.xhtml: This test is modified to include a new test case. * svg/properties/SVGMatrixTearOff.h: m_value of SVGMatrixTearOff will be a null pointer. There is no point in having SVGMatrixTearOff points to the parent and the property of the parent at the same time. (WebCore::SVGMatrixTearOff::create): SVGMatrixTearOff will hold a pointer to the parent SVGPropertyTearOff. But it should overrides setValue() and propertyReference() so it can set and get the SVGMatrix from the SVGTransform parent. (WebCore::SVGMatrixTearOff::SVGMatrixTearOff): Pass a nullptr to the base class. SVGMatrixTearOff will act as a proxy of the parent. It does not hold any data by itself but it knows what property to set and get from the parent. * svg/properties/SVGPropertyTearOff.h: (WebCore::SVGPropertyTearOff::create): Add a create method which can take a pointer value. (WebCore::SVGPropertyTearOff::propertyReference): (WebCore::SVGPropertyTearOff::setValue): Make these functions virtual so concrete classes like SVGMatrixTearOff can override them. (WebCore::SVGPropertyTearOff::SVGPropertyTearOff): Add a new constructor. 2015-02-15 Said Abou-Hallawa Crash when accessing an item in SVGLengthList and then replacing it with a previous item in the list. https://bugs.webkit.org/show_bug.cgi?id=141552. Reviewed by Darin Adler. Tests: LayoutTests/svg/dom/SVGLengthList-basics.xhtml: This test is modified to include a new test case. * svg/properties/SVGListPropertyTearOff.h: Commit the removal of the replacing item before trying to detach the wrapper of the item which going to be replaced. 2015-02-15 David Kilzer CoreText only needs to be soft-linked on Windows More work towards the Maverick Debug build fix: REGRESSION (r180082): WebCore Debug builds fail on Mavericks due to weak export symbols * page/CaptionUserPreferencesMediaAF.cpp: 2015-02-15 Alexey Proskuryakov More build fixing. * platform/cocoa/TelephoneNumberDetectorCocoa.cpp: 2015-02-14 Alexey Proskuryakov More internal build fixing. DDDFACache.h is not an actual private header, so we were using open source redeclaration of DDDFACacheRef with an internal function prototype from DDDFAScanner.h. * platform/cocoa/TelephoneNumberDetectorCocoa.cpp: (WebCore::TelephoneNumberDetector::phoneNumbersScanner): 2015-02-14 Benjamin Poulain Add the initial matching implementation for attribute selectors with case-insensitive value https://bugs.webkit.org/show_bug.cgi?id=141615 Reviewed by Andreas Kling. Tests: fast/css/case-insensitive-attribute-selector-specificity.html fast/css/case-insensitive-attribute-selector-styling-html-1.html fast/css/case-insensitive-attribute-selector-styling-html-2.html fast/css/case-insensitive-attribute-selector-styling-html-3.html fast/css/case-insensitive-attribute-selector-styling-xhtml-1.xhtml fast/css/case-insensitive-attribute-selector-styling-xhtml-2.xhtml fast/css/case-insensitive-attribute-selector-styling-xhtml-3.xhtml fast/selectors/case-insensitive-attribute-bascis.html fast/selectors/case-insensitive-attribute-matching-style-attribute.html fast/selectors/case-insensitive-attribute-style-update.html fast/selectors/case-insensitive-attribute-with-case-sensitive-name.html * css/SelectorChecker.cpp: (WebCore::SelectorChecker::checkOne): We already had case-insensitive value matching due to some legacy HTML behaviors where some attribute values would be matched case-insensitively depending on the attribute name. For this patch, I just re-use the same mechanism. I used branches to try to convey the idea that matching is case sensitive by default unless the selector has a flag or we are in the weird HTML exception. * cssjit/SelectorCompiler.cpp: (WebCore::SelectorCompiler::constructFragmentsInternal): Disable that case in the CSS JIT for now, I'll implement it later. 2015-02-14 David Kilzer Declare soft-linked functions with extern "C" linkage More work towards the Maverick Debug build fix: REGRESSION (r180082): WebCore Debug builds fail on Mavericks due to weak export symbols * platform/mac/SoftLinking.h: Try declaring soft-linked functions with extern "C" linkage to see if they stop appearing as weak externals. This has the added benefit that if the function signature changes, we'll get a build failure. 2015-02-14 Joseph Pecoraro [Mac] RetainPtr member cleanup, possible leaks https://bugs.webkit.org/show_bug.cgi?id=141616 Reviewed by Andreas Kling. * platform/mac/PlatformSpeechSynthesizerMac.mm: (-[WebSpeechSynthesisWrapper speakUtterance:]): Adopt the allocated object to avoid a possible leak. * platform/mac/ScrollAnimatorMac.mm: (WebCore::ScrollAnimatorMac::ScrollAnimatorMac): Adopt to avoid unnecessary retain/autorelease. 2015-02-14 Joseph Pecoraro IncompleteMetaDataCue leak seen on leaks bot https://bugs.webkit.org/show_bug.cgi?id=141611 Reviewed by Eric Carlson. * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.h: (WebCore::IncompleteMetaDataCue::IncompleteMetaDataCue): Deleted. (WebCore::IncompleteMetaDataCue::~IncompleteMetaDataCue): Deleted. (WebCore::IncompleteMetaDataCue::cueData): Deleted. (WebCore::IncompleteMetaDataCue::startTime): Deleted. Convert to a struct and hold a list of structs instead of pointers. * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp: (WebCore::InbandMetadataTextTrackPrivateAVF::addDataCue): (WebCore::InbandMetadataTextTrackPrivateAVF::updatePendingCueEndTimes): (WebCore::InbandMetadataTextTrackPrivateAVF::flushPartialCues): Update use of IncompleteMetaDataCue and modernize related code. 2015-02-09 Brian J. Burg Web Inspector: remove some unnecessary Inspector prefixes from class names in Inspector namespace https://bugs.webkit.org/show_bug.cgi?id=141372 Reviewed by Joseph Pecoraro. * WebCore.exp.in: * inspector/InspectorApplicationCacheAgent.cpp: (WebCore::InspectorApplicationCacheAgent::didCreateFrontendAndBackend): (WebCore::InspectorApplicationCacheAgent::willDestroyFrontendAndBackend): * inspector/InspectorApplicationCacheAgent.h: * inspector/InspectorCSSAgent.cpp: (WebCore::InspectorCSSAgent::didCreateFrontendAndBackend): (WebCore::InspectorCSSAgent::willDestroyFrontendAndBackend): * inspector/InspectorCSSAgent.h: * inspector/InspectorController.cpp: (WebCore::InspectorController::InspectorController): (WebCore::InspectorController::inspectedPageDestroyed): (WebCore::InspectorController::connectFrontend): (WebCore::InspectorController::disconnectFrontend): (WebCore::InspectorController::show): (WebCore::InspectorController::close): (WebCore::InspectorController::dispatchMessageFromFrontend): * inspector/InspectorController.h: * inspector/InspectorDOMAgent.cpp: (WebCore::InspectorDOMAgent::didCreateFrontendAndBackend): (WebCore::InspectorDOMAgent::willDestroyFrontendAndBackend): * inspector/InspectorDOMAgent.h: * inspector/InspectorDOMDebuggerAgent.cpp: (WebCore::InspectorDOMDebuggerAgent::didCreateFrontendAndBackend): (WebCore::InspectorDOMDebuggerAgent::willDestroyFrontendAndBackend): (WebCore::InspectorDOMDebuggerAgent::didInvalidateStyleAttr): (WebCore::InspectorDOMDebuggerAgent::willInsertDOMNode): (WebCore::InspectorDOMDebuggerAgent::willRemoveDOMNode): (WebCore::InspectorDOMDebuggerAgent::willModifyDOMAttr): (WebCore::InspectorDOMDebuggerAgent::pauseOnNativeEventIfNeeded): (WebCore::InspectorDOMDebuggerAgent::willSendXMLHttpRequest): * inspector/InspectorDOMDebuggerAgent.h: * inspector/InspectorDOMStorageAgent.cpp: (WebCore::InspectorDOMStorageAgent::didCreateFrontendAndBackend): (WebCore::InspectorDOMStorageAgent::willDestroyFrontendAndBackend): * inspector/InspectorDOMStorageAgent.h: * inspector/InspectorDatabaseAgent.cpp: (WebCore::InspectorDatabaseAgent::didCreateFrontendAndBackend): (WebCore::InspectorDatabaseAgent::willDestroyFrontendAndBackend): * inspector/InspectorDatabaseAgent.h: * inspector/InspectorDatabaseResource.cpp: (WebCore::InspectorDatabaseResource::bind): * inspector/InspectorDatabaseResource.h: * inspector/InspectorForwarding.h: * inspector/InspectorIndexedDBAgent.cpp: (WebCore::InspectorIndexedDBAgent::didCreateFrontendAndBackend): (WebCore::InspectorIndexedDBAgent::willDestroyFrontendAndBackend): * inspector/InspectorIndexedDBAgent.h: * inspector/InspectorLayerTreeAgent.cpp: (WebCore::InspectorLayerTreeAgent::didCreateFrontendAndBackend): (WebCore::InspectorLayerTreeAgent::willDestroyFrontendAndBackend): * inspector/InspectorLayerTreeAgent.h: * inspector/InspectorPageAgent.cpp: (WebCore::InspectorPageAgent::didCreateFrontendAndBackend): (WebCore::InspectorPageAgent::willDestroyFrontendAndBackend): (WebCore::InspectorPageAgent::getScriptExecutionStatus): * inspector/InspectorPageAgent.h: * inspector/InspectorReplayAgent.cpp: (WebCore::InspectorReplayAgent::didCreateFrontendAndBackend): (WebCore::InspectorReplayAgent::willDestroyFrontendAndBackend): * inspector/InspectorReplayAgent.h: * inspector/InspectorResourceAgent.cpp: (WebCore::InspectorResourceAgent::didCreateFrontendAndBackend): (WebCore::InspectorResourceAgent::willDestroyFrontendAndBackend): * inspector/InspectorResourceAgent.h: * inspector/InspectorStyleSheet.cpp: (WebCore::InspectorStyle::styleWithProperties): * inspector/InspectorTimelineAgent.cpp: (WebCore::InspectorTimelineAgent::didCreateFrontendAndBackend): (WebCore::InspectorTimelineAgent::willDestroyFrontendAndBackend): * inspector/InspectorTimelineAgent.h: * inspector/InspectorWorkerAgent.cpp: (WebCore::InspectorWorkerAgent::WorkerFrontendChannel::WorkerFrontendChannel): (WebCore::InspectorWorkerAgent::didCreateFrontendAndBackend): (WebCore::InspectorWorkerAgent::willDestroyFrontendAndBackend): * inspector/InspectorWorkerAgent.h: * inspector/PageRuntimeAgent.cpp: (WebCore::PageRuntimeAgent::didCreateFrontendAndBackend): (WebCore::PageRuntimeAgent::willDestroyFrontendAndBackend): * inspector/PageRuntimeAgent.h: * inspector/WorkerInspectorController.cpp: (WebCore::WorkerInspectorController::~WorkerInspectorController): (WebCore::WorkerInspectorController::connectFrontend): (WebCore::WorkerInspectorController::disconnectFrontend): * inspector/WorkerInspectorController.h: * inspector/WorkerRuntimeAgent.cpp: (WebCore::WorkerRuntimeAgent::didCreateFrontendAndBackend): (WebCore::WorkerRuntimeAgent::willDestroyFrontendAndBackend): * inspector/WorkerRuntimeAgent.h: * loader/EmptyClients.h: * page/PageDebuggable.cpp: (WebCore::PageDebuggable::connect): (WebCore::PageDebuggable::disconnect): * page/PageDebuggable.h: * testing/Internals.cpp: (WebCore::Internals::closeDummyInspectorFrontend): * workers/WorkerMessagingProxy.cpp: (WebCore::WorkerMessagingProxy::disconnectFromInspector): 2015-02-14 David Kilzer REGRESSION (r180082): WebCore Debug builds fail on Mavericks due to weak export symbols Work towards fixing the Mavericks Debug build. * dom/Document.h: (WebCore::Document::setAnnotatedRegionsDirty): * dom/Event.h: (WebCore::Event::create): * dom/Node.h: (WebCore::Node::hasEditableStyle): * dom/Position.h: (WebCore::Position::Position): * editing/FrameSelection.h: (WebCore::DragCaretController::clear): * loader/ResourceLoader.h: (WebCore::ResourceLoader::originalRequest): - Do not mark inline methods for export. 2015-02-14 Alexey Proskuryakov rel="noreferrer" should make window.opener null https://bugs.webkit.org/show_bug.cgi?id=141579 Reviewed by Darin Adler. Tests: http/tests/navigation/target-blank-opener-post.html http/tests/navigation/target-blank-opener.html We used to avoid passing window.opener policy by temporarily storing it in a FrameLoader member variable. This works for some clients - ones that invoke delegate callbacks synchronously - but not in the general case. So, changed to passing the policy explicitly. * WebCore.exp.in: * loader/FrameLoader.cpp: (WebCore::FrameLoader::FrameLoader): (WebCore::FrameLoader::urlSelected): (WebCore::FrameLoader::loadURLIntoChildFrame): (WebCore::FrameLoader::loadFrameRequest): (WebCore::FrameLoader::loadURL): (WebCore::FrameLoader::load): (WebCore::FrameLoader::loadPostRequest): (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy): * loader/FrameLoader.h: (WebCore::FrameLoader::suppressOpenerInNewFrame): Deleted. * loader/FrameLoaderTypes.h: * loader/NavigationScheduler.cpp: * page/ContextMenuController.cpp: (WebCore::openNewWindow): (WebCore::ContextMenuController::contextMenuItemSelected): 2015-02-14 David Kilzer REGRESSION (r180082): WebCore build on Mountain Lion fails due to weak export for i386 * Configurations/WebCore.unexp: Add missing symbol. 2015-02-13 Chris Dumez RenderListItem resets its marker's style on style change even if the diff is StyleDifferenceEqual https://bugs.webkit.org/show_bug.cgi?id=141572 Reviewed by Simon Fraser. Do not unnecessarily update the marker's style in RenderListItem::styleDidChange() if the RenderStyle diff is StyleDifferenceEqual. Doing so can cause unnecessary layouts. This was causing high cpu usage on http://www.nokogiri.org/tutorials/searching_a_xml_html_document.html because there is an animation that changes the style every second (but the diff is equal) and the RenderListItem keeps resetting its marker's margin, which triggers a layout and the RenderListMarker re-computes its margin during layout and updates its style again. With this change, CPU usage on the page goes from 150% to 20%. There is only a style recalc happening every second, no more relayouts and repaints. Test: fast/repaint/list-item-equal-style-change-no-repaint.html * rendering/RenderListItem.cpp: (WebCore::RenderListItem::styleDidChange): 2015-02-13 Timothy Horton Make WebCore::IOSurface have single ownership instead of refcounting https://bugs.webkit.org/show_bug.cgi?id=141578 Reviewed by Anders Carlsson. In the interests of making it harder to misuse and to make it more like ImageBuffer, our IOSurface wrapper should have single ownership. This will also allow future changes which depend on temporarily consuming an IOSurface to more easily enforce correct usage. * WebCore.exp.in: * platform/graphics/cg/IOSurfacePool.cpp: (WebCore::IOSurfacePool::takeSurface): (WebCore::IOSurfacePool::addSurface): (WebCore::IOSurfacePool::insertSurfaceIntoPool): (WebCore::IOSurfacePool::tryEvictInUseSurface): (WebCore::IOSurfacePool::tryEvictOldestCachedSurface): (WebCore::IOSurfacePool::collectInUseSurfaces): * platform/graphics/cg/IOSurfacePool.h: * platform/graphics/cocoa/IOSurface.h: * platform/graphics/cocoa/IOSurface.mm: (IOSurface::create): (IOSurface::createFromSendRight): (IOSurface::createFromSurface): (IOSurface::createFromImage): Make IOSurface::create()s return a unique_ptr, and adjust everywhere. 2015-02-12 Enrica Casucci Additional emoji group support. https://bugs.webkit.org/show_bug.cgi?id=141539 rdar://problem/19727527 Reviewed by Sam Weinig. Adding some new emoji ligatures. Updated existing test to include the new sequences. * platform/text/TextBreakIterator.cpp: (WebCore::cursorMovementIterator): * rendering/RenderText.cpp: (WebCore::isEmojiGroupCandidate): 2015-02-13 Alex Christensen Really stop using export files. https://bugs.webkit.org/show_bug.cgi?id=141521 Reviewed by Mark Rowe. * Configurations/WebCore.xcconfig: Don't use exported symbols files. * Configurations/WebCore.unexp: Added list of symbols not to export (needed by Xcode 5.0.2). 2015-02-13 Zalan Bujtas Simplify ASSERT in lastRubyRun(). https://bugs.webkit.org/show_bug.cgi?id=141574 Reviewed by Daniel Bates. r180064 made some of the conditions in the ASSERT redundant. Covered by existing tests. * rendering/RenderRuby.cpp: (WebCore::lastRubyRun): 2015-02-13 Brent Fulgham [Mac, iOS] Adjust pagination behavior for Mail.app printing use https://bugs.webkit.org/show_bug.cgi?id=141569 Reviewed by Anders Carlsson. * page/Settings.in: Add new pagination setting flag. * rendering/RenderBlockFlow.cpp: (WebCore::messageContainerName): Added. (WebCore::needsPaginationQuirk): Added. (WebCore::RenderBlockFlow::adjustLinePositionForPagination): Don't move the message content div to a new page when using this special printing mode. 2015-02-13 Daniel Bates [iOS] DumpRenderTree.app fails to link due to undefined classes Following r179945, DumpRenderTree.app fails to link due to undefined symbols: Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_WebEvent", referenced from: objc-class-ref in libDumpRenderTree.a(EventSendingController.o) "_OBJC_CLASS_$_WebUndefined", referenced from: objc-class-ref in libDumpRenderTree.a(ObjCController.o) We need to export the classes WebScriptObject and WebEvent. * bindings/objc/WebScriptObject.h: * platform/ios/WebEvent.h: 2015-02-13 Andreas Kling CachedResource::clearLoader() should self-destruct if nothing else retains the CachedResource. Reviewed by Antti Koivisto. Anything that may cause CachedResource::canDelete() to return true must also make sure to call CachedResource::deleteIfPossible(), or we risk leaking the CachedResource. This is because CachedResource employs an extremely convoluted lifetime mechanism that depends on its presence in a number of collections, as well as internal counters and state. This is a speculative fix for a potential CachedResource leak that I'm not sure exists in practice, but let's be good citizens here. * loader/cache/CachedResource.cpp: (WebCore::CachedResource::clearLoader): 2015-02-13 Jer Noble [MSE][Mac] Crash at WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset + 2357 https://bugs.webkit.org/show_bug.cgi?id=141566 rdar://problem/19826075 Reviewed by Andreas Kling. Null check m_mediaSource before dereferencing. * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: (WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset): 2015-02-13 Zalan Bujtas REGRESSION (r174761): Invalid cast in WebCore::lastRubyRun / WebCore::RenderRubyAsBlock::addChild https://bugs.webkit.org/show_bug.cgi?id=137929 rdar://problem/18723492 Reviewed by Chris Dumez. Ensure that the child renderer is a RenderRubyRun. Test: fast/ruby/crash-with-before-after-on-ruby.html * rendering/RenderRuby.cpp: (WebCore::lastRubyRun): 2015-02-13 Simon Fraser Crashes under RenderLayer::hitTestLayer under determinePrimarySnapshottedPlugIn() https://bugs.webkit.org/show_bug.cgi?id=141551 Reviewed by Zalan Bujtas. It's possible for a layout to dirty the parent frame's state, via the calls to ownerElement()->scheduleSetNeedsStyleRecalc() that RenderLayerCompositor does when iframes toggle their compositing mode. That could cause FrameView::updateLayoutAndStyleIfNeededRecursive() to fail to leave all the frames in a clean state. Later on, we could enter hit testing, which calls document().updateLayout() on each frame's document. Document::updateLayout() does layout on all ancestor documents, so in the middle of hit testing, we could layout a subframe (dirtying an ancestor frame), then layout another frame, which would forcing that ancestor to be laid out while we're hit testing it, thus corrupting the RenderLayer tree while it's being iterated over. Fix by having FrameView::updateLayoutAndStyleIfNeededRecursive() do a second layout after laying out subframes, which most of the time will be a no-op. Also add a stronger assertion, that this frame and all subframes are clean at the end of FrameView::updateLayoutAndStyleIfNeededRecursive() for the main frame. Various existing frames tests hit the new assertion if the code change is removed, so this is covered by existing tests. * page/FrameView.cpp: (WebCore::FrameView::needsStyleRecalcOrLayout): (WebCore::FrameView::updateLayoutAndStyleIfNeededRecursive): * page/FrameView.h: * rendering/RenderWidget.cpp: (WebCore::RenderWidget::willBeDestroyed): 2015-02-12 Simon Fraser determinePrimarySnapshottedPlugIn() should only traverse visible Frames https://bugs.webkit.org/show_bug.cgi?id=141547 Part of rdar://problem/18445733. Reviewed by Anders Carlsson. There's an expectation from clients that FrameView::updateLayoutAndStyleIfNeededRecursive() updates layout in all frames, but it uses the widget tree, so only hits frames that are parented via renderers (i.e. not display:none frames or their descendants). Moving towards a future where we remove Widgets, fix by adding a FrameTree traversal function that only finds rendered frames (those with an ownerRenderer). Not testable. * page/FrameTree.cpp: (WebCore::FrameTree::firstRenderedChild): (WebCore::FrameTree::nextRenderedSibling): (WebCore::FrameTree::traverseNextRendered): (printFrames): * page/FrameTree.h: * page/FrameView.cpp: (WebCore::FrameView::updateLayoutAndStyleIfNeededRecursive): 2015-02-13 Alexey Proskuryakov TimerBase::m_heapInsertionOrder calculation is racy https://bugs.webkit.org/show_bug.cgi?id=141554 Reviewed by Anders Carlsson. Use an atomic increment. * platform/Timer.cpp: (WebCore::TimerBase::setNextFireTime): 2015-02-13 Andreas Kling [iOS] Refine GC behavior in response to process suspension and memory pressure. Reviewed by Geoffrey Garen. Do an immediate full garbage collection when the web process is about to be suspended (when another tab is moving to the foreground on iOS.) This ensures that we make a best effort to reduce the process footprint before we lose the ability to execute code. When receiving a memory pressure warning, tell the garbage collector to accelerate its next collection (by calling garbageCollectSoon().) This gives us some confidence that a collection will happen within a reasonable timeframe, but doesn't risk dooming us to a loop of endless garbage collections. * platform/cocoa/MemoryPressureHandlerCocoa.mm: (WebCore::MemoryPressureHandler::platformReleaseMemory): 2015-02-13 Antti Koivisto Add some RELEASE_ASSERTs to try to catch crashes in StyleResolver::loadPendingImages https://bugs.webkit.org/show_bug.cgi?id=141561 Reviewed by Simon Fraser. One possibility is that loads triggered by loadPendingImages end up synchronously destroying or re-entering style resolver. Try to catch these in release builds. * css/StyleResolver.cpp: (WebCore::StyleResolver::~StyleResolver): (WebCore::StyleResolver::styleForElement): (WebCore::StyleResolver::styleForKeyframe): (WebCore::StyleResolver::styleForPage): (WebCore::StyleResolver::loadPendingImages): * css/StyleResolver.h: 2015-02-13 ChangSeok Oh Div having contentEditable and display:grid cannot be edited if it is empty. https://bugs.webkit.org/show_bug.cgi?id=141465 Reviewed by Ryosuke Niwa. This bug is quite similar to webkit.org/b/141218. RenderGrid should be also treated as a candidate for visible position as like RenderFlexibleBox. The only different situation between them is that RenderGrid has a bug setting "0px" for logicalHeight when it is empty. RenderGrid should also have a minimum height of a single line if it is editable as well as RenderFlexibleBox does. Test: fast/events/key-events-in-editable-gridbox.html * dom/Position.cpp: (WebCore::Position::isCandidate): (WebCore::Position::isRenderedCharacter): * rendering/RenderGrid.cpp: (WebCore::RenderGrid::layoutGridItems): 2015-02-12 Zalan Bujtas REGRESSION (r176262): Invalid cast in WebCore`WebCore::RootInlineBox::selectionTop https://bugs.webkit.org/show_bug.cgi?id=138992 Reviewed by Dave Hyatt. RenderRubyText requires the ancestor chain to be (RenderRubyAsInline | RenderRubyAsBlock) -> RenderRubyRun -> RenderRubyText. This patch ensures that we create RenderRubyText for an element only when the expected ancestor chain is guaranteed. Test: fast/ruby/crash-when-ruby-is-set-to-inline-block.html * rendering/RenderElement.cpp: (WebCore::RenderElement::createFor): treat inline-block as block. * rendering/RenderObject.h: (WebCore::RenderObject::isRubyInline): (WebCore::RenderObject::isRubyBlock): (WebCore::RenderObject::isRuby): Deleted. * rendering/RenderRuby.cpp: (WebCore::isAnonymousRubyInlineBlock): * rendering/RenderRuby.h: add support for is(renderer) and for is(renderer) The isRuby() method does not follow the is*() -> maps to one class pattern. (WebCore::isRuby): * rendering/RenderRubyRun.cpp: (WebCore::RenderRubyRun::addChild): (WebCore::RenderRubyRun::staticCreateRubyRun): 2015-02-13 Csaba Osztrogonac Fix the gperf related build issue on the WinCairo bot https://bugs.webkit.org/show_bug.cgi?id=141507 Reviewed by Alex Christensen. * platform/ColorData.gperf: Modified property svn:eol-style. 2015-02-13 Csaba Osztrogonác Unreviewed, remove empty directories. * loader/icon/wince: Removed. * platform/graphics/wince: Removed. * storage/wince: Removed. 2015-02-12 Timothy Horton Crashes under detectItemAroundHitTestResult when DataDetectors is not available https://bugs.webkit.org/show_bug.cgi?id=141549 Reviewed by Dan Bernstein. * editing/mac/DataDetection.mm: (WebCore::DataDetection::detectItemAroundHitTestResult): Bail out from data detection if either of the relevant frameworks aren't loaded. 2015-02-12 Dean Jackson [iOS Media] Audio should hide timeline scrubber until playback starts https://bugs.webkit.org/show_bug.cgi?id=141542 Reviewed by Eric Carlson. We regressed from the system behaviour in iOS 7, where the timeline scrubber for an audio element is not shown until the user starts playback. * Modules/mediacontrols/mediaControlsiOS.css: (video::-webkit-media-controls-panel): Fix the alignment of the flexbox. (audio::-webkit-media-controls-status-display): Add the style for the status display. * Modules/mediacontrols/mediaControlsiOS.js: (ControllerIOS.prototype.configureInlineControls): Start hidden if we are an