[GStreamer] Stopping playback of html5 media when receiving a higher priority audio event needs implementation
https://bugs.webkit.org/show_bug.cgi?id=91611

Source/WebCore:

React to REQUEST_STATE GStreamer message to stop the pipeline when
a higher priority stream is played. When this happens, states are
updated accordingly.

A method was added in the MediaPlayer class and internals to allow
the the test runner to simulate an audio interruption.

Patch by Xabier Rodriguez Calvar <calvaris@igalia.com> on 2013-03-14
Reviewed by Philippe Normand.

Test: media/media-higher-prio-audio-stream.html

* platform/graphics/MediaPlayer.h:
* platform/graphics/MediaPlayer.cpp:
(WebCore):
(MediaPlayer):
(WebCore::MediaPlayer::simulateAudioInterruption): New method
delegating an audio interruption to the private backend to
simulate the use-case where an external application needs
exclusive access to the audio device.
* platform/graphics/MediaPlayerPrivate.h:
(MediaPlayerPrivateInterface):
(WebCore::MediaPlayerPrivateInterface::simulateAudioInterruption):
Added default empty method in the common private header.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore):
(WebCore::MediaPlayerPrivateGStreamer::createAudioSink):
(WebCore::setAudioStreamPropertiesCallback): Hooked to child-added
signal on the audio sink, delegates on setAudioStreamProperties.
(WebCore::MediaPlayerPrivateGStreamer::setAudioStreamProperties):
Sets the audio stream properties.
(WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer):
Initializes the new attribute.
(WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer):
Disconnects autoaudiosink signal.
(WebCore::MediaPlayerPrivateGStreamer::changePipelineState):
Changed logging.
(WebCore::MediaPlayerPrivateGStreamer::handleMessage): Reacting to
the REQUEST_STATE message.
(WebCore::MediaPlayerPrivateGStreamer::simulateAudioInterruption):
Added. Injects the REQUEST_STATE message to the pipeline.
(WebCore::MediaPlayerPrivateGStreamer::updateStates): Updating the
playback state if REQUEST_STATE.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
(MediaPlayerPrivateGStreamer): Added new method and attribute.
* testing/Internals.h:
* testing/Internals.idl:
* testing/Internals.cpp:
(WebCore):
(WebCore::Internals::simulateAudioInterruption): Added to call the
method to stop the element because of a higher prio stream at the
tests.

LayoutTests:

Created test, expected result and updated other ports
expectations.

Patch by Xabier Rodriguez Calvar <calvaris@igalia.com> on 2013-03-14
Reviewed by Philippe Normand.

* media/media-higher-prio-audio-stream-expected.txt: Added.
* media/media-higher-prio-audio-stream.html: Added.
* platform/chromium/TestExpectations: Skipped the new test.
* platform/mac/TestExpectations: Skipped the new test.
* platform/qt/TestExpectations: Skipped the new test for Mac and
Win.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145811 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL][WK2] Add an API for adding and removing user style sheets from a page group
https://bugs.webkit.org/show_bug.cgi?id=110728

Patch by Jinwoo Song <jinwoo7.song@samsung.com> on 2013-03-14
Reviewed by Gyuyoung Kim.

Source/WebKit2:

This patch implements EwkPageGroup API to provide the interface of WKPageGroup. Using the EwkPageGroup,
applications may create the views with a page group for the specific identifier. Also, this patch
encapsulates the APIs WKPageGroupAddUserStyleSheet and WKPageGroupRemoveAllUserStyleSheets behind
the EwkPageGroup class for adding and removing user style sheets from a page group. WKArrayCreateWithEinaList()
is added as a generic WKArray creation API from Eina_List.

* PlatformEfl.cmake:
* UIProcess/API/C/efl/WKView.cpp:
(createWKView):
* UIProcess/API/efl/EWebKit2.h:
* UIProcess/API/efl/EwkView.cpp:
(EwkView::EwkView):
(EwkView::createEvasObject):
* UIProcess/API/efl/EwkView.h:
(EwkView::ewkPageGroup):
(EwkView):
* UIProcess/API/efl/ewk_view.cpp:
(ewk_view_smart_add):
(ewk_view_page_group_get):
* UIProcess/API/efl/ewk_view.h:
* UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.cpp:
(EWK2UnitTest::EWK2UnitTestBase::SetUp):
* UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.h:
(EWK2UnitTest::EWK2UnitTestBase::setWebView):
* UIProcess/API/efl/tests/test_ewk2_view.cpp:
(TEST_F):
* UIProcess/efl/WebInspectorProxyEfl.cpp:
(WebKit::WebInspectorProxy::platformCreateInspectorPage):

