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