Add a WKError.h header and rename the existing WKError.h to WKErrorRef.h
https://bugs.webkit.org/show_bug.cgi?id=133657

Reviewed by Dan Bernstein.

* Shared/API/Cocoa/WebKit.h:
* Shared/API/c/WKErrorRef.cpp: Renamed from Source/WebKit2/Shared/API/c/WKError.cpp.
(WKErrorGetTypeID):
(WKErrorCopyWKErrorDomain):
(WKErrorCopyDomain):
(WKErrorGetErrorCode):
(WKErrorCopyFailingURL):
(WKErrorCopyLocalizedDescription):
* Shared/API/c/WKErrorRef.h: Renamed from Source/WebKit2/Shared/API/c/WKError.h.
* UIProcess/API/C/WKPage.h:
* UIProcess/API/C/WKPageLoaderClient.h:
* UIProcess/API/C/WebKit2_C.h:
* UIProcess/API/Cocoa/WKError.h: Copied from Source/WebKit2/Shared/API/Cocoa/WebKit.h.
* UIProcess/API/Cocoa/WKError.mm: Copied from Source/WebKit2/Shared/API/Cocoa/WebKit.h.
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/WebCoreSupport/mac/WebErrorsMac.mm:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169711 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Address review feedback.

* UIProcess/API/Cocoa/WKWebView.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169712 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Mac] caption size is not update immediately when system preferences change
https://bugs.webkit.org/show_bug.cgi?id=133598

Reviewed by Brent Fulgham.

* Modules/mediacontrols/MediaControlsHost.cpp:
(WebCore::MediaControlsHost::updateCaptionDisplaySizes): New.
* Modules/mediacontrols/MediaControlsHost.h:

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::captionPreferencesChanged): Tell the controls host to update sizes.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169713 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS WebGL] Implement OES_vertex_array_object for iOS.
https://bugs.webkit.org/show_bug.cgi?id=133629

Patch by Alex Christensen <achristensen@webkit.org> on 2014-06-09
Reviewed by Brady Eidson.

Covered by the Khronos test (and in LayoutTests):
conformance/extensions/oes-vertex-array-object.html

* platform/graphics/ios/GraphicsContext3DIOS.h:
Added OpenGL vertex array function renaming for iOS adding the OES suffix.
* platform/graphics/opengl/Extensions3DOpenGL.cpp:
(WebCore::Extensions3DOpenGL::createVertexArrayOES):
(WebCore::Extensions3DOpenGL::deleteVertexArrayOES):
(WebCore::Extensions3DOpenGL::isVertexArrayOES):
(WebCore::Extensions3DOpenGL::bindVertexArrayOES):
Added isVertexArrayObjectSupported and support for iOS.
(WebCore::Extensions3DOpenGL::supportsExtension):
Added iOS name for GL_OES_vertex_array_object extension.
* platform/graphics/opengl/Extensions3DOpenGL.h:
Added isVertexArrayObjectSupported for iOS.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169714 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION: missing underline under CJK text
https://bugs.webkit.org/show_bug.cgi?id=128145

Reviewed by Darin Adler.

Source/WebCore:
This patch refactors the GlyphToPathTranslator which is used to find intersections of
glyphs and underlines. It was modified to allow for querying these pieces of
information:
1) The extents of the glyph. This can be used to make the underlines skip an entire
glyph, wholesale
2) What kind of skipping behavior should be used
3) The Path which represents the glyph
There are three skipping behaviors:
1) (SkipDescenders) The previous behavior
2) (SkipGlyph) Make the underline skip over the entire glyph, using the extents() function
3) (DrawOverGlyph) Make the underline plow through the glyph, ignoring any descenders

Calculating which underlining behavior to use depends on what the base codepoint that
originated that glyph is. This means that we have to map from glyphs to characters,
something which is nontrivial to do. In order to solve this problem, this patch adds
an optional vector to GlyphBuffer which represents the location in the original string
from which a particular glyph originated. Then, when our WidthIterator code adds
glyphs to the GlyphBuffer, we can include the extra information about where we are
in the input string. Once this data is available, the GlyphPathTranslator can look up
the base codepoint from which this glyph originates, and can run ICU functions on that
codepoint.

We can use the ICU ublock_getCode() function to find which Unicode block a particular
codepoint comes from. If the codepoint comes from a CJK block, we will use
DrawOverGlyph; otherwise, we will use SkipDescenders.

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

