[MSE] Add a SourceBufferPrivateClient interface for platform -> html communication.
https://bugs.webkit.org/show_bug.cgi?id=123373

Reviewed by Eric Carlson.

To enable communication between SourceBuffer and SourceBufferPrivate without introducing
layering violations, add a new interface class SourceBufferPrivateInterface from which
SourceBuffer will inherit.

* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::SourceBuffer): Set the private's client.
(WebCore::SourceBuffer::~SourceBuffer): Clear the private's client.
(WebCore::SourceBuffer::sourceBufferPrivateDidEndStream): Added stub.
(WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment): Hinno.
(WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample): Ditto.
(WebCore::SourceBuffer::sourceBufferPrivateHasAudio): Ditto.
(WebCore::SourceBuffer::sourceBufferPrivateHasVideo): Ditto.
* Modules/mediasource/SourceBuffer.h:
* WebCore.xcodeproj/project.pbxproj: Add new files to project.
* platform/graphics/SourceBufferPrivate.h:
* platform/graphics/SourceBufferPrivateClient.h: Added.
(WebCore::SourceBufferPrivateClient::~SourceBufferPrivateClient): Empty destructor.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158606 268f45cc-cd09-0410-ab3c-d52691b4dbfc
DFG NewArray/NewArrayBuffer shouldn't be constructing with negative indexing
https://bugs.webkit.org/show_bug.cgi?id=123760
<rdar://problem/15356705>

Reviewed by Mark Hahnenberg and Oliver Hunt.

Source/JavaScriptCore: 

* dfg/DFGOperations.cpp:

LayoutTests: 

* js/dfg-new-array-buffer-while-having-a-bad-time-expected.txt: Added.
* js/dfg-new-array-buffer-while-having-a-bad-time.html: Added.
* js/dfg-new-array-while-having-a-bad-time-expected.txt: Added.
* js/dfg-new-array-while-having-a-bad-time.html: Added.
* js/script-tests/dfg-new-array-buffer-while-having-a-bad-time.js: Added.
(foo):
* js/script-tests/dfg-new-array-while-having-a-bad-time.js: Added.
(foo):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158608 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WKRemoteObjectEncoder should escape keys
https://bugs.webkit.org/show_bug.cgi?id=123761

Reviewed by Tim Horton.

Keys that start with $ will be reserved for use by the coder, so prepend an extra
$ to keys that already start with $ to avoid clashes.

* Shared/API/Cocoa/WKRemoteObjectCoder.mm:
(escapeKey):
(-[WKRemoteObjectEncoder encodeBytes:length:forKey:]):
(-[WKRemoteObjectEncoder _encodeObjectForKey:usingBlock:]):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158610 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Use RenderAncestorIterator in a couple of places.
<https://webkit.org/b/123725>

Take the ancestorsOfType<RenderMoo>() thingy out for a spin.

Found a bunch of parent chain walking loops that were really just
looking for the first ancestor renderer of a certain type.
They were a perfect fit for this pattern:

    if (auto svgRoot = ancestorsOfType<RenderSVGRoot>(renderer).first())
        svgRoot->shakeMoneyMaker();

Quite a bit clearer than the previous:

    for (auto ancestor = renderer.parent(); ancestor; ancestor = ancestor->parent()) {
        if (ancestor->isSVGRoot())
            toRenderSVGRoot(ancestor)->makeMoneyShaker();
    }

Reviewed by Antti Koivisto.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158611 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION(r158586): plugins/refcount-leaks.html fails
https://bugs.webkit.org/show_bug.cgi?id=123765

Add the test expectation.

* TestExpectations:
* platform/wk2/TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158614 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Change structure of frame tree in WINCE port.
https://bugs.webkit.org/show_bug.cgi?id=121079

Patch by Zhuang Zhigang <zhuangzg@cn.fujitsu.com> on 2013-11-04
Reviewed by Darin Adler.

* WebCoreSupport/FrameLoaderClientWinCE.cpp:
(WebKit::FrameLoaderClientWinCE::createFrame):
* WebView.cpp:
(WebView::createFrame):
* WebView.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158616 268f45cc-cd09-0410-ab3c-d52691b4dbfc
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.

Source/WebCore: 

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:

LayoutTests: 

Add two flavors of this. One where the replaced element has rendered children and one where it does not,
which go down two different code paths.

* platform/mac/accessibility/object-replacement-with-no-rendered-children-at-node-start-expected.txt: Added.
* platform/mac/accessibility/object-replacement-with-no-rendered-children-at-node-start.html: Added.
* platform/mac/accessibility/object-replacement-with-rendered-children-at-node-start-expected.txt: Added.
* platform/mac/accessibility/object-replacement-with-rendered-children-at-node-start.html: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158617 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove PlatformCALayer::playerLayer
https://bugs.webkit.org/show_bug.cgi?id=123764

Reviewed by Sam Weinig.

Source/WebCore:

* platform/graphics/ca/PlatformCALayer.h:
* platform/graphics/ca/mac/PlatformCALayerMac.h:
* platform/graphics/ca/mac/PlatformCALayerMac.mm:
(PlatformCALayerMac::clone):
Remove playerLayer(), fold it into clone().

Source/WebKit2:

* WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
* WebProcess/WebPage/mac/PlatformCALayerRemote.h:
Remove playerLayer().


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158619 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fixing MediaStreamDescriptor addSource and addTrack methods
https://bugs.webkit.org/show_bug.cgi?id=123755

Patch by Thiago de Barros Lacerda <thiago.lacerda@openbossa.org> on 2013-11-04
Reviewed by Eric Carlson.

We must store the track and source that is passed as parameter in a RefPtr,
otherwise we will refer to a null pointer.