Tools:

Use the page group to create the view object.

* MiniBrowser/efl/main.c:
(window_create):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145812 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Disable DRT on Windows

Reviewed by Jocelyn Turcotte.

We don't run and maintain DRT on Windows, so let's not try to maintain the build of it.

* qmake/mkspecs/features/configure.prf:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145813 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] GraphicsContext3D: implement ImageExtractor::extractImage()
https://bugs.webkit.org/show_bug.cgi?id=112242

Patch by Alberto Garcia <agarcia@igalia.com> on 2013-03-14
Reviewed by Rob Buis.

In r136282 GraphicsContext3D::getImageData() was refactored in a
new class called ImageExtractor.

This patch implements the necessary changes for the BlackBerry
port, which is still using the old API.

* platform/graphics/GraphicsContext3D.h:
(ImageExtractor):
* platform/graphics/blackberry/GraphicsContext3DBlackBerry.cpp:
(WebCore::GraphicsContext3D::ImageExtractor::~ImageExtractor):
(WebCore):
(WebCore::GraphicsContext3D::ImageExtractor::extractImage):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145814 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fixed styles pane visibility when docked to right.
https://bugs.webkit.org/show_bug.cgi?id=112348

Patch by Vladislav Kaznacheev <kaznacheev@chromium.org> on 2013-03-14
Reviewed by Pavel Feldman.

* inspector/front-end/ElementsPanel.js:
(WebInspector.ElementsPanel.prototype._splitVertically):
* inspector/front-end/SidebarPane.js:
(WebInspector.SidebarPane.prototype.setExpandCallback):
(WebInspector.SidebarPaneTitle):
(WebInspector.SidebarTabbedPane.prototype.addPane):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145815 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: keep deprecated function stubs in InspectorFrontendHost.
https://bugs.webkit.org/show_bug.cgi?id=112347

Reviewed by Vsevolod Vlasov.

In order to open older front-ends in newer hosts, we need to keep stubs
for deprecated functions. Longer term, we need to wrap all calls to InspectorFrontendHost in the front-end.

* inspector/InspectorFrontendHost.cpp:
(WebCore::InspectorFrontendHost::canInspectWorkers):
(WebCore):
(WebCore::InspectorFrontendHost::hiddenPanels):
* inspector/InspectorFrontendHost.h:
(InspectorFrontendHost):
* inspector/InspectorFrontendHost.idl:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145816 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Not reviewed: chromium expectations updated.

* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145817 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Replace static_casts with to* helper functions.
https://bugs.webkit.org/show_bug.cgi?id=112296

Reviewed by Kentaro Hara.

to* helper functions are preferred over static_cast calls since they
help to catch bad casts easily on the testing infrastructure.

Source/WebCore:

