Determine text direction for rendering a TextTrackCue
https://bugs.webkit.org/show_bug.cgi?id=79749

Reviewed by Levi Weintraub.

Source/WebCore:

The rendering rules for WebVTT cues are slightly different
depending on the directionality determined from the characters
of the cue text. This patch implements the preliminary step
to be able to take directionality into account.

It iterates through the cue characters and setting the CSS
directionality to the one of the first strong directional character.

Test: media/track/track-cue-rendering-rtl.html

* html/track/TextTrackCue.cpp:
(WebCore::TextTrackCueBox::applyCSSProperties): Applies the determined
direction.
(WebCore::TextTrackCue::TextTrackCue): Sets the default value for the
display direction.
(WebCore::isCueParagraphSeparator): Tests for explicit unicode characters
that are paragraph separators.
(WebCore):
(WebCore::TextTrackCue::determineTextDirection): Determined the direction
by the first strong directional character found.
(WebCore::TextTrackCue::calculateDisplayParameters): Updated.
(WebCore::TextTrackCue::getCSSWritingDirection): Return the determined CSS
writing direction.
* html/track/TextTrackCue.h:
(TextTrackCue):

LayoutTests:

* media/track/captions-webvtt/captions-rtl.vtt: Added.
* media/track/track-cue-rendering-rtl-expected.txt: Added.
* media/track/track-cue-rendering-rtl.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146128 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Variant of non-primary fell-back SVGFont causes crash.
https://bugs.webkit.org/show_bug.cgi?id=112367

Reviewed by Stephen Chenney.

Source/WebCore:

Don't go to PlatformFontData path for SimpleFontData::createScaledFontData()
for SVG fonts.

Test: svg/css/font-face-variant-crash.html

* platform/graphics/SimpleFontData.cpp:
(WebCore::SimpleFontData::~SimpleFontData):
(WebCore::SimpleFontData::createScaledFontData): Don't go to PlatformFontData path for SVG fonts.
(WebCore):
* platform/graphics/SimpleFontData.h:
(SimpleFontData): Added createScaledFontData and renamed the original createScaledFontData to platformCreateScaledFontData.
                  BTW, Removed unreferenced commonInit.
* platform/graphics/blackberry/SimpleFontDataBlackBerry.cpp:
(WebCore::SimpleFontData::platformCreateScaledFontData): Renamed from createScaledFontData.
* platform/graphics/chromium/SimpleFontDataChromiumWin.cpp:
(WebCore::SimpleFontData::platformCreateScaledFontData): Ditto.
* platform/graphics/freetype/SimpleFontDataFreeType.cpp:
(WebCore::SimpleFontData::platformCreateScaledFontData): Ditto.
* platform/graphics/mac/SimpleFontDataMac.mm:
(WebCore::SimpleFontData::platformCreateScaledFontData): Ditto.
* platform/graphics/qt/SimpleFontDataQt.cpp:
(WebCore::SimpleFontData::platformCreateScaledFontData): Ditto.
* platform/graphics/skia/SimpleFontDataSkia.cpp:
(WebCore::SimpleFontData::platformCreateScaledFontData): Ditto.
* platform/graphics/win/SimpleFontDataWin.cpp:
(WebCore::SimpleFontData::platformCreateScaledFontData): Ditto.
* platform/graphics/wince/SimpleFontDataWinCE.cpp:
(WebCore::SimpleFontData::platformCreateScaledFontData): Ditto.
* platform/graphics/wx/SimpleFontDataWx.cpp:
(WebCore::SimpleFontData::platformCreateScaledFontData): Ditto.

LayoutTests:

* resources/SpaceOnly.otf: Added. A font containing only the space glyph for testing font fallback.
* svg/css/font-face-variant-crash-expected.txt: Added.
* svg/css/font-face-variant-crash.html: Added.


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