AX: Regression: media controls are no longer accessible
https://bugs.webkit.org/show_bug.cgi?id=121990

Patch by James Craig <jcraig@apple.com> on 2013-11-01
Reviewed by Jer Noble.

Source/WebCore:

Updated existing test coverage.
Added ARIA roles, attrs, and labels to the new media controls shadow DOM.
Localization will be handled in http://webkit.org/b/120956

* Modules/mediacontrols/mediaControlsApple.js:
(Controller.prototype.UIString):
(Controller.prototype.createControls):
(Controller.prototype.handleLoadStart):
(Controller.prototype.handleError):
(Controller.prototype.handleAbort):
(Controller.prototype.handleSuspend):
(Controller.prototype.handleStalled):
(Controller.prototype.handleWaiting):
(Controller.prototype.handleFullscreenChange):
(Controller.prototype.handleMuteButtonClicked):
(Controller.prototype.handleMinButtonClicked):
(Controller.prototype.handleMaxButtonClicked):
(Controller.prototype.handleVolumeSliderChange):
(Controller.prototype.updatePlaying):

LayoutTests:

Removed failure expectation and updated expected render dump output.

* platform/mac/TestExpectations:
* platform/mac/accessibility/media-element-expected.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158455 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Cocoa] Avoid some double-wrapping of strings and URLs
https://bugs.webkit.org/show_bug.cgi?id=123632

Reviewed by Anders Carlsson.

* Shared/API/c/cf/WKStringCF.cpp: Removed.
* Shared/API/c/cf/WKStringCF.mm: Copied from Source/WebKit2/Shared/API/c/cf/WKStringCF.cpp.
(wkNSStringClass): Added this helper.
(WKStringCreateWithCFString): If the passed-in CFString is already wrapping a WebString,
then retain it and return it.
* Shared/API/c/cf/WKURLCF.cpp: Removed.
* Shared/API/c/cf/WKURLCF.mm: Copied from Source/WebKit2/Shared/API/c/cf/WKURLCF.cpp.
(wkNSURLClass): Added this helper.
(WKURLCreateWithCFURL): If the passed-in CFURL is already wrapping a WebURL, then retain it
and return it.
* WebKit2.xcodeproj/project.pbxproj: Updated for renames.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158456 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WK2] Create a unique identifier for WebPageGroup if the input name is empty
https://bugs.webkit.org/show_bug.cgi?id=123606

Reviewed by Andreas Kling.

Strengthen the "public" API of page group.
If someone uses WKBrowsingContextGroup with a nil or empty string, the related WKString
would be empty, and all the WKBrowsingContextGroup end up with the same identifier.

* UIProcess/WebPageGroup.cpp:
(WebKit::WebPageGroup::WebPageGroup):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158457 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Teach check-for-webkit-framework-include-consistency to ignore stale iOS Private headers that might exist in build directories due to r158443
https://bugs.webkit.org/show_bug.cgi?id=123636

Reviewed by Andreas Kling.

* Scripts/check-for-webkit-framework-include-consistency:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158458 268f45cc-cd09-0410-ab3c-d52691b4dbfc
OSR exit profiling should be robust against all code being cleared
https://bugs.webkit.org/show_bug.cgi?id=123629
<rdar://problem/15365476>

Reviewed by Michael Saboff.
        
The problem here is two-fold:

1) A watchpoint (i.e. ProfiledCodeBlockJettisoningWatchpoint) may be fired after we
have cleared the CodeBlock for all or some Executables.  This means that doing
codeBlock->baselineVersion() would either crash or return a bogus CodeBlock, since
there wasn't a baseline code block reachable from the Executable anymore.  The
solution is that we shouldn't be asking for the baseline code block reachable from
the owning executable (what baselineVersion did), but instead we should be asking
for the baseline version reachable from the code block being watchpointed (basically
what CodeBlock::alternative() did).

2) If dealing with inlined code, baselienCodeBlockForOriginAndBaselineCodeBlock()
may return null, for the same reason as above - we might have cleared the baseline
codeblock for the executable that was inlined.  The solution is to just not do
profiling if there isn't a baseline code block anymore.

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::baselineAlternative):
(JSC::CodeBlock::baselineVersion):
(JSC::CodeBlock::jettison):
* bytecode/CodeBlock.h:
* bytecode/CodeBlockJettisoningWatchpoint.cpp:
(JSC::CodeBlockJettisoningWatchpoint::fireInternal):
* bytecode/ProfiledCodeBlockJettisoningWatchpoint.cpp:
(JSC::ProfiledCodeBlockJettisoningWatchpoint::fireInternal):
* dfg/DFGOSRExitBase.cpp:
(JSC::DFG::OSRExitBase::considerAddingAsFrequentExitSiteSlow):
* jit/AssemblyHelpers.h:
(JSC::AssemblyHelpers::AssemblyHelpers):
* runtime/Executable.cpp:
(JSC::FunctionExecutable::baselineCodeBlockFor):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158459 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Cocoa] WKObject seems to be initializing its target in a thread-safe manner, but really is not
https://bugs.webkit.org/show_bug.cgi?id=123640