* accessibility/AXObjectCache.cpp:
(WebCore::nodeHasRole):
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::hasAttribute):
(WebCore::AccessibilityObject::getAttribute):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::anchorElement):
(WebCore::AccessibilityRenderObject::helpText):
(WebCore::AccessibilityRenderObject::checkboxOrRadioRect):
(WebCore::AccessibilityRenderObject::titleUIElement):
(WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
(WebCore::AccessibilityRenderObject::accessKey):
(WebCore::AccessibilityRenderObject::setElementAttributeValue):
(WebCore::AccessibilityRenderObject::setValue):
(WebCore::AccessibilityRenderObject::activeDescendant):
(WebCore::AccessibilityRenderObject::handleActiveDescendantChanged):
(WebCore::AccessibilityRenderObject::correspondingLabelForControlElement):
(WebCore::AccessibilityRenderObject::inheritsPresentationalRole):
(WebCore::AccessibilityRenderObject::setAccessibleName):
(WebCore::AccessibilityRenderObject::stringRoleForMSAA):
* bindings/gobject/WebKitDOMBinding.cpp:
(WebKit::createWrapper):
* bindings/js/JSClipboardCustom.cpp:
(WebCore::JSClipboard::setDragImage):
* bindings/js/JSElementCustom.cpp:
(WebCore::toJSNewlyCreated):
* bindings/js/JSNodeCustom.cpp:
(WebCore::createWrapperInline):
* bindings/v8/custom/V8ClipboardCustom.cpp:
(WebCore::V8Clipboard::setDragImageMethodCustom):
* bindings/v8/custom/V8ElementCustom.cpp:
(WebCore::wrap):
* bindings/v8/custom/V8NodeCustom.cpp:
(WebCore::wrap):
* dom/Document.cpp:
(WebCore::Document::importNode):
(WebCore::Document::recalcStyle):
(WebCore::Document::setFocusedNode):
(WebCore::Document::updateFocusAppearanceTimerFired):
* dom/DocumentStyleSheetCollection.cpp:
(WebCore::DocumentStyleSheetCollection::collectActiveStyleSheets):
* dom/Element.cpp:
(WebCore::Element::offsetParent):
(WebCore::Element::boundsInRootViewSpace):
(WebCore::Element::getBoundingClientRect):
(WebCore::Element::recalcStyle):
(WebCore::Element::computeInheritedLanguage):
(WebCore::Element::lastElementChild):
* dom/LiveNodeList.cpp:
(WebCore::LiveNodeList::namedItem):
* dom/Node.cpp:
(WebCore::Node::dumpStatistics):
(WebCore::Node::normalize):
(WebCore::Node::rootEditableElement):
(WebCore::Node::isDefaultNamespace):
(WebCore::Node::ancestorElement):
(WebCore::appendAttributeDesc):
* dom/Position.cpp:
(WebCore::Position::element):
* dom/Range.cpp:
(WebCore::Range::getBorderAndTextQuads):
* dom/SelectorQuery.cpp:
(WebCore::SelectorDataList::queryFirst):
(WebCore::SelectorDataList::execute):
* dom/ShadowRoot.cpp:
(WebCore::ShadowRoot::recalcStyle):
* dom/StaticHashSetNodeList.cpp:
(WebCore::StaticHashSetNodeList::namedItem):
* editing/ApplyStyleCommand.cpp:
(WebCore::ApplyStyleCommand::splitAncestorsWithUnicodeBidi):
(WebCore::ApplyStyleCommand::pushDownInlineStyleAroundNode):
(WebCore::ApplyStyleCommand::mergeStartWithPreviousIfIdentical):
(WebCore::ApplyStyleCommand::surroundNodeRangeWithElement):
* editing/Editor.cpp:
(WebCore::Editor::applyEditingStyleToBodyElement):
* editing/FrameSelection.cpp:
(WebCore::removingNodeRemovesPosition):
* editing/IndentOutdentCommand.cpp:
(WebCore::IndentOutdentCommand::outdentParagraph):
* editing/MarkupAccumulator.cpp:
(WebCore::MarkupAccumulator::entityMaskForText):
(WebCore::MarkupAccumulator::appendStartMarkup):
(WebCore::MarkupAccumulator::appendEndMarkup):
* editing/ModifySelectionListLevel.cpp:
(WebCore::IncreaseSelectionListLevelCommand::doApply):
* editing/ReplaceSelectionCommand.cpp:
(WebCore::haveSameTagName):
(WebCore::handleStyleSpansBeforeInsertion):
(WebCore::ReplaceSelectionCommand::doApply):
* editing/SplitTextNodeContainingElementCommand.cpp:
(WebCore::SplitTextNodeContainingElementCommand::doApply):
* editing/TextIterator.cpp:
(WebCore::TextIterator::advance):
* editing/htmlediting.cpp:
(WebCore::unsplittableElementForPosition):
(WebCore::enclosingTableCell):
* editing/markup.cpp:
(WebCore::StyledMarkupAccumulator::wrapWithNode):
(WebCore::createMarkupInternal):
(WebCore::createFragmentFromMarkupWithContext):
(WebCore::isPlainTextMarkup):
(WebCore::createFragmentFromText):
* html/HTMLElement.cpp:
(WebCore::HTMLElement::insertAdjacentElement):
(WebCore::contextElementForInsertion):
* html/HTMLFormControlElement.cpp:
(WebCore::focusPostAttach):
(WebCore::updateFromElementCallback):
* html/HTMLFormElement.cpp:
(WebCore::submitElementFromEvent):
* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::updateDocNamedItem):
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::updateSnapshotInfo):
* html/HTMLViewSourceDocument.cpp:
(WebCore::HTMLViewSourceDocument::addRange):
* html/parser/HTMLTreeBuilder.cpp:
(WebCore::closestFormAncestor):
* html/shadow/MediaControlElementTypes.cpp:
(WebCore::toParentMediaElement):
* html/shadow/TextFieldDecorationElement.h:
(WebCore::toTextFieldDecorationElement):
* inspector/DOMPatchSupport.cpp:
(WebCore::DOMPatchSupport::createDigest):
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::buildObjectForNode):
(WebCore::InspectorDOMAgent::didInvalidateStyleAttr):
* inspector/InspectorStyleSheet.cpp:
(WebCore::InspectorStyleSheet::inlineStyleSheetText):
* mathml/MathMLElement.h:
(WebCore::toMathMLElement):
* page/ContextMenuController.cpp:
(WebCore::ContextMenuController::populate):
* page/DragController.cpp:
(WebCore::elementUnderMouse):
(WebCore::DragController::startDrag):
* page/FocusController.cpp:
(WebCore::FocusController::advanceFocusInDocumentOrder):
* page/Frame.cpp:
(WebCore::Frame::searchForLabelsBeforeElement):
* page/FrameView.cpp:
(WebCore::FrameView::updateWidget):
* page/SpatialNavigation.cpp:
(WebCore::rectToAbsoluteCoordinates):
* page/animation/ImplicitAnimation.cpp:
(WebCore::ImplicitAnimation::sendTransitionEvent):
* page/animation/KeyframeAnimation.cpp:
(WebCore::KeyframeAnimation::KeyframeAnimation):
(WebCore::KeyframeAnimation::sendAnimationEvent):
* platform/efl/RenderThemeEfl.cpp:
(WebCore::RenderThemeEfl::paintMediaFullscreenButton):
(WebCore::RenderThemeEfl::paintMediaMuteButton):
* rendering/FilterEffectRenderer.cpp:
(WebCore::FilterEffectRenderer::buildReferenceFilter):
* rendering/svg/RenderSVGViewportContainer.cpp:
(WebCore::RenderSVGViewportContainer::calcViewport):
* svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::getElementById):
* svg/SVGUseElement.cpp:
(WebCore::isDisallowedElement):
* svg/animation/SVGSMILElement.cpp:
(WebCore::SVGSMILElement::buildPendingResource):
* xml/XPathStep.cpp:
(WebCore::XPath::nodeMatchesBasicTest):
* xml/parser/XMLDocumentParserQt.cpp:
(WebCore::XMLDocumentParser::XMLDocumentParser):
(WebCore::XMLDocumentParser::parseEndElement):

