2013-11-20 Lucas Forschler Merge r159481 2013-11-18 Zalan Bujtas use after free in WebCore::DocumentOrderedMap::remove / WebCore::TreeScope::removeElementById https://bugs.webkit.org/show_bug.cgi?id=121324 Reviewed by Ryosuke Niwa. Update the document ordered map for an image element before dispatching load or error events when it's inserted into a document. Test: fast/dom/modify-node-and-while-in-the-callback-too-crash.html * dom/DocumentOrderedMap.cpp: defensive fix to avoid use after free issues. (WebCore::DocumentOrderedMap::remove): * html/HTMLImageElement.cpp: (WebCore::HTMLImageElement::insertedInto): * loader/ImageLoader.cpp: (WebCore::ImageLoader::updateFromElement): setting m_failedLoadURL makes repeated updateFromElement calls return early. 2013-11-13 Dean Jackson Fix incorrect merge of r157299 made in r158605. * platform/graphics/DisplayRefreshMonitor.cpp: (WebCore::DisplayRefreshMonitor::removeClient): Remember to remove clients from m_clientsToBeNotified. * platform/graphics/DisplayRefreshMonitor.h: Might as well make the code more consistent with ToT while I'm here. 2013-11-08 Lucas Forschler Merge r152867 2013-07-18 Jer Noble New PDFPlugin doesn't support WebKitOmitPDFSupport, acts as if Plug-ins are off https://bugs.webkit.org/show_bug.cgi?id=118858 Reviewed by Eric Carlson. Expand the scope of rejecting non video/ or audio/ MIME types when filling the MIME type cache. * platform/graphics/mac/MediaPlayerPrivateQTKit.mm: (WebCore::shouldRejectMIMEType): Added utility function. 2013-11-07 Chris Fleizach Merge r158743 2013-11-06 Chris Fleizach AX: Audio and Video attachments are not output to VoiceOver https://bugs.webkit.org/show_bug.cgi?id=123479 Reviewed by Mario Sanchez Prada. Video and audio elements don't appear as distinct objects in the AX hierarchy, nor are they treated as replaceable objects when emitting the text. We should treat these characters like attachments, for one. On the Mac platform, we should also identify them with special subroles. Tests: platform/mac/accessibility/media-emits-object-replacement.html platform/mac/accessibility/media-role-descriptions.html * accessibility/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::isGenericFocusableElement): * accessibility/AccessibilityObject.h: * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored): (WebCore::AccessibilityRenderObject::determineAccessibilityRole): * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (createAccessibilityRoleMap): (-[WebAccessibilityObjectWrapper subrole]): (-[WebAccessibilityObjectWrapper roleDescription]): * editing/TextIterator.cpp: (WebCore::isRendererReplacedElement): 2013-11-06 Lucas Forschler Merge r158617 2013-11-04 Chris Fleizach AX: Mail attachments at the start of an email are not output by VoiceOver https://bugs.webkit.org/show_bug.cgi?id=123697 Reviewed by Ryosuke Niwa. VoiceOver is expecting that "replaced elements" (attachments in a Mail message in this case) to be represented by the replacement character when asking for a stringForRange. However, when that replaced element is at the beginning of the document, the logic does not work because there is a few code places that will take that first Position and advance it forward, not accounting for replaced elements. When using the TextIterator normally, it does account for these, so that's why it's only affecting as at the beginning of the document. Also a "replaced element" can be more than just renderer->isReplaced(), hence the externing of the isRendererReplacedElement method and using that it in pertinent places. Tests: platform/mac/accessibility/object-replacement-with-no-rendered-children-at-node-start.html platform/mac/accessibility/object-replacement-with-rendered-children-at-node-start.html * accessibility/AccessibilityObject.cpp: (WebCore::replacedNodeNeedsCharacter): * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (nsStringForReplacedNode): * dom/Position.cpp: (WebCore::Position::isCandidate): * dom/PositionIterator.cpp: * dom/Range.cpp: (WebCore::Range::firstNode): * editing/TextIterator.cpp: (WebCore::isRendererReplacedElement): * editing/TextIterator.h: 2013-11-06 Lucas Forschler Merge r158629 2013-11-04 Samuel White AX: AXShowMenu doesn't always work. https://bugs.webkit.org/show_bug.cgi?id=123649 Reviewed by Chris Fleizach. No new tests, the change occurs in a code path that forces the context menu to show which locks up DRT if we try to test it (platform menu is shown). The change itself gives the mouse event handler a chance to handle our platform mouse event BEFORE the event ends up in the show context menu machinery. This is necessary because without it, the element will not become focused. Without focus, accessibility shows different/less menu items than a mouse click. The end result is that context menus shown via accessibility are consistent with menus shown via click. * page/ContextMenuController.cpp: (WebCore::ContextMenuController::showContextMenuAt): 2013-11-06 Lucas Forschler Merge r154391 2013-08-21 Brent Fulgham [Windows] Enable CSS_IMAGE_SET Reviewed by Anders Carlsson. We can now activate: fast/css/image-set-parsing.html fast/css/image-set-parsing-invalid.html * WebCore.vcxproj/WebCore.vcxproj: Add missing image set implementation files. * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto. * css/CSSAllInOne.cpp: Add missing CSSImageSetValue.cpp * rendering/style/StyleAllInOne.cpp: Add missing StyeCachedImageSet.cpp 2013-11-04 Lucas Forschler Merge r155130 2013-09-05 Brent Fulgham [Windows] Unreviewed build/link improvement after r155127 to be consistent about using debug-build support libraries. Now that is resolved, we should be linking to debug AVFoundationCF as well. * page/CaptionUserPreferencesMediaAF.cpp: Link to AVFoundationCF_debug when building with the DEBUG_ALL target. * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp: Ditto. * platform/graphics/avfoundation/cf/AVFoundationCFSoftLinking.h: Ditto. 2013-11-04 Brent Fulgham Merge r157773 2013-10-21 Brent Fulgham [WIN] Properly support reverse animations without needing software fallback. https://bugs.webkit.org/show_bug.cgi?id=85121 Reviewed by Dean Jackson. Testing is provided by existing animation tests. * platform/animation/TimingFunction.h: (WebCore::CubicBezierTimingFunction::createReversed): Added. * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::addAnimation): The early return when performing a reverse or autoreverse animation is no longer needed. * platform/graphics/ca/PlatformCAAnimation.h: * platform/graphics/ca/mac/PlatformCAAnimationMac.mm: (toCAMediaTimingFunction): Use new reversed function. * platform/graphics/ca/win/PlatformCAAnimationWin.cpp: (toCACFTimingFunction): Ditto. (PlatformCAAnimation::setTimingFunction): Pass 'reverse' flag. (PlatformCAAnimation::setTimingFunctions): Ditto. 2013-11-04 Lucas Forschler Merge r154180 2013-08-15 Brent Fulgham [Windows] Prevent dangling CACFLayer when switching to/from Tiled backing. https://bugs.webkit.org/show_bug.cgi?id=119818 Reviewed by Darin Adler. Covered by existing: compositing/tiling/empty-to-tiled.html * platform/graphics/ca/win/PlatformCALayerWin.cpp: (PlatformCALayer::~PlatformCALayer): Remove deleted layer from its parent layer 2013-11-04 Dean Jackson Merge r157299 2013-10-10 Darin Adler Use after free in WebCore::DisplayRefreshMonitorClient::fireDisplayRefreshIfNeeded https://bugs.webkit.org/show_bug.cgi?id=121033 Reviewed by Dean Jackson. For safe iteration, use a set rather than a vector, and remove the clients from the set if they are removed during iteration. Test: fast/animation/request-animation-frame-remove-client.html * platform/graphics/DisplayRefreshMonitor.cpp: (WebCore::DisplayRefreshMonitor::DisplayRefreshMonitor): Initialize the m_clientsToBeNotified pointer to null. (WebCore::DisplayRefreshMonitor::removeClient): If there is a m_clientsToBeNotified set, remove from it as well as the real m_clients set. (WebCore::DisplayRefreshMonitor::displayDidRefresh): Use a HashSet instead of a vector for the copy of the clients set we iterate. * platform/graphics/DisplayRefreshMonitor.h: Moved some of the BlackBerry-specific part of this out of the header. Added a new HashSet pointer, m_clientsToBeNotified, to be used to remove clients during the notification process. Also added a FIXME. * platform/graphics/blackberry/DisplayRefreshMonitorBlackBerry.cpp: Moved the DisplayAnimationClient class in here. 2013-11-04 Lucas Forschler Merge r157436 2013-10-14 Ryosuke Niwa Crash in WebCore::BidiResolver::createBidiRunsForLine https://bugs.webkit.org/show_bug.cgi?id=122776 Reviewed by Darin Adler. Merge https://chromium.googlesource.com/chromium/blink/+/aca89bc4d984705a1f94b623dae0ab03e239a248 Fix modification of whitespace endpoints to not assume it's operating on RenderTexts During line layout, we use midpoints to identify RenderObjects, or parts of RenderObjects, that don't need InlineBoxes, usually because of collapsed whitespace. Prior to actually creating BidiRuns (the precursor to InlineBoxes), we use checkMidpoints to fix up our lineMidpointState to handle the case where we start ignoring spaces in our line, but don't stop until somewhere on the following line. Previously, this function assumed that the final midpoint (called an endpoint) was a RenderText, but this assumption is wrong if we have a beginning midpoint created by shouldSkipWhitespaceAfterStartObject (which handles inlines and list markers) and no endpoint on that line. In that case, we'd instead adjust the position backwards on the beginning midpoint, which would cause us to fail to create an InlineBox for the inline or list marker. In the new test added, this would actually trigger a crash due to an assumption when visually re-ordering BidiRuns that a non-empty line would actually contain at least one such run. Test: fast/text/whitespace/whitespace-and-margin-wrap-after-list-marker-crash.html * rendering/RenderBlockLineLayout.cpp: (WebCore::checkMidpoints): 2013-11-01 Brent Fulgham Merge r157070 2013-10-04 Ojan Vafai and Martin Robinson [MathML] Remove RenderTree modification during layout and refactor the StretchyOp code https://bugs.webkit.org/show_bug.cgi?id=121416 Reviewed by David Hyatt. Tests: mathml/presentation/mo-minus.html mathml/presentation/mo-stacked-glyphs.html mathml/presentation/mo-stretchy-vertical-bar.html mathml/very-large-stretchy-operators.html MathML stretched operators by both modifying the width of the operator and adding children to the operator node in the render tree. Instead we make the operator width equal to the widest glyph possible that we use to represent the operator. Additionally instead of rendering stretchy glyphs via stacked operator pieces in separate render tree nodes, keep only one node for the glyph, and use a custom paint method to paint the stacked representation. With this patch, rendering seems roughly equivalent on Mac and markedly better on Linux. * css/mathml.css: Not sure what this line-height:0 was here for, but it caused bugs with the new code * mathml/MathMLTextElement.cpp: (WebCore::MathMLTextElement::attach): (WebCore): (WebCore::MathMLTextElement::childrenChanged): Need to update the anonymous render tree below elements when their children change or when the renderer is first attached. * mathml/MathMLTextElement.h: (MathMLTextElement): * rendering/mathml/RenderMathMLBlock.cpp: (WebCore::RenderMathMLBlock::RenderMathMLBlock): * rendering/mathml/RenderMathMLBlock.h: Now that the preferred width doesn't depend on the height, we don't need to override computePreferredLogicalWidths at all. * rendering/mathml/RenderMathMLFenced.cpp: (WebCore::RenderMathMLFenced::makeFences): (WebCore::RenderMathMLFenced::styleDidChange): Need to update the anonymous renderers for the anonymous RenderMathMLOperators. * rendering/mathml/RenderMathMLOperator.cpp: (WebCore::RenderMathMLOperator::expandedStretchHeight): Store the non-expanded stretch height so that we can detect when the height actually changed. (WebCore::RenderMathMLOperator::stretchToHeight): Only update the style on the anonymous render tree since this is called from RenderMathMLRow::layout (WebCore::RenderMathMLOperator::styleDidChange): (WebCore::RenderMathMLOperator::glyphBoundsForCharacter): A helper to get glyph boundaries. (WebCore::RenderMathMLOperator::glyphHeightForCharacter): Ditto for glyph width. (WebCore::RenderMathMLOperator::advanceForCharacter): The advance is different from the width, and we want the width of the operator to be the advance instead of the tight bounding width. (WebCore::RenderMathMLOperator::computePreferredLogicalWidths): Use the max of all possible glyphs we can use to render this operator. (WebCore::RenderMathMLOperator::computeLogicalHeight): Return the stretched operator height, if appropriate. (WebCore::RenderMathMLOperator::updateFromElement): We add a child for rendering the non-scaled version of the glyph. (WebCore::RenderMathMLOperator::firstCharacterForStretching): Helper to figure out what character is the character used for stretching operations. (WebCore::RenderMathMLOperator::findAcceptableStretchyCharacter): Helper to find an acceptable set of glyph pieces for stretching characters. (WebCore::RenderMathMLOperator::updateStyle): Resize the operator to the appropriate height and hide the child if we are using the stretchy style. (WebCore::RenderMathMLOperator::firstLineBoxBaseline): (WebCore::RenderMathMLOperator::paintCharacter): Helper to paint a single character component of the stretchy glyph. (WebCore::RenderMathMLOperator::fillWithExtensionGlyph): Helper to paint the extender glue between features of the stretchy glyph. (WebCore::RenderMathMLOperator::paint): Properly paint stretchy glyphs. * rendering/mathml/RenderMathMLOperator.h: Update method declarations. 2013-11-01 Lucas Forschler Merge r158334 2013-10-30 Brent Fulgham [Win] Legible Output callbacks should happen on notification queue https://bugs.webkit.org/show_bug.cgi?id=123545 Reviewed by Eric Carlson. Modify the callback creation for Legible Output items so that they are made on our notification queue. The use of the main queue was a holdover from some temporary code used during earlier development. * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp: (WebCore::AVFWrapper::AVFWrapper): Assert this happens on the main thread. (WebCore::AVFWrapper::~AVFWrapper): Ditto. (WebCore::destroyAVFWrapper): Ditto. (WebCore::AVFWrapper::createPlayer): Ditto. (WebCore::AVFWrapper::createPlayerItem): Ditto. Also, instruct LegibleOutput callbacks to happen on our notification queue, rather than the main thread. (WebCore::AVFWrapper::createAVCFVideoLayer): Assert this happens on the main thread. (WebCore::AVFWrapper::destroyVideoLayer): Ditto. (WebCore::AVFWrapper::createImageGenerator): Ditto. (WebCore::AVFWrapper::destroyImageGenerator): Ditto. 2013-10-31 Lucas Forschler Merge r157183 2013-10-09 Chris Fleizach AX: VoiceOver double speaks all items in
  • nodes https://bugs.webkit.org/show_bug.cgi?id=122564 Reviewed by Brent Fulgham. Test: platform/mac/accessibility/native-list-item-should-not-expose-label.html * accessibility/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::visibleText): 2013-10-31 Lucas Forschler Merge r157056 2013-10-07 Tim Horton Animated images are not restarted when page visibility changes https://bugs.webkit.org/show_bug.cgi?id=122464 Reviewed by Simon Fraser. Always kickstart animated images when the page visibility changes, which can occur via window occlusion, and which is independent of in-window state, which we were previously using to advance animation. No new tests; attempts to make a test have resulted only in a flaky, timing-dependent test. * page/Frame.cpp: (WebCore::Frame::resumeActiveDOMObjectsAndAnimations): Move this call to resumeAnimatingImages() up to Page. * page/FrameView.cpp: (WebCore::FrameView::setIsInWindow): Move this call to resumeAnimatingImages() up to Page. * WebCore.exp.in * page/FrameView.h: * page/Page.h: Move resumeAnimatingImages() itself up to Page. * page/Page.cpp: (WebCore::Page::setIsInWindow): Resume animated images when we move in-window. (WebCore::Page::setVisibilityState): Resume animated images when we become visible. This is the one we were previously missing. (WebCore::Page::resumeActiveDOMObjectsAndAnimations): Resume animated images when we're told to. (WebCore::Page::resumeAnimatingImages): Kickstart any animated images in all frames. 2013-10-28 Brent Fulgham Merge r155221. 2013-09-06 Brent Fulgham [Windows] StructuredExceptionHandlerSuppressor Causes Bad Interactions with Support Libraries https://bugs.webkit.org/show_bug.cgi?id=120901 Reviewed by Anders Carlsson. Change from old "crash on any exception" implementation to a new version that leaves normal exception handling infrastructure in place for use by support libraries. We check exceptions and decide whether to abort or not based on the failure type. * WebCore.vcxproj/WebCore.vcxproj: Add new implementation files. * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto. * platform/graphics/ca/win/LayerChangesFlusher.cpp: (WebCore::LayerChangesFlusher::hookCallback): Allocate handler struct on stack. * platform/win/StructuredExceptionHandlerSuppressor.cpp: Added. (exceptionShouldTerminateProgram): New. (exceptionHandler): New. (WebCore::StructuredExceptionHandlerSuppressor::StructuredExceptionHandlerSuppressor): Moved from header, and updated to add our new exception handler. (WebCore::StructuredExceptionHandlerSuppressor::~StructuredExceptionHandlerSuppressor): Moved from header. * platform/win/StructuredExceptionHandlerSuppressor.h: Move implementation of constructor and destructor from header file. * platform/win/makesafeseh.asm: Added. 2013-10-28 Brent Fulgham Merge r155215. 2013-09-06 Brent Fulgham [Windows] Unreviewed gardening: Spell 'Suppressor' properly * WebCore.vcxproj/WebCore.vcxproj: Change StructuredExceptionHandlerSupressor to StructuredExceptionHandlerSuppressor * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto * platform/graphics/ca/win/LayerChangesFlusher.cpp: (WebCore::LayerChangesFlusher::hookCallback): Ditto * platform/win/StructuredExceptionHandlerSuppressor.h: Copied from platform/win/StructuredExceptionHandlerSupressor.h. * platform/win/StructuredExceptionHandlerSupressor.h: Removed. 2013-10-28 Lucas Forschler Merge r157298 2013-10-10 Dean Jackson Use after free in WebCore::DisplayRefreshMonitorClient::fireDisplayRefreshIfNeeded http://webkit.org/b/121033 Reviewed by Darin Adler. Add an ASSERT to detect if an animation client will be removed during the callback dispatch. Test: fast/animation/request-animation-frame-remove-client.html * platform/graphics/DisplayRefreshMonitor.cpp: (WebCore::DisplayRefreshMonitor::displayDidRefresh): 2013-10-28 Lucas Forschler Merge r155554 2013-09-11 Myles C. Maxfield Fix nested unicode-bidi: isolate https://bugs.webkit.org/show_bug.cgi?id=120504 Reviewed by Darin Adler. When we have a nested isolate renderer if the outer isolate has a text and this text is not the first child, the isolated chain is not rendered correctly. This happens because constructBidiRunsForSegment uses always the first inner isolated renderer as isolated inline container. This patch fixes the behavior described changing containingIsolate to find the right isolated container. Merged from Blink: https://chromium.googlesource.com/chromium/blink/+/840a57050eade39dd04dde0c6603e129b783151c Tests: fast/text/international/unicode-bidi-isolate-nested-first-child-text.html fast/text/international/unicode-bidi-isolate-nested-simple.html * rendering/InlineIterator.h: (WebCore::containingIsolate): * rendering/RenderBlockLineLayout.cpp: (WebCore::constructBidiRunsForSegment): 2013-10-28 Lucas Forschler Merge r155665 2013-09-12 Tim Horton [mac] Cache rendered image in PDFDocumentImage https://bugs.webkit.org/show_bug.cgi?id=121207 Reviewed by Simon Fraser. Tests: fast/images/pdf-as-image-too-big.html * loader/cache/CachedImage.cpp: (WebCore::CachedImage::createImage): PDFDocumentImage takes a ImageObserver now so that it can report decoded data size changes to the memory cache. * platform/graphics/Image.h: (WebCore::Image::isPDFDocumentImage): Added. * platform/graphics/cg/PDFDocumentImage.cpp: (WebCore::PDFDocumentImage::PDFDocumentImage): PDFDocumentImage takes a ImageObserver now so that it can report decoded data size changes to the memory cache. (WebCore::PDFDocumentImage::applyRotationForPainting): Fix up some comments, and use GraphicsContext instead of CG API. (WebCore::PDFDocumentImage::cacheParametersMatch): Determine whether our cached image is still valid, given the new destination's size, CTM scale, and source rect. (WebCore::transformContextForPainting): Added. (WebCore::PDFDocumentImage::updateCachedImageIfNeeded): Cache a rendered bitmap of the PDF. Invalidate the cache if cacheParametersMatch decides that the parameters don't match, unless we're painting in low quality mode, in which case we'll scale the existing image (and then fully repaint when the high-quality repaint timer fires). Inform the memory cache of our new size. (WebCore::PDFDocumentImage::draw): Update the cached image if needed. Paint the cached image into the context if it's available (which it might not be, if the image is way too big and the allocation fails). Otherwise, paint straight into the context as we previously did. (WebCore::PDFDocumentImage::destroyDecodedData): Throw away the cached image if requested. (WebCore::PDFDocumentImage::decodedSize): (WebCore::PDFDocumentImage::drawPDFPage): Drive-by use GraphicsContext instead of CG directly. * platform/graphics/cg/PDFDocumentImage.h: (WebCore::PDFDocumentImage::create): Override isPDFDocumentImage(). Add storage for the cached image buffer and various cache parameters. * rendering/ImageQualityController.cpp: (WebCore::ImageQualityController::shouldPaintAtLowQuality): PDFDocumentImage is also interested in/capable of low-quality painting now. 2013-10-28 Lucas Forschler Merge r155664 2013-09-12 Tim Horton Image doesn't always repaint at high quality in all tiles after a live resize https://bugs.webkit.org/show_bug.cgi?id=121244 Reviewed by Darin Adler. Currently, ImageQualityController removes an image from its low-quality-images list from inside shouldPaintAtLowQuality, if this is the first paint outside of a live resize, but does not force the renderer to repaint in its entirety. However, there's no guarantee we've invalidated the whole renderer, so this can leave some parts of the image painted in low-quality. This just removes a short-circuit, instead using the ordinary high-quality-repaint timer to ensure that the entire renderer is repainted. No new test; all attempts have failed, as this depends on tiled drawing and a live resize occurring. * rendering/ImageQualityController.cpp: (WebCore::ImageQualityController::shouldPaintAtLowQuality): 2013-10-28 Lucas Forschler Rollout 158067. 2013-10-25 Lucas Forschler Merge r155608 2013-09-12 Zalan Bujtas Crash in ScrollingStateStickyNode::updateConstraints https://bugs.webkit.org/show_bug.cgi?id=119638 Reviewed by Simon Fraser. Ensure when a scrolling state node is removed from the state tree, we remove both the current node and all its children from the associated m_stateNodeMap lookup table. Test: fast/css/sticky/multiple-layers-sticky-crash.html * page/scrolling/ScrollingStateNode.cpp: (WebCore::ScrollingStateNode::removeChild): (WebCore::ScrollingStateNode::willBeRemovedFromStateTree): * page/scrolling/ScrollingStateNode.h: 2013-10-25 Lucas Forschler Merge r155546 2013-09-10 Simon Fraser REGRESSION (143483): overflow:hidden doesn't quash big repaints from text-indent: -9999px https://bugs.webkit.org/show_bug.cgi?id=121137 Reviewed by Ryosuke Niwa. The change in r143483 made it so that negative text-indent gets added to visual oveflow even when we have overflow:hidden, which is really bad because it causes large repaints (and large layers) for a common-on-the-web pattern. Revert the change, and add a new test to make sure it doesn't regress. I can't reproduce the bug it was trying to fix with the change reverted. Tests: compositing/geometry/negative-text-indent-with-overflow-hidden-layer.html fast/repaint/negative-text-indent-with-overflow-hidden.html * rendering/RenderBlock.cpp: (WebCore::RenderBlock::computeOverflow): 2013-10-25 Lucas Forschler Merge r155468 2013-09-10 Tim Horton [mac] PDFDocumentImage should use PDFKit to draw https://bugs.webkit.org/show_bug.cgi?id=120651 Unreviewed hopeful build fix. * platform/graphics/mac/PDFDocumentImageMac.mm: 2013-10-25 Lucas Forschler Merge r155461 2013-09-10 Tim Horton [mac] PDFDocumentImage should use PDFKit to draw https://bugs.webkit.org/show_bug.cgi?id=120651 Reviewed by Alexey Proskuryakov. Use PDFKit to draw PDF-in- on Mac, so that annotations in PDF are painted. Test: fast/images/pdf-as-image-with-annotations.html * WebCore.xcodeproj/project.pbxproj: Add PDFDocumentImageMac.mm. * platform/graphics/cg/PDFDocumentImage.cpp: (WebCore::PDFDocumentImage::PDFDocumentImage): We don't need to initialize m_document anymore because it's now a RetainPtr. Initialize m_hasPage to false. (WebCore::PDFDocumentImage::~PDFDocumentImage): We don't need to manually release our CGPDFDocumentRef anymore because it's now a RetainPtr. (WebCore::PDFDocumentImage::size): Use expandedIntSize for explicitness. (WebCore::PDFDocumentImage::applyRotationForPainting): Rename adjustCTM to applyRotationForPainting, and move the one non-rotation related transformation out. We need to do this because PDFKit applies the rotation transformation itself, so we don't need to. Also, explicitly use std::min instead of importing the whole std namespace. (WebCore::PDFDocumentImage::dataChanged): Assert that we don't re-enter dataChanged after we've created a document, because it seems like that shouldn't happen - we only create a document when we've supposedly received all data, and it would be nice if we didn't have all this varying code to deal with SharedBuffers changing out from under each other. Factor the code to create a CGPDFDocumentRef out into createPDFDocument, so we can replace it with a different implementation that creates a PDFDocument. (WebCore::PDFDocumentImage::setCurrentPage): Make all page-number-related things unsigned, since they are in CG and PDFKit, and add m_hasPage to denote whether we've acquired a valid page yet. Factor code to retrieve the PDF box bounds into computeBoundsForCurrentPage. Remove setCurrentPage itself, as we never use a page other than the first page; we will call computeBoundsForCurrentPage and set hasPage in dataChanged, now. (WebCore::PDFDocumentImage::draw): Fix a weird comment. Factor code that actually draws the PDF out into drawPDFPage. The rest of the functions in this file are only built for USE(CG) && !PLATFORM(MAC): (WebCore::PDFDocumentImage::createPDFDocument): Factored out of dataChanged(). Use the PLATFORM(MAC) way of making a CGDataProvider from a SharedBuffer everywhere; we're already using it on iOS, and it should also work for Windows, the only other USE(CG) platform. Since we only createPDFDocument() after all data has been received, remove the comment about the SharedBuffer being secretly written to behind its back. (WebCore::PDFDocumentImage::computeBoundsForCurrentPage): Factored out of setCurrentPage(). Use deg2rad since we have it. (WebCore::PDFDocumentImage::pageCount): (WebCore::PDFDocumentImage::drawPDFPage): Factored out of draw(). Reduced an unnecessary transform (we were effectively doing mediaBox.origin - cropBox.origin - mediaBox.origin). * platform/graphics/cg/PDFDocumentImage.h: Unindent all the things, as we don't indent the first level inside a namespace scope. Forward-declare PDFDocument. Make m_currentPage unsigned as it should be. Add m_hasPage. Make m_document a PDFDocument on PLATFORM(MAC) and a CGPDFDocumentRef on other platforms. * platform/graphics/mac/PDFDocumentImageMac.mm: Added. Soft-link in PDFKit and specifically the PDFDocument class. (WebCore::PDFDocumentImage::createPDFDocument): Create our PDFDocument from the SharedBuffer's NSData directly. This shouldn't be a problem (with respect to the SharedBuffer's data being appended to in secret), because we've waited for the document to finish loading before getting here. (WebCore::PDFDocumentImage::computeBoundsForCurrentPage): Ask PDFKit for the page's media and crop boxes; it automatically performs the correct fallback. Ask PDFKit for the page's rotation. (WebCore::PDFDocumentImage::pageCount): Ask PDFKit for the page count. (WebCore::PDFDocumentImage::drawPDFPage): Paint the current page of the PDF. Note that we do not apply the rotation here via applyRotationForPainting because PDFKit will do it itself. Save and restore two bits of CG state which aren't saved and restored with the graphics state, as PDFKit can mutate them above us (). * platform/mac/SoftLinking.h: I couldn't find any clients of SOFT_LINK_FRAMEWORK_IN_CORESERVICES_UMBRELLA, so I made it the more generic SOFT_LINK_FRAMEWORK_IN_UMBRELLA, taking the name of the umbrella framework and the subframework, so I could use it to soft link Quartz.framework's PDFKit.framework. 2013-10-25 Lucas Forschler Merge r155127 2013-09-04 Anders Carlsson Vector::releaseBuffer should return an OwnPtr https://bugs.webkit.org/show_bug.cgi?id=120718 Reviewed by Andreas Kling. Change FormStreamFields::currentData to an OwnPtr. * platform/network/cf/FormDataStreamCFNet.cpp: (WebCore::closeCurrentStream): (WebCore::advanceCurrentStream): (WebCore::formCreate): 2013-10-25 Lucas Forschler Merge r154915 2013-08-30 Brent Fulgham [Windows] Update to incorporate additional suggestions https://bugs.webkit.org/show_bug.cgi?id=120448 Reviewed by Darin Adler * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp: Add notes as to why AVFoundationCF needs this extra method call. * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h: Use OVERRIDE * rendering/RenderVideo.cpp: Replace ternary operator with logical &&. 2013-10-25 Lucas Forschler Merge r154914 2013-08-30 Brent Fulgham [Windows] Vide element in page always uses non-hw accelerated mode. https://bugs.webkit.org/show_bug.cgi?id=120448 Reviewed by Darin Adler This patch is unfortunately larger than my original idea, but seems to make the layout system happier. Instead of switching into composited mode when building the media player, we now build the original layout tree with compositing active if the underlying media element requires it. The AVFoundationCF player needs to have the compositor available at construction time so it can attach to the rendering device. Otherwise it falls back to CPU-only mode. * platform/graphics/MediaPlayer.cpp: (WebCore::MediaPlayer::requiresImmediateCompositing): Added * platform/graphics/MediaPlayer.h: * platform/graphics/MediaPlayerPrivate.h: (WebCore::MediaPlayerPrivateInterface::requiresImmediateCompositing): Added * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp: (WebCore::MediaPlayerPrivateAVFoundationCF::createAVPlayer): Added * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h: (WebCore::MediaPlayerPrivateAVFoundationCF::requiresImmediateCompositing): * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::requiresCompositingForVideo): Uses new 'requiresImmediateCompositing' to short-circuit check for whether a compositor is required. * rendering/RenderVideo.cpp: (WebCore::RenderVideo::requiresImmediateCompositing): * rendering/RenderVideo.h: 2013-10-25 Lucas Forschler Merge r154890 2013-08-30 Brent Fulgham [Windows] Video inside page always uses non-hardware accelerated playback https://bugs.webkit.org/show_bug.cgi?id=120448 Reviewed by Eric Carlson. * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp: (WebCore::MediaPlayerPrivateAVFoundationCF::createAVPlayer): Check for D3D device. If it doesn't exist, switch to compositing mode and try again. 2013-10-25 Lucas Forschler Merge r154856 2013-08-29 Tim Horton SVG clipping, masking, and gradients-on-text do not respect the device scale factor https://bugs.webkit.org/show_bug.cgi?id=120377 Reviewed by Simon Fraser. Tests: svg/custom/masking-clipping-hidpi.svg calculateTransformationToOutermostCoordinateSystem should include the page's device scale factor in its transform. * rendering/svg/SVGRenderingContext.cpp: (WebCore::SVGRenderingContext::calculateTransformationToOutermostCoordinateSystem): 2013-10-24 Lucas Forschler Merge r154694 2013-08-27 Brent Fulgham [Windows] Correct method call for characteristic update. Reviewed by Eric Carlson. * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp: (WebCore::MediaPlayerPrivateAVFoundationCF::tracksChanged): [Windows] Correct method call (should have been "characteristicsChanged", not "player()->characteristicChanged()" 2013-10-24 Lucas Forschler Merge r154693 2013-08-26 Brent Fulgham [Windows] some track language tags are not recognized https://bugs.webkit.org/show_bug.cgi?id=120335 Reviewed by Eric Carlson. * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp: Revise implementation to match logic in platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjc.mm 2013-10-24 Lucas Forschler Merge r154681 2013-08-27 Joseph Pecoraro Web Inspector: Column Breakpoint not working, may be off by 1 https://bugs.webkit.org/show_bug.cgi?id=120334 Reviewed by David Kilzer. JavaScriptCore changed to 1-based column numbers at some point. We need to update the ScriptDebugger assumption that they were 0-based. Test: inspector-protocol/debugger/column-breakpoint.html * bindings/js/ScriptDebugServer.cpp: (WebCore::ScriptDebugServer::createCallFrame): (WebCore::ScriptDebugServer::updateCallFrameAndPauseIfNeeded): 2013-10-24 Lucas Forschler Merge r154647 2013-08-23 Andy Estes Fix issues found by the Clang Static Analyzer https://bugs.webkit.org/show_bug.cgi?id=120230 Reviewed by Darin Adler. * WebCore.xcodeproj/project.pbxproj: Removed FoundationExtras.h. * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: Removed CFAutoreleaseHelper(). (AXTextMarkerRange): Used HardAutorelease() instead of CFAutoreleaseHelper(). (AXTextMarkerRangeStart): Ditto. (AXTextMarkerRangeEnd): Ditto. (textMarkerForVisiblePosition): Ditto. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (-[WebCoreAVFMovieObserver initWithCallback:]): Called [super init] first so that we don't later use ivars from the wrong self. (-[WebCoreAVFLoaderDelegate initWithCallback:]): Ditto. * platform/mac/FoundationExtras.h: Removed. * platform/mac/KURLMac.mm: (WebCore::KURL::operator NSURL *): Used WTF's HardAutorelease(). * platform/mac/WebCoreNSURLExtras.mm: (WebCore::mapHostNameWithRange): Used HardAutorelease() instead of WebCoreCFAutorelease(). (WebCore::URLWithData): Ditto. (WebCore::userVisibleString): Ditto. (WebCore::URLByRemovingComponentAndSubsequentCharacter): Used Vector<> with an inline capacity rather than heap-allocating a buffer. * platform/mac/WebCoreObjCExtras.h: Used HardAutorelease() instead of WebCoreCFAutorelease(). * platform/text/mac/StringImplMac.mm: (WTF::StringImpl::operator NSString *): Used WTF's HardAutorelease(). 2013-10-24 Lucas Forschler Merge r154527 2013-08-23 Eric Carlson [Mac] some track language tags are not recognized https://bugs.webkit.org/show_bug.cgi?id=119643 Reviewed by Jere Noble. No new tests, existing tests updated. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::HTMLMediaElement): Initialize m_captionDisplayMode from settings if possible. (WebCore::HTMLMediaElement::configureTextTrackGroup): Don't enable a default track when preferences say captions should be disabled. Don't disable an already visible track if we don't find a match unless preferences say captions should be disabled. m_forcedOrAutomaticSubtitleTrackLanguage -> m_subtitleTrackLanguage. (WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged): If the language of the primary audio track changes, only kick off a text track recalc if caption preference are set to "automatic". * html/HTMLMediaElement.h: * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp: (WebCore::MediaPlayerPrivateAVFoundation::MediaPlayerPrivateAVFoundation): Initialize m_characteristicsChanged and m_delayCharacteristicsChangedNotification. (WebCore::MediaPlayerPrivateAVFoundation::setHasVideo): Call characteristicsChanged. (WebCore::MediaPlayerPrivateAVFoundation::setHasAudio): Ditto. (WebCore::MediaPlayerPrivateAVFoundation::setHasClosedCaptions): Ditto. (WebCore::MediaPlayerPrivateAVFoundation::characteristicsChanged): New, allows us to coalesce calls to the media player when we know several characteristics may change. (WebCore::MediaPlayerPrivateAVFoundation::setDelayCharacteristicsChangedNotification): Enable or disable notification delay. * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged): Always call languageOfPrimaryAudioTrack(), a track may have changed so we may have a new language. (WebCore::MediaPlayerPrivateAVFoundationObjC::languageOfPrimaryAudioTrack): Call [AVAssetTrack languageCode] if [AVAssetTrack extendedLanguageTag] returns NULL in case the media file has an old QuickTime language code. 2013-10-24 Lucas Forschler Merge r154308 2013-08-19 Ryosuke Niwa input[type=range]: Fix a crash by changing input type in 'input' event handler Reviewed by Kent Tamura. Merge https://chromium.googlesource.com/chromium/blink/+/99afc9b55ce176b4f5fe053070e19dbebc1891a5 In SliderThumbElement::setPositionFromPoint, renderer() can be NULL after HTMLInputElement::setValueFromRenderer, which dispatches 'input' event. Also, make a local vairable 'input' a RefPtr just in case. Also add null-poinetr checks for the host element as SliderThumbElement only weakly holds onto the host element. Test: fast/forms/range/range-type-change-oninput.html * html/shadow/SliderThumbElement.cpp: (WebCore::SliderThumbElement::isDisabledFormControl): (WebCore::SliderThumbElement::matchesReadOnlyPseudoClass): (WebCore::SliderThumbElement::matchesReadWritePseudoClass): (WebCore::SliderThumbElement::setPositionFromPoint): (WebCore::SliderThumbElement::hostInput): 2013-10-21 Lucas Forschler Merge r154289 2013-08-19 Ryosuke Niwa ASSERTION FAILED: !node || node->isShadowRoot() in WebCore::EventRetargeter::eventTargetRespectingTargetRules https://bugs.webkit.org/show_bug.cgi?id=119720 Reviewed by Andy Estes. Merge https://chromium.googlesource.com/chromium/blink/+/4ce9bfbf54410179cd0f18b3d1a912045fc0ec3d * dom/EventRetargeter.h: (WebCore::EventRetargeter::eventTargetRespectingTargetRules): 2013-10-21 Lucas Forschler Merge r154183 2013-08-16 Brady Eidson (NetworkProcess) Sync XHRs should load using async ResourceHandles, not ResourceHandle::loadResourceSynchronously https://bugs.webkit.org/show_bug.cgi?id=119493 Reviewed by Alexey Proskuryakov. No new tests (Covered by plenty of existing tests). * WebCore.exp.in: * WebCore.xcodeproj/project.pbxproj: * platform/network/SynchronousLoaderClient.h: Make platformBadResponseError public * platform/network/mac/ResourceHandleMac.mm: (WebCore::ResourceHandle::platformLoadResourceSynchronously): Add comments/FIXMEs spelling out how wrong this code is. 2013-10-21 Lucas Forschler Merge r153975 2013-08-12 Ryosuke Niwa Fix NULL de-refernce in HTMLAnchorElement::sendPings when settings doesn't exist https://bugs.webkit.org/show_bug.cgi?id=119716 Reviewed by Darin Adler. Merge https://chromium.googlesource.com/chromium/blink/+/d5783da353ab783e9994b8fbecd91880be5192a1 No new tests since the test in the Blink change doesn't reproduce crash on WebKit. * html/HTMLAnchorElement.cpp: (WebCore::HTMLAnchorElement::sendPings): 2013-10-21 Lucas Forschler Merge r153920 2013-08-09 Jer Noble Crash in com.apple.WebKit.WebContent at com.apple.MediaToolbox. https://bugs.webkit.org/show_bug.cgi?id=119645 Reviewed by Eric Carlson. Work around crash caused by by releasing m_request as soon as keys have been added to it. * Modules/encryptedmedia/CDMPrivateAVFoundation.mm: (WebCore::CDMSessionAVFoundation::update): 2013-10-21 Lucas Forschler Merge r153913 2013-08-09 Alexey Proskuryakov REGRESSION (r142755): window.open creates an invisible window when width and height are 0 https://bugs.webkit.org/show_bug.cgi?id=119633 Reviewed by Darin Adler. Test: fast/dom/Window/open-zero-size-as-default.html Relying on each WebKit to refuse setting size to zero was fragile - because this required each one to have the check, and because by the time the client was called, the initially zero size was not necessarily zero. * loader/FrameLoader.cpp: (WebCore::createWindow): When sizes are zero, keep the size the window was created with, because that's the default one by definition. * page/DOMWindow.cpp: (WebCore::DOMWindow::adjustWindowRect): It's too late to check for zero size now, it's been mangled to adjust for the difference between window and viewport size. 2013-10-21 Lucas Forschler Merge r153909 2013-08-09 Dean Jackson Captions menu needs to reset text-align https://bugs.webkit.org/show_bug.cgi?id=119637 Reviewed by Eric Carlson. Reset the text-align property on the menu so that it doesn't get the inherited value. The full fix for all controls is http://webkit.org/b/116100. * css/mediaControlsQuickTime.css: (video::-webkit-media-controls-closed-captions-container): 2013-10-21 Lucas Forschler Merge r153877 2013-08-08 Tim Horton navigator.plugins has plugins in it when plugins are disabled https://bugs.webkit.org/show_bug.cgi?id=119607 Reviewed by Anders Carlsson. Test: plugins/navigator-plugins-disabled.html * page/Settings.cpp: (WebCore::Settings::setPluginsEnabled): Refresh the plugin database when plugins are enabled or disabled. This is necessary to ensure that navigator.plugins will have the correct set of plugins after dynamically changing whether plugins are enabled, which makes the test for this patch possible (but it makes sense in the browser as well). 2013-09-06 Lucas Forschler Merge r155203 2013-09-06 Mike West Revalidation header blacklisting should be case-insensitive. https://bugs.webkit.org/show_bug.cgi?id=120832 Reviewed by Alexey Proskuryakov. Headers like 'content-type' should be ignored for 304 responses, even if they are delivered as 'Content-Type', or 'CoNtEnT-TyPe', etc. I broke this behavior in http://trac.webkit.org/changeset/142068 ("Entity-header extension headers honored on 304 responses"). Pages like https://learndev.unm.edu/ currently break on reload, as they incorrectly send 'Content-Type: text/plain' for 304 responses for resources like CSS and JavaScript. The browser should drop these headers, but because we're comparing in a case-sensitive fashion, we don't. https://code.google.com/p/chromium/issues/detail?id=246875 documents the Blink-side fix; this patch is a port of that patch. Test: http/tests/cache/content-type-ignored-during-revalidation.html * loader/cache/CachedResource.cpp: (WebCore::shouldUpdateHeaderAfterRevalidation): Compare the provided AtomicString 'header' to the revalidation blacklists in a case-insensitive fashion. 2013-09-05 Lucas Forschler Merge r154037 2013-08-13 Ryosuke Niwa REGRESSION(r150187): Safari fails to render allrecipe.com comment popups https://bugs.webkit.org/show_bug.cgi?id=119780 Reviewed by Benjamin Poulain. The bug was caused by SelectorDataList::executeFastPathForIdSelector not verifying that elements found by getAllElementsById are descendents of rootNode when there are multiple elements of the same id. This resulted in querySelector and querySelectorAll of an element returning nodes outside of the element. Fixed the bug by checking this condition when we have multiple elements of the same id. Test: fast/selectors/querySelector-id-with-multiple-elements-with-same-id.html * dom/SelectorQuery.cpp: (WebCore::SelectorDataList::executeFastPathForIdSelector): 2013-09-04 Dean Jackson Disable CSS_SHAPES on safari-537-branch Reviewed by Beth Dakin. * Configurations/FeatureDefines.xcconfig: 2013-09-04 Lucas Forschler Merge r155014 2013-09-03 Enrica Casucci Can't select Katakana word by double-clicking. Reviewed by Alexey Proskuryakov and Ryosuke Niwa. For some languages, like Japanese we need to use more context for word breaking. New test: editing/selection/doubleclick-japanese-text.html * platform/text/TextBoundaries.h: (WebCore::requiresContextForWordBoundary): 2013-09-02 Lucas Forschler Merge r154785 2013-08-28 Simon Fraser Fix compositing layers in columns https://bugs.webkit.org/show_bug.cgi?id=120436 Reviewed by Dave Hyatt. Remove the old hack in RenderLayer::updateLayerPosition() for placing layers in columns, which changed the layer position for composited layers; this broke hit-testing. Fix a better way by moving compositing layers to the correct positions that take column offsets into account, by fixing RenderLayer::convertToLayerCoords() to optionally apply column adjustment, and using this in the code which positions compositing layers. Tests: compositing/columns/ancestor-clipped-in-paginated.html compositing/columns/clipped-in-paginated.html compositing/columns/composited-columns-vertical-rl.html compositing/columns/composited-columns.html compositing/columns/composited-in-paginated-rl.html compositing/columns/composited-in-paginated-writing-mode-rl.html compositing/columns/composited-lr-paginated-repaint.html compositing/columns/composited-rl-paginated-repaint.html compositing/columns/hittest-composited-in-paginated.html compositing/columns/rotated-in-paginated.html compositing/columns/untransformed-composited-in-paginated.html * rendering/RenderLayer.cpp: (WebCore::RenderLayer::updateLayerPosition): (WebCore::RenderLayer::convertToPixelSnappedLayerCoords): (WebCore::accumulateOffsetTowardsAncestor): (WebCore::RenderLayer::convertToLayerCoords): * rendering/RenderLayer.h: * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateCompositedBounds): (WebCore::RenderLayerBacking::updateGraphicsLayerGeometry): 2013-08-26 Lucas Forschler Merge r154528 2013-08-23 Beth Dakin REGRESSION (r132545): Some PDFs generated by WebKit are blank when viewed in Adobe Reader https://bugs.webkit.org/show_bug.cgi?id=120240 -and corresponding- Reviewed by Anders Carlsson. This patch makes it so that we don’t use the infinite rect for the PDF context, and it adds WebCoreSystemInterface API to find out if the current content is the PDF context. * WebCore.exp.in: * platform/graphics/cg/GraphicsContextCG.cpp: (WebCore::GraphicsContext::clipOut): * platform/mac/WebCoreSystemInterface.h: * platform/mac/WebCoreSystemInterface.mm: 2013-08-26 Lucas Forschler Merge r154529 2013-08-23 Jer Noble REGRESSION (r150516): Media controls are messed up on right-to-left webpages https://bugs.webkit.org/show_bug.cgi?id=120234 Reviewed by Dan Bernstein. Test: media/video-rtl.html Make the media control panel explicitly direction:ltr. The captions menu and captions display are unaffected, so rtl content will continue to appear rtl there. * css/mediaControls.css: (audio::-webkit-media-controls-panel, video::-webkit-media-controls-panel): 2013-08-26 Lucas Forschler Merge r154535 2013-08-23 Simon Fraser Improve scrolling behavior in iTunes https://bugs.webkit.org/show_bug.cgi?id=120241 Reviewed by Sam Weinig. When vertically scrolling a page with horizontally scrollable overflow areas, vertical scroll gestures would be interrupted when wheel events with non-zero X deltas were intercepted by the overflow areas. Fix by storing a small history of wheel events deltas and using it to determine of the scroll gesture is primarily vertical or horizontal. When this is detected, avoid dispatching scroll events on the on the non-dominant axis. Currently this behavior is conditionalized to only apply in iTunes. * page/EventHandler.cpp: (WebCore::EventHandler::EventHandler): (WebCore::EventHandler::recordWheelEventDelta): (WebCore::deltaIsPredominantlyVertical): (WebCore::EventHandler::dominantScrollGestureDirection): (WebCore::EventHandler::handleWheelEvent): (WebCore::EventHandler::defaultWheelEventHandler): * page/EventHandler.h: * platform/RuntimeApplicationChecks.cpp: (WebCore::applicationIsITunes): * platform/RuntimeApplicationChecks.h: 2013-08-21 Lucas Forschler Merge r154378 2013-08-20 Jer Noble [Mac] Suspended HTMLMediaElements can still hold power assertion after playback stops. Reviewed by Eric Carlson. Call updateDisplaySleep() when we clear our MediaPlayer, as doing so may kill any in-flight rateChanged() notifications. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::clearMediaPlayer): (WebCore::HTMLMediaElement::stop): 2013-08-16 Lucas Forschler Merge r154147 2013-08-15 Simon Fraser Flash of garbage pixels when playing a show on Hulu Reviewed by Tim Horton. When starting a show on Hulu, there's a layer that gets marked as opaque because it has a child RenderLayer whose background fills the compositing layer. That child RenderLayer was recently position:fixed but outside the viewport, so its viewportConstrainedNotCompositedReason was set to a non-zero value. However, we failed to clear the viewportConstrainedNotCompositedReason when the layer became non-fixed. This caused painting the opaque layer to bail in RenderLayer::paintLayer(), leaving garbage. Test: compositing/contents-opaque/fixed-to-nonfixed.html * rendering/RenderLayer.cpp: (WebCore::RenderLayer::paintLayer): Add an assertion to catch this error in future. * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::updateBacking): Make sure we clear the ViewportConstrainedNotCompositedReason if the layer is no longer fixed. 2013-08-15 Lucas Forschler Merge r154115 2013-08-15 Andy Estes REGRESSION (r139343): WebKit crashes when canceling a load inside webView:resource:didFinishLoadingFromDataSource: Reviewed by Brady Eidson. A client implementing webView:resource:didFinishLoadingFromDataSource: might decide to call stopLoading: for the identifier that just finished loading. If this happens we re-enter the loader and attempt to cancel a load that has already finished and been removed from the set of active loaders. Prevent this by clearing DocumentLoader's m_identifierForLoadWithoutResourceLoader before calling dispatchDidFinishLoading(). New API test: WebKit1.StopLoadingFromDidFinishLoading. * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::finishedLoading): Set m_identifierForLoadWithoutResourceLoader to 0 before calling dispatchDidFinishLoading(). 2013-08-15 Lucas Forschler Merge r154123 2013-08-15 Chris Fleizach AX: WKView does not become first responder when the voiceover cursor lands on it Reviewed by Darin Adler. Incorporate review feedback from Darin. * accessibility/AccessibilityScrollView.cpp: (WebCore::AccessibilityScrollView::canSetFocusAttribute): (WebCore::AccessibilityScrollView::isFocused): * accessibility/AccessibilityScrollView.h: 2013-08-15 Lucas Forschler Merge r154083 2013-08-14 Chris Fleizach AX: WKView does not become first responder when the voiceover cursor lands on it Reviewed by Tim Horton. VoiceOver lands on Scroll views by default. It expects that the scroll view will be able to handle the focus calls. We should forward scroll view focus requests to the web area to handle, which will trigger a becomeFirstResponder on WKView. There's not a great way to test this unfortunately, since it requires having focus comes from outside the webview into the webview. * accessibility/AccessibilityScrollView.cpp: (WebCore::AccessibilityScrollView::canSetFocusAttribute): (WebCore::AccessibilityScrollView::isFocused): (WebCore::AccessibilityScrollView::setFocused): * accessibility/AccessibilityScrollView.h: 2013-08-14 Lucas Forschler Merge r154030 2013-08-13 Brent Fulgham [Windows] Windows is incorrectly using a LayerTypeTiledBackingLayer https://bugs.webkit.org/show_bug.cgi?id=119772 Reviewed by Simon Fraser. * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::swapFromOrToTiledLayer): Ensure that we use the correct (supported) tiled layer type for Windows. * platform/graphics/ca/win/PlatformCALayerWin.cpp: (PlatformCALayer::PlatformCALayer): Add an assertion to notify us if we introduce this mistake again in the future. 2013-08-12 Lucas Forschler Merge r153917 2013-08-09 Anders Carlsson Artifacts seen sometimes with layer backed WebKit1 plug-in https://bugs.webkit.org/show_bug.cgi?id=119647 Reviewed by Beth Dakin. Don't try to paint layer backed views - they will be painted by Core Animation. * platform/mac/WidgetMac.mm: (WebCore::Widget::paint): 2013-08-09 Lucas Forschler Merge r153907 2013-08-09 Beth Dakin AX: Not able to use arrow keys to read text in a WK2 app https://bugs.webkit.org/show_bug.cgi?id=119605 -and corresponding- Reviewed by Darin Adler. This code from defaultKeyboardEventHandler() is the magic that makes this AX functionality work. This patch moves that into a separate function so that we can call it from WK2. * WebCore.exp.in: * page/EventHandler.cpp: (WebCore::EventHandler::handleKeyboardSelectionMovementForAccessibility): (WebCore::EventHandler::defaultKeyboardEventHandler): * page/EventHandler.h: 2013-08-09 Lucas Forschler Merge r153809 2013-08-07 Simon Fraser Be more aggressive about sending fake mouse events less frequently https://bugs.webkit.org/show_bug.cgi?id=119563 Reviewed by Tim Horton. r109151 added code that throttles back the fake mouse events that we send during scrolling, but in such a way that a page could take up to 100ms to handle a single mousemove, and we'd still send fake mousemove events every 100ms. This could cause serious scrolling stutter. Fix by changing when we drop back to sending events every 250ms, rather than every 100ms: if the slowest mousemove takes 10ms or more (less than one frame), drop back to a 250ms fake move interval. * page/EventHandler.cpp: (WebCore::EventHandler::dispatchFakeMouseMoveEventSoon): 2013-08-08 Lucas Forschler Merge r153867 2013-08-08 Jer Noble [EME] MediaKey APIs should be prefixed. https://bugs.webkit.org/show_bug.cgi?id=119606 Reviewed by Anders Carlsson. No new tests; updated exsisting tests with new names. Prefix all new classes with "WebKit" and new methods on existing unprefixed classes with "webkit" * Modules/encryptedmedia/MediaKeyMessageEvent.idl: MediaKeyMessageEvent -> WebKitMediaKeyMessageEvent * Modules/encryptedmedia/MediaKeySession.idl: MediaKeySession -> WebKitMediaKeySession * Modules/encryptedmedia/MediaKeys.idl: MediaKeys -> WebKitMediaKeys * html/HTMLMediaElement.idl: keys -> webkitKeys, setMediaKeys -> webkitSetMediaKeys * html/MediaKeyError.idl: MediaKeyError -> WebKitMediaKeyError 2013-08-08 Lucas Forschler Merge r153851 2013-08-08 Jer Noble [EME] setMediaKeys function as defined in the EME specification does not work https://bugs.webkit.org/show_bug.cgi?id=119597 Reviewed by Anders Carlsson. No new tests; updated media/encrypted-media/encrypted-media-v2-syntax.html Rename the mediaKeys attribute 'keys' and make readonly, and add an explicit setMediaKeys() method in HTMLMediaElement's IDL. * html/HTMLMediaElement.h: (WebCore::HTMLMediaElement::keys): * html/HTMLMediaElement.idl: 2013-08-08 Lucas Forschler Merge r153838 2013-08-08 Jer Noble [EME] Implement MediaKeys.isTypeSupported() https://bugs.webkit.org/show_bug.cgi?id=119586 Reviewed by Eric Carlson. Test: media/encrypted-media/encrypted-media-is-type-supported.html The EME spec has removed the extra keySystem parameter from HTMLMediaElement.canPlayType() in favor of a new isTypeSupported() method on MediaKeys. To implement this method, the CDMFactory needs to know whether the registered CDM supports the specified mime type. CDMs must register this new factory method, which requires changes to CDMPrivateAVFoundation and MockCDM. Add the new MediaKeys.isTypeSupported() method: * Modules/encryptedmedia/MediaKeys.cpp: (WebCore::MediaKeys::isTypeSupported): * Modules/encryptedmedia/MediaKeys.h: * Modules/encryptedmedia/MediaKeys.idl: Add the new factory CDMSupportsKeySystemAndMimeType method: * Modules/encryptedmedia/CDM.cpp: (WebCore::CDMFactory::CDMFactory): Now takes a third parameter. (WebCore::installedCDMFactories): When adding the AVFoundation CDM, pass its new method. (WebCore::CDM::registerCDMFactory): Now takes a third parameter. (WebCore::CDM::keySystemSupportsMimeType): Added. * Modules/encryptedmedia/CDM.h: * WebCore.exp.in: Register this new method with the factory for all concrete CDMs: * Modules/encryptedmedia/CDMPrivateAVFoundation.h: * Modules/encryptedmedia/CDMPrivateAVFoundation.mm: (WebCore::CDMPrivateAVFoundation::supportsKeySystem): (WebCore::CDMPrivateAVFoundation::supportsKeySystemAndMimeType): * testing/Internals.cpp: (WebCore::Internals::initializeMockCDM): * testing/MockCDM.cpp: (WebCore::MockCDM::supportsKeySystem): (WebCore::MockCDM::supportsKeySystemAndMimeType): * testing/MockCDM.h: 2013-08-08 Lucas Forschler Merge r153810 2013-08-07 Simon Fraser Avoid spurious "all repaint" layouts when scrolling WebViews on Retina displays https://bugs.webkit.org/show_bug.cgi?id=119564 Reviewed by Beth Dakin. When scrolling WebViews on Macs with Retina displays, AppKit uses device pixels for the scroll offset, so [scrollView() documentVisibleRect] can return a CGRect with non-integral origin. This rect is used by layout, via layoutSize(), to decide whether the view size changed, which prompts a full repaint. However, FrameView gets a value which has been rounded by enclosingIntRect(), which increases the height or width by 1px if the y or x offset is on a half-pixel, causing spurious full repaints. Fix by plumbing through platformVisibleContentSize(), which just gets the size of the -documentVisibleRect. * page/FrameView.cpp: (WebCore::FrameView::layout): Don't get layoutHeight and layoutWidth separately, since that is two calls down into platformVisibleContentSize. * platform/ScrollView.cpp: (WebCore::ScrollView::unscaledVisibleContentSize): (WebCore::ScrollView::platformVisibleContentSize): * platform/ScrollView.h: * platform/mac/ScrollViewMac.mm: (WebCore::ScrollView::platformVisibleContentSize): 2013-08-08 Lucas Forschler Merge r153845 2013-08-08 Brent Fulgham [Windows] Improper Caption Button Displayed to Users https://bugs.webkit.org/show_bug.cgi?id=119593 Reviewed by Eric Carlson. Remove the custom drawing code for the Windows port, and have it render using the CSS/SVG markup like we do on OS X. * rendering/RenderThemeWin.cpp: Remove drawing code. * rendering/RenderThemeWin.h: Remove declaration. 2013-08-07 Lucas Forschler Merge r153775 2013-08-06 Stephanie Lewis Update Order Files for Safari Unreviewed. No change in functionality. * WebCore.order: 2013-08-06 Lucas Forschler Merge r153758 2013-08-06 Brent Fulgham Improper Calculation of In-band Cue Colors https://bugs.webkit.org/show_bug.cgi?id=119523 Reviewed by Eric Carlson. * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp: (WebCore::makeRGBA32FromARGBCFArray): Remove redundant multiplication by 255. The internal conversion logic already converts to bytes. 2013-08-05 Lucas Forschler Merge r153725 2013-08-05 Alexey Proskuryakov REGRESSION (r153060?): Microphone appears in the way of text when dictating an e-mail https://bugs.webkit.org/show_bug.cgi?id=119496 Reviewed by Ryosuke Niwa. Test: platform/mac/editing/input/firstrectforcharacterrange-caret-in-br.html * rendering/RenderObject.cpp: (WebCore::RenderObject::absoluteBoundingBoxRectForRange): FloatRect::unite() doesn't preserve empty rects, which we need here. We alrady handle the case of collapsed range in Editor::firstRectForRange(), and this is similar, but we can't currently cover both with one simple fix. 2013-08-05 Lucas Forschler Merge r152884 2013-07-18 Ryosuke Niwa Build fix after r152876. * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp: (WebCore::MediaPlayerPrivateAVFoundation::processNewAndRemovedTextTracks): 2013-08-05 Lucas Forschler Merge r152876 2013-07-18 Brent Fulgham [Media] Share more code between Mac and Windows implementation files. https://bugs.webkit.org/show_bug.cgi?id=118801 Reviewed by Eric Carlson. * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp: (WebCore::MediaPlayerPrivateAVFoundation::clearTextTracks): Move implementation from ObjC file to parent file. (WebCore::MediaPlayerPrivateAVFoundation::processNewAndRemovedTextTracks): Ditto. * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h: Remove duplicate implementation. * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp: Ditto. * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h: Ditto. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h: Ditto. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: Ditto. 2013-08-05 Lucas Forschler Merge r153628 2013-08-01 Brent Fulgham [Windows] WebKit1 Fullscreen Video Play is Broken https://bugs.webkit.org/show_bug.cgi?id=119415 Reviewed by Jer Noble. * platform/graphics/avfoundation/cf/AVFoundationCFSoftLinking.h: Add call for ACFPlayerLayerSetFrame * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp: (WebCore::MediaPlayerPrivateAVFoundationCF::platformSetVisible): Tear down video player when leaving Fullscreen mode and not using the newer Fullscreen feature. (WebCore::AVFWrapper::disconnectAndDeleteAVFWrapper): Disconnect from notifications for AVCFPlayerItemPresentationSizeChangedNotification, AVCFPlayerItemDuratoinChangedNotification, and disconnect any LegibleOutput items added to the player item. (WebCore::AVFWrapper::createPlayerItem): Add notifications for AVCFPlayerItemPresentationSizeChanged. (WebCore::LayerClient::platformCALayerLayoutSublayersOfLayer): Notify the AVCFPLayerLayer when the display size has changed. * platform/graphics/ca/win/CACFLayerTreeHost.h: (WebCore::CACFLayerTreeHost::manualCreateRenderer): Added. * platform/graphics/ca/win/WKCACFViewLayerTreeHost.h: (WebCore::WKCACFViewLayerTreeHost::manualCreateRenderer): Added. * platform/graphics/win/MediaPlayerPrivateFullscreenWindow.cpp: (WebCore::MediaPlayerPrivateFullscreenWindow::createWindow): Minor cleanups. (WebCore::MediaPlayerPrivateFullscreenWindow::setRootChildLayer): Make sure a Direct3D renderer is created when building the full screen window for Video playback. 2013-08-05 Lucas Forschler Merge r153377 2013-07-26 Brent Fulgham [Windows] Remove workarounds now that rdar://problem/14390466 is fixed. https://bugs.webkit.org/show_bug.cgi?id=119150 Reviewed by Anders Carlsson. * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp: (WebCore::AVFWrapper::createPlayer): Remove workaround to add legible output after player is created. (WebCore::AVFWrapper::createPlayerItem): Remove workaround to delay adding legible output until player is created. (WebCore::AVFWrapper::platformLayer): Get rid of unused temporary. 2013-08-05 Lucas Forschler Merge r152861 2013-07-17 Brent Fulgham [Windows] Support in-band text tracks. https://bugs.webkit.org/show_bug.cgi?id=103770 Reviewed by Eric Carlson. Existing media tests cover these features. * WebCore.vcxproj/WebCore.vcxproj: Add new files for Windows captions * WebCore.vcxproj/WebCore.vcxproj.filters: ditto. * config.h: Make sure proper buid flags are turned on when building with AVCF_LEGIBLE_OUTPUT. * page/CaptionUserPreferencesMediaAF.cpp: Revise to reduce soft linking duplication between Mac and Windows. * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp: Update to support Windows platform by removing compiler guards and adding Windows declarations for soft-link functions. * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.h: Ditto. * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp: Remove build guards preventing Windows from using LegibleOutput features. (WebCore::MediaPlayerPrivateAVFoundation::MediaPlayerPrivateAVFoundation): (WebCore::MediaPlayerPrivateAVFoundation::seek): (WebCore::MediaPlayerPrivateAVFoundation::seekCompleted): (WebCore::MediaPlayerPrivateAVFoundation::dispatchNotification): (WebCore::MediaPlayerPrivateAVFoundation::trackModeChanged): * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h: (WebCore::MediaPlayerPrivateAVFoundation::contentsNeedsDisplay): Ditto * platform/graphics/avfoundation/cf/AVFoundationCFSoftLinking.h: Add new LegibleOutput support functions, and try to reduce duplication between Windows and Mac soft link declarations. * platform/graphics/avfoundation/cf/CoreMediaSoftLinking.h: Ditto. * platform/graphics/avfoundation/cf/InbandTextTrackPrivateAVCF.cpp: Added. (WebCore::InbandTextTrackPrivateAVCF::InbandTextTrackPrivateAVCF): (WebCore::InbandTextTrackPrivateAVCF::disconnect): (WebCore::InbandTextTrackPrivateAVCF::kind): (WebCore::InbandTextTrackPrivateAVCF::isClosedCaptions): (WebCore::InbandTextTrackPrivateAVCF::isSDH): (WebCore::InbandTextTrackPrivateAVCF::containsOnlyForcedSubtitles): (WebCore::InbandTextTrackPrivateAVCF::isMainProgramContent): (WebCore::InbandTextTrackPrivateAVCF::isEasyToRead): (WebCore::InbandTextTrackPrivateAVCF::label): (WebCore::InbandTextTrackPrivateAVCF::language): (WebCore::InbandTextTrackPrivateAVCF::isDefault): * platform/graphics/avfoundation/cf/InbandTextTrackPrivateAVCF.h: Added. (WebCore::InbandTextTrackPrivateAVCF::create): (WebCore::InbandTextTrackPrivateAVCF::~InbandTextTrackPrivateAVCF): (WebCore::InbandTextTrackPrivateAVCF::mediaSelectionOption): * platform/graphics/avfoundation/cf/InbandTextTrackPrivateLegacyAVCF.cpp: Added. (WebCore::InbandTextTrackPrivateLegacyAVCF::InbandTextTrackPrivateLegacyAVCF): (WebCore::InbandTextTrackPrivateLegacyAVCF::disconnect): (WebCore::InbandTextTrackPrivateLegacyAVCF::kind): (WebCore::InbandTextTrackPrivateLegacyAVCF::isClosedCaptions): (WebCore::InbandTextTrackPrivateLegacyAVCF::containsOnlyForcedSubtitles): (WebCore::InbandTextTrackPrivateLegacyAVCF::isMainProgramContent): (WebCore::InbandTextTrackPrivateLegacyAVCF::isEasyToRead): (WebCore::InbandTextTrackPrivateLegacyAVCF::label): (WebCore::InbandTextTrackPrivateLegacyAVCF::language): * platform/graphics/avfoundation/cf/InbandTextTrackPrivateLegacyAVCF.h: Added. (WebCore::InbandTextTrackPrivateLegacyAVCF::create): (WebCore::InbandTextTrackPrivateLegacyAVCF::~InbandTextTrackPrivateLegacyAVCF): (WebCore::InbandTextTrackPrivateLegacyAVCF::avPlayerItemTrack): * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp: Update to support LegibleOutput features for the Windows port. (WebCore::AVFWrapper::currentTrack): Added. (WebCore::AVFWrapper::legibleOutput): Added. (WebCore::createMetadataKeyNames): Added missing key names. (WebCore::avLegibleOutput): Added. (WebCore::safeMediaSelectionGroupForLegibleMedia): Added. (WebCore::MediaPlayerPrivateAVFoundationCF::cancelLoad): Clear text tracks when cancelling. (WebCore::MediaPlayerPrivateAVFoundationCF::setCurrentTrack): Added. (WebCore::MediaPlayerPrivateAVFoundationCF::currentTrack): Added. (WebCore::MediaPlayerPrivateAVFoundationCF::platformDuration): Revised to match logic in Objective C implementation. (WebCore::MediaPlayerPrivateAVFoundationCF::currentTime): Revised to match logic in Objective C implementation. (WebCore::MediaPlayerPrivateAVFoundationCF::paintCurrentFrameInContext): Check presence of metadata before proceeding. Revised to match logic in Objective C implementation. (WebCore::MediaPlayerPrivateAVFoundationCF::paint): Ditto. (WebCore::MediaPlayerPrivateAVFoundationCF::tracksChanged): Update for in-band text tracks. (WebCore::MediaPlayerPrivateAVFoundationCF::clearTextTracks): Added. (WebCore::MediaPlayerPrivateAVFoundationCF::processLegacyClosedCaptionsTracks): Added. (WebCore::MediaPlayerPrivateAVFoundationCF::processNewAndRemovedTextTracks): Added. (WebCore::MediaPlayerPrivateAVFoundationCF::processMediaSelectionOptions): Added. (WebCore::AVFWrapper::setCurrentTrack): Added. (WebCore::MediaPlayerPrivateAVFoundationCF::languageOfPrimaryAudioTrack): Added. (WebCore::AVFWrapper::AVFWrapper): Add new initializers. (WebCore::AVFWrapper::~AVFWrapper): Clean up text track information. (WebCore::AVFWrapper::createPlayer): Add Legible Output support. (WebCore::AVFWrapper::createPlayerItem): Ditto. (WebCore::LegibleOutputData::LegibleOutputData): Added. (WebCore::AVFWrapper::processCue): Added. (WebCore::AVFWrapper::legibleOutputCallback): Added. (WebCore::AVFWrapper::safeMediaSelectionGroupForLegibleMedia): Added. * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h: Update to support LegibleOutput features for the Windows port. * platform/win/SoftLinking.h: Change signature of variable accessor to match Mac so reduce duplicate code. 2013-08-05 Lucas Forschler Merge r153706 2013-08-03 Jer Noble Loading a video with a custom URL scheme will result in stalling playback https://bugs.webkit.org/show_bug.cgi?id=119469 Reviewed by Eric Carlson. Break the assumption that only one AVAssetResourceRequest will be outstanding simultaneously by storing a HashMap of AVAssetResourceRequests and their resulting WebCoreAVFResourceLoader. When loading is stopped (due to completion or error), notify the MediaPlayerPrivateAVFoundation parent so that the map can be emptied. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource): Store the request in m_resourceLoaderMap. (WebCore::MediaPlayerPrivateAVFoundationObjC::didCancelLoadingRequest): Pull the request from m_resourceLoaderMap. (WebCore::MediaPlayerPrivateAVFoundationObjC::didStopLoadingRequest): Remove the requset from m_resourceLoaderMap. * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.h: * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm: (WebCore::WebCoreAVFResourceLoader::create): Return a PassRefPtr, rather than a PassOwnPtr. (WebCore::WebCoreAVFResourceLoader::stopLoading): Call didStopLoadingRequest. 2013-08-05 Lucas Forschler Merge r153699 2013-08-04 Andreas Kling Inserting a rule into an empty style sheet shouldn't trigger style recalc unless necessary. Reviewed by Antti Koivisto. This is kind of a cheesy optimization, but it turns out that the use case is quite common. The pattern goes like this: (1) Create Since the change in text-decoration has no effect on the rendering of the element, we'll now be smart enough to avoid repainting it. * rendering/style/RenderStyleConstants.h: * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::diff): Move checking of text-only properties until the very end, and return StyleDifferenceRepaintIfText in case a difference is found, giving precedence to StyleDifferenceRepaint. * rendering/RenderObject.h: * rendering/RenderObject.cpp: (WebCore::RenderObject::hasImmediateNonWhitespaceTextChild): Helper to check if a RenderObject has at least one RenderText child containing more than just collapsible whitespace. (WebCore::RenderObject::shouldRepaintForStyleDifference): Helper to check if a StyleDifference is either ...Repaint or ...RepaintIfText and the renderer has an immediate text child. (WebCore::RenderObject::styleWillChange): (WebCore::RenderObject::setStyle): Don't repaint for StyleDifferenceRepaintIfText unless hasImmediateNonWhitespaceTextChild(). * rendering/RenderBox.cpp: (WebCore::RenderBox::styleDidChange): * rendering/svg/SVGResourcesCache.cpp: (WebCore::SVGResourcesCache::clientStyleChanged): Tweak for new StyleDifference enum value. * rendering/RenderText.h: * rendering/RenderText.cpp: (WebCore::RenderText::isAllCollapsibleWhitespace): Made this const. 2013-05-17 Lamarque V. Souza Improve -webkit-text-underline-position memory usage. https://bugs.webkit.org/show_bug.cgi?id=116108 Reviewed by Benjamin Poulain. Remove m_maxLogicalTop private variable from RootInlineBox to reduce the overall memory used to render RootInlineBoxes (eight bytes per RootInlineBox instance in a 64-bit machine). RootInline::maxLogicalTop() now computes the maxLogicalTop value everytime it is called. In a typical page computeMaxLogicalTop is called less than 10 times for each InlineTextBox that uses -webkit-text-underline-position. That is a small price users of -webkit-text-underline-position will pay so that everybody can benefit from the memory reduction in RootInlineBox. No new tests, no change in behavior. * rendering/InlineFlowBox.cpp: (WebCore::InlineFlowBox::computeMaxLogicalTop): Make it const. * rendering/InlineFlowBox.h: * rendering/RootInlineBox.cpp: (WebCore::RootInlineBox::RootInlineBox): Remove m_maxLogicalTop. (WebCore::RootInlineBox::alignBoxesInBlockDirection): Remove computeMaxLogicalTop call and obsolete comment. (WebCore): (WebCore::RootInlineBox::maxLogicalTop): Compute maxLogicalTop before returning its value. * rendering/RootInlineBox.h: (RootInlineBox): 2013-05-17 Alexis Menard Make sure to call release() on our smart pointers when we should. https://bugs.webkit.org/show_bug.cgi?id=116307 Reviewed by Andreas Kling. Call release() when we should call it. There is probably more occurence of this problem on the codebase but this is a first bunch of fixes. No new tests : existing ones should cover. * css/CSSComputedStyleDeclaration.cpp: (WebCore::valueForNinePieceImage): (WebCore::getBorderRadiusShorthandValue): (WebCore::CSSComputedStyleDeclaration::valueForFilter): (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): (WebCore::CSSComputedStyleDeclaration::getCSSPropertyValuesForSidesShorthand): (WebCore::CSSComputedStyleDeclaration::getCSSPropertyValuesForGridShorthand): * css/CSSParser.cpp: (WebCore::CSSParser::parseBorderImage): * html/HTMLBodyElement.cpp: (WebCore::HTMLBodyElement::collectStyleForPresentationAttribute): 2013-05-17 Allan Sandfeld Jensen Make PNGImageDecoder::rowAvailable auto-vectorizable https://bugs.webkit.org/show_bug.cgi?id=116151 Reviewed by Benjamin Poulain. Changed the main loops under PNGImageDecoder::rowAvailable so that they avoid branches and non-sequential table look ups. Together with automatic vectorization by the compiler this provides around 4x speed-up with AVX or 2x speed-up on generic x64. Shaving off 12-40% on PNG decoding in general. * platform/graphics/Color.cpp: (WebCore::premultipliedARGBFromColor): * platform/graphics/Color.h: (WebCore::fastDivideBy255): * platform/graphics/filters/FEBlend.cpp: * platform/image-decoders/png/PNGImageDecoder.cpp: (WebCore::setPixelRGB): (WebCore::setPixelRGBA): (WebCore::setPixelRGBA_Premultiplied): (WebCore::PNGImageDecoder::rowAvailable): 2013-05-17 Joseph Pecoraro Web Inspector: Allow "//# sourceMappingURL" syntax alongside "//@" https://bugs.webkit.org/show_bug.cgi?id=116290 Follow an update to the spec and support the new and old syntax. Reviewed by Timothy Hatcher. * inspector/ContentSearchUtils.cpp: (WebCore::ContentSearchUtils::scriptCommentPattern): (WebCore::ContentSearchUtils::stylesheetCommentPattern): * inspector/front-end/SASSSourceMapping.js: (WebInspector.SASSSourceMapping.prototype._loadAndProcessSourceMap): 2013-05-17 Christophe Dumez Remove custom code for MessageEvent.ports getter https://bugs.webkit.org/show_bug.cgi?id=116304 Reviewed by Kentaro Hara. Remove Custom code for the "ports" attribute getter in MessageEvent IDL interface. The JSC bindings generator already supports attributes of type MessagePortArray. No new tests, already covered by existing layout tests and bindings tests. * bindings/js/JSMessageEventCustom.cpp: Remove Custom code for ports getter. * bindings/scripts/CodeGeneratorJS.pm: (NativeToJSValue): Small tweak to correctly handle the case where impl->ports() returns NULL and avoid crashing in this case. * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp: Rebaseline due to bindings generator tweak. * dom/MessageEvent.idl: Remove [CustomGetter] extended attribute for 'ports' attribute and switch to MessagePortArray type. 2013-05-16 Jesus Sanchez-Palencia Add stubs for ContextMenu and ContextMenuItem https://bugs.webkit.org/show_bug.cgi?id=116235 Reviewed by Antonio Gomes. No new tests needed, only a refactor. Add ContextMenuNone.cpp and ContextMenuItemNone.cpp so ports using ENABLE(CROSS_PLATFORM_CONTEXT_MENU) don't need to replicate these stubs. * PlatformEfl.cmake: * Target.pri: * platform/ContextMenuNone.cpp: Added. (WebCore): (WebCore::ContextMenu::ContextMenu): (WebCore::ContextMenu::getContextMenuItems): (WebCore::ContextMenu::createPlatformContextMenuFromItems): (WebCore::ContextMenu::platformContextMenu): * platform/ContextMenuItemNone.cpp: Added. (WebCore): (WebCore::ContextMenuItem::platformContextMenuItem): * platform/efl/ContextMenuEfl.cpp: Removed. * platform/efl/ContextMenuItemEfl.cpp: Removed. * platform/qt/ContextMenuQt.cpp: Removed. * platform/qt/ContextMenuItemQt.cpp: Removed. 2013-05-16 Alexis Menard Regression: Event#stopPropagation() does not halt bubbling for webkitTransitionEnd https://bugs.webkit.org/show_bug.cgi?id=115656 Reviewed by Darin Adler. If we create a prefixed event to dispatch it (in the case we have only prefixed event listeners in client's code) then we need to make sure to keep it in sync with the original unprefixed event after it has been dispatched. While being dispatched the event can be modified by client's code and when propagated back to outer elements, attributes were not updated. This patch changes the old design of creating a separate event for the prefixed case and now change the type of the event (so the name) before dispatching it, keeping the attributes if changed and then rename it back to unprefixed when the dispatching is finished. Tests: transitions/transition-end-event-prefixed-01.html transitions/transition-end-event-prefixed-02.html transitions/transition-end-event-prefixed-03.html * dom/Event.h: (WebCore::Event::setType): * dom/EventTarget.cpp: (WebCore::EventTarget::fireEventListeners): 2013-05-16 Mike Fenton [BlackBerry] Strip invoke URLs when writing to the clipboard. https://bugs.webkit.org/show_bug.cgi?id=116226 Reviewed by Rob Buis. PR 333516. Invoke URLs should not be included in the paste data. Internally Reviewed by Gen Mak. * platform/blackberry/PasteboardBlackBerry.cpp: (WebCore::Pasteboard::writeSelection): 2013-05-16 Eduardo Lima Mitev Missing UNUSED_PARAM macro for textPosition argument in WebKitAccessibleInterfaceText https://bugs.webkit.org/show_bug.cgi?id=116230 Reviewed by Chris Fleizach. No new functionality, no new tests. * accessibility/atk/WebKitAccessibleInterfaceText.cpp: (webkitAccessibleTextGetTextForOffset): List textPosition argument as unused parameter for all platforms except GTK. 2013-05-16 Jaehun Lim Frame flattening prevents in from having scrollbars https://bugs.webkit.org/show_bug.cgi?id=115884 Reviewed by Antonio Gomes. Frame flattening should be applied when the frame owner is frame or iframe. But when the frame owner is object element, frame flattening prevents it from having scrollbars. In this situation, we can't scroll the html document in object element. This patch adds two helper functions to verify flattening conditions. Test: fast/frames/flattening/scrolling-in-object.html * page/FrameView.cpp: (WebCore::frameFlatteningEnabled): Added. Helper to check whether flattening is enabled or not. (WebCore::supportsFrameFlattening): Added. Helper to check whether the frame owner is or