Reviewed by Darin Adler.

* Shared/Cocoa/WKObject.mm:
(initializeTargetIfNeeded): Removed misleading incorrect code.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158460 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Kill RenderArena.
<https://webkit.org/b/123634>

There are no remaining users of the RenderArena allocator.

Reviewed by Geoffrey Garen.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158461 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remote Layer Tree: Move RemoteLayerBackingStore to Shared/
https://bugs.webkit.org/show_bug.cgi?id=123646

Reviewed by Darin Adler.

Move RemoteLayerBackingStore to Shared/, since it is
used on both the UI and Web process side of things.

* Shared/mac/RemoteLayerBackingStore.h: Renamed from Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerBackingStore.h.
* Shared/mac/RemoteLayerBackingStore.mm: Renamed from Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerBackingStore.mm.
* WebKit2.xcodeproj/project.pbxproj:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158463 268f45cc-cd09-0410-ab3c-d52691b4dbfc
CSS 'initial' and 'inherit' value constructors should return PassRef.
<https://webkit.org/b/123641>

Make the helpers involved in constructing CSS{Initial,Inherited}Value
all return PassRef instead of PassRefPtr. This avoids generating
pointless null checks at the call sites.

Reviewed by Darin Adler.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158465 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Shapes] Fix typo in simple-polygon.js LayoutTest helper
https://bugs.webkit.org/show_bug.cgi?id=123595

Reviewed by Darin Adler.

* fast/shapes/resources/simple-polygon.js:
(generatePolygonContentString): Fixed a typo: the lineHeight parameter generatePolygonContentString() is now lineHeight.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158466 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Initial implementation of text-decoration-skip ink
https://bugs.webkit.org/show_bug.cgi?id=121806

Patch by Myles C. Maxfield <mmaxfield@apple.com> on 2013-11-01
Reviewed by Darin Adler.

Source/WebCore:

text-decoration-skip: ink is implemented by the following steps:
1. Before drawing any decorations, figure out the bounding box for the decorations that will be drawn
2. Create an ImageBuffer with these dimensions
3. Draw text into this ImageBuffer with a thicker stroke
4. Apply the ImageBuffer as a mask to the context
5. Draw decorations like normal
6. Clean up

Test: fast/css3-text/css3-text-decoration/text-decoration-skip/text-decoration-skip-ink.html

* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::computeLineBoundsAndAntialiasingModeForText): Don't call GraphicsContext::roundToDevicePixels
when painting is disabled
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paint): Pass the TextPainter to paintDecoration
(WebCore::computeUnderlineOffset): Small cleanup
(WebCore::getWavyStrokeControlPointDistance): Pulling out of strokeWavyTextDecoration()
(WebCore::getWavyStrokeStep): Ditto
(WebCore::strokeWavyTextDecoration): Use the previous 2 functions
(WebCore::getSingleDecorationBoundingBox): Pulling out repeated code into a function
(WebCore::getDecorationBoundingBox): Compute the bounding box for an underline which
hasn't been drawn yet
(WebCore::InlineTextBox::paintDecoration): Construct a mask and apply it to the GraphicsContext
* rendering/InlineTextBox.h: paintDecoration needs the TextPainter
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::changeRequiresRepaintIfTextOrBorderOrOutline): Redraw the underline when
text-decoration-skip changes

LayoutTests:

Adding a test which draws a very large "p" with text-decoration-skip:ink. The
viewport is restricted to be just hugging the place where an underline would
intersect the descender of the "p". This should look the same as if there was
no underline at all (because of the skipping underline).

* fast/css3-text/css3-text-decoration/text-decoration-skip/text-decoration-skip-ink-expected.html: Added.
* fast/css3-text/css3-text-decoration/text-decoration-skip/text-decoration-skip-ink.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158467 268f45cc-cd09-0410-ab3c-d52691b4dbfc
CSSAspectRatioValue construction helper should return PassRef.
<https://webkit.org/b/123645>

Return PassRef instead of PassRefPtr from functions that return
ownership-passing pointers that are known to be non-null.

Reviewed by Darin Adler.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158469 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Removing unnecessary early returns in addTrack, removeTrack and removeRemoteSource methods
https://bugs.webkit.org/show_bug.cgi?id=123644

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