Source/WebKit/blackberry:

* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPagePrivate::webContext):
(BlackBerry::WebKit::WebPagePrivate::handleMouseEvent):
(BlackBerry::WebKit::WebPage::setNodeFocus):
(BlackBerry::WebKit::WebPagePrivate::adjustFullScreenElementDimensionsIfNeeded):
* WebCoreSupport/EditorClientBlackBerry.cpp:
(WebCore::EditorClientBlackBerry::shouldSpellCheckFocusedField):
(WebCore::EditorClientBlackBerry::shouldChangeSelectedRange):
* WebKitSupport/BackingStoreClient.cpp:
(BlackBerry::WebKit::BackingStoreClient::absoluteRect):
* WebKitSupport/DOMSupport.cpp:
(BlackBerry::WebKit::DOMSupport::toTextControlElement):
(BlackBerry::WebKit::DOMSupport::selectionContainerElement):
* WebKitSupport/FatFingers.cpp:
(BlackBerry::WebKit::FatFingers::getRelevantInfoFromCachedHitTest):
(BlackBerry::WebKit::FatFingers::setSuccessfulFatFingersResult):
* WebKitSupport/InputHandler.cpp:
(BlackBerry::WebKit::InputHandler::focusedNodeChanged):
(BlackBerry::WebKit::InputHandler::willOpenPopupForNode):
* WebKitSupport/SelectionHandler.cpp:
(BlackBerry::WebKit::SelectionHandler::inputNodeOverridesTouch):
* WebKitSupport/TouchEventHandler.cpp:
(BlackBerry::WebKit::elementForTapHighlight):