No new tests needed.

* platform/mediastream/MediaStreamDescriptor.cpp:
(WebCore::MediaStreamDescriptor::addSource):
(WebCore::MediaStreamDescriptor::addTrack):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158620 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove code duplications in createFontCustomPlatformData()
https://bugs.webkit.org/show_bug.cgi?id=123706

Reviewed by Darin Adler.

Move OpenTypeSanitizer and WOFF handling from the port specific
implementations in createFontCustomPlatformData() into the only
caller of this function CachedFont::ensureCustomFontData().
Also change the parameter passing the SharedBuffer from a
pointer to a reference since it is never null.

* loader/cache/CachedFont.cpp:
(WebCore::CachedFont::ensureCustomFontData):
* platform/graphics/blackberry/FontCustomPlatformData.h:
* platform/graphics/blackberry/FontCustomPlatformDataBlackBerry.cpp:
(WebCore::FontCustomPlatformData::FontCustomPlatformData):
(WebCore::createFontCustomPlatformData):
* platform/graphics/cairo/FontCustomPlatformData.h:
* platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp:
(WebCore::FontCustomPlatformData::FontCustomPlatformData):
(WebCore::createFontCustomPlatformData):
* platform/graphics/mac/FontCustomPlatformData.cpp:
(WebCore::createFontCustomPlatformData):
* platform/graphics/mac/FontCustomPlatformData.h:
* platform/graphics/win/FontCustomPlatformData.cpp:
(WebCore::createFontCustomPlatformData):
* platform/graphics/win/FontCustomPlatformData.h:
* platform/graphics/win/FontCustomPlatformDataCairo.cpp:
(WebCore::createFontCustomPlatformData):
* platform/graphics/wince/FontCustomPlatformData.cpp:
(WebCore::createFontCustomPlatformData):
* platform/graphics/wince/FontCustomPlatformData.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158623 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION(r158311): media/media-fragments/TC0054.html and TC0061.html hit assertions
https://bugs.webkit.org/show_bug.cgi?id=123555

Reviewed by Darin Adler.

Source/WebCore:

No new tests, covered by existing tests.

* html/MediaFragmentURIParser.cpp:
(WebCore::MediaFragmentURIParser::parseFragments): Don't add a fragment with empty key or value as
    they will not processed.
(WebCore::MediaFragmentURIParser::parseNPTFragment): Remove excess whitespace.

LayoutTests:

* TestExpectations: Remove media/media-fragments/TC0054.html and media/media-fragments/TC0061.html.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158624 268f45cc-cd09-0410-ab3c-d52691b4dbfc
FrameView destructor is worried about being retained by a renderer.
<https://webkit.org/b/123763>

There's no way we can be in ~FrameView() while also being owned by
a RenderWidget. Remove some overly paranoid code that was making sure
the renderer didn't have a reference on us.

Reviewed by Anders Carlsson.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158625 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Move duplicate code in TrackPrivate classes to a common base class
https://bugs.webkit.org/show_bug.cgi?id=123619

Patch by Brendan Long <b.long@cablelabs.com> on 2013-11-04
Reviewed by Darin Adler.

No new tests because this is just refactoring.

* GNUmakefile.list.am: Add TrackPrivateBase.
* WebCore.vcxproj/WebCore.vcxproj: Same.
* WebCore.vcxproj/WebCore.vcxproj.filters: Same.
* WebCore.xcodeproj/project.pbxproj: Same.
* html/track/AudioTrack.cpp:
(WebCore::AudioTrack::inbandTrackIndex): Renamed audioTrackIndex() to trackIndex().
(WebCore::AudioTrack::labelChanged): First argument is now a TrackPrivateBase*.
(WebCore::AudioTrack::languageChanged): Same.
(WebCore::AudioTrack::willRemove): Same.
* html/track/AudioTrack.h: Update TrackPrivateBaseClient function signatures.
* html/track/InbandTextTrack.cpp:
(WebCore::InbandTextTrack::inbandTrackIndex): Renamed textTrackIndex() to trackIndex().
(WebCore::InbandTextTrack::labelChanged): First argument is now a TrackPrivateBase*.
(WebCore::InbandTextTrack::languageChanged): Same.
(WebCore::InbandTextTrack::willRemove): Same.
* html/track/InbandTextTrack.h: Update TrackPrivateBaseClient function signatures.
* html/track/VideoTrack.cpp:
(WebCore::VideoTrack::inbandTrackIndex): Renamed videoTrackIndex() to trackIndex().
(WebCore::VideoTrack::labelChanged): First argument is now a TrackPrivateBase*.
(WebCore::VideoTrack::languageChanged): Same.
(WebCore::VideoTrack::willRemove): Same.
* html/track/VideoTrack.h: Update TrackPrivateBaseClient function signatures.
* platform/graphics/AudioTrackPrivate.h: Remove code that was moved to TrackPrivateBase.
* platform/graphics/InbandTextTrackPrivate.h: Same.
* platform/graphics/InbandTextTrackPrivateClient.h: Same.
* platform/graphics/VideoTrackPrivate.h: Same.
* platform/graphics/TrackPrivateBase.h: Refactored out duplicate code in AudioTrackPrivate, InbandTextTrackPrivate and VideoTrackPrivate.
* platform/graphics/avfoundation/InbandTextTrackPrivateAVF.h: Renamed textTrackIndex() to trackIndex().
* platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.h: Same.
* platform/graphics/gstreamer/AudioTrackPrivateGStreamer.h: Renamed audioTrackIndex() to trackIndex().
* platform/graphics/gstreamer/VideoTrackPrivateGStreamer.h: Renamed videoTrackIndex() to trackIndex90.

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