No new tests needed.

* Modules/mediastream/MediaStream.cpp:
(WebCore::MediaStream::addTrack):
(WebCore::MediaStream::removeTrack):
(WebCore::MediaStream::removeRemoteSource):
(WebCore::MediaStream::trackVectorForType):
* Modules/mediastream/MediaStream.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158470 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Move CF/Mac WTF String implementations down into WTF
https://bugs.webkit.org/show_bug.cgi?id=123635

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2013-11-01
Reviewed by Sam Weinig.

Source/WebCore:

* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:

Source/WTF:

* WTF.vcxproj/WTF.vcxproj:
* WTF.vcxproj/WTF.vcxproj.filters:
* WTF.xcodeproj/project.pbxproj:
* wtf/text/AtomicString.h:
* wtf/text/StringImpl.h:
* wtf/text/WTFString.h:
* wtf/text/cf/AtomicStringCF.cpp: Renamed from Source/WebCore/platform/text/cf/AtomicStringCF.cpp.
(WTF::AtomicString::add):
* wtf/text/cf/StringCF.cpp: Renamed from Source/WebCore/platform/text/cf/StringCF.cpp.
(WTF::String::String):
(WTF::String::createCFString):
* wtf/text/cf/StringImplCF.cpp: Renamed from Source/WebCore/platform/text/cf/StringImplCF.cpp.
(garbageCollectionEnabled):
(WTF::StringWrapperCFAllocator::retain):
(WTF::StringWrapperCFAllocator::release):
(WTF::StringWrapperCFAllocator::copyDescription):
(WTF::StringWrapperCFAllocator::allocate):
(WTF::StringWrapperCFAllocator::reallocate):
(WTF::StringWrapperCFAllocator::deallocateOnMainThread):
(WTF::StringWrapperCFAllocator::deallocate):
(WTF::StringWrapperCFAllocator::preferredSize):
(WTF::StringWrapperCFAllocator::create):
(WTF::StringWrapperCFAllocator::allocator):
(WTF::StringImpl::createCFString):
* wtf/text/mac/StringImplMac.mm: Renamed from Source/WebCore/platform/text/mac/StringImplMac.mm.
(WTF::StringImpl::operator NSString *):
* wtf/text/mac/StringMac.mm: Renamed from Source/WebCore/platform/text/mac/StringMac.mm.
(WTF::String::String):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158471 268f45cc-cd09-0410-ab3c-d52691b4dbfc
CSSCanvasValue construction helper should return PassRef.
<https://webkit.org/b/123650>

Return PassRef instead of PassRefPtr from functions that return
ownership-passing pointers that are known to be non-null.

Reviewed by Anders Carlsson.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158472 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Neuter WTF_MAKE_FAST_ALLOCATED in GLOBAL_FASTMALLOC_NEW builds.
<https://webkit.org/b/123639>

Source/JavaScriptCore:

JSC::ParserArenaRefCounted really needed to have the new/delete
operators overridden, in order for JSC::ScopeNode to be able to
choose that "operator new" out of the two it inherits.

Reviewed by Anders Carlsson.

Source/WebCore:

WebCore::TimerBase really needed to have the new/delete operators
overridden, in order for WebCore::SuspendableTimer to be able to
choose that "operator new" out of the two it inherits.

Reviewed by Anders Carlsson.

Source/WTF:

When building with GLOBAL_FASTMALLOC_NEW, we don't need to expand
operator new/delete overrides in every class.

This change makes allocations group up nicely in Instruments,
instead of being split between "WTF::fastMalloc" and "operator new"
depending on whether the class had WTF_MAKE_FAST_ALLOCATED.

Reviewed by Anders Carlsson.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158473 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Make more StringImpl construction helpers return PassRef.
<https://webkit.org/b/123652>

Tweak another handful of StringImpl constructor functions to return
PassRef<StringImpl> instead of PassRefPtr.

Reviewed by Anders Carlsson.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158474 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed attempt at Windows build fix after r158471.

* wtf/text/cf/AtomicStringCF.cpp:
* wtf/text/cf/StringCF.cpp:
* wtf/text/cf/StringImplCF.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158475 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Re-use existing RenderStyle local in textWidth().
<https://webkit.org/b/123392>

We already have the RenderStyle cached in a local here, so avoid
getting it from RenderText since that has to go via the parent.

Reviewed by Antti Koivisto.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158476 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fixing mac code to use new MediaStreamDescriptor create method
https://bugs.webkit.org/show_bug.cgi?id=123653

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

No new tests needed.

* platform/mediastream/mac/MediaStreamCenterMac.cpp:
(WebCore::MediaStreamCenterMac::createMediaStream):

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