Source/WebKit/chromium:

* src/WebDocument.cpp:
(WebKit::WebDocument::images):
* src/WebElement.cpp:
(WebKit::WebElement::operator PassRefPtr<Element>):
* src/WebPageSerializer.cpp:
(WebCore::retrieveResourcesForFrame):
* src/WebViewImpl.cpp:
(WebKit::WebViewImpl::setFocus):
(WebKit::WebViewImpl::clearFocusedNode):
(WebKit::WebViewImpl::scrollFocusedNodeIntoView):
(WebKit::WebViewImpl::scrollFocusedNodeIntoRect):

Source/WebKit/gtk:

* webkit/webkitwebview.cpp:
(webkit_web_view_query_tooltip):

Source/WebKit/mac:

* WebCoreSupport/WebFrameLoaderClient.mm:
(applyAppleDictionaryApplicationQuirkNonInlinePart):
* WebView/WebHTMLRepresentation.mm:
(searchForLabelsBeforeElement):

Source/WebKit/qt:

* Api/qwebelement.cpp:
(QWebElement::firstChild):
(QWebElement::lastChild):
(QWebElement::nextSibling):
(QWebElement::previousSibling):
(QWebElementCollection::at):
(QWebElementCollection::toList):
* WebCoreSupport/QWebFrameAdapter.cpp:
(QWebHitTestResultPrivate::elementForInnerNode):

Source/WebKit/win:

* WebView.cpp:
(WebView::enterFullscreenForNode):

Source/WebKit2:

* WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
(WebKit::InjectedBundleNodeHandle::elementBounds):
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::containsAnyFormElements):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145818 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: nuke bottom up CPU profile calculation on backend
https://bugs.webkit.org/show_bug.cgi?id=112351

Reviewed by Pavel Feldman.

Removed code that builds bottom-up CPU profile on the inspector
backend. Bottom-up view is already built on the front-end from
the top-down profile data.

* bindings/js/ScriptProfile.cpp:
* bindings/js/ScriptProfile.h:
(ScriptProfile):
* bindings/v8/ScriptProfile.cpp:
(WebCore::ScriptProfile::buildInspectorObjectForHead):
* bindings/v8/ScriptProfile.h:
(ScriptProfile):
* inspector/Inspector.json:
* inspector/InspectorProfilerAgent.cpp:
(WebCore::InspectorProfilerAgent::getCPUProfile):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145819 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add a mode to ResourceLoader that takes SharedBuffers instead of raw pointers and lengths.
<rdar://problem/13416953> and https://bugs.webkit.org/show_bug.cgi?id=112310

Reviewed by Andy Estes.

No new tests (No independently testable change in behavior).

Many of the tested platforms deliver data buffers to their ResourceHandles from objects
that encapsulate a data buffer such as NSData (Mac), CFDataRef (CF), or QByteArray (qt).

If those platforms also augmented SharedBuffer to wrap their native object (which Mac/CF do)
and there existed ResourceLoader callbacks to take that SharedBuffer instead of char* + length,
then many resource loads could avoid a useless copy.

At least on Mac, there are some extremely important behind-the-scenes optimizations for NS/CFData
that will be a more important win than simply avoiding a copy.

This patch adds that SharedBuffer-based callback with the hope that all platforms could find a
way to use a buffer-encapsulating object going forward, and we could therefore deprecate the
char* + length version of didReceiveData.

* platform/network/ResourceHandleClient.h:
(WebCore::ResourceHandleClient::didReceiveBuffer): Add a didReceiveBuffer callback that takes
  a SharedBuffer object. The default implementation passes raw bytes + length to didReceiveData.

* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::addDataOrBuffer): Replacing addData(), optionally adding the data from
  either a data+length or SharedBuffer
(WebCore::ResourceLoader::didReceiveData): Pipe to didReceiveDataOrBuffer.
(WebCore::ResourceLoader::didReceiveBuffer): Pipe to didReceiveDataOrBuffer.
(WebCore::ResourceLoader::didReceiveDataOrBuffer): Single chokepoint for receiving data.
* loader/ResourceLoader.h: Add OVERRIDE to all of the ResourceHandleClient methods to help
  catch future mistakes. Remove "virtual" from methods that didn't need it. Make "addData" into
  "addDataOrBuffer" and make it private.

* loader/NetscapePlugInStreamLoader.cpp:
(WebCore::NetscapePlugInStreamLoader::didReceiveData): Pipe to didReceiveDataOrBuffer.
(WebCore::NetscapePlugInStreamLoader::didReceiveBuffer): Pipe to didReceiveDataOrBuffer.
(WebCore::NetscapePlugInStreamLoader::didReceiveDataOrBuffer): Single chokepoint for receiving data.
* loader/NetscapePlugInStreamLoader.h:

* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::didReceiveData): Pipe to didReceiveDataOrBuffer.
(WebCore::SubresourceLoader::didReceiveBuffer): Pipe to didReceiveDataOrBuffer.
(WebCore::SubresourceLoader::didReceiveDataOrBuffer): Single chokepoint for receiving data. Also,
  rely on ResourceLoader's base implementation for notifying the ResourceLoadNotifier.
* loader/SubresourceLoader.h:

* loader/ResourceBuffer.cpp:
(WebCore::ResourceBuffer::append): Add a mode that appends a SharedBuffer.
* loader/ResourceBuffer.h:

* platform/cf/SharedBufferCF.cpp:
(WebCore::SharedBuffer::maybeTransferPlatformData): Fix a bug where appending data to a CFData-backed
  SharedBuffer would re-enter maybeTransferPlatformData and blow out the stack.

* platform/network/mac/ResourceHandleMac.mm:
(-[WebCoreResourceHandleAsDelegate connection:didReceiveData:lengthReceived:]): Send a wrapped NSData
  to didReceiveBuffer() instead of sending its char* and length to didReceiveData()

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145820 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION(r145305) Performance: 1.3% mac-release-10.6-webkit-latest/intl2/times/t change after rev 145300
https://bugs.webkit.org/show_bug.cgi?id=112125

Reviewed by Julien Chaffraix.

When detecting cases where a loaded image may need to move up into the padding created by the row's baseline
we don't need to do anything if the row doesn't have a baseline yet.

* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::layout):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145822 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed flakiness fix following r145727: filter out coalescing records while dumping timeline record structure.

* inspector/timeline/timeline-receive-response-event.html:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145823 268f45cc-cd09-0410-ab3c-d52691b4dbfc
IndexedDB: Histogram leveldb open errors.
https://bugs.webkit.org/show_bug.cgi?id=112307

Reviewed by Tony Chang.

No new tests, I don't know if there's a good way to test histograms.

* platform/leveldb/LevelDBDatabase.cpp:
(WebCore::LevelDBDatabase::open):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145824 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Crash in DumpRenderTree at com.apple.WebCore: WebCore::CaptionUserPreferences::captionPreferencesChanged + 185
https://bugs.webkit.org/show_bug.cgi?id=112051

Reviewed by Eric Carlson.

No new tests; fixes a crash during media/video-controls-captions-trackmenu.html.

Instead of relying on a registration system which can fail when an element's document does not have a page,
Elements will register for captionPreferencesChanged() notifications directly with their owning Document.
CaptionUserPreferences, in turn, will notify all Documents in its PageGroup, rather than only directly
registered listeners.

* dom/Document.cpp:
(WebCore::Document::registerForCaptionPreferencesChangedCallbacks): Added. Notify the CaptionUserPreferences that someone
    is interested in captionPreferencesChanged notfications.
(WebCore::Document::unregisterForCaptionPreferencesChangedCallbacks): Added.
(WebCore::Document::captionPreferencesChanged): Added. Pass to all registered elements.
* dom/Document.h:
* dom/Element.h:
(WebCore::Element::captionPreferencesChanged): Added. Empty; intended
    to be overridden by subclasses.
* history/CachedPage.cpp:
(WebCore::CachedPage::CachedPage): Initialize m_needsCaptionPreferenceChanged member.
(WebCore::CachedPage::restore): Call captionPreferencesChanged() if necessary.
* history/CachedPage.h:
(WebCore::CachedPage::markForCaptionPreferencesChanged): Set the m_needsCaptionPreferenceChanged member.
* history/PageCache.cpp:
(WebCore::PageCache::markPagesForCaptionPreferencesChanged): Pass to every CachedPage.
* history/PageCache.h:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::HTMLMediaElement): Register with the Document.
(WebCore::HTMLMediaElement::~HTMLMediaElement): Unregister with same.
(WebCore::HTMLMediaElement::attach): Remove previous registration call.
* html/HTMLMediaElement.h:
* page/CaptionUserPreferences.cpp:
(WebCore::CaptionUserPreferences::captionPreferencesChanged): Pass to the
    PageGroup.
