MediaControls: Use font with fixed number width
authordino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Mar 2015 17:43:56 +0000 (17:43 +0000)
committerdino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Mar 2015 17:43:56 +0000 (17:43 +0000)
commit612108d2ed8bc5fdf0650e6753b71935ab5ca401
treea9aa6810694d7838f663f0b24eed86e94e77b4ee
parentd1857772a9ad99795ee5ba1302d638eebb6bef0d
MediaControls: Use font with fixed number width
https://bugs.webkit.org/show_bug.cgi?id=143018
<rdar://problem/20245415>

Reviewed by Eric Carlson.

Source/WebCore:

Add a new font-family, specific to Apple platforms,
called -apple-system-font-monospaced-numbers. This is
a special variant of the system font which uses monospaced
forms for the number glyphs - allowing a time reading that
doesn't bounce around as the time changes.

* Modules/mediacontrols/mediaControlsApple.css: Media controls should
use the new font.
(audio::-webkit-media-controls-time-remaining-display):
* Modules/mediacontrols/mediaControlsiOS.css:
(audio::-webkit-media-controls-time-remaining-display):

* platform/graphics/ios/FontCacheIOS.mm: Request a new CTFontRef with
the appropriate attributes.
(WebCore::createCTFontWithFamilyNameAndWeight):
* platform/graphics/mac/FontCacheMac.mm: Ditto, but NSFont.
(WebCore::fontWithFamily):
* platform/spi/cocoa/CoreTextSPI.h: Expose the constants for
the new form so that the public SDK can build.

LayoutTests:

Add some results for the new font family "-apple-system-font-monospaced-numbers".

* platform/mac/fast/text/systemFont.html:
* platform/mac/fast/text/systemFont-expected.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@181965 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/platform/mac/fast/text/systemFont-expected.txt
LayoutTests/platform/mac/fast/text/systemFont.html
Source/WebCore/ChangeLog
Source/WebCore/Modules/mediacontrols/mediaControlsApple.css
Source/WebCore/Modules/mediacontrols/mediaControlsiOS.css
Source/WebCore/platform/graphics/ios/FontCacheIOS.mm
Source/WebCore/platform/graphics/mac/FontCacheMac.mm
Source/WebCore/platform/spi/cocoa/CoreTextSPI.h