* platform/graphics/Font.cpp:
(WebCore::sharedUnderlineType): Look up the base codepoint from which this glyph
originates, call ublock_getCode to get its Unicode block, then return
a GlyphUnderlineType accordingly. This code is shared between SVG and non-SVG.
* platform/graphics/Font.h: New virtual functions in GlyphToPathTranslator, as well as
function signatures for the above two functions.
* platform/graphics/GlyphBuffer.h: Add an optional instance member for the location
from within the original string from which a particular glyph originates.
(WebCore::GlyphBuffer::clear): Updated for new member.
(WebCore::GlyphBuffer::add): Ditto.
(WebCore::GlyphBuffer::saveOffsetsInString): Opt-in to using the new variable
(WebCore::GlyphBuffer::offsetInString): New variable accessor.
* platform/graphics/TextRun.h: SVG needs the TextRun to use sharedUnderlineType.
* platform/graphics/WidthIterator.cpp:
(WebCore::WidthIterator::advanceInternal): Use GlyphBuffer's new variable (if present).
* platform/graphics/mac/ComplexTextController.cpp:
(WebCore::ComplexTextController::advance): Use GlyphBuffer's new variable (if present).
* platform/graphics/mac/FontMac.mm: Implement new GlyphToPathTranslator functions.
(WebCore::MacGlyphToPathTranslator::path):
(WebCore::MacGlyphToPathTranslator::extents):
(WebCore::MacGlyphToPathTranslator::underlineType): Calls sharedUnderlineType().
(WebCore::MacGlyphToPathTranslator::moveToNextValidGlyph):
(WebCore::MacGlyphToPathTranslator::increment):
(WebCore::Font::dashesForIntersectionsWithRect): Ask the translator what kind of underline
behavior should be used. React accordingly.
(WebCore::MacGlyphToPathTranslator::nextPath): Deleted.
(WebCore::MacGlyphToPathTranslator::incrementIndex): Deleted.
* platform/graphics/win/UniscribeController.cpp:
(WebCore::UniscribeController::shapeAndPlaceItem): Update to new signature of GlyphBuffer::add()
* rendering/svg/SVGTextRunRenderingContext.cpp: Implement new GlyphToPathTranslator functions.
(WebCore::SVGGlyphToPathTranslator::SVGGlyphToPathTranslator):
(WebCore::SVGGlyphToPathTranslator::getCurrentTransform):
(WebCore::SVGGlyphToPathTranslator::path):
(WebCore::SVGGlyphToPathTranslator::extents):
(WebCore::MacGlyphToPathTranslator::underlineType): Calls sharedUnderlineType().
(WebCore::SVGGlyphToPathTranslator::moveToNextValidGlyph):
(WebCore::SVGGlyphToPathTranslator::increment):
(WebCore::SVGTextRunRenderingContext::createGlyphToPathTranslator):
(WebCore::SVGTextRunRenderingContext::drawSVGGlyphs):
(WebCore::SVGGlyphToPathTranslator::nextPath): Deleted.
(WebCore::SVGGlyphToPathTranslator::incrementIndex): Deleted.
* rendering/svg/SVGTextRunRenderingContext.h: SVG needs the TextRun to use sharedUnderlineType.

LayoutTests:
This test makes sure that underlines under CJK text don't skip over descenders.

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

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169715 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Subpixel rendering: Pixelsnapping empty rounded rect results in NaN radii width/height.
https://bugs.webkit.org/show_bug.cgi?id=133654

Reviewed by Simon Fraser.

Empty rounded rects don't need snapping.

Not testable.

* platform/graphics/RoundedRect.cpp:
(WebCore::RoundedRect::pixelSnappedRoundedRectForPainting):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169716 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Attempt to fix the EFL and GTK builds after <http://trac.webkit.org/changeset/169711>
(https://bugs.webkit.org/show_bug.cgi?id=133657)

Rename Shared/API/c/WKError.cpp to Shared/API/c/WKErrorRef.cpp.

* CMakeLists.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169717 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Mac][MSE] Exception thrown from ~MediaPlayerPrivateMediaSourceAVFObjC().
https://bugs.webkit.org/show_bug.cgi?id=133656

Reviewed by Eric Carlson.

AVSampleBufferRenderSynchronizer can't handle being passed a NULL observer, so only attempt
to remove the time jumped or duration observer if one was actually created.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::~MediaPlayerPrivateMediaSourceAVFObjC):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169718 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Another attempt to fix the EFL and GTK builds after <http://trac.webkit.org/changeset/169711>
(https://bugs.webkit.org/show_bug.cgi?id=133657)

Substitute WKErrorRef.h for WKError.h.

* UIProcess/API/efl/ewk_error.cpp:
* WebProcess/WebCoreSupport/efl/WebErrorsEfl.cpp:
* WebProcess/WebCoreSupport/gtk/WebErrorsGtk.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169719 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Mac] Hang when painting media before compositing mode activated
https://bugs.webkit.org/show_bug.cgi?id=133655

Reviewed by Eric Carlson.

When asked to paint(), MediaPlayerPrivateAVFoundationObjC should not create an image generator
or a video output. These operations are synchronous, and will block the drawing thread and cause
a spin. paint() as opposed to paintImageInContext() is only called when painting the layer tree
and MediaPlayerPrivateAVFoundationObjC will paint by creating a AVPlayerLayer, not by painting
frames directly into the tree.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::paint):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169720 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Flash video controls hit-test incorrectly after changing topContentInset
https://bugs.webkit.org/show_bug.cgi?id=133658
-and corresponding-
<rdar://problem/16978590>

Reviewed by Anders Carlsson.

When the topContent changes, the PluginView needs to be informed.

New function PluginView::topContentInsetDidChange() calls viewGeometryDidChange().
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::topContentInsetDidChange):
* WebProcess/Plugins/PluginView.h:

Call topContentInsetDidChange() after setting an inset only if it is a new inset.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::setTopContentInset):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169724 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Automatic text track selection can select more than one track
https://bugs.webkit.org/show_bug.cgi?id=133590

Reviewed by Brent Fulgham.

Source/WebCore:
Test: media/video-trackmenu-selection.html

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::configureTextTrack): Consider the currently selected
    track, if any.

* page/CaptionUserPreferencesMediaAF.cpp:
(WebCore::CaptionUserPreferencesMediaAF::sortedTrackListForMenu): Drive-by change
    to make sure no non-visible text tracks are included in the track menu.

LayoutTests:
* media/video-trackmenu-selection-expected.txt: Added.
* media/video-trackmenu-selection.html: Added.

* platform/efl/TestExpectations: New test skipped.


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