* page/CaptionUserPreferences.h:
(WebCore::CaptionUserPreferences::setInterestedInCaptionPreferenceChanges):
    Empty; intended to be overridden by subclasses.
* page/CaptionUserPreferencesMac.h:
* page/CaptionUserPreferencesMac.mm:
(WebCore::CaptionUserPreferencesMac::setInterestedInCaptionPreferenceChanges):
    Renamed from registerForPreferencesChangedCallbacks().
(WebCore::CaptionUserPreferencesMac::captionPreferencesChanged):
    Replace call to havePreferenceChangeListeners() with m_listeningForPreferenceChanges.
* page/Page.cpp:
(WebCore::Page::captionPreferencesChanged):
    Pass to every contained Document.
* page/Page.h:
* page/CaptionUserPreferences.cpp:
(WebCore::CaptionUserPreferences::captionPreferencesChanged): Pass to the PageGroup.
* page/CaptionUserPreferences.h:
* page/PageGroup.cpp:
(WebCore::PageGroup::captionPreferencesChanged): Pass to every page, as well as pages in the PageCache.
* page/PageGroup.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145826 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Move platform-specific typedefs to PlatformMenuDescription.h
https://bugs.webkit.org/show_bug.cgi?id=111876

Patch by Jesus Sanchez-Palencia <jesus.palencia@openbossa.org> on 2013-03-14
Reviewed by Caio Marcelo de Oliveira Filho.

Source/WebCore:

Cross platform Context Menu platform-specific typedefs fit better
in PlatformMenuDescription.h and should not be part of the classes
ContextMenu and ContextMenuItem. We have also renamed them to
PlatformContextMenu and PlatformContextMenuItem instead of NativeMenu
and NativeMenuItem respectively.

No new tests needed since no behavior has changed.

* platform/ContextMenu.h:
(ContextMenu):
* platform/ContextMenuItem.h:
(ContextMenuItem):
* platform/PlatformMenuDescription.h:
(WebCore):
* platform/efl/ContextMenuEfl.cpp:
(WebCore::ContextMenu::createPlatformContextMenuFromItems):
(WebCore::ContextMenu::platformContextMenu):
* platform/efl/ContextMenuItemEfl.cpp:
(WebCore::ContextMenuItem::platformContextMenuItem):
* platform/win/ContextMenuItemWin.cpp:
(WebCore):
(WebCore::ContextMenuItem::platformContextMenuItem):
* platform/win/ContextMenuWin.cpp:
(WebCore::ContextMenu::createPlatformContextMenuFromItems):
(WebCore::ContextMenu::platformContextMenu):

Source/WebKit/win:

Rename NativeMenuItem to PlatformContextMenuItem and the getter
function call.

* WebCoreSupport/WebContextMenuClient.cpp:
(WebContextMenuClient::customizeMenu):
(WebContextMenuClient::contextMenuItemSelected):
* WebView.cpp:
(WebView::handleContextMenuEvent):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145827 268f45cc-cd09-0410-ab3c-d52691b4dbfc
DFG bytecode parser is too aggressive about getting rid of GetLocals on captured variables
https://bugs.webkit.org/show_bug.cgi?id=112287
<rdar://problem/13342340>

Reviewed by Oliver Hunt.

Source/JavaScriptCore: 

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::dumpBytecode):
(JSC::CodeBlock::finalizeUnconditionally):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::getLocal):

LayoutTests: 

* fast/js/dfg-captured-var-get-local-expected.txt: Added.
* fast/js/dfg-captured-var-get-local.html: Added.
* fast/js/jsc-test-list:
* fast/js/script-tests/dfg-captured-var-get-local.js: Added.
(foo):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145828 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Add tools/protoc_wrapper to directories pulled in Chromium-in-WebKit configuration
https://bugs.webkit.org/show_bug.cgi?id=112363

Patch by James Robinson <jamesr@chromium.org> on 2013-03-14
Reviewed by Kenneth Russell.

