2014-02-20 Dean Jackson An unresolved WebGL Context should operate normally until used https://bugs.webkit.org/show_bug.cgi?id=129110 Reviewed by Brent Fulgham. Add the ability to create a special instance of WebGLRenderingContext, that appears normal but won't actually do anything if asked. This will be created in the case of the WebGLLoadPolicy being "pending" and helps in the case of pages that feature detect by creating a context and immediately deleting it. Note that the context doesn't actually try to recover from this state yet, although that would be a nice addition. When asked to do something it could actually try to create the GraphicsContext3D. However, if it fails it would then have to fire a context lost. * html/HTMLCanvasElement.cpp: (WebCore::HTMLCanvasElement::getContext): Move the load policy code out of getContext. * html/canvas/WebGLRenderingContext.cpp: (WebCore::WebGLRenderingContext::create): Add the ability to create a pending context. (WebCore::WebGLRenderingContext::WebGLRenderingContext): New constructor for a pending context. (WebCore::WebGLRenderingContext::~WebGLRenderingContext): Only delete if not pending. (WebCore::WebGLRenderingContext::destroyGraphicsContext3D): Ditto. (WebCore::WebGLRenderingContext::clearIfComposited): Everything below is about checking the pending state before doing anything, and triggering a resolution if necessary. (WebCore::WebGLRenderingContext::activeTexture): (WebCore::WebGLRenderingContext::attachShader): (WebCore::WebGLRenderingContext::bindAttribLocation): (WebCore::WebGLRenderingContext::checkObjectToBeBound): (WebCore::WebGLRenderingContext::blendColor): (WebCore::WebGLRenderingContext::blendEquation): (WebCore::WebGLRenderingContext::blendEquationSeparate): (WebCore::WebGLRenderingContext::blendFunc): (WebCore::WebGLRenderingContext::blendFuncSeparate): (WebCore::WebGLRenderingContext::bufferData): (WebCore::WebGLRenderingContext::bufferSubData): (WebCore::WebGLRenderingContext::checkFramebufferStatus): (WebCore::WebGLRenderingContext::clear): (WebCore::WebGLRenderingContext::clearColor): (WebCore::WebGLRenderingContext::clearDepth): (WebCore::WebGLRenderingContext::clearStencil): (WebCore::WebGLRenderingContext::colorMask): (WebCore::WebGLRenderingContext::compileShader): (WebCore::WebGLRenderingContext::compressedTexImage2D): (WebCore::WebGLRenderingContext::compressedTexSubImage2D): (WebCore::WebGLRenderingContext::copyTexImage2D): (WebCore::WebGLRenderingContext::copyTexSubImage2D): (WebCore::WebGLRenderingContext::createBuffer): (WebCore::WebGLRenderingContext::createFramebuffer): (WebCore::WebGLRenderingContext::createTexture): (WebCore::WebGLRenderingContext::createProgram): (WebCore::WebGLRenderingContext::createRenderbuffer): (WebCore::WebGLRenderingContext::createShader): (WebCore::WebGLRenderingContext::cullFace): (WebCore::WebGLRenderingContext::deleteObject): (WebCore::WebGLRenderingContext::depthFunc): (WebCore::WebGLRenderingContext::depthMask): (WebCore::WebGLRenderingContext::depthRange): (WebCore::WebGLRenderingContext::detachShader): (WebCore::WebGLRenderingContext::disable): (WebCore::WebGLRenderingContext::disableVertexAttribArray): (WebCore::WebGLRenderingContext::validateDrawArrays): (WebCore::WebGLRenderingContext::validateDrawElements): (WebCore::WebGLRenderingContext::enable): (WebCore::WebGLRenderingContext::enableVertexAttribArray): (WebCore::WebGLRenderingContext::finish): (WebCore::WebGLRenderingContext::flush): (WebCore::WebGLRenderingContext::framebufferRenderbuffer): (WebCore::WebGLRenderingContext::framebufferTexture2D): (WebCore::WebGLRenderingContext::frontFace): (WebCore::WebGLRenderingContext::generateMipmap): (WebCore::WebGLRenderingContext::getActiveAttrib): (WebCore::WebGLRenderingContext::getActiveUniform): (WebCore::WebGLRenderingContext::getAttachedShaders): (WebCore::WebGLRenderingContext::getAttribLocation): (WebCore::WebGLRenderingContext::getBufferParameter): (WebCore::WebGLRenderingContext::getContextAttributes): (WebCore::WebGLRenderingContext::getExtension): (WebCore::WebGLRenderingContext::getFramebufferAttachmentParameter): (WebCore::WebGLRenderingContext::getParameter): (WebCore::WebGLRenderingContext::getProgramParameter): (WebCore::WebGLRenderingContext::getProgramInfoLog): (WebCore::WebGLRenderingContext::getRenderbufferParameter): (WebCore::WebGLRenderingContext::getShaderParameter): (WebCore::WebGLRenderingContext::getShaderInfoLog): (WebCore::WebGLRenderingContext::getShaderPrecisionFormat): (WebCore::WebGLRenderingContext::getShaderSource): (WebCore::WebGLRenderingContext::getTexParameter): (WebCore::WebGLRenderingContext::getUniform): (WebCore::WebGLRenderingContext::getUniformLocation): (WebCore::WebGLRenderingContext::getVertexAttrib): (WebCore::WebGLRenderingContext::getVertexAttribOffset): (WebCore::WebGLRenderingContext::hint): (WebCore::WebGLRenderingContext::isBuffer): (WebCore::WebGLRenderingContext::isContextLostOrPending): (WebCore::WebGLRenderingContext::isEnabled): (WebCore::WebGLRenderingContext::isFramebuffer): (WebCore::WebGLRenderingContext::isProgram): (WebCore::WebGLRenderingContext::isRenderbuffer): (WebCore::WebGLRenderingContext::isShader): (WebCore::WebGLRenderingContext::isTexture): (WebCore::WebGLRenderingContext::lineWidth): (WebCore::WebGLRenderingContext::linkProgram): (WebCore::WebGLRenderingContext::pixelStorei): (WebCore::WebGLRenderingContext::polygonOffset): (WebCore::WebGLRenderingContext::readPixels): (WebCore::WebGLRenderingContext::releaseShaderCompiler): (WebCore::WebGLRenderingContext::renderbufferStorage): (WebCore::WebGLRenderingContext::sampleCoverage): (WebCore::WebGLRenderingContext::scissor): (WebCore::WebGLRenderingContext::shaderSource): (WebCore::WebGLRenderingContext::stencilFunc): (WebCore::WebGLRenderingContext::stencilFuncSeparate): (WebCore::WebGLRenderingContext::stencilMask): (WebCore::WebGLRenderingContext::stencilMaskSeparate): (WebCore::WebGLRenderingContext::stencilOp): (WebCore::WebGLRenderingContext::stencilOpSeparate): (WebCore::WebGLRenderingContext::texImage2D): (WebCore::WebGLRenderingContext::texParameter): (WebCore::WebGLRenderingContext::texSubImage2D): (WebCore::WebGLRenderingContext::uniform1f): (WebCore::WebGLRenderingContext::uniform1fv): (WebCore::WebGLRenderingContext::uniform1i): (WebCore::WebGLRenderingContext::uniform1iv): (WebCore::WebGLRenderingContext::uniform2f): (WebCore::WebGLRenderingContext::uniform2fv): (WebCore::WebGLRenderingContext::uniform2i): (WebCore::WebGLRenderingContext::uniform2iv): (WebCore::WebGLRenderingContext::uniform3f): (WebCore::WebGLRenderingContext::uniform3fv): (WebCore::WebGLRenderingContext::uniform3i): (WebCore::WebGLRenderingContext::uniform3iv): (WebCore::WebGLRenderingContext::uniform4f): (WebCore::WebGLRenderingContext::uniform4fv): (WebCore::WebGLRenderingContext::uniform4i): (WebCore::WebGLRenderingContext::uniform4iv): (WebCore::WebGLRenderingContext::uniformMatrix2fv): (WebCore::WebGLRenderingContext::uniformMatrix3fv): (WebCore::WebGLRenderingContext::uniformMatrix4fv): (WebCore::WebGLRenderingContext::validateProgram): (WebCore::WebGLRenderingContext::vertexAttribPointer): (WebCore::WebGLRenderingContext::viewport): (WebCore::WebGLRenderingContext::forceLostContext): (WebCore::WebGLRenderingContext::forceRestoreContext): (WebCore::WebGLRenderingContext::platformLayer): (WebCore::WebGLRenderingContext::removeSharedObject): (WebCore::WebGLRenderingContext::addSharedObject): (WebCore::WebGLRenderingContext::removeContextObject): (WebCore::WebGLRenderingContext::addContextObject): (WebCore::WebGLRenderingContext::detachAndRemoveAllObjects): (WebCore::WebGLRenderingContext::stop): (WebCore::WebGLRenderingContext::vertexAttribfImpl): (WebCore::WebGLRenderingContext::vertexAttribfvImpl): (WebCore::WebGLRenderingContext::vertexAttribDivisor): * html/canvas/WebGLRenderingContext.h: 2014-02-20 Dean Jackson Add an unresolved WebGLPolicy and an API to resolve it https://bugs.webkit.org/show_bug.cgi?id=129109 Reviewed by Anders Carlsson. Add a third WebGLLoadPolicy which is "pending" allowing the page to go ahead with creating the WebGLRenderingContext and resolve the policy at a later time. Add a new API resolveWebGLLoadPolicy to do the resolution. * html/HTMLCanvasElement.cpp: (WebCore::HTMLCanvasElement::getContext): WebGLBlock -> WebGLBlockCreation * loader/FrameLoaderClient.h: (WebCore::FrameLoaderClient::webGLPolicyForURL): WebGLAllow -> WebGLAllowCreation. (WebCore::FrameLoaderClient::resolveWebGLPolicyForURL): New method. * loader/FrameLoaderTypes.h: Add WebGLPendingCreation. 2014-02-20 Zalan Bujtas Subpixel rendering: Enable compositing RenderLayer painting on device pixel position. https://bugs.webkit.org/show_bug.cgi?id=128509 Reviewed by Simon Fraser. GraphicsLayer is now positioned on device pixel boundary. This enables us to put compositing layers on a subpixel position and animate them with device pixel precision. Tests: fast/sub-pixel/compositing-layers-on-subpixel-position.html fast/sub-pixel/simple-clipping.html * platform/LayoutUnit.h: (WebCore::ceilToDevicePixel): * platform/graphics/LayoutPoint.h: (WebCore::flooredForPainting): (WebCore::ceiledForPainting): * platform/graphics/LayoutRect.cpp: (WebCore::enclosingRectForPainting): * platform/graphics/LayoutRect.h: * rendering/RenderLayer.cpp: (WebCore::RenderLayer::clipToRect): * rendering/RenderLayerBacking.cpp: (WebCore::clipBox): (WebCore::pixelFractionForLayerPainting): (WebCore::calculateDevicePixelOffsetFromRenderer): (WebCore::RenderLayerBacking::updateGraphicsLayerGeometry): (WebCore::RenderLayerBacking::paintIntoLayer): * rendering/RenderLayerBacking.h: 2014-02-20 Bem Jones-Bey Rename border/padding/margin width/height to horizontal/vertical extent on RenderBoxModelObject https://bugs.webkit.org/show_bug.cgi?id=129043 Reviewed by David Hyatt. Using horizontal extent instead of width and vertical extent instead of height makes it more obvious that these are measurements of both border/margin/padding sides, not just one. As David Hyatt put it: "I dislike using terms like 'width' since it could be confused with the actual border-width CSS name, i.e., a person new to this code would think the method was returning the pixel width of a single border." No new tests, no behavior change. * html/HTMLAppletElement.cpp: (WebCore::HTMLAppletElement::updateWidget): * inspector/InspectorOverlay.cpp: * rendering/RenderBlockLineLayout.cpp: (WebCore::RenderBlockFlow::checkFloatsInCleanLine): * rendering/RenderBox.cpp: (WebCore::RenderBox::repaintLayerRectsForImage): (WebCore::RenderBox::positionForPoint): * rendering/RenderBoxModelObject.h: (WebCore::RenderBoxModelObject::horizontalBorderExtent): (WebCore::RenderBoxModelObject::verticalBorderExtent): (WebCore::RenderBoxModelObject::verticalBorderAndPaddingExtent): (WebCore::RenderBoxModelObject::horizontalBorderAndPaddingExtent): (WebCore::RenderBoxModelObject::verticalMarginExtent): (WebCore::RenderBoxModelObject::horizontalMarginExtent): * rendering/RenderDeprecatedFlexibleBox.cpp: (WebCore::RenderDeprecatedFlexibleBox::layoutHorizontalBox): (WebCore::RenderDeprecatedFlexibleBox::layoutVerticalBox): (WebCore::RenderDeprecatedFlexibleBox::applyLineClamp): * rendering/RenderFieldset.cpp: (WebCore::RenderFieldset::computePreferredLogicalWidths): * rendering/RenderFileUploadControl.cpp: (WebCore::RenderFileUploadControl::computePreferredLogicalWidths): * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::crossAxisMarginExtentForChild): (WebCore::RenderFlexibleBox::mainAxisBorderAndPaddingExtentForChild): (WebCore::RenderFlexibleBox::computeNextFlexLine): * rendering/RenderInline.cpp: (WebCore::RenderInline::localCaretRect): (WebCore::RenderInline::generateCulledLineBoxRects): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::resize): * rendering/RenderListBox.cpp: (WebCore::RenderListBox::computePreferredLogicalWidths): (WebCore::RenderListBox::computeLogicalHeight): * rendering/RenderMenuList.cpp: (RenderMenuList::computePreferredLogicalWidths): * rendering/RenderScrollbar.cpp: (WebCore::RenderScrollbar::trackPieceRectWithMargins): * rendering/RenderSlider.cpp: (WebCore::RenderSlider::computePreferredLogicalWidths): * rendering/RenderTextControl.cpp: (WebCore::RenderTextControl::computeLogicalHeight): * rendering/RenderTextControlSingleLine.cpp: (WebCore::RenderTextControlSingleLine::layout): * rendering/line/LineLayoutState.h: (WebCore::FloatWithRect::FloatWithRect): * rendering/shapes/ShapeInfo.cpp: (WebCore::ShapeInfo::setReferenceBoxLogicalSize): * rendering/svg/RenderSVGRoot.cpp: (WebCore::RenderSVGRoot::updateCachedBoundaries): 2014-02-20 Bem Jones-Bey Rename RenderBlockFlow::clearFloats and RenderBlockFlow::newLine to be more accurate https://bugs.webkit.org/show_bug.cgi?id=128991 Reviewed by David Hyatt. Rename clearFloats to rebuildFloatingObjectSetFromIntrudingFloats since it does just that. Rename newLine to clearFloats because it actually does what the CSS spec calls clearing floats. This also matches clearFloatsIfNeeded. This also removes a FIXME comment that points to a bug that has already been fixed. This patch is based on a Blink patch by leviw: https://src.chromium.org/viewvc/blink?revision=158598&view=revision No new tests, no behavior change. * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::rebuildFloatingObjectSetFromIntrudingFloats): (WebCore::RenderBlockFlow::layoutBlock): (WebCore::RenderBlockFlow::clearFloats): * rendering/RenderBlockFlow.h: * rendering/RenderBlockLineLayout.cpp: (WebCore::RenderBlockFlow::layoutRunsAndFloats): (WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange): * rendering/line/BreakingContextInlineHeaders.h: (WebCore::BreakingContext::handleFloat): * rendering/svg/RenderSVGText.cpp: (WebCore::RenderSVGText::layout): 2014-02-19 Pratik Solanki ASSERT in FrameLoader::shouldInterruptLoadForXFrameOptions https://bugs.webkit.org/show_bug.cgi?id=129081 Reviewed by Alexey Proskuryakov. Do not assert if the server sends us a malformed X-Frame-Options header. * loader/FrameLoader.cpp: (WebCore::FrameLoader::shouldInterruptLoadForXFrameOptions): 2014-02-20 Krzysztof Czech AX: Use auto to reduce some code in loops https://bugs.webkit.org/show_bug.cgi?id=129087 Reviewed by Chris Fleizach. Use auto where appropriate to reduce some code. * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::boundingBoxForQuads): (WebCore::AccessibilityObject::ariaRoleToWebCoreRole): * accessibility/atk/WebKitAccessibleInterfaceHypertext.cpp: (webkitAccessibleHypertextGetNLinks): 2014-02-20 Commit Queue Unreviewed, rolling out r164422. http://trac.webkit.org/changeset/164422 https://bugs.webkit.org/show_bug.cgi?id=129102 Causes assertions in ScriptExecutionContext::canSuspendActiveDOMObjects() (Requested by zdobersek on #webkit). * dom/KeyboardEvent.cpp: (WebCore::KeyboardEvent::KeyboardEvent): * dom/KeyboardEvent.h: * dom/ScriptExecutionContext.cpp: (WebCore::ScriptExecutionContext::reportException): (WebCore::ScriptExecutionContext::publicURLManager): * dom/ScriptExecutionContext.h: * dom/ScriptRunner.h: 2014-02-20 Zan Dobersek Move to using std::unique_ptr for VisitedLinkState, CheckedRadioButtons https://bugs.webkit.org/show_bug.cgi?id=128967 Reviewed by Andreas Kling. Replace uses of OwnPtr and PassOwnPtr in the VisitedLinkState and CheckedRadioButtons classes with std::unique_ptr. * dom/CheckedRadioButtons.cpp: (WebCore::RadioButtonGroup::RadioButtonGroup): (WebCore::RadioButtonGroup::remove): (WebCore::CheckedRadioButtons::addButton): (WebCore::CheckedRadioButtons::removeButton): * dom/CheckedRadioButtons.h: * dom/Document.cpp: (WebCore::Document::Document): * dom/Document.h: * dom/VisitedLinkState.cpp: * dom/VisitedLinkState.h: 2014-02-20 Artur Moryc AX: Children Nodes for Canvas objects are not equal to Render Objects. https://bugs.webkit.org/show_bug.cgi?id=123568 Reviewed by Chris Fleizach. There is a difference in children nodes taken into account for RenderObject and for NodeObject types. There is a problem with text nodes that are focusable for EFL/GTK and therefore are not filtered out in the test like it happens for the MAC port. Text nodes are eliminated in the AccessibilityRenderObject::computeAccessibilityIsIgnored() method. The same approach has been applied to the NodeObject to eliminate text nodes. Covered by existing tests. * accessibility/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::computeAccessibilityIsIgnored): 2014-02-20 Zan Dobersek Move to using std::unique_ptr for KeyboardEvent, ScriptExecutionContext::PendingException https://bugs.webkit.org/show_bug.cgi?id=129061 Reviewed by Andreas Kling. Replace uses of OwnPtr and PassOwnPtr for KeyboardEvent and ScriptExecutionContext::PendingException classes with std::unique_ptr. ScriptExecutionContext::Task objects are still handled through OwnPtr, but this will be addressed later. * dom/KeyboardEvent.cpp: (WebCore::KeyboardEvent::KeyboardEvent): * dom/KeyboardEvent.h: * dom/ScriptExecutionContext.cpp: (WebCore::ScriptExecutionContext::reportException): (WebCore::ScriptExecutionContext::publicURLManager): * dom/ScriptExecutionContext.h: * dom/ScriptRunner.h: Remove an unnecessary PassOwnPtr header inclusion. 2014-02-20 Zan Dobersek Move to using std::unique_ptr for EventListenerMap, EventTarget https://bugs.webkit.org/show_bug.cgi?id=129062 Reviewed by Andreas Kling. Replace uses of OwnPtr and PassOwnPtr in the EventListenerMap and EventTarget classes with std::unique_ptr. * dom/EventListenerMap.cpp: (WebCore::EventListenerMap::add): * dom/EventListenerMap.h: * dom/EventTarget.cpp: (WebCore::EventTarget::fireEventListeners): * dom/EventTarget.h: 2014-02-20 Zan Dobersek Move to using std::unique_ptr for Document and related classes https://bugs.webkit.org/show_bug.cgi?id=129063 Reviewed by Anders Carlsson. Replace uses of OwnPtr and PassOwnPtr in the Document and related classes with std::unique_ptr. * dom/DOMImplementation.h: * dom/Document.cpp: (WebCore::Document::Document): (WebCore::Document::removedLastRef): (WebCore::Document::selectorQueryCache): (WebCore::Document::implementation): (WebCore::Document::formController): (WebCore::Document::createStyleResolver): (WebCore::Document::clearStyleResolver): (WebCore::Document::clearAXObjectCache): (WebCore::Document::axObjectCache): (WebCore::Document::setParsing): (WebCore::Document::styleResolverChanged): (WebCore::Document::setTransformSource): (WebCore::Document::accessSVGExtensions): (WebCore::Document::sharedObjectPoolClearTimerFired): (WebCore::Document::didAddTouchEventHandler): * dom/Document.h: * dom/DocumentEventQueue.cpp: (WebCore::DocumentEventQueue::DocumentEventQueue): * dom/DocumentEventQueue.h: * dom/DocumentMarkerController.cpp: (WebCore::DocumentMarkerController::addMarker): * dom/DocumentMarkerController.h: * dom/DocumentSharedObjectPool.cpp: * dom/DocumentSharedObjectPool.h: * dom/DocumentStyleSheetCollection.cpp: (WebCore::DocumentStyleSheetCollection::updateActiveStyleSheets): (WebCore::DocumentStyleSheetCollection::activeStyleSheetsContains): * dom/DocumentStyleSheetCollection.h: * dom/DocumentType.h: * html/FormController.h: * rendering/TextAutosizer.h: * xml/parser/XMLDocumentParserLibxml2.cpp: (WebCore::XMLDocumentParser::doEnd): 2014-02-20 Mihnea Ovidenie [CSSRegions] Add helper method for region clipping flow content https://bugs.webkit.org/show_bug.cgi?id=129036 Reviewed by Andrei Bucur. Add helper method to test whether a region should clip the flow thread content and use it thoughout the code. Code refactoring, no functionality change, no new tests. * rendering/RenderLayer.cpp: (WebCore::RenderLayer::calculateClipRects): * rendering/RenderRegion.cpp: (WebCore::RenderRegion::overflowRectForFlowThreadPortion): (WebCore::RenderRegion::shouldClipFlowThreadContent): (WebCore::RenderRegion::rectFlowPortionForBox): * rendering/RenderRegion.h: 2014-02-20 Frédéric Wang Implement the MathML Operator Dictionary. https://bugs.webkit.org/show_bug.cgi?id=99620 Reviewed by Chris Fleizach. The MathML Operator Dictionary is implemented and the corresponding mo attributes are parsed. Currently, only the stretchy property is used for the visual rendering and the fence/separators properties are used by the accessibility code. Very basic heuristics to determine the form are also added. Tests: mathml/presentation/mo-form-fallback.html mathml/presentation/mo-form-stretchy.html mathml/presentation/mo-invalid-attributes.html * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::isMathFenceOperator): (WebCore::AccessibilityRenderObject::isMathSeparatorOperator): * mathml/mathattrs.in: * rendering/mathml/RenderMathMLFenced.cpp: (WebCore::RenderMathMLFenced::createMathMLOperator): (WebCore::RenderMathMLFenced::makeFences): (WebCore::RenderMathMLFenced::addChild): * rendering/mathml/RenderMathMLFenced.h: * rendering/mathml/RenderMathMLOperator.cpp: (WebCore::MathMLOperatorDictionary::ExtractKey): (WebCore::MathMLOperatorDictionary::ExtractChar): (WebCore::RenderMathMLOperator::RenderMathMLOperator): (WebCore::RenderMathMLOperator::setOperatorFlagFromAttribute): (WebCore::RenderMathMLOperator::setOperatorPropertiesFromOpDictEntry): (WebCore::RenderMathMLOperator::SetOperatorProperties): (WebCore::RenderMathMLOperator::advanceForCharacter): (WebCore::RenderMathMLOperator::computePreferredLogicalWidths): (WebCore::RenderMathMLOperator::updateFromElement): (WebCore::RenderMathMLOperator::shouldAllowStretching): (WebCore::RenderMathMLOperator::updateStyle): * rendering/mathml/RenderMathMLOperator.h: 2014-02-19 Zalan Bujtas Subpixel rendering: Make GraphicsLayer's offsetFromRenderer subpixel position based. https://bugs.webkit.org/show_bug.cgi?id=128694 Reviewed by Simon Fraser. Changing layers from using integral types to using Float/LayoutUnits so that we can position them on subpixels. They are still integral positioned though. Covered by existing tests. * platform/graphics/GraphicsLayer.cpp: (WebCore::GraphicsLayer::setOffsetFromRenderer): (WebCore::GraphicsLayer::paintGraphicsLayerContents): * platform/graphics/GraphicsLayer.h: (WebCore::GraphicsLayer::offsetFromRenderer): removed incorrect comment. * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateGraphicsLayerGeometry): (WebCore::RenderLayerBacking::adjustAncestorCompositingBoundsForFlowThread): (WebCore::RenderLayerBacking::positionOverflowControlsLayers): (WebCore::RenderLayerBacking::computeTransformOrigin): (WebCore::RenderLayerBacking::computePerspectiveOrigin): * rendering/RenderLayerBacking.h: * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::requiresOwnBackingStore): * rendering/RenderLayerCompositor.h: * rendering/RenderMultiColumnSet.cpp: (WebCore::RenderMultiColumnSet::adjustRegionBoundsFromFlowThreadPortionRect): * rendering/RenderMultiColumnSet.h: * rendering/RenderRegion.cpp: (WebCore::RenderRegion::adjustRegionBoundsFromFlowThreadPortionRect): * rendering/RenderRegion.h: 2014-02-19 Zalan Bujtas Subpixel rendering: Make GraphicsLayer::paintGraphicsLayerContents()'s cliprect FloatRect based. https://bugs.webkit.org/show_bug.cgi?id=128911 Reviewed by Simon Fraser. Switching from IntRect to FloatRect makes device pixel position clipping possible. Covered by existing tests. * WebCore.exp.in: * platform/graphics/GraphicsLayer.cpp: (WebCore::GraphicsLayer::paintGraphicsLayerContents): * platform/graphics/GraphicsLayer.h: * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::platformCALayerPaintContents): * platform/graphics/ca/GraphicsLayerCA.h: * platform/graphics/ca/PlatformCALayerClient.h: * platform/graphics/ca/mac/TileController.h: * platform/graphics/ca/mac/TileController.mm: (WebCore::TileController::platformCALayerPaintContents): * platform/graphics/mac/WebLayer.mm: (WebCore::drawLayerContents): (-[WebSimpleLayer drawInContext:]): 2014-02-19 Zalan Bujtas Subpixel rendering: (RenderLayer)Pass non-css-pixel-snapped dirty rects to PaintInfo when painting renderer(). https://bugs.webkit.org/show_bug.cgi?id=128913 Reviewed by Simon Fraser. This is part of the preparation to move RenderLayers to device pixel positioning. We might need to device pixelsnapp the dirty rects later, but PaintInfo should be able to manage that instead of doing it everywhere in the code. Covered by existing tests. * rendering/RenderLayer.cpp: (WebCore::RenderLayer::paintBackgroundForFragments): (WebCore::RenderLayer::paintForegroundForFragmentsWithPhase): (WebCore::RenderLayer::paintOutlineForFragments): (WebCore::RenderLayer::paintMaskForFragments): 2014-02-19 Ryosuke Niwa fieldset:disabled fieldset > legend:first-child input should be disabled https://bugs.webkit.org/show_bug.cgi?id=129077 Reviewed by Antti Koivisto. Similar to r164403. When a fieldset inside a disabled fieldset, input elements inside the inner fieldset's first legend element child should be disabled. Test: fast/forms/fieldset/fieldset-disabled-2.html * html/HTMLFieldSetElement.cpp: (WebCore::HTMLFieldSetElement::legend): Fixed the bug where it was returning the first legend element descendent. It should be the first legend element _child_. * html/HTMLFormControlElement.cpp: (WebCore::HTMLFormControlElement::updateAncestorDisabledState): Fixed the algorithm to look for any ancestor fieldset that has been disabled instead of the first fieldset ancestor and checking its disabledness. 2014-02-19 Ryosuke Niwa Debug build fix after r164401. Removed a bogus assertion in comparePositions. When either position is anchored at a detached node, they don't have a tree scope in common. * editing/htmlediting.cpp: (WebCore::comparePositions): 2014-02-19 Ryosuke Niwa fieldset:disabled > legend:first-child legend input should not be disabled https://bugs.webkit.org/show_bug.cgi?id=129068 Reviewed by Andreas Kling. An input element inside a disabled fieldset element is ordinarily disabled unless it's inside a legend element that is the first of its kind to appear in the fieldset's child node list. Prior to this patch, an input element inside such a legend element was erroneously disabled if we had another legend element between the two as in
. Fixed the bug by correcting the algorithm in updateAncestorDisabledState. Test: fast/forms/fieldset/fieldset-disabled-2.html * html/HTMLFormControlElement.cpp: (WebCore::HTMLFormControlElement::updateAncestorDisabledState): 2014-02-18 Ryosuke Niwa Changing selection shouldn't synchronously update editor UI components https://bugs.webkit.org/show_bug.cgi?id=129024 Reviewed by Brent Fulgham. Make updates to spellchecker, alternative text controller (correction pane), and delete button controller asynchronous for programmatically triggered selection changes. We continue to update their states synchronously immediately after we have applied, unapplied, or reapplied editing commands to keep states in spell checker and alternative text controller consistent. We should be able to make them asynchronous as well in the future but that should be done in a separate patch. * WebCore.exp.in: * editing/AlternativeTextController.cpp: (WebCore::AlternativeTextController::respondToChangedSelection): This function used to enumerate all document makers and call respondToMarkerAtEndOfWord on each one of them only to exit early when SetSelectionOptions had DictationTriggered. This condition is now checked in Editor::respondToChangedSelection to avoid all the unnecessary work and remove the dependency on SetSelectionOptions. (WebCore::AlternativeTextController::respondToMarkerAtEndOfWord): Ditto. * editing/AlternativeTextController.h: * editing/Editor.cpp: (WebCore::Editor::appliedEditing): Calls updateEditorUINowIfScheduled before calling respondToAppliedEditing on the alternative text controller. (WebCore::Editor::unappliedEditing): Ditto. (WebCore::Editor::reappliedEditing): Ditto. (WebCore::Editor::Editor): Initializes newly added booleans. (WebCore::Editor::respondToChangedSelection): Continue to call respondToChangedSelection (for API consistency) and setStartNewKillRingSequence but defer the "editor UI updates" to spellchecker, alternative text controller and delete button controller by firing a newly added one shot timer. (WebCore::Editor::updateEditorUINowIfScheduled): Synchronously update the pending editor UI updates. (WebCore::Editor::editorUIUpdateTimerFired): Extracted from respondToChangedSelection. * editing/Editor.h: * testing/Internals.cpp: (WebCore::Internals::markerCountForNode): Calls updateEditorUINowIfScheduled() to update document markers. (WebCore::Internals::markerAt): Ditto. (WebCore::Internals::updateEditorUINowIfScheduled): Added. (WebCore::Internals::findEditingDeleteButton): Added. Updates delete button controller synchronously. (WebCore::Internals::hasSpellingMarker): Calls updateEditorUINowIfScheduled() to update document markers. (WebCore::Internals::hasAutocorrectedMarker): Ditto. * testing/Internals.h: * testing/Internals.idl: 2014-02-19 Anders Carlsson Add WTF_MAKE_FAST_ALLOCATED to more classes https://bugs.webkit.org/show_bug.cgi?id=129064 Reviewed by Andreas Kling. * dom/EventContext.h: * platform/graphics/Region.h: * platform/text/BidiResolver.h: * rendering/LayoutState.h: 2014-02-19 Ryosuke Niwa isEditablePosition shouldn't trigger synchronous layout https://bugs.webkit.org/show_bug.cgi?id=129026 Reviewed by Brent Fulgham. Just trigger style recalc instead. * editing/htmlediting.cpp: (WebCore::isEditablePosition): 2014-02-19 Beth Dakin UIProcess needs to know the color of the page's extended background https://bugs.webkit.org/show_bug.cgi?id=129004 Rubber-stamped by Andreas Kling. Missed this late-breaking review comment. Fixing now! * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::RenderLayerCompositor): 2014-02-19 Beth Dakin UIProcess needs to know the color of the page's extended background https://bugs.webkit.org/show_bug.cgi?id=129004 Reviewed by Brent Fulgham. This patch adds a new ChromeClient function, pageExtendedBackgroundColorDidChange() which will be called whenever the extended background color has changed. New function. * page/ChromeClient.h: (WebCore::ChromeClient::pageExtendedBackgroundColorDidChange): Store the extended background color in a member variable so that we can know if it changed even if we do not have an m_layerForOverhangAreas. * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::RenderLayerCompositor): (WebCore::RenderLayerCompositor::setRootExtendedBackgroundColor): * rendering/RenderLayerCompositor.h: 2014-02-19 Dirk Schulze Missing box doesn't use border-box as reference box for clip-path https://bugs.webkit.org/show_bug.cgi?id=129049 Reviewed by Simon Fraser. If no reference box was specified the default reference box should be border-box. Previously to this patch the reference box was the bounding client rect. This was not following the specification. http://www.w3.org/TR/2014/WD-css-masking-1-20140213/#the-clip-path The change affects content using -webkit-clip-path in Safari. Since the bounding client box is equalvalent to the border box most of the time there shouldn't be to much impact. Existing tests cover the issue. * rendering/RenderLayer.cpp: (WebCore::computeReferenceBox): 2014-02-19 James Craig Web Inspector: AX: clarify reason for ignored state where possible (hidden, default for tag, etc) https://bugs.webkit.org/show_bug.cgi?id=129037 Reviewed by Timothy Hatcher. Passing back hidden and ignoredByDefault attrs to clarify some reasons for "ignored" status. Test Updated: inspector-protocol/dom/getAccessibilityPropertiesForNode.html * inspector/InspectorDOMAgent.cpp: (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties): * inspector/protocol/DOM.json: 2014-02-19 Thiago de Barros Lacerda [WebRTC] Updating RTCConfiguration to match WebRTC editor's draft of 01/27/2014 https://bugs.webkit.org/show_bug.cgi?id=129000 Reviewed by Eric Carlson. Adding RTCIceTransports and RTCIdentityOption to RTCConfiguration object. Existing test was updated. * Modules/mediastream/RTCPeerConnection.cpp: (WebCore::RTCPeerConnection::parseConfiguration): Taking into account iceTransports and requestIdentity parameters. * platform/mediastream/RTCConfiguration.h: (WebCore::RTCConfiguration::iceTransports): Added. (WebCore::RTCConfiguration::setIceTransports): Added. (WebCore::RTCConfiguration::requestIdentity): Added. (WebCore::RTCConfiguration::setRequestIdentity): Added. (WebCore::RTCConfiguration::RTCConfiguration): Initialize iceTransports and requestIdentity with the default values. 2014-02-19 Antti Koivisto Don't call to willBeDeletedFrom(Document&) when destructing document https://bugs.webkit.org/show_bug.cgi?id=129013 Reviewed by Andreas Kling. The document is half dead at this point. * dom/ContainerNode.cpp: (WebCore::ContainerNode::~ContainerNode): 2014-02-19 Daniel Bates REGRESSION (r163560): Always treat SVG and as display inline https://bugs.webkit.org/show_bug.cgi?id=128552 Reviewed by Andreas Kling. Following , SVG and may be treated as block- level elements depending on their CSS styles (e.g. display: block). But such elements should always be treated as inline-level elements. Tests: svg/text/textpath-display-block.html svg/text/textpath-display-none.html svg/text/tspan-display-block.html * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): 2014-02-19 Daniel Bates Do not dispatch change event twice in single step action https://bugs.webkit.org/show_bug.cgi?id=116936 Reviewed by Ryosuke Niwa. Merged from Blink (patch by Kent Tamura): https://src.chromium.org/viewvc/blink?view=rev&revision=151175 Test: fast/forms/number/number-type-update-by-change-event.html * html/InputType.cpp: (WebCore::InputType::stepUpFromRenderer): 2014-02-19 Brady Eidson Add FeatureDefines for image controls https://bugs.webkit.org/show_bug.cgi?id=129022 Reviewed by Jer Noble. * Configurations/FeatureDefines.xcconfig: 2014-02-19 Piotr Grad Setting playback rate on Media Controller modifies current time. https://bugs.webkit.org/show_bug.cgi?id=129042 Reviewed by Jer Noble. In ClockGeneric: when setting playback rate or stoping timer,clock was restarted using current real time instead of provided time by setCurrentTime. Changed impl. so that m_offset is updated when clock stops to remember last clock position. When playbackRate is changed m_offset is updated in order to not use old time interval for new playback rate. Test: media/video-controller-currentTime-rate.html * html/MediaController.cpp: (MediaController::updatePlaybackState): * platform/ClockGeneric.cpp: (ClockGeneric::setPlayRate): (ClockGeneric::start): (ClockGeneric::stop): 2014-02-19 Brady Eidson Add settings/preferences for enabling image controls https://bugs.webkit.org/show_bug.cgi?id=129027 Reviewed by Jer Noble. * WebCore.exp.in: * page/Settings.cpp: (WebCore::Settings::Settings): (WebCore::Settings::setImageControlsEnabled): * page/Settings.h: (WebCore::Settings::imageControlsEnabled): 2014-02-19 Bem Jones-Bey [CSS Shapes] shape-outside does not properly handle different writing modes https://bugs.webkit.org/show_bug.cgi?id=128631 Reviewed by David Hyatt. Fix ShapeOutsideInfo to properly convert the line coordinates and shape coordinates with respect to the writing mode and writing direction for the lines that are affected by the shape. This is notably different from shape inside in that shape outside needs to use the writing mode of the container, not of the element that the shape is applied to. Tests: fast/shapes/shape-outside-floats/shape-outside-floats-different-writing-direction-border-box.html fast/shapes/shape-outside-floats/shape-outside-floats-different-writing-direction-content-box.html fast/shapes/shape-outside-floats/shape-outside-floats-different-writing-direction-margin-box.html fast/shapes/shape-outside-floats/shape-outside-floats-different-writing-direction-padding-box.html fast/shapes/shape-outside-floats/shape-outside-floats-different-writing-modes-border-box.html fast/shapes/shape-outside-floats/shape-outside-floats-different-writing-modes-content-box.html fast/shapes/shape-outside-floats/shape-outside-floats-different-writing-modes-margin-box.html fast/shapes/shape-outside-floats/shape-outside-floats-different-writing-modes-padding-box.html * rendering/RenderBoxModelObject.h: (WebCore::RenderBoxModelObject::borderWidth): Used by ShapeInfo::setReferenceBoxLogicalSize. (WebCore::RenderBoxModelObject::borderHeight): Ditto. * rendering/shapes/ShapeInfo.cpp: (WebCore::ShapeInfo::setReferenceBoxLogicalSize): Use the container's writing mode to determine the logical dimensions in the case of shape outside. (WebCore::ShapeInfo::computedShape): Use the new ShapeInfo::styleForWritingMode method. (WebCore::borderBeforeInWritingMode): Determines the borderBefore for the passed in renderer using the writing mode passed in. The borderBefore method on the renderer is implemented in RenderStyle, unlike with the margin methods, so this was chosen instead of attempting to move the border method implementation into a place where it could take the writing mode as an argument. (WebCore::borderAndPaddingBeforeInWritingMode): Determines the borderAndPaddingBefore for the passed in renderer using the given writihg mode. See above for why this method instead of doing it like margins. (WebCore::borderStartWithStyleForWritingMode): Determines the borderStart for the passed in renderer using the writing mode and direction from the style passed in. See above for why this method instead of doing it like margins. (WebCore::borderAndPaddingStartWithStyleForWritingMode): Determines the borderAndPaddingStart for the passed in renderer using the writing mode and direction from the style passed in. See above for why this method instead of doing it like margins. (WebCore::ShapeInfo::logicalTopOffset): Use the container's writing mode to determine the logicalTopOffset in the case of shape outside. (WebCore::ShapeInfo::logicalLeftOffset): Use the container's writing mode to determine the logicalTopOffset in the case of shape outside. * rendering/shapes/ShapeInfo.h: * rendering/shapes/ShapeInsideInfo.cpp: (WebCore::ShapeInsideInfo::styleForWritingMode): Return the entire style because to determine start/end the writing direction is needed in addtion to the writing mode. * rendering/shapes/ShapeInsideInfo.h: * rendering/shapes/ShapeOutsideInfo.cpp: (WebCore::ShapeOutsideInfo::updateDeltasForContainingBlockLine): Properly convert the containing block line into the reference box coordinates of the shape. (WebCore::ShapeOutsideInfo::styleForWritingMode): Return the entire style because to determine start/end the writing direction is needed in addtion to the writing mode. * rendering/shapes/ShapeOutsideInfo.h: 2014-02-19 Xabier Rodriguez Calvar [GStreamer] the GstPlayFlags enum diverged from upstream https://bugs.webkit.org/show_bug.cgi?id=128957 Reviewed by Philippe Normand. Removed the GstPlayFlags from the GStreamer implementation and replaced by the use of the GFlags. * platform/graphics/gstreamer/GStreamerUtilities.h: * platform/graphics/gstreamer/GStreamerUtilities.cpp: (WebCore::getGstPlaysFlag): Created to get the flags by using the GFlags infrastructure. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::setDownloadBuffering): Replaced GST_PLAY_FLAG_DOWNLOAD with getGstPlaysFlag. 2014-02-19 Zan Dobersek Replace WTF::bind() uses in RTCPeerConnection with C++11 lambdas https://bugs.webkit.org/show_bug.cgi?id=129001 Reviewed by Eric Carlson. * Modules/mediastream/RTCPeerConnection.cpp: (WebCore::RTCPeerConnection::setLocalDescription): Pass a lambda function to callOnMainThread() instead of using WTF::bind(). (WebCore::RTCPeerConnection::setRemoteDescription): Ditto. 2014-02-19 Dan Bernstein Simplify PLATFORM(MAC) && !PLATFORM(IOS) and similar expressions https://bugs.webkit.org/show_bug.cgi?id=129029 Reviewed by Mark Rowe. * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::boundsForVisiblePositionRange): (WebCore::AccessibilityRenderObject::visiblePositionForPoint): * config.h: * editing/Editor.cpp: (WebCore::Editor::copyURL): * editing/EditorCommand.cpp: (WebCore::createCommandMap): * editing/TypingCommand.cpp: (WebCore::TypingCommand::markMisspellingsAfterTyping): * loader/FrameLoader.cpp: (WebCore::FrameLoader::loadArchive): * page/AlternativeTextClient.h: * page/EventHandler.cpp: * page/PageGroup.cpp: (WebCore::PageGroup::captionPreferences): * page/scrolling/ScrollingStateScrollingNode.cpp: (WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode): * page/scrolling/ScrollingStateScrollingNode.h: * page/scrolling/ScrollingTree.h: * page/scrolling/ThreadedScrollingTree.cpp: * page/scrolling/ThreadedScrollingTree.h: * platform/DragData.h: * platform/FileSystem.cpp: * platform/MemoryPressureHandler.cpp: * platform/Pasteboard.h: * platform/PlatformMouseEvent.h: (WebCore::PlatformMouseEvent::PlatformMouseEvent): * platform/PlatformPasteboard.h: * platform/PlatformScreen.h: * platform/Scrollbar.cpp: (WebCore::Scrollbar::supportsUpdateOnSecondaryThread): * platform/SuddenTermination.h: * platform/ThreadGlobalData.cpp: (WebCore::ThreadGlobalData::ThreadGlobalData): (WebCore::ThreadGlobalData::destroy): * platform/ThreadGlobalData.h: * platform/audio/mac/AudioDestinationMac.cpp: * platform/audio/mac/AudioFileReaderMac.cpp: * platform/audio/mac/AudioSessionMac.cpp: * platform/graphics/DisplayRefreshMonitor.h: * platform/graphics/FloatPoint.h: * platform/graphics/FloatRect.h: * platform/graphics/FloatSize.h: * platform/graphics/IntRect.h: * platform/graphics/IntSize.h: * platform/graphics/MediaPlayer.cpp: (WebCore::installedMediaEngines): * platform/graphics/cg/ImageBufferCG.cpp: (WebCore::utiFromMIMEType): * platform/graphics/cg/PDFDocumentImage.h: * platform/graphics/cocoa/FontPlatformDataCocoa.mm: * platform/graphics/mac/GraphicsContextMac.mm: (WebCore::GraphicsContext::drawLineForDocumentMarker): * platform/graphics/opengl/Extensions3DOpenGL.cpp: (WebCore::Extensions3DOpenGL::supportsExtension): (WebCore::Extensions3DOpenGL::drawBuffersEXT): * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp: (WebCore::Extensions3DOpenGLCommon::Extensions3DOpenGLCommon): * platform/mac/KeyEventMac.mm: * platform/network/NetworkStateNotifier.h: * platform/network/cf/CookieJarCFNet.cpp: * platform/network/cf/ResourceRequest.h: * platform/network/cf/ResourceRequestCFNet.cpp: * platform/network/cf/SocketStreamHandleCFNet.cpp: (WebCore::SocketStreamHandle::reportErrorToClient): * platform/text/TextEncodingRegistry.cpp: (WebCore::extendTextCodecMaps): * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::allowsIndependentlyCompositedFrames): (WebCore::RenderLayerCompositor::requiresCompositingForAnimation): 2014-02-18 Dan Bernstein PLATFORM(MAC) is true when building for iOS https://bugs.webkit.org/show_bug.cgi?id=129025 Reviewed by Mark Rowe. * editing/Editor.cpp: Changed PLATFORM(MAC) to PLATFORM(COCOA) now that the former does not include iOS. 2014-02-17 Gavin Barraclough Add fast mapping from StringImpl to JSString https://bugs.webkit.org/show_bug.cgi?id=128625 Reviewed by Geoff Garen & Andreas Kling. Removed JSStringCache from WebCore; call JSC::jsStringWithWeakOwner instead. * bindings/js/DOMWrapperWorld.cpp: (WebCore::DOMWrapperWorld::clearWrappers): - removed JSStringCache. * bindings/js/DOMWrapperWorld.h: - removed JSStringCache. * bindings/js/JSDOMBinding.h: (WebCore::jsStringWithCache): - call jsStringWithWeakOwner insead of using JSStringCache. * bindings/js/JSDOMWindowBase.cpp: (WebCore::JSDOMWindowBase::commonVM): - renamed createLeaked -> createLeakedForMainThread. * bindings/scripts/StaticString.pm: (GenerateStrings): - StringImpl has an additional field. 2014-02-18 Simon Fraser Remove UIWKRemoteView https://bugs.webkit.org/show_bug.cgi?id=129015 Reviewed by Dan Bernstein. The project referenced a maketokenizer script that disappeared long ago. * WebCore.xcodeproj/project.pbxproj: 2014-02-18 Simon Fraser border-box clip-paths jump around when outline changes https://bugs.webkit.org/show_bug.cgi?id=128929 Reviewed by Dirk Schulze. computeReferenceBox() for clip paths was using "rootRelativeBounds" to position the border-box. This bounds is an enclosing bounds for the layer and its descendants, including outlines and absolute descendants, so it is not the correct box to use to offset the border-box. The caller has offsetFromRoot(), which is the correct thing to use, so use it. Test: css3/masking/clip-path-root-relative-bounds.html * rendering/RenderLayer.cpp: (WebCore::computeReferenceBox): (WebCore::RenderLayer::setupClipPath): 2014-02-18 James Craig Web Inspector: AX: more properties: exists, required, and invalid (exists was previously combined with ignored) https://bugs.webkit.org/show_bug.cgi?id=128504 Reviewed by Timothy Hatcher. Additions to the accessibility node inspector: exists, required, invalid. Test: inspector-protocol/dom/getAccessibilityPropertiesForNode.html * inspector/InspectorDOMAgent.cpp: (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties): * inspector/protocol/DOM.json: 2014-02-18 Ryosuke Niwa Commit the code change supposed to happen in r164320. * editing/Editor.cpp: (WebCore::Editor::setIgnoreCompositionSelectionChange): (WebCore::Editor::respondToChangedSelection): * editing/Editor.h: 2014-02-18 Ryosuke Niwa TextFieldInputType::handleBeforeTextInsertedEvent shouldn't use plainText https://bugs.webkit.org/show_bug.cgi?id=128953 Reviewed by Alexey Proskuryakov. Don't use FrameSelection's toNormalizedRange and plainText. Instead, use the cached selection start and selection end to extract the selected text. The caches are updated inside FrameSelection::setSelection whenever selection is inside a text form control via HTMLTextFormControlElement::selectionChanged. * html/TextFieldInputType.cpp: (WebCore::TextFieldInputType::handleBeforeTextInsertedEvent): 2014-02-18 Viatcheslav Ostapenko Bottom/right sticky positioning don't correctly handle scroll containers with padding https://bugs.webkit.org/show_bug.cgi?id=119280 Reviewed by Simon Fraser. Take padding into account during calculation of overflow constraining rect for sticky positioning. Test: fast/css/sticky/sticky-bottom-overflow-padding.html * rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::stickyPositionOffset): 2014-02-17 Jon Honeycutt Crash when merging ruby bases that contain floats https://bugs.webkit.org/show_bug.cgi?id=127515 This crash occurs when we remove a ruby text object and decide to merge two adjacent ruby base objects. The right ruby base's children were being merged into the left ruby base, but the right ruby base's floats were not being moved to the left base. This could cause us not to descend into all nodes containing a FloatingObject in RenderBlockFlow::markAllDescendantsWithFloatsForLayout(), because we assume that if a block does not have a particular float in its float list, none of its descendants will, either. Reviewed by David Hyatt. Test: fast/ruby/ruby-base-merge-block-children-crash-2.html * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::moveFloatsTo): Code split out of moveAllChildrenIncludingFloatsTo(). (WebCore::RenderBlockFlow::moveAllChildrenIncludingFloatsTo): Call moveFloatsTo(). * rendering/RenderBlockFlow.h: Add declaration of moveFloatsTo(). * rendering/RenderRubyBase.cpp: (WebCore::RenderRubyBase::mergeChildrenWithBase): Move children and floats to the new base. * rendering/RenderRubyBase.h: Declare mergeChildrenWithBase(). * rendering/RenderRubyRun.cpp: (WebCore::RenderRubyRun::removeChild): Call mergeChildrenWithBase(). 2014-02-18 Ryosuke Niwa iOS build fix after r164319. * editing/FrameSelection.cpp: (WebCore::FrameSelection::setSelectedRange): 2014-02-18 Samuel White AX: Searching for "immediate descendants only" can return unexpected results. https://bugs.webkit.org/show_bug.cgi?id=128986 Reviewed by Chris Fleizach. Missed an application of the immediateDescendantsOnly flag during the initial implementation. We need to make sure we don't decend into the startObject first if it is provided. This fix causes the outer loop to 'skip' the first iteration so only siblings of the startObject are considered. No new tests, updated existing search-predicate-immediate-descendants-only.html test to cover this case. * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::findMatchingObjects): 2014-02-18 Ryosuke Niwa Merge notifyComponentsOnChangedSelection into respondToSelectionChange https://bugs.webkit.org/show_bug.cgi?id=128993 Reviewed by Andreas Kling. Merged notifyComponentsOnChangedSelection into respondToSelectionChange since notifyComponentsOnChangedSelection was only added in iOS codebase in response to the code added for continuous spellchecking and alternative text controller in respondToChangedSelection but they should have been called inside setIgnoreCompositionSelectionChange. So merge these two functions and make respondToChangedSelection behave like setIgnoreCompositionSelectionChange. * editing/Editor.cpp: (WebCore::Editor::setIgnoreCompositionSelectionChange): (WebCore::Editor::respondToChangedSelection): * editing/Editor.h: 2014-02-18 Ryosuke Niwa FrameSelection::textWasReplaced and setSelectedRange shouldn't trigger synchronous layout https://bugs.webkit.org/show_bug.cgi?id=128951 Reviewed by Antti Koivisto. Cleanup. * editing/FrameSelection.cpp: (WebCore::FrameSelection::textWasReplaced): Don't call updateLayout. It's totally unnecessarily. (WebCore::FrameSelection::setSelectedRange): Ditto. Also removed the code to set affinity only when range is collapsed since VisibleSelection::validate already does this. 2014-02-18 Eric Carlson Do not cache media time until media engine returns a non-zero value https://bugs.webkit.org/show_bug.cgi?id=128976 Reviewed by Jer Noble. No new tests, covered by existing tests. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::refreshCachedTime): Don't mark the cached time as valid until it is non-zero. (WebCore::HTMLMediaElement::currentTime): Return 0 if m_cachedTime is invalid. 2014-02-17 Alexey Proskuryakov [iOS] All WebKit clients should encrypt WebCrypto keys automatically https://bugs.webkit.org/show_bug.cgi?id=128938 Reviewed by Dan Bernstein. Don't pass ACLs on iOS. Key will be added to app's default Keychain access group. Also, don't pass kSecAttrIsPermanent, which is irrelevant for password items, and caused error -50 in DumpRenderTree for me when passed. Added fallback to _NSGetProgname for account name, to account for tools such as Mac DumpRenderTree that don't have bundle identifiers. * crypto/mac/SerializedCryptoKeyWrapMac.mm: (WebCore::masterKeyAccountNameForCurrentApplication): (WebCore::createAndStoreMasterKey): 2014-02-18 Ryosuke Niwa setSelectionRange should set selection without validation https://bugs.webkit.org/show_bug.cgi?id=128949 Reviewed by Enrica Casucci. Since positionForIndex in HTMLTextFormControlElement always returns a candidate Position, we don't have to validate selection in setSelectionRange. Also fixed various bugs uncovered by this change. This patch also fixes fast/forms/input-select-webkit-user-select-none.html, which used to assert wrong outcome so that WebKit's behavior matches that of Chrome and Firefox. Test: fast/forms/input-select-webkit-user-select-none.html * dom/Position.h: (WebCore::positionInParentBeforeNode): This function had a bug that when node is a child of the shadow root it would return a null Position. Allow a position anchored inside a shadow root. (WebCore::positionInParentAfterNode): Ditto. * editing/FrameSelection.cpp: (WebCore::FrameSelection::moveWithoutValidationTo): Renamed from moveTo and avoided selection validation. * editing/FrameSelection.h: * editing/htmlediting.cpp: (WebCore::updatePositionForNodeRemoval): Fixed the bug that this function doesn't update positions before or after children even if the shadow host of the anchor node is getting removed. Move the position before the shadow host to be removed in both situations. * html/HTMLTextFormControlElement.cpp: (WebCore::HTMLTextFormControlElement::setSelectionRange): moveTo is renamed to moveWithoutValidationTo. (WebCore::HTMLTextFormControlElement::selectionChanged): Check if the cached selection offsets are different in lieu of FrameSelection::isRange() since they're equivalent here. (WebCore::positionForIndex): Return the position inside or after the last br when there is one to match the canonicalization algorithm we have. It's probably harmless to return the last position in the inner text element anyways since most of our codebase supports that but this would avoid having to rebaseline dozens of tests and reduces the risk of this patch. 2014-02-18 Zan Dobersek Move IndexedDB module, LevelDB code to std::unique_ptr https://bugs.webkit.org/show_bug.cgi?id=128964 Reviewed by Andreas Kling. Replace uses of OwnPtr and PassOwnPtr in the IndexedDB module and LevelDB platform code with std::unique_ptr. * Modules/indexeddb/IDBCursorBackend.h: * Modules/indexeddb/IDBDatabaseBackend.cpp: (WebCore::IDBDatabaseBackend::IDBDatabaseBackend): (WebCore::IDBDatabaseBackend::transactionFinishedAndAbortFired): (WebCore::IDBDatabaseBackend::processPendingCalls): (WebCore::IDBDatabaseBackend::processPendingOpenCalls): (WebCore::IDBDatabaseBackend::openConnection): (WebCore::IDBDatabaseBackend::runIntVersionChangeTransaction): (WebCore::IDBDatabaseBackend::deleteDatabase): (WebCore::IDBDatabaseBackend::close): * Modules/indexeddb/IDBDatabaseBackend.h: (WebCore::IDBDatabaseBackend::hasPendingSecondHalfOpen): (WebCore::IDBDatabaseBackend::setPendingSecondHalfOpen): * Modules/indexeddb/IDBPendingDeleteCall.h: (WebCore::IDBPendingDeleteCall::IDBPendingDeleteCall): * Modules/indexeddb/IDBPendingOpenCall.h: (WebCore::IDBPendingOpenCall::IDBPendingOpenCall): * Modules/indexeddb/IDBTransactionBackendOperations.cpp: (WebCore::IDBDatabaseBackend::VersionChangeOperation::perform): * Modules/indexeddb/IDBTransactionCoordinator.cpp: * Modules/indexeddb/IDBTransactionCoordinator.h: * Modules/indexeddb/leveldb/IDBBackingStoreCursorLevelDB.h: * Modules/indexeddb/leveldb/IDBBackingStoreLevelDB.cpp: (WebCore::setUpMetadata): (WebCore::DefaultLevelDBFactory::openLevelDB): (WebCore::IDBBackingStoreLevelDB::IDBBackingStoreLevelDB): (WebCore::IDBBackingStoreLevelDB::~IDBBackingStoreLevelDB): (WebCore::IDBBackingStoreLevelDB::open): (WebCore::IDBBackingStoreLevelDB::openInMemory): (WebCore::IDBBackingStoreLevelDB::create): (WebCore::IDBBackingStoreLevelDB::getDatabaseNames): (WebCore::deleteRange): (WebCore::IDBBackingStoreLevelDB::deleteDatabase): (WebCore::IDBBackingStoreLevelDB::getObjectStores): (WebCore::IDBBackingStoreLevelDB::getKeyGeneratorCurrentNumber): (WebCore::IDBBackingStoreLevelDB::getIndexes): (WebCore::findGreatestKeyLessThanOrEqual): (WebCore::IDBBackingStoreLevelDB::findKeyInIndex): * Modules/indexeddb/leveldb/IDBBackingStoreLevelDB.h: * platform/leveldb/LevelDBDatabase.cpp: (WebCore::LevelDBDatabase::~LevelDBDatabase): (WebCore::LevelDBDatabase::open): (WebCore::LevelDBDatabase::openInMemory): (WebCore::IteratorImpl::IteratorImpl): (WebCore::LevelDBDatabase::createIterator): * platform/leveldb/LevelDBDatabase.h: * platform/leveldb/LevelDBTransaction.cpp: (WebCore::LevelDBTransaction::commit): (WebCore::LevelDBTransaction::createIterator): (WebCore::LevelDBTransaction::TransactionIterator::TransactionIterator): (WebCore::LevelDBTransaction::TransactionIterator::refreshTreeIterator): (WebCore::LevelDBWriteOnlyTransaction::LevelDBWriteOnlyTransaction): * platform/leveldb/LevelDBTransaction.h: * platform/leveldb/LevelDBWriteBatch.cpp: (WebCore::LevelDBWriteBatch::LevelDBWriteBatch): * platform/leveldb/LevelDBWriteBatch.h: 2014-02-18 David Kilzer Follow-up: Add type-checked casts for StyleImage and subclasses Address some style issues based on feedback from Andreas Kling. * css/CSSCursorImageValue.cpp: (WebCore::CSSCursorImageValue::cachedImageURL): * css/CSSImageSetValue.cpp: (WebCore::CSSImageSetValue::~CSSImageSetValue): (WebCore::CSSImageSetValue::hasFailedOrCanceledSubresources): * css/CSSImageValue.cpp: (WebCore::CSSImageValue::hasFailedOrCanceledSubresources): - Use the reference version of the type-checked casts since we know the pointers are not NULL. * rendering/style/StyleImage.h: - Use 'styleImage' instead of 'resource' in STYLE_IMAGE_TYPE_CASTS. 2014-02-18 Zan Dobersek Remove unnecessary UserActionElementSet constructor, destructor https://bugs.webkit.org/show_bug.cgi?id=128962 Reviewed by Andreas Kling. UserActionElementSet constructor and destructor are not necessary, as is not the static create() function that returns PassOwnPtr. The implicit constructor and destructor can take care of creating and destroying the sole HashMap member variable. * dom/UserActionElementSet.cpp: * dom/UserActionElementSet.h: 2014-02-18 Myles C. Maxfield Rename convertFixedAndStickyPosition() to convertPositionStyle() https://bugs.webkit.org/show_bug.cgi?id=128987 Reviewed by NOBODY. This is addressing a post-commit review from Dean Jackson. No new tests are necessary because there is no behavior change * editing/EditingStyle.cpp: (WebCore::EditingStyle::convertPositionStyle): * editing/EditingStyle.h: * editing/markup.cpp: (WebCore::StyledMarkupAccumulator::appendElement): 2014-02-18 Commit Queue Unreviewed, rolling out r164296. http://trac.webkit.org/changeset/164296 https://bugs.webkit.org/show_bug.cgi?id=128989 Broke many media tests (Requested by eric_carlson on #webkit). * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::parseAttribute): * html/HTMLMediaElement.h: 2014-02-18 Myles C. Maxfield Convert position:sticky to position:static upon copy and paste https://bugs.webkit.org/show_bug.cgi?id=128982 Reviewed by Simon Fraser. This patch has two parts: 1. Make sure that position:absolute elements trigger the position:relative wrapping (as well as position:fixed) 2. Now that we copy position:sticky, convert that to position:static Tests: editing/pasteboard/copy-paste-converts-fixed.html editing/pasteboard/copy-paste-converts-sticky.html editing/pasteboard/copy-paste-wraps-position-absolute.html * editing/EditingStyle.cpp: (WebCore::EditingStyle::convertFixedAndStickyPosition): 2014-02-18 David Kilzer Add type-checked casts for StyleImage and subclasses Reviewed by Oliver Hunt. * css/CSSCursorImageValue.cpp: (WebCore::CSSCursorImageValue::detachPendingImage): (WebCore::CSSCursorImageValue::cachedImage): (WebCore::CSSCursorImageValue::cachedImageURL): * css/CSSImageSetValue.cpp: (WebCore::CSSImageSetValue::detachPendingImage): (WebCore::CSSImageSetValue::~CSSImageSetValue): (WebCore::CSSImageSetValue::cachedImageSet): (WebCore::CSSImageSetValue::hasFailedOrCanceledSubresources): * css/CSSImageValue.cpp: (WebCore::CSSImageValue::detachPendingImage): (WebCore::CSSImageValue::cachedImage): (WebCore::CSSImageValue::hasFailedOrCanceledSubresources): * css/StyleResolver.cpp: (WebCore::StyleResolver::loadPendingShapeImage): (WebCore::StyleResolver::loadPendingImages): * page/PageSerializer.cpp: (WebCore::PageSerializer::retrieveResourcesForProperties): * page/animation/CSSPropertyAnimation.cpp: (WebCore::blendFunc): - Switch from static_cast<>() operators to toTypeName() methods. - Replace 0 with nullptr where convenient. * rendering/style/StyleCachedImage.h: * rendering/style/StyleCachedImageSet.h: * rendering/style/StyleGeneratedImage.h: * rendering/style/StyleImage.h: * rendering/style/StylePendingImage.h: - Define type-checked cast macros. 2014-02-18 Sam Weinig Simplify HTML tokenizer parameterization down to what is used https://bugs.webkit.org/show_bug.cgi?id=128977 Reviewed by Alexey Proskuryakov. - Removes support for CustomHTMLTokenizerChunkSize. - Consolidates CustomHTMLTokenizerTimeDelay down to one implementation, using Settings::maxParseDuration * WebCore.exp.in: * html/parser/HTMLParserScheduler.cpp: (WebCore::HTMLParserScheduler::HTMLParserScheduler): * page/Page.cpp: (WebCore::Page::Page): (WebCore::Page::hasCustomHTMLTokenizerTimeDelay): (WebCore::Page::customHTMLTokenizerTimeDelay): * page/Page.h: 2014-02-18 Eric Carlson Do not cache media time until media engine returns a non-zero value https://bugs.webkit.org/show_bug.cgi?id=128976 Reviewed by Jer Noble. No new tests, covered by existing tests. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::refreshCachedTime): Don't mark the cached time as valid until it is non-zero. 2014-02-18 Mihai Tica [CSS Blending] Add -webkit-blend-mode support for SVG. https://bugs.webkit.org/show_bug.cgi?id=110427 Reviewed by Dirk Schulze. Add support for blend modes to SVG. This includes adding and validating isolation for blending. Make masked elements isolate blending by creating a transparency layer. Tests: css3/compositing/svg-blend-color-burn.html css3/compositing/svg-blend-color-dodge.html css3/compositing/svg-blend-color.html css3/compositing/svg-blend-darken.html css3/compositing/svg-blend-difference.html css3/compositing/svg-blend-exclusion.html css3/compositing/svg-blend-hard-light.html css3/compositing/svg-blend-hue.html css3/compositing/svg-blend-layer-blend.html css3/compositing/svg-blend-layer-clip-path.html css3/compositing/svg-blend-layer-filter.html css3/compositing/svg-blend-layer-mask.html css3/compositing/svg-blend-layer-opacity.html css3/compositing/svg-blend-layer-shadow.html css3/compositing/svg-blend-lighten.html css3/compositing/svg-blend-luminosity.html css3/compositing/svg-blend-multiply-alpha.html css3/compositing/svg-blend-multiply.html css3/compositing/svg-blend-normal.html css3/compositing/svg-blend-overlay.html css3/compositing/svg-blend-saturation.html css3/compositing/svg-blend-screen.html css3/compositing/svg-blend-soft-light.html * rendering/RenderElement.cpp: (WebCore::RenderElement::styleDidChange): Also pass a pointer to the old style when calling SVGRenderSupport::styleChanged. * rendering/style/RenderStyle.h: Add blendMode default getter when CSS_COMPOSITING is disabled. * rendering/style/SVGRenderStyle.h: (WebCore::SVGRenderStyle::isolatesBlending): Add method. * rendering/svg/SVGRenderSupport.cpp: (WebCore::SVGRenderSupport::styleChanged): Call updateMaskedAncestorShouldIsolateBlending only when a blend mode is set/unset. (WebCore::SVGRenderSupport::isolatesBlending): Implement method that decides whether an SVGElement isolates or not blending. (WebCore::SVGRenderSupport::updateMaskedAncestorShouldIsolateBlending): Traverse to the nearest ancestor having a mask. - Set a flag causing the creation of a transparency layer when rendering the masked element. * rendering/svg/SVGRenderSupport.h: * rendering/svg/SVGRenderingContext.cpp: (WebCore::SVGRenderingContext::prepareToRenderSVGContent): Call GraphicsContext::setCompositeOperation. - Isolate blending by creating a transparency layer. - Isolate group when rendering a masked element having a blended child node. * svg/SVGGraphicsElement.cpp: (WebCore::SVGGraphicsElement::SVGGraphicsElement): Set default m_shouldIsolateBlending to false. * svg/SVGGraphicsElement.h: Add m_shouldIsolateBlending member, getter and setter. (WebCore::SVGGraphicsElement::shouldIsolateBlending): (WebCore::SVGGraphicsElement::setShouldIsolateBlending): 2014-02-18 ChangSeok Oh [GTK] Unreviewed fix. Correct wrong flags, ENABLE(GTK)->PLATFORM(GTK). * platform/graphics/opengl/Extensions3DOpenGL.cpp: (WebCore::Extensions3DOpenGL::drawArraysInstanced): (WebCore::Extensions3DOpenGL::drawElementsInstanced): (WebCore::Extensions3DOpenGL::vertexAttribDivisor): 2014-02-18 Mihnea Ovidenie [CSSRegions] Compute region ranges for inline replaced elements https://bugs.webkit.org/show_bug.cgi?id=128800 Reviewed by Andrei Bucur. Tests: fast/regions/hover-content-inside-iframe-in-region.html fast/regions/select-multiple-in-region.html When asking for the range of regions for an inline replaced box, use the region cached on the root inline box for the inline replaced box as the range of regions is computed only for blocks. A future patch will extend the computation of region ranges for inline blocks too. * rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::mapAbsoluteToLocalPoint): Remove the restriction set during https://bugs.webkit.org/show_bug.cgi?id=113703 and enable the code path for boxes not only for blocks. Method RenderFlowThread::getRegionRangeForBox returns a null region when it is unable to get the region range and we already check for null region case. * rendering/RenderFlowThread.cpp: (WebCore::RenderFlowThread::getRegionRangeForBox): 2014-02-18 Xabier Rodriguez Calvar Move inheriting method to the superclass in the JavaScript media controls https://bugs.webkit.org/show_bug.cgi?id=128897 Reviewed by Jer Noble. The inheriting method of the JavaScript multimedia controls was moved from the subclasses to the superclass because this way it is only defined once. * Modules/mediacontrols/mediaControlsApple.js: (Controller.prototype.extend): Added to replace inheritFrom in the subclasses. * Modules/mediacontrols/mediaControlsGtk.js: * Modules/mediacontrols/mediaControlsiOS.js: Removed inheritFrom and used extend. 2014-02-18 Xabier Rodriguez Calvar [GTK] Fix hitting hasClass() assertion in debug with the new JS media controls https://bugs.webkit.org/show_bug.cgi?id=128820 Reviewed by Martin Robinson. The code introduced at r164024 caused the hit of hasClass() assertion when getting the classNames() of an element with no class. Now we check for it to avoid the assertion. No new tests, current set detects the crash in many tests. * platform/gtk/RenderThemeGtk.cpp: (WebCore::nodeHasClass): Check for hasClass() in order not to hit the assertion when getting the classNames() in debug mode. 2014-02-18 Gyuyoung Kim Refactor SVGPreserveAspectRatio::parse() https://bugs.webkit.org/show_bug.cgi?id=128658 Reviewed by Dirk Schulze. To removed "goto" in SVGPreserveAspectRatio::parse(), this patch introduce parseInternal() to handle existing behavior with local variables, and existing/new parse() functions invoke it, then set those to member variables. Motivated from Blink: https://src.chromium.org/viewvc/blink?view=rev&revision=166927 No new tests, no behavior change. * svg/SVGPreserveAspectRatio.cpp: (WebCore::SVGPreserveAspectRatio::parse): (WebCore::SVGPreserveAspectRatio::parseInternal): * svg/SVGPreserveAspectRatio.h: Add parse() and parseInternal() functions. 2014-02-17 Radu Stavila [CSS Regions] Move specific named flow methods from RenderRegion to RenderNamedFlowFragment https://bugs.webkit.org/show_bug.cgi?id=128914 Reviewed by Antti Koivisto. Moved named flow specific methods regionContainer() and regionContainerLayer() from RenderRegion to RenderNamedFlowFragment and renamed them to fragmentContainer and fragmentContainerLayer. No new tests required. * rendering/RenderLayer.cpp: (WebCore::RenderLayer::mapLayerClipRectsToFragmentationLayer): (WebCore::RenderLayer::calculateClipRects): * rendering/RenderNamedFlowFragment.cpp: (WebCore::RenderNamedFlowFragment::fragmentContainer): (WebCore::RenderNamedFlowFragment::fragmentContainerLayer): * rendering/RenderNamedFlowFragment.h: * rendering/RenderRegion.cpp: * rendering/RenderRegion.h: 2014-02-17 Sangho Kim Move PublicURLMansger to std::unique_ptr. https://bugs.webkit.org/show_bug.cgi?id=128891 Reviewed by Anders Carlsson. Use std::unique_ptr and std::make_unique in place of PassOwnPtr and adoptPtr in the PublicURLManager * dom/ScriptExecutionContext.h: * html/PublicURLManager.cpp: (WebCore::PublicURLManager::create): * html/PublicURLManager.h: 2014-02-17 Ricky Mondello Expose a way to clear cookies modified after a given date https://bugs.webkit.org/show_bug.cgi?id=128845 Reviewed by Alexey Proskuryakov. * WebCore.exp.in: Add a symbol. * platform/network/PlatformCookieJar.h: Declare deleteAllCookiesModifiedAfterDate. * platform/network/cf/CookieJarCFNet.cpp: (WebCore::deleteAllCookiesModifiedAfterDate): Add a stub. * platform/network/curl/CookieJarCurl.cpp: (WebCore::deleteAllCookiesModifiedAfterDate): Ditto. * platform/network/soup/CookieJarSoup.cpp: (WebCore::deleteAllCookiesModifiedAfterDate): Ditto. * platform/network/mac/CookieJarMac.mm: Add a category NSHTTPCookieStorage category with the method used for time-based clearing so we can build on all platforms. For now, we'll check for support at runtime. (WebCore::deleteAllCookiesModifiedAfterDate): Added. Without foundation API, we'll ignore the passed-in NetworkStorageSession. 2014-02-17 Benjamin Poulain SelectorCompiler incorrectly saves a backtracking register for a child chain without descendant relation on the right https://bugs.webkit.org/show_bug.cgi?id=128944 Reviewed by Andreas Kling. When resolving the backtracking relations, the value of ancestorPositionSinceDescendantRelation was incorrect for the rightmost child chain. What was happenning is updateChainStates() would increment ancestorPositionSinceDescendantRelation even if there was no descendant relation previously in the chain. As a result, the second SelectorFragment in the fragment chain would save a backtracking register. Previously this would just be a wasted register but since r163850, the number of registers available for compilation is defined by SelectorCompiler::minimumRegisterRequirements(). Since we would have one less register available than computed, we could run out of register and RegisterAllocator would invoke WTFCrash to avoid generating incorrect code. This patch fixes the issue by not updating ancestorPositionSinceDescendantRelation until the first descendant relation is seen. There was no need to fix the Adjacent relation because adjacentPositionSinceIndirectAdjacentTreeWalk already had the correct guard. Test: fast/selectors/querySelector-rightmost-child-chain-attribute-matching.html * cssjit/SelectorCompiler.cpp: (WebCore::SelectorCompiler::updateChainStates): (WebCore::SelectorCompiler::isFirstAdjacent): The name was a bad copy-paste, fix it. 2014-02-17 Dean Jackson Constrain replaced element layout to from-intrinsic aspect ratio if specified https://bugs.webkit.org/show_bug.cgi?id=128629 Reviewed by Simon Fraser. First pass at implementing -webkit-aspect-ratio: from-instrinsics; After RenderReplaced has done layout, attempt to update the resulting size to match the desired aspect ratio. This step will only reduce the size of an element, and never below the minimum dimensions. Tests: fast/css/aspect-ratio/columns.html fast/css/aspect-ratio/containers.html fast/css/aspect-ratio/simple.html * rendering/RenderImage.cpp: (WebCore::RenderImage::imageDimensionsChanged): If we get an update to our intrinsic dimensions, and layout depends on this, trigger another layout pass. * rendering/RenderReplaced.cpp: (WebCore::RenderReplaced::layout): Implement the step described above. 2014-02-17 Sam Weinig Fix build. * WebCore.exp.in: 2014-02-17 Anders Carlsson Remove ENABLE_GLOBAL_FASTMALLOC_NEW https://bugs.webkit.org/show_bug.cgi?id=127067 Reviewed by Geoffrey Garen. * platform/Timer.h: 2014-02-17 Sam Weinig Move iOS only Settings into Settings.in and make them not-iOS only https://bugs.webkit.org/show_bug.cgi?id=128942 Reviewed by Tim Horton. * page/Settings.cpp: * page/Settings.h: * page/Settings.in: 2014-02-17 Anders Carlsson Remove view source code https://bugs.webkit.org/show_bug.cgi?id=127233 Reviewed by Antti Koivisto. * CMakeLists.txt: * DerivedSources.make: * GNUmakefile.am: * GNUmakefile.list.am: * WebCore.vcxproj/WebCore.vcxproj: * WebCore.vcxproj/WebCore.vcxproj.filters: * WebCore.xcodeproj/project.pbxproj: * bindings/js/ScriptController.cpp: (WebCore::ScriptController::canExecuteScripts): * css/CSSDefaultStyleSheets.cpp: * css/CSSDefaultStyleSheets.h: * css/DocumentRuleSets.cpp: (WebCore::DocumentRuleSets::appendAuthorStyleSheets): (WebCore::DocumentRuleSets::collectFeatures): * css/DocumentRuleSets.h: * css/ElementRuleCollector.cpp: (WebCore::ElementRuleCollector::matchUARules): * css/StyleResolver.cpp: (WebCore::StyleResolver::appendAuthorStyleSheets): (WebCore::StyleResolver::styleForElement): * css/view-source.css: Removed. * dom/DOMImplementation.cpp: (WebCore::DOMImplementation::createDocument): * dom/DOMImplementation.h: * dom/Document.cpp: (WebCore::Document::Document): * dom/Document.h: * html/HTMLAttributeNames.in: * html/HTMLFrameElementBase.cpp: (WebCore::HTMLFrameElementBase::HTMLFrameElementBase): (WebCore::HTMLFrameElementBase::openURL): * html/HTMLFrameElementBase.h: * html/HTMLViewSourceDocument.cpp: Removed. * html/HTMLViewSourceDocument.h: Removed. * html/parser/HTMLToken.h: * html/parser/HTMLViewSourceParser.cpp: Removed. * html/parser/HTMLViewSourceParser.h: Removed. * html/parser/TextViewSourceParser.cpp: Removed. * html/parser/TextViewSourceParser.h: Removed. * inspector/InspectorOverlayPage.css: (.tag-name): (.node-id): (.class-name): * loader/DocumentWriter.cpp: (WebCore::DocumentWriter::createDocument): * loader/FrameLoader.cpp: (WebCore::FrameLoader::receivedFirstData): * page/Frame.cpp: (WebCore::Frame::Frame): * page/Frame.h: * xml/DOMParser.cpp: (WebCore::DOMParser::parseFromString): * xml/XMLViewer.css: (.tag): * xml/XSLTProcessor.cpp: (WebCore::XSLTProcessor::createDocumentFromSource): 2014-02-17 Simon Fraser box-shadows get truncated with a combination of transforms and clip: (affects Google Maps) https://bugs.webkit.org/show_bug.cgi?id=128937 Reviewed by Dean Jackson. RenderLayer::calculateLayerBounds() incorrectly assumed that if localClipRect() returns a non-infinite rect, that rect is OK to use as the compositing bounds. That is not a valid assumption when clip() has a larger rect than the element (e.g. with negative top/left in the rect). In that case, localClipRect() still just returns the background rect, but we actually need a larger compositing layer to show the unclipped parts of descendants. Fix by detecting clip() that exceeds the renderer bounds, and when it does, not early returning in the UseLocalClipRectIfPossible clause. Test: compositing/geometry/css-clip-oversize.html * rendering/RenderLayer.cpp: (WebCore::RenderLayer::localClipRect): Do a convertToLayerCoords() because we need offsetFromRoot later, and we can pass our value down to calculateRects(). Compute clipExceedsBounds based on the CSS clip rect. (WebCore::RenderLayer::calculateClipRects): Don't early return if clipExceedsBounds is true. * rendering/RenderLayer.h: 2014-02-17 Antti Koivisto Make TreeScope::rootNode return a reference https://bugs.webkit.org/show_bug.cgi?id=128934 Reviewed by Andreas Kling. It is never null. * css/ElementRuleCollector.cpp: (WebCore::ElementRuleCollector::collectMatchingRules): * dom/ContainerNode.h: (WebCore::Node::isTreeScope): * dom/Document.cpp: (WebCore::Document::buildAccessKeyMap): * dom/DocumentOrderedMap.cpp: (WebCore::DocumentOrderedMap::add): (WebCore::DocumentOrderedMap::get): (WebCore::DocumentOrderedMap::getAllElementsById): * dom/EventDispatcher.cpp: (WebCore::EventRelatedNodeResolver::moveToParentOrShadowHost): (WebCore::eventTargetRespectingTargetRules): (WebCore::shouldEventCrossShadowBoundary): * dom/Node.cpp: (WebCore::Node::containingShadowRoot): (WebCore::Node::removedFrom): * dom/ShadowRoot.h: (WebCore::isShadowRoot): * dom/TreeScope.h: (WebCore::TreeScope::rootNode): * page/DOMSelection.cpp: (WebCore::DOMSelection::DOMSelection): * page/DragController.cpp: (WebCore::asFileInput): * page/FocusController.cpp: (WebCore::FocusNavigationScope::rootNode): 2014-02-17 Chris Fleizach AX: Invalid cast in WebCore::AccessibilityTable::isDataTable (CRBug 280352) Merged from Blink (patch by Dominic Mazzoni): https://src.chromium.org/viewvc/blink?revision=159711&view=revision Reviewed by Oliver Hunt. Don't cast to a table cell element unless we are sure it is one. Test: accessibility/display-table-cell-causes-crash.html * accessibility/AccessibilityTable.cpp: (WebCore::AccessibilityTable::isDataTable): 2014-02-17 Antti Koivisto Node constructor should take Document reference https://bugs.webkit.org/show_bug.cgi?id=128931 Reviewed by Geoff Garen. * dom/Attr.cpp: (WebCore::Attr::Attr): * dom/CharacterData.h: (WebCore::CharacterData::CharacterData): * dom/ContainerNode.cpp: (WebCore::ContainerNode::~ContainerNode): * dom/ContainerNode.h: (WebCore::ContainerNode::ContainerNode): * dom/Document.cpp: (WebCore::Document::Document): * dom/Document.h: (WebCore::Node::Node): * dom/DocumentFragment.cpp: (WebCore::DocumentFragment::DocumentFragment): (WebCore::DocumentFragment::create): * dom/DocumentFragment.h: * dom/DocumentType.cpp: (WebCore::DocumentType::DocumentType): * dom/Element.h: (WebCore::Element::Element): * dom/Entity.h: (WebCore::Entity::Entity): * dom/EntityReference.cpp: (WebCore::EntityReference::EntityReference): * dom/Node.cpp: (WebCore::Node::~Node): (WebCore::Node::willBeDeletedFrom): * dom/Node.h: * dom/Notation.cpp: * dom/Notation.h: (WebCore::Notation::publicId): (WebCore::Notation::systemId): (WebCore::Notation::Notation): Remove cruft from this non-instantiated class. * dom/ShadowRoot.cpp: (WebCore::ShadowRoot::ShadowRoot): (WebCore::ShadowRoot::~ShadowRoot): * dom/TemplateContentDocumentFragment.h: 2014-02-17 Sergio Correia Replace uses of PassOwnPtr/OwnPtr with std::unique_ptr in WebCore/inspector https://bugs.webkit.org/show_bug.cgi?id=128681 Reviewed by Timothy Hatcher. Another step towards getting rid of PassOwnPtr/OwnPtr, now targeting WebCore/inspector/*. Besides files in there, a few other files in JavaScriptCore/inspector, WebKit/, WebKit2/WebProcess/WebCoreSupport/ and WebCore/testing were touched. No new tests; no new behavior. * WebCore.exp.in: * inspector/CommandLineAPIHost.cpp: * inspector/CommandLineAPIHost.h: * inspector/DOMEditor.cpp: * inspector/DOMPatchSupport.cpp: * inspector/DOMPatchSupport.h: * inspector/InspectorApplicationCacheAgent.h: * inspector/InspectorCSSAgent.cpp: * inspector/InspectorCSSAgent.h: * inspector/InspectorCanvasAgent.h: * inspector/InspectorDOMAgent.cpp: * inspector/InspectorDOMAgent.h: * inspector/InspectorDOMDebuggerAgent.h: * inspector/InspectorDOMStorageAgent.h: * inspector/InspectorDatabaseAgent.h: * inspector/InspectorFrontendClientLocal.cpp: * inspector/InspectorFrontendClientLocal.h: * inspector/InspectorHeapProfilerAgent.h: * inspector/InspectorHistory.cpp: * inspector/InspectorHistory.h: * inspector/InspectorIndexedDBAgent.h: * inspector/InspectorInputAgent.h: * inspector/InspectorLayerTreeAgent.h: * inspector/InspectorMemoryAgent.cpp: * inspector/InspectorMemoryAgent.h: * inspector/InspectorOverlay.cpp: * inspector/InspectorOverlay.h: * inspector/InspectorProfilerAgent.cpp: * inspector/InspectorProfilerAgent.h: * inspector/InspectorResourceAgent.cpp: * inspector/InspectorResourceAgent.h: * inspector/InspectorStyleSheet.cpp: * inspector/InspectorStyleSheet.h: * inspector/InspectorTimelineAgent.h: * inspector/InspectorWorkerAgent.cpp: * inspector/PageConsoleAgent.cpp: * inspector/PageRuntimeAgent.h: * inspector/WebConsoleAgent.cpp: * inspector/WorkerRuntimeAgent.h: * testing/Internals.cpp: 2014-02-17 Antti Koivisto Rename Document::m_selfOnlyRefCount to m_referencingNodeCount https://bugs.webkit.org/show_bug.cgi?id=128916 Reviewed by Andreas Kling. Make the name more informative. Also make it zero based (document is not considered to reference itself). * dom/Document.cpp: (WebCore::Document::Document): (WebCore::Document::removedLastRef): * dom/Document.h: (WebCore::Document::increaseReferencingNodeCount): (WebCore::Document::decreaseReferencingNodeCount): (WebCore::Node::Node): * dom/Node.cpp: (WebCore::Node::~Node): * dom/TreeScopeAdopter.cpp: (WebCore::TreeScopeAdopter::moveTreeToNewScope): (WebCore::TreeScopeAdopter::moveNodeToNewDocument): 2014-02-17 ChangSeok Oh [GTK] Build failure caused by missing jsmin module https://bugs.webkit.org/show_bug.cgi?id=128742 Reviewed by Philippe Normand. No new tests since no functionality changed. * GNUmakefile.am: Relocate PYTHONPATH to make it meaningful. 2014-02-17 Radu Stavila [CSS Regions] Make regions unsplittable https://bugs.webkit.org/show_bug.cgi?id=128811 Reviewed by David Hyatt. At the moment, nested regions are not properly fragmented across regions. For the moment, the regions will become unsplittable elements to avoid slicing. At a later time a proper fragmentation algorithm should be written, also taking into consideration pagination strut. Test: fast/regions/unsplittable-nested-region.html * rendering/RenderBox.cpp: (WebCore::RenderBox::isUnsplittableForPagination): 2014-02-17 Simon Fraser Graphics buffer issue with clip-path and fixed positioned element https://bugs.webkit.org/show_bug.cgi?id=126262 Reviewed by Tim Horton. If an element has a clip-path, backgroundIsKnownToBeOpaqueInRect() needs to return false so that we don't try to make opaque compositing layers. Test: compositing/contents-opaque/opaque-with-clip-path.html * rendering/RenderBox.cpp: (WebCore::RenderBox::backgroundIsKnownToBeOpaqueInRect): 2014-02-17 Radu Stavila [CSS Regions] The box decorations of an element overflowing a region should be clipped at the border box, not the content box https://bugs.webkit.org/show_bug.cgi?id=128815 Reviewed by Andrei Bucur. Elements flowed into a region should not be painted past the region's content box if they continue to flow into another region in that direction. If they do not continue into another region in that direction, they should be painted all the way to the region's border box. Regions with overflow:hidden will apply clip at the border box, not the content box. Tests: fast/regions/box-decorations-over-region-padding-fragmented.html fast/regions/box-decorations-over-region-padding-horiz-bt.html fast/regions/box-decorations-over-region-padding-vert-lr.html fast/regions/box-decorations-over-region-padding-vert-rl.html fast/regions/box-decorations-over-region-padding.html * rendering/RenderNamedFlowFragment.cpp: (WebCore::RenderNamedFlowFragment::flowThreadPortionRectForClipping): * rendering/RenderNamedFlowFragment.h: * rendering/RenderRegion.cpp: (WebCore::RenderRegion::rectFlowPortionForBox): 2014-02-17 Brendan Long DataCue.data should be a copy of the input ArrayBuffer, not a pointer https://bugs.webkit.org/show_bug.cgi?id=128886 Reviewed by Eric Carlson. No new tests, just updated existing track-datacue.html test. * html/track/DataCue.cpp: (WebCore::DataCue::DataCue): Add ExceptionCode and pass through to setData(). (WebCore::DataCue::data): Return a copy of m_data instead of a pointer. (WebCore::DataCue::setData): Create a copy of the input data, or throw an exception if it's null. * html/track/DataCue.h: Add ExceptionCode parameters to constructor and data setter. * html/track/DataCue.idl: Same. 2014-02-17 David Kilzer CounterContentData::counter() and ImageContentData::image() should return references Reviewed by Darin Adler. * css/CSSComputedStyleDeclaration.cpp: (WebCore::contentToCSSValue): - Update to use references. Remove useless ASSERTs. * css/StyleResolver.cpp: (WebCore::StyleResolver::loadPendingImages): - Update to use references. StyleResolver::loadPendingImage() will be changed to take a reference in the near future. * rendering/RenderElement.cpp: (WebCore::RenderElement::createFor): - Update to use references. The auto keyword wanted to instantiate a StyleImage instead a reference, so it was replaced. * rendering/style/ContentData.h: (WebCore::ImageContentData::ImageContentData): Add ASSERT that m_image is not NULL. (WebCore::ImageContentData::image): Return a reference. Remove useless overload with identical name. (WebCore::ImageContentData::cloneInternal): Simplify by using implicit PassRefPtr constructor. (WebCore::operator==): Remove unneeded deref operators. (WebCore::CounterContentData::counter): Return a reference. (WebCore::CounterContentData::cloneInternal): Remove unneeded deref operator. (WebCore::operator==): Remove unneeded deref operators. 2014-02-17 Jer Noble [MediaControls][iOS] Make mediacontrols match the system inline controls https://bugs.webkit.org/show_bug.cgi?id=128833 Reviewed by Eric Carlson. Move items slightly, fix button sizes, font sizes, and colors to match the inline controls from MoviePlayer.framework. * Modules/mediacontrols/mediaControlsiOS.css: (audio::-webkit-media-controls-panel): (audio::-webkit-media-controls-fullscreen-button): (audio::-webkit-media-controls-play-button): (audio::-webkit-media-controls-play-button.paused): (audio::-webkit-media-controls-timeline): (audio::-webkit-media-controls-timeline::-webkit-slider-thumb): (audio::-webkit-media-controls-time-remaining-display): * Modules/mediacontrols/mediaControlsiOS.js: (ControllerIOS.prototype.configureInlineControls): Do not add the status text. (ControllerIOS.prototype.updateTime): Call updateProgress(). (ControllerIOS.prototype.progressFillStyle): Draw a slightly different color. (ControllerIOS.prototype.updateProgress): Draw white to the left of the currentTime. (ControllerIOS.prototype.formatTime): Single leading zero in the time display fields. (ControllerIOS.prototype.handleTimelineChange): Call updateProgress(). 2014-02-17 Manuel Rego Casasnovas [CSS Grid Layout] Fix missing layout in flexible and content sized columns https://bugs.webkit.org/show_bug.cgi?id=128672 Reviewed by Sergio Villar Senin. RenderGrid::logicalContentHeightForChild() is called for some items at the beginning of RenderGrid::layoutGridItems() from RenderGrid::computeUsedBreadthOfGridTracks(). This causes that the comparison inside the for loop in RenderGrid::layoutGridItems() does not detect width changes, so elements won't be marked as needsLayout. So the comparison is done in RenderGrid::logicalContentHeightForChild() and the element is marked to perform a layout if the width has changed. The issue can be reproduced easily with a simple grid with one flexible or content sized column, all the available width is not used. On top of that, when you resize the window the flexible or content sized columns are not updating their size properly. CSS Grid Layout perftest results are around 4% worse, which is expected as we're adding a missing layout. Test: fast/css-grid-layout/flex-content-sized-column-use-available-width.html * rendering/RenderGrid.cpp: (WebCore::RenderGrid::logicalContentHeightForChild): Check width changes and mark element as needed layout if required. 2014-02-16 Andreas Kling Ensure that removing an iframe from the DOM tree disconnects its Frame. Merged from Blink (patch by Adam Klein): https://src.chromium.org/viewvc/blink?revision=156174&view=revision SubframeLoadingDisabler wasn't catching the case when an