Chromium r187704 added a reference to this script to src/gpu/gpu.gyp, which we pull in the Chromium-in-WebKit
configuration. This adds the script to DEPS so we can roll past that rev.

* DEPS:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145829 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Tighten up the type bounds for SVGPropertyInfo callback parameters
https://bugs.webkit.org/show_bug.cgi?id=111786

Reviewed by Philip Rogers.

Update SVGPropertyInfo's callbacks to pass SVGElement* parameters instead of void*. This
allows us to perform some ASSERT-based type checking before downcasting in implementors.

To avoid adding virtual methods unused in release builds to the base class (and overrides
in descendants), for subtypes lacking polymorphic type markers (isXXX()) the check is
performed using hasTagName() instead.

The patch is also removing the lookupOrCreateWrapperForAnimatedProperty() SVGPropertyInfo
callback for SVGViewSpec properties, because

  a) it doesn't appear to be reachable (SVGViewSpec doesn't have a backing element and
  thus cannot have an associated animator)

  b) it interferes with the parameter specialization described above (SVGViewSpec does not
  inherit from SVGElement)

No new tests, refactoring only.

* svg/SVGElement.cpp:
(WebCore::SVGElement::synchronizeRequiredFeatures):
(WebCore::SVGElement::synchronizeRequiredExtensions):
(WebCore::SVGElement::synchronizeSystemLanguage):
* svg/SVGElement.h:
(SVGElement):
* svg/SVGMarkerElement.cpp:
(WebCore::SVGMarkerElement::synchronizeOrientType):
(WebCore::SVGMarkerElement::lookupOrCreateOrientTypeWrapper):
* svg/SVGMarkerElement.h:
(SVGMarkerElement):
(WebCore::toSVGMarkerElement):
(WebCore):
* svg/SVGPathElement.cpp:
(WebCore::SVGPathElement::lookupOrCreateDWrapper):
(WebCore::SVGPathElement::synchronizeD):
* svg/SVGPathElement.h:
(SVGPathElement):
(WebCore::toSVGPathElement):
(WebCore):
* svg/SVGPolyElement.cpp:
(WebCore::SVGPolyElement::synchronizePoints):
(WebCore::SVGPolyElement::lookupOrCreatePointsWrapper):
* svg/SVGPolyElement.h:
(SVGPolyElement):
(WebCore::toSVGPolyElement):
(WebCore):
* svg/SVGTextContentElement.cpp:
(WebCore::SVGTextContentElement::synchronizeTextLength):
(WebCore::SVGTextContentElement::lookupOrCreateTextLengthWrapper):
* svg/SVGTextContentElement.h:
(SVGTextContentElement):
(WebCore::toSVGTextContentElement):
(WebCore):
Change SVGPropertyInfo callback params to SVGElement* and replace static casts with
conversion wrappers. Implement conversion wrappers where needed.

* svg/SVGViewSpec.cpp:
(WebCore::SVGViewSpec::viewBoxPropertyInfo):
(WebCore::SVGViewSpec::preserveAspectRatioPropertyInfo):
(WebCore::SVGViewSpec::transformPropertyInfo):
(WebCore::SVGViewSpec::lookupOrCreateViewBoxWrapper):
(WebCore::SVGViewSpec::lookupOrCreatePreserveAspectRatioWrapper):
(WebCore::SVGViewSpec::lookupOrCreateTransformWrapper):
* svg/SVGViewSpec.h:
(SVGViewSpec):
Remove SVGPropertyInfo-based lookupOrCreate* callbacks and updated the methods' parameters
to SVGViewSpec*. Remove now-unneeded casts.

* svg/properties/SVGAnimatedPropertyMacros.h:
(WebCore):
* svg/properties/SVGPropertyInfo.h:
(WebCore):
(SVGPropertyInfo):
Update callback declarations.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145830 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GStreamer] simulateAudioInterruption needs to be guarded by ENABLE(VIDEO)"
https://bugs.webkit.org/show_bug.cgi?id=112358

Guarded with ENABLE(VIDEO) to prevent problems when it is not
enabled.

Patch by Xabier Rodriguez Calvar <calvaris@igalia.com> on 2013-03-14
Reviewed by Philippe Normand.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145831 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed expectations updates for a couple of failing tests.

* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145832 268f45cc-cd09-0410-ab3c-d52691b4dbfc