зеркало из https://github.com/mozilla/gecko-dev.git
merge mozilla-inbound to mozilla-central a=merge
This commit is contained in:
Коммит
b4d42f370a
|
@ -830,6 +830,7 @@ skip-if = buildapp == 'mulet' || buildapp == 'b2g' || toolkit == 'android'
|
|||
[test_bug1081686.html]
|
||||
skip-if = buildapp == 'b2g' || toolkit == 'android' || e10s
|
||||
[test_window_define_nonconfigurable.html]
|
||||
skip-if = release_build
|
||||
[test_root_iframe.html]
|
||||
[test_performance_observer.html]
|
||||
[test_performance_user_timing.html]
|
||||
|
|
|
@ -275,8 +275,12 @@ WebGL2Context::GetQuery(GLenum target, GLenum pname)
|
|||
}
|
||||
|
||||
WebGLRefPtr<WebGLQuery>& targetSlot = GetQuerySlotByTarget(target);
|
||||
|
||||
RefPtr<WebGLQuery> tmp = targetSlot.get();
|
||||
if (tmp && tmp->mType != target) {
|
||||
// Query in slot doesn't match target
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return tmp.forget();
|
||||
}
|
||||
|
||||
|
|
|
@ -1783,12 +1783,6 @@ int64_t MediaDecoderStateMachine::AudioDecodedUsecs()
|
|||
// already decoded and pushed to the hardware, plus the amount of audio
|
||||
// data waiting to be pushed to the hardware.
|
||||
int64_t pushed = mMediaSink->IsStarted() ? (AudioEndTime() - GetMediaTime()) : 0;
|
||||
|
||||
// Currently for real time streams, AudioQueue().Duration() produce
|
||||
// wrong values (Bug 1114434), so we use frame counts to calculate duration.
|
||||
if (IsRealTime()) {
|
||||
return pushed + FramesToUsecs(AudioQueue().FrameCount(), mInfo.mAudio.mRate).value();
|
||||
}
|
||||
return pushed + AudioQueue().Duration();
|
||||
}
|
||||
|
||||
|
|
|
@ -103,6 +103,11 @@ GonkDecoderManager::Flush()
|
|||
GMDD_LOG("Decoder is not initialized");
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
if (!mInitPromise.IsEmpty()) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
{
|
||||
MutexAutoLock lock(mMutex);
|
||||
mQueuedSamples.Clear();
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
<!DOCTYPE html>
|
||||
<html class="reftest-wait">
|
||||
<script>
|
||||
const rate = 44100;
|
||||
var context = new window.OfflineAudioContext(1, 512, rate);
|
||||
var buffer = context.createBuffer(1, 128, rate);
|
||||
var source = context.createBufferSource();
|
||||
source.buffer = buffer;
|
||||
source.start(0, 0, 86400);
|
||||
context.startRendering().
|
||||
then(function() {
|
||||
document.documentElement.removeAttribute("class");
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,16 @@
|
|||
<!DOCTYPE html>
|
||||
<html class="reftest-wait">
|
||||
<script>
|
||||
const rate = 44101; // not divisible by 2
|
||||
var context = new window.OfflineAudioContext(1, 512, rate);
|
||||
var buffer = context.createBuffer(1, 128, rate);
|
||||
buffer.getChannelData(0)[0] = 1.0;
|
||||
var source = context.createBufferSource();
|
||||
source.buffer = buffer;
|
||||
source.playbackRate.value = rate / (Math.pow(2, 30) * 1.0000001);
|
||||
source.start(512 / rate);
|
||||
context.startRendering().
|
||||
then(function() {
|
||||
document.documentElement.removeAttribute("class");
|
||||
});
|
||||
</script>
|
|
@ -83,7 +83,9 @@ load 1185176.html
|
|||
load 1185192.html
|
||||
load analyser-channels-1.html
|
||||
load audiocontext-double-suspend.html
|
||||
load buffer-source-duration-1.html
|
||||
load buffer-source-ended-1.html
|
||||
load buffer-source-resampling-start-1.html
|
||||
load doppler-1.html
|
||||
HTTP load media-element-source-seek-1.html
|
||||
load offline-buffer-source-ended-1.html
|
||||
|
|
|
@ -97,7 +97,7 @@ public:
|
|||
switch (aIndex) {
|
||||
case AudioBufferSourceNode::START:
|
||||
MOZ_ASSERT(!mStart, "Another START?");
|
||||
mStart = mDestination->SecondsToNearestStreamTime(aParam);
|
||||
mStart = aParam * mDestination->SampleRate();
|
||||
// Round to nearest
|
||||
mBeginProcessing = mStart + 0.5;
|
||||
break;
|
||||
|
@ -265,15 +265,18 @@ public:
|
|||
// buffer, but correct for input latency. If starting before mStart,
|
||||
// then align the resampler so that the time corresponding to the
|
||||
// first input sample is mStart.
|
||||
uint32_t skipFracNum = inputLatency * ratioDen;
|
||||
int64_t skipFracNum = static_cast<int64_t>(inputLatency) * ratioDen;
|
||||
double leadTicks = mStart - *aCurrentPosition;
|
||||
if (leadTicks > 0.0) {
|
||||
// Round to nearest output subsample supported by the resampler at
|
||||
// these rates.
|
||||
skipFracNum -= leadTicks * ratioNum + 0.5;
|
||||
MOZ_ASSERT(skipFracNum < INT32_MAX, "mBeginProcessing is wrong?");
|
||||
int64_t leadSubsamples = leadTicks * ratioNum + 0.5;
|
||||
MOZ_ASSERT(leadSubsamples <= skipFracNum,
|
||||
"mBeginProcessing is wrong?");
|
||||
skipFracNum -= leadSubsamples;
|
||||
}
|
||||
speex_resampler_set_skip_frac_num(resampler, skipFracNum);
|
||||
speex_resampler_set_skip_frac_num(resampler,
|
||||
std::min<int64_t>(skipFracNum, UINT32_MAX));
|
||||
|
||||
mBeginProcessing = -STREAM_TIME_MAX;
|
||||
}
|
||||
|
|
|
@ -169,6 +169,7 @@ skip-if = (toolkit == 'gonk' && !debug) || android_version == '10' || android_ve
|
|||
[test_scriptProcessorNode_playbackTime1.html]
|
||||
[test_scriptProcessorNodeZeroInputOutput.html]
|
||||
[test_scriptProcessorNodeNotConnected.html]
|
||||
[test_sequentialBufferSourceWithResampling.html]
|
||||
[test_singleSourceDest.html]
|
||||
[test_stereoPanningWithGain.html]
|
||||
[test_waveDecoder.html]
|
||||
|
|
|
@ -0,0 +1,72 @@
|
|||
<!DOCTYPE html>
|
||||
<title>Test seamless playback of a series of resampled buffers</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script>
|
||||
// Permitting some accumulation of rounding to int16_t.
|
||||
// 64/2^15 would be only just small enough to detect off-by-one-subsample
|
||||
// scheduling errors with the frequencies here.
|
||||
const EPSILON = 4.0 / Math.pow(2, 15);
|
||||
// Offsets test for rounding to nearest rather than up or down.
|
||||
const OFFSETS = [EPSILON, 1.0 - EPSILON];
|
||||
// The ratio of resampling is 147:160, so 256 start points is enough to cover
|
||||
// every fractional offset.
|
||||
const LENGTH = 256;
|
||||
|
||||
function do_test(context_rate, buffer_rate, start_offset) {
|
||||
|
||||
var context =
|
||||
new OfflineAudioContext(2, LENGTH, context_rate);
|
||||
|
||||
var merger = context.createChannelMerger(context.destination.channelCount);
|
||||
merger.connect(context.destination);
|
||||
|
||||
// Create an audio signal that will be repeated
|
||||
var repeating_signal = context.createBuffer(1, 1, buffer_rate);
|
||||
repeating_signal.getChannelData(0)[0] = 0.5;
|
||||
|
||||
// Schedule a series of nodes to repeat the signal.
|
||||
for (var i = 0; i < LENGTH; ++i) {
|
||||
var source = context.createBufferSource();
|
||||
source.buffer = repeating_signal;
|
||||
source.connect(merger, 0, 0);
|
||||
source.start((i + start_offset) / buffer_rate);
|
||||
}
|
||||
|
||||
// A single long signal should produce the same result.
|
||||
var long_signal = context.createBuffer(1, LENGTH, buffer_rate);
|
||||
var c = long_signal.getChannelData(0);
|
||||
for (var i = 0; i < c.length; ++i) {
|
||||
c[i] = 0.5;
|
||||
}
|
||||
|
||||
var source = context.createBufferSource();
|
||||
source.buffer = long_signal;
|
||||
source.connect(merger, 0, 1);
|
||||
source.start(start_offset / buffer_rate);
|
||||
|
||||
return context.startRendering().
|
||||
then((buffer) => {
|
||||
series_output = buffer.getChannelData(0);
|
||||
expected = buffer.getChannelData(1);
|
||||
|
||||
for (var i = 0; i < buffer.length; ++i) {
|
||||
assert_approx_equals(series_output[i], expected[i], EPSILON,
|
||||
"series output at " + i);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function start_tests(context_rate, buffer_rate) {
|
||||
OFFSETS.forEach((start_offset) => {
|
||||
promise_test(() => do_test(context_rate, buffer_rate, start_offset),
|
||||
"" + context_rate + " context, "
|
||||
+ buffer_rate + " buffer, "
|
||||
+ start_offset + " start");
|
||||
});
|
||||
}
|
||||
|
||||
start_tests(48000, 44100);
|
||||
start_tests(44100, 48000);
|
||||
|
||||
</script>
|
|
@ -198,6 +198,7 @@ nsCookiePermission::CanSetCookie(nsIURI *aURI,
|
|||
switch (perm) {
|
||||
case nsICookiePermission::ACCESS_SESSION:
|
||||
*aIsSession = true;
|
||||
MOZ_FALLTHROUGH;
|
||||
|
||||
case nsICookiePermission::ACCESS_ALLOW:
|
||||
*aResult = true;
|
||||
|
|
|
@ -910,6 +910,7 @@ nsPermissionManager::InitDB(bool aRemoveFile)
|
|||
}
|
||||
|
||||
// fall through to the next upgrade
|
||||
MOZ_FALLTHROUGH;
|
||||
|
||||
// TODO: we want to make default version as version 2 in order to fix bug 784875.
|
||||
case 0:
|
||||
|
@ -929,6 +930,7 @@ nsPermissionManager::InitDB(bool aRemoveFile)
|
|||
}
|
||||
|
||||
// fall through to the next upgrade
|
||||
MOZ_FALLTHROUGH;
|
||||
|
||||
// Version 3->4 is the creation of the modificationTime field.
|
||||
case 3:
|
||||
|
@ -946,6 +948,7 @@ nsPermissionManager::InitDB(bool aRemoveFile)
|
|||
}
|
||||
|
||||
// fall through to the next upgrade
|
||||
MOZ_FALLTHROUGH;
|
||||
|
||||
// In version 5, host appId, and isInBrowserElement were merged into a
|
||||
// single origin entry
|
||||
|
@ -1031,6 +1034,7 @@ nsPermissionManager::InitDB(bool aRemoveFile)
|
|||
}
|
||||
|
||||
// fall through to the next upgrade
|
||||
MOZ_FALLTHROUGH;
|
||||
|
||||
// At this point, the version 5 table has been migrated to a version 6 table
|
||||
// We are guaranteed to have at least one of moz_hosts and moz_perms. If
|
||||
|
@ -1228,6 +1232,7 @@ nsPermissionManager::InitDB(bool aRemoveFile)
|
|||
}
|
||||
|
||||
// fall through to the next upgrade
|
||||
MOZ_FALLTHROUGH;
|
||||
|
||||
// The version 7-8 migration is the re-migration of localhost and ip-address
|
||||
// entries due to errors in the previous version 7 migration which caused
|
||||
|
@ -1329,6 +1334,7 @@ nsPermissionManager::InitDB(bool aRemoveFile)
|
|||
}
|
||||
|
||||
// fall through to the next upgrade
|
||||
MOZ_FALLTHROUGH;
|
||||
|
||||
// The version 8-9 migration removes the unnecessary backup moz-hosts database contents.
|
||||
// as the data no longer needs to be migrated
|
||||
|
@ -1355,6 +1361,9 @@ nsPermissionManager::InitDB(bool aRemoveFile)
|
|||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
|
||||
// fall through to the next upgrade
|
||||
MOZ_FALLTHROUGH;
|
||||
|
||||
// current version.
|
||||
case HOSTS_SCHEMA_VERSION:
|
||||
break;
|
||||
|
|
|
@ -389,8 +389,10 @@ GLBlitHelper::InitTexQuadProgram(BlitType target)
|
|||
GLint texUnitLoc = mGL->fGetUniformLocation(program, "uTexUnit");
|
||||
MOZ_ASSERT(texUnitLoc != -1, "uniform uTexUnit not found");
|
||||
mGL->fUniform1i(texUnitLoc, 0);
|
||||
break;
|
||||
#else
|
||||
MOZ_ASSERT_UNREACHABLE("gralloc not support on non-android");
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
case ConvertPlanarYCbCr: {
|
||||
GLint texY = mGL->fGetUniformLocation(program, "uYTexture");
|
||||
|
|
|
@ -1431,10 +1431,11 @@ GLContext::InitWithPrefix(const char *prefix, bool trygl)
|
|||
}
|
||||
|
||||
if (IsSupported(GLFeature::uniform_buffer_object)) {
|
||||
// Note: Don't query for glGetActiveUniformName because it is not
|
||||
// supported by GL ES 3.
|
||||
SymLoadStruct uboSymbols[] = {
|
||||
{ (PRFuncPtr*) &mSymbols.fGetUniformIndices, { "GetUniformIndices", nullptr } },
|
||||
{ (PRFuncPtr*) &mSymbols.fGetActiveUniformsiv, { "GetActiveUniformsiv", nullptr } },
|
||||
{ (PRFuncPtr*) &mSymbols.fGetActiveUniformName, { "GetActiveUniformName", nullptr } },
|
||||
{ (PRFuncPtr*) &mSymbols.fGetUniformBlockIndex, { "GetUniformBlockIndex", nullptr } },
|
||||
{ (PRFuncPtr*) &mSymbols.fGetActiveUniformBlockiv, { "GetActiveUniformBlockiv", nullptr } },
|
||||
{ (PRFuncPtr*) &mSymbols.fGetActiveUniformBlockName, { "GetActiveUniformBlockName", nullptr } },
|
||||
|
|
|
@ -3011,15 +3011,6 @@ public:
|
|||
AFTER_GL_CALL;
|
||||
}
|
||||
|
||||
void fGetActiveUniformName(GLuint program, GLuint uniformIndex, GLsizei bufSize,
|
||||
GLsizei* length, GLchar* uniformName)
|
||||
{
|
||||
ASSERT_SYMBOL_PRESENT(fGetActiveUniformName);
|
||||
BEFORE_GL_CALL;
|
||||
mSymbols.fGetActiveUniformName(program, uniformIndex, bufSize, length, uniformName);
|
||||
AFTER_GL_CALL;
|
||||
}
|
||||
|
||||
GLuint fGetUniformBlockIndex(GLuint program, const GLchar* uniformBlockName) {
|
||||
ASSERT_SYMBOL_PRESENT(fGetUniformBlockIndex);
|
||||
BEFORE_GL_CALL;
|
||||
|
|
|
@ -614,8 +614,6 @@ struct GLContextSymbols
|
|||
typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMSIVPROC) (GLuint program, GLsizei uniformCount, const GLuint* uniformIndices,
|
||||
GLenum pname, GLint* params);
|
||||
PFNGLGETACTIVEUNIFORMSIVPROC fGetActiveUniformsiv;
|
||||
typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMNAMEPROC) (GLuint program, GLuint uniformIdex, GLsizei bufSize, GLsizei* length, GLchar* uniformName);
|
||||
PFNGLGETACTIVEUNIFORMNAMEPROC fGetActiveUniformName;
|
||||
typedef GLuint (GLAPIENTRY * PFNGLGETUNIFORMBLOCKINDEXPROC) (GLuint program, const GLchar* uniformBlockName);
|
||||
PFNGLGETUNIFORMBLOCKINDEXPROC fGetUniformBlockIndex;
|
||||
typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMBLOCKIVPROC) (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint* params);
|
||||
|
|
|
@ -979,7 +979,9 @@ SenderHelper::SendLayer(LayerComposite* aLayer,
|
|||
case Layer::TYPE_COLOR: {
|
||||
EffectChain effect;
|
||||
aLayer->GenEffectChain(effect);
|
||||
SenderHelper::SendEffectChain(nullptr, effect, aWidth, aHeight);
|
||||
|
||||
LayerScope::DrawBegin();
|
||||
LayerScope::DrawEnd(nullptr, effect, aWidth, aHeight);
|
||||
break;
|
||||
}
|
||||
case Layer::TYPE_IMAGE:
|
||||
|
@ -995,7 +997,9 @@ SenderHelper::SendLayer(LayerComposite* aLayer,
|
|||
// Generate primary effect (lock and gen)
|
||||
AutoLockCompositableHost lock(compHost);
|
||||
aLayer->GenEffectChain(effect);
|
||||
SenderHelper::SendEffectChain(compOGL->gl(), effect);
|
||||
|
||||
LayerScope::DrawBegin();
|
||||
LayerScope::DrawEnd(compOGL->gl(), effect, aWidth, aHeight);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -1172,6 +1176,12 @@ SenderHelper::SendEffectChain(GLContext* aGLContext,
|
|||
if (!sLayersBufferSendable) return;
|
||||
|
||||
const Effect* primaryEffect = aEffectChain.mPrimaryEffect;
|
||||
MOZ_ASSERT(primaryEffect);
|
||||
|
||||
if (!primaryEffect) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch (primaryEffect->mType) {
|
||||
case EffectTypes::RGB: {
|
||||
const TexturedEffect* texturedEffect =
|
||||
|
|
|
@ -1183,7 +1183,7 @@ nsEventStatus AsyncPanZoomController::OnTouchStart(const MultiTouchInput& aEvent
|
|||
case WHEEL_SCROLL:
|
||||
case PAN_MOMENTUM:
|
||||
CurrentTouchBlock()->GetOverscrollHandoffChain()->CancelAnimations(ExcludeOverscroll);
|
||||
// Fall through.
|
||||
MOZ_FALLTHROUGH;
|
||||
case NOTHING: {
|
||||
mX.StartTouch(point.x, aEvent.mTime);
|
||||
mY.StartTouch(point.y, aEvent.mTime);
|
||||
|
@ -1292,7 +1292,7 @@ nsEventStatus AsyncPanZoomController::OnTouchEnd(const MultiTouchInput& aEvent)
|
|||
case FLING:
|
||||
// Should never happen.
|
||||
NS_WARNING("Received impossible touch end in OnTouchEnd.");
|
||||
// Fall through.
|
||||
MOZ_FALLTHROUGH;
|
||||
case ANIMATING_ZOOM:
|
||||
case SMOOTH_SCROLL:
|
||||
case NOTHING:
|
||||
|
|
|
@ -408,6 +408,7 @@ void GestureEventListener::HandleInputTimeoutLongTap()
|
|||
// just in case MAX_TAP_TIME > ContextMenuDelay cancel MAX_TAP timer
|
||||
// and fall through
|
||||
CancelMaxTapTimeoutTask();
|
||||
MOZ_FALLTHROUGH;
|
||||
case GESTURE_FIRST_SINGLE_TOUCH_MAX_TAP_DOWN: {
|
||||
SetState(GESTURE_LONG_TOUCH_DOWN);
|
||||
mAsyncPanZoomController->HandleGestureEvent(
|
||||
|
|
|
@ -289,10 +289,10 @@ APZEventState::ProcessTouchEvent(const WidgetTouchEvent& aEvent,
|
|||
mTouchEndCancelled = true;
|
||||
mEndTouchIsClick = false;
|
||||
}
|
||||
// fall through
|
||||
MOZ_FALLTHROUGH;
|
||||
case eTouchCancel:
|
||||
mActiveElementManager->HandleTouchEndEvent(mEndTouchIsClick);
|
||||
// fall through
|
||||
MOZ_FALLTHROUGH;
|
||||
case eTouchMove: {
|
||||
if (mPendingTouchPreventedResponse) {
|
||||
MOZ_ASSERT(aGuid == mPendingTouchPreventedGuid);
|
||||
|
@ -427,4 +427,3 @@ APZEventState::GetWidget() const
|
|||
|
||||
} // namespace layers
|
||||
} // namespace mozilla
|
||||
|
||||
|
|
|
@ -69,6 +69,27 @@ TiledContentHost::~TiledContentHost()
|
|||
MOZ_COUNT_DTOR(TiledContentHost);
|
||||
}
|
||||
|
||||
already_AddRefed<TexturedEffect>
|
||||
TiledContentHost::GenEffect(const gfx::Filter& aFilter)
|
||||
{
|
||||
// If we can use hwc for this TiledContentHost, it implies that we have exactly
|
||||
// one high precision tile. Please check TiledContentHost::GetRenderState() for
|
||||
// all condition.
|
||||
MOZ_ASSERT(mTiledBuffer.GetTileCount() == 1 && mLowPrecisionTiledBuffer.GetTileCount() == 0);
|
||||
MOZ_ASSERT(mTiledBuffer.GetTile(0).mTextureHost);
|
||||
|
||||
TileHost& tile = mTiledBuffer.GetTile(0);
|
||||
if (!tile.mTextureHost->BindTextureSource(tile.mTextureSource)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return CreateTexturedEffect(tile.mTextureSource,
|
||||
nullptr,
|
||||
aFilter,
|
||||
true,
|
||||
tile.mTextureHost->GetRenderState());
|
||||
}
|
||||
|
||||
void
|
||||
TiledContentHost::Attach(Layer* aLayer,
|
||||
Compositor* aCompositor,
|
||||
|
|
|
@ -211,6 +211,8 @@ public:
|
|||
return LayerRenderState();
|
||||
}
|
||||
|
||||
// Generate effect for layerscope when using hwc.
|
||||
virtual already_AddRefed<TexturedEffect> GenEffect(const gfx::Filter& aFilter) override;
|
||||
|
||||
virtual bool UpdateThebes(const ThebesBufferData& aData,
|
||||
const nsIntRegion& aUpdated,
|
||||
|
|
|
@ -328,26 +328,26 @@ gfxFontEntry*
|
|||
gfxAndroidPlatform::LookupLocalFont(const nsAString& aFontName,
|
||||
uint16_t aWeight,
|
||||
int16_t aStretch,
|
||||
bool aItalic)
|
||||
uint8_t aStyle)
|
||||
{
|
||||
return gfxPlatformFontList::PlatformFontList()->LookupLocalFont(aFontName,
|
||||
aWeight,
|
||||
aStretch,
|
||||
aItalic);
|
||||
aStyle);
|
||||
}
|
||||
|
||||
gfxFontEntry*
|
||||
gfxAndroidPlatform::MakePlatformFont(const nsAString& aFontName,
|
||||
uint16_t aWeight,
|
||||
int16_t aStretch,
|
||||
bool aItalic,
|
||||
uint8_t aStyle,
|
||||
const uint8_t* aFontData,
|
||||
uint32_t aLength)
|
||||
{
|
||||
return gfxPlatformFontList::PlatformFontList()->MakePlatformFont(aFontName,
|
||||
aWeight,
|
||||
aStretch,
|
||||
aItalic,
|
||||
aStyle,
|
||||
aFontData,
|
||||
aLength);
|
||||
}
|
||||
|
|
|
@ -48,11 +48,11 @@ public:
|
|||
virtual gfxFontEntry* LookupLocalFont(const nsAString& aFontName,
|
||||
uint16_t aWeight,
|
||||
int16_t aStretch,
|
||||
bool aItalic);
|
||||
uint8_t aStyle);
|
||||
virtual gfxFontEntry* MakePlatformFont(const nsAString& aFontName,
|
||||
uint16_t aWeight,
|
||||
int16_t aStretch,
|
||||
bool aItalic,
|
||||
uint8_t aStyle,
|
||||
const uint8_t* aFontData,
|
||||
uint32_t aLength);
|
||||
|
||||
|
|
|
@ -217,7 +217,8 @@ gfxDWriteFontFamily::FindStyleVariations(FontInfoData *aFontInfoData)
|
|||
" with style: %s weight: %d stretch: %d psname: %s fullname: %s",
|
||||
NS_ConvertUTF16toUTF8(fe->Name()).get(),
|
||||
NS_ConvertUTF16toUTF8(Name()).get(),
|
||||
(fe->IsItalic()) ? "italic" : "normal",
|
||||
(fe->IsItalic()) ?
|
||||
"italic" : (fe->IsOblique() ? "oblique" : "normal"),
|
||||
fe->Weight(), fe->Stretch(),
|
||||
NS_ConvertUTF16toUTF8(psname).get(),
|
||||
NS_ConvertUTF16toUTF8(fullname).get()));
|
||||
|
@ -388,7 +389,7 @@ gfxDWriteFontEntry::CopyFontTable(uint32_t aTableTag,
|
|||
// potential cmap discrepancies, see bug 629386.
|
||||
// Ditto for Hebrew, bug 837498.
|
||||
if (mFont && pFontList->UseGDIFontTableAccess() &&
|
||||
!(mItalic && UsingArabicOrHebrewScriptSystemLocale()) &&
|
||||
!(mStyle && UsingArabicOrHebrewScriptSystemLocale()) &&
|
||||
!mFont->IsSymbolFont())
|
||||
{
|
||||
LOGFONTW logfont = { 0 };
|
||||
|
@ -743,7 +744,7 @@ gfxFontEntry *
|
|||
gfxDWriteFontList::LookupLocalFont(const nsAString& aFontName,
|
||||
uint16_t aWeight,
|
||||
int16_t aStretch,
|
||||
bool aItalic)
|
||||
uint8_t aStyle)
|
||||
{
|
||||
gfxFontEntry *lookup;
|
||||
|
||||
|
@ -758,7 +759,7 @@ gfxDWriteFontList::LookupLocalFont(const nsAString& aFontName,
|
|||
dwriteLookup->mFont,
|
||||
aWeight,
|
||||
aStretch,
|
||||
aItalic);
|
||||
aStyle);
|
||||
fe->SetForceGDIClassic(dwriteLookup->GetForceGDIClassic());
|
||||
return fe;
|
||||
}
|
||||
|
@ -767,7 +768,7 @@ gfxFontEntry *
|
|||
gfxDWriteFontList::MakePlatformFont(const nsAString& aFontName,
|
||||
uint16_t aWeight,
|
||||
int16_t aStretch,
|
||||
bool aItalic,
|
||||
uint8_t aStyle,
|
||||
const uint8_t* aFontData,
|
||||
uint32_t aLength)
|
||||
{
|
||||
|
@ -832,7 +833,7 @@ gfxDWriteFontList::MakePlatformFont(const nsAString& aFontName,
|
|||
fontFile,
|
||||
aWeight,
|
||||
aStretch,
|
||||
aItalic);
|
||||
aStyle);
|
||||
|
||||
fontFile->Analyze(&isSupported, &fileType, &entry->mFaceType, &numFaces);
|
||||
if (!isSupported || numFaces > 1) {
|
||||
|
@ -974,7 +975,8 @@ gfxDWriteFontList::InitFontList()
|
|||
" with style: %s weight: %d stretch: %d",
|
||||
NS_ConvertUTF16toUTF8(fe->Name()).get(),
|
||||
NS_ConvertUTF16toUTF8(gillSansMTFamily->Name()).get(),
|
||||
(fe->IsItalic()) ? "italic" : "normal",
|
||||
(fe->IsItalic()) ?
|
||||
"italic" : (fe->IsOblique() ? "oblique" : "normal"),
|
||||
fe->Weight(), fe->Stretch()));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -80,8 +80,11 @@ public:
|
|||
: gfxFontEntry(aFaceName), mFont(aFont), mFontFile(nullptr),
|
||||
mForceGDIClassic(false)
|
||||
{
|
||||
mItalic = (aFont->GetStyle() == DWRITE_FONT_STYLE_ITALIC ||
|
||||
aFont->GetStyle() == DWRITE_FONT_STYLE_OBLIQUE);
|
||||
DWRITE_FONT_STYLE dwriteStyle = aFont->GetStyle();
|
||||
mStyle = (dwriteStyle == DWRITE_FONT_STYLE_ITALIC ?
|
||||
NS_FONT_STYLE_ITALIC :
|
||||
(dwriteStyle == DWRITE_FONT_STYLE_OBLIQUE ?
|
||||
NS_FONT_STYLE_OBLIQUE : NS_FONT_STYLE_NORMAL));
|
||||
mStretch = FontStretchFromDWriteStretch(aFont->GetStretch());
|
||||
uint16_t weight = NS_ROUNDUP(aFont->GetWeight() - 50, 100);
|
||||
|
||||
|
@ -101,19 +104,19 @@ public:
|
|||
* \param aFont DirectWrite font object
|
||||
* \param aWeight Weight of the font
|
||||
* \param aStretch Stretch of the font
|
||||
* \param aItalic True if italic
|
||||
* \param aStyle italic or oblique of font
|
||||
*/
|
||||
gfxDWriteFontEntry(const nsAString& aFaceName,
|
||||
IDWriteFont *aFont,
|
||||
uint16_t aWeight,
|
||||
int16_t aStretch,
|
||||
bool aItalic)
|
||||
uint8_t aStyle)
|
||||
: gfxFontEntry(aFaceName), mFont(aFont), mFontFile(nullptr),
|
||||
mForceGDIClassic(false)
|
||||
{
|
||||
mWeight = aWeight;
|
||||
mStretch = aStretch;
|
||||
mItalic = aItalic;
|
||||
mStyle = aStyle;
|
||||
mIsLocalUserFont = true;
|
||||
mIsCJK = UNINITIALIZED_VALUE;
|
||||
}
|
||||
|
@ -125,19 +128,19 @@ public:
|
|||
* \param aFontFile DirectWrite fontfile object
|
||||
* \param aWeight Weight of the font
|
||||
* \param aStretch Stretch of the font
|
||||
* \param aItalic True if italic
|
||||
* \param aStyle italic or oblique of font
|
||||
*/
|
||||
gfxDWriteFontEntry(const nsAString& aFaceName,
|
||||
IDWriteFontFile *aFontFile,
|
||||
uint16_t aWeight,
|
||||
int16_t aStretch,
|
||||
bool aItalic)
|
||||
uint8_t aStyle)
|
||||
: gfxFontEntry(aFaceName), mFont(nullptr), mFontFile(aFontFile),
|
||||
mForceGDIClassic(false)
|
||||
{
|
||||
mWeight = aWeight;
|
||||
mStretch = aStretch;
|
||||
mItalic = aItalic;
|
||||
mStyle = aStyle;
|
||||
mIsDataUserFont = true;
|
||||
mIsCJK = UNINITIALIZED_VALUE;
|
||||
}
|
||||
|
@ -349,12 +352,12 @@ public:
|
|||
virtual gfxFontEntry* LookupLocalFont(const nsAString& aFontName,
|
||||
uint16_t aWeight,
|
||||
int16_t aStretch,
|
||||
bool aItalic);
|
||||
uint8_t aStyle);
|
||||
|
||||
virtual gfxFontEntry* MakePlatformFont(const nsAString& aFontName,
|
||||
uint16_t aWeight,
|
||||
int16_t aStretch,
|
||||
bool aItalic,
|
||||
uint8_t aStyle,
|
||||
const uint8_t* aFontData,
|
||||
uint32_t aLength);
|
||||
|
||||
|
|
|
@ -85,8 +85,9 @@ gfxDWriteFont::gfxDWriteFont(gfxFontEntry *aFontEntry,
|
|||
static_cast<gfxDWriteFontEntry*>(aFontEntry);
|
||||
nsresult rv;
|
||||
DWRITE_FONT_SIMULATIONS sims = DWRITE_FONT_SIMULATIONS_NONE;
|
||||
if ((GetStyle()->style & (NS_FONT_STYLE_ITALIC | NS_FONT_STYLE_OBLIQUE)) &&
|
||||
!fe->IsItalic() && GetStyle()->allowSyntheticStyle) {
|
||||
if ((GetStyle()->style != NS_FONT_STYLE_NORMAL) &&
|
||||
fe->IsUpright() &&
|
||||
GetStyle()->allowSyntheticStyle) {
|
||||
// For this we always use the font_matrix for uniformity. Not the
|
||||
// DWrite simulation.
|
||||
mNeedsOblique = true;
|
||||
|
|
|
@ -188,9 +188,9 @@ FT2FontEntry::CreateScaledFont(const gfxFontStyle *aStyle)
|
|||
cairo_matrix_init_identity(&identityMatrix);
|
||||
|
||||
// synthetic oblique by skewing via the font matrix
|
||||
bool needsOblique = !IsItalic() &&
|
||||
(aStyle->style & (NS_FONT_STYLE_ITALIC | NS_FONT_STYLE_OBLIQUE)) &&
|
||||
aStyle->allowSyntheticStyle;
|
||||
bool needsOblique = IsUpright() &&
|
||||
aStyle->style != NS_FONT_STYLE_NORMAL &&
|
||||
aStyle->allowSyntheticStyle;
|
||||
|
||||
if (needsOblique) {
|
||||
cairo_matrix_t style;
|
||||
|
@ -251,7 +251,7 @@ FT2FontEntry*
|
|||
FT2FontEntry::CreateFontEntry(const nsAString& aFontName,
|
||||
uint16_t aWeight,
|
||||
int16_t aStretch,
|
||||
bool aItalic,
|
||||
uint8_t aStyle,
|
||||
const uint8_t* aFontData,
|
||||
uint32_t aLength)
|
||||
{
|
||||
|
@ -277,7 +277,7 @@ FT2FontEntry::CreateFontEntry(const nsAString& aFontName,
|
|||
FT2FontEntry::CreateFontEntry(face, nullptr, 0, aFontName,
|
||||
aFontData);
|
||||
if (fe) {
|
||||
fe->mItalic = aItalic;
|
||||
fe->mStyle = aStyle;
|
||||
fe->mWeight = aWeight;
|
||||
fe->mStretch = aStretch;
|
||||
fe->mIsDataUserFont = true;
|
||||
|
@ -323,7 +323,7 @@ FT2FontEntry::CreateFontEntry(const FontListEntry& aFLE)
|
|||
fe->mFTFontIndex = aFLE.index();
|
||||
fe->mWeight = aFLE.weight();
|
||||
fe->mStretch = aFLE.stretch();
|
||||
fe->mItalic = aFLE.italic();
|
||||
fe->mStyle = (aFLE.italic() ? NS_FONT_STYLE_ITALIC : NS_FONT_STYLE_NORMAL);
|
||||
return fe;
|
||||
}
|
||||
|
||||
|
@ -380,7 +380,8 @@ FT2FontEntry::CreateFontEntry(FT_Face aFace,
|
|||
const uint8_t* aFontData)
|
||||
{
|
||||
FT2FontEntry *fe = new FT2FontEntry(aName);
|
||||
fe->mItalic = FTFaceIsItalic(aFace);
|
||||
fe->mStyle = (FTFaceIsItalic(aFace) ?
|
||||
NS_FONT_STYLE_ITALIC : NS_FONT_STYLE_NORMAL);
|
||||
fe->mWeight = FTFaceGetWeight(aFace);
|
||||
fe->mFilename = aFilename;
|
||||
fe->mFTFontIndex = aIndex;
|
||||
|
@ -596,7 +597,7 @@ FT2FontFamily::AddFacesToFontList(InfallibleTArray<FontListEntry>* aFontList,
|
|||
aFontList->AppendElement(FontListEntry(Name(), fe->Name(),
|
||||
fe->mFilename,
|
||||
fe->Weight(), fe->Stretch(),
|
||||
fe->IsItalic(),
|
||||
fe->mStyle,
|
||||
fe->mFTFontIndex,
|
||||
aVisibility == kHidden));
|
||||
}
|
||||
|
@ -1452,7 +1453,7 @@ gfxFontEntry*
|
|||
gfxFT2FontList::LookupLocalFont(const nsAString& aFontName,
|
||||
uint16_t aWeight,
|
||||
int16_t aStretch,
|
||||
bool aItalic)
|
||||
uint8_t aStyle)
|
||||
{
|
||||
// walk over list of names
|
||||
FT2FontEntry* fontEntry = nullptr;
|
||||
|
@ -1509,7 +1510,7 @@ searchDone:
|
|||
fontEntry->mFTFontIndex,
|
||||
fontEntry->Name(), nullptr);
|
||||
if (fe) {
|
||||
fe->mItalic = aItalic;
|
||||
fe->mStyle = aStyle;
|
||||
fe->mWeight = aWeight;
|
||||
fe->mStretch = aStretch;
|
||||
fe->mIsLocalUserFont = true;
|
||||
|
@ -1538,7 +1539,7 @@ gfxFontEntry*
|
|||
gfxFT2FontList::MakePlatformFont(const nsAString& aFontName,
|
||||
uint16_t aWeight,
|
||||
int16_t aStretch,
|
||||
bool aItalic,
|
||||
uint8_t aStyle,
|
||||
const uint8_t* aFontData,
|
||||
uint32_t aLength)
|
||||
{
|
||||
|
@ -1546,7 +1547,7 @@ gfxFT2FontList::MakePlatformFont(const nsAString& aFontName,
|
|||
// but instead pass ownership to the font entry.
|
||||
// Deallocation will happen later, when the font face is destroyed.
|
||||
return FT2FontEntry::CreateFontEntry(aFontName, aWeight, aStretch,
|
||||
aItalic, aFontData, aLength);
|
||||
aStyle, aFontData, aLength);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -42,7 +42,7 @@ public:
|
|||
CreateFontEntry(const nsAString& aFontName,
|
||||
uint16_t aWeight,
|
||||
int16_t aStretch,
|
||||
bool aItalic,
|
||||
uint8_t aStyle,
|
||||
const uint8_t* aFontData,
|
||||
uint32_t aLength);
|
||||
|
||||
|
@ -125,12 +125,12 @@ public:
|
|||
virtual gfxFontEntry* LookupLocalFont(const nsAString& aFontName,
|
||||
uint16_t aWeight,
|
||||
int16_t aStretch,
|
||||
bool aItalic);
|
||||
uint8_t aStyle);
|
||||
|
||||
virtual gfxFontEntry* MakePlatformFont(const nsAString& aFontName,
|
||||
uint16_t aWeight,
|
||||
int16_t aStretch,
|
||||
bool aItalic,
|
||||
uint8_t aStyle,
|
||||
const uint8_t* aFontData,
|
||||
uint32_t aLength);
|
||||
|
||||
|
|
|
@ -256,8 +256,10 @@ gfxFontconfigFontEntry::gfxFontconfigFontEntry(const nsAString& aFaceName,
|
|||
if (FcPatternGetInteger(aFontPattern, FC_SLANT, 0, &slant) != FcResultMatch) {
|
||||
slant = FC_SLANT_ROMAN;
|
||||
}
|
||||
if (slant > 0) {
|
||||
mItalic = true;
|
||||
if (slant == FC_SLANT_OBLIQUE) {
|
||||
mStyle = NS_FONT_STYLE_OBLIQUE;
|
||||
} else if (slant > 0) {
|
||||
mStyle = NS_FONT_STYLE_ITALIC;
|
||||
}
|
||||
|
||||
// weight
|
||||
|
@ -278,7 +280,7 @@ gfxFontconfigFontEntry::gfxFontconfigFontEntry(const nsAString& aFaceName,
|
|||
gfxFontconfigFontEntry::gfxFontconfigFontEntry(const nsAString& aFaceName,
|
||||
uint16_t aWeight,
|
||||
int16_t aStretch,
|
||||
bool aItalic,
|
||||
uint8_t aStyle,
|
||||
const uint8_t *aData,
|
||||
FT_Face aFace)
|
||||
: gfxFontEntry(aFaceName),
|
||||
|
@ -286,7 +288,7 @@ gfxFontconfigFontEntry::gfxFontconfigFontEntry(const nsAString& aFaceName,
|
|||
mAspect(0.0), mFontData(aData)
|
||||
{
|
||||
mWeight = aWeight;
|
||||
mItalic = aItalic;
|
||||
mStyle = aStyle;
|
||||
mStretch = aStretch;
|
||||
mIsDataUserFont = true;
|
||||
|
||||
|
@ -319,13 +321,13 @@ gfxFontconfigFontEntry::gfxFontconfigFontEntry(const nsAString& aFaceName,
|
|||
FcPattern* aFontPattern,
|
||||
uint16_t aWeight,
|
||||
int16_t aStretch,
|
||||
bool aItalic)
|
||||
uint8_t aStyle)
|
||||
: gfxFontEntry(aFaceName), mFontPattern(aFontPattern),
|
||||
mFTFace(nullptr), mFTFaceInitialized(false),
|
||||
mAspect(0.0), mFontData(nullptr)
|
||||
{
|
||||
mWeight = aWeight;
|
||||
mItalic = aItalic;
|
||||
mStyle = aStyle;
|
||||
mStretch = aStretch;
|
||||
mIsLocalUserFont = true;
|
||||
}
|
||||
|
@ -670,9 +672,9 @@ gfxFontconfigFontEntry::CreateScaledFont(FcPattern* aRenderPattern,
|
|||
}
|
||||
|
||||
// synthetic oblique by skewing via the font matrix
|
||||
bool needsOblique = !IsItalic() &&
|
||||
(aStyle->style & (NS_FONT_STYLE_ITALIC | NS_FONT_STYLE_OBLIQUE)) &&
|
||||
aStyle->allowSyntheticStyle;
|
||||
bool needsOblique = IsUpright() &&
|
||||
aStyle->style != NS_FONT_STYLE_NORMAL &&
|
||||
aStyle->allowSyntheticStyle;
|
||||
|
||||
if (needsOblique) {
|
||||
// disable embedded bitmaps (mimics behavior in 90-synthetic.conf)
|
||||
|
@ -863,7 +865,8 @@ gfxFontconfigFontFamily::FindStyleVariations(FontInfoData *aFontInfoData)
|
|||
" psname: %s fullname: %s",
|
||||
NS_ConvertUTF16toUTF8(fontEntry->Name()).get(),
|
||||
NS_ConvertUTF16toUTF8(Name()).get(),
|
||||
fontEntry->IsItalic() ? "italic" : "normal",
|
||||
(fontEntry->IsItalic()) ?
|
||||
"italic" : (fontEntry->IsOblique() ? "oblique" : "normal"),
|
||||
fontEntry->Weight(), fontEntry->Stretch(),
|
||||
NS_ConvertUTF16toUTF8(psname).get(),
|
||||
NS_ConvertUTF16toUTF8(fullname).get()));
|
||||
|
@ -1172,7 +1175,7 @@ gfxFontEntry*
|
|||
gfxFcPlatformFontList::LookupLocalFont(const nsAString& aFontName,
|
||||
uint16_t aWeight,
|
||||
int16_t aStretch,
|
||||
bool aItalic)
|
||||
uint8_t aStyle)
|
||||
{
|
||||
nsAutoString keyName(aFontName);
|
||||
ToLowerCase(keyName);
|
||||
|
@ -1185,14 +1188,14 @@ gfxFcPlatformFontList::LookupLocalFont(const nsAString& aFontName,
|
|||
|
||||
return new gfxFontconfigFontEntry(aFontName,
|
||||
fontPattern,
|
||||
aWeight, aStretch, aItalic);
|
||||
aWeight, aStretch, aStyle);
|
||||
}
|
||||
|
||||
gfxFontEntry*
|
||||
gfxFcPlatformFontList::MakePlatformFont(const nsAString& aFontName,
|
||||
uint16_t aWeight,
|
||||
int16_t aStretch,
|
||||
bool aItalic,
|
||||
uint8_t aStyle,
|
||||
const uint8_t* aFontData,
|
||||
uint32_t aLength)
|
||||
{
|
||||
|
@ -1210,8 +1213,8 @@ gfxFcPlatformFontList::MakePlatformFont(const nsAString& aFontName,
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
return new gfxFontconfigFontEntry(aFontName, aWeight, aStretch, aItalic,
|
||||
aFontData, face);
|
||||
return new gfxFontconfigFontEntry(aFontName, aWeight, aStretch,
|
||||
aStyle, aFontData, face);
|
||||
}
|
||||
|
||||
gfxFontFamily*
|
||||
|
|
|
@ -99,7 +99,7 @@ public:
|
|||
explicit gfxFontconfigFontEntry(const nsAString& aFaceName,
|
||||
uint16_t aWeight,
|
||||
int16_t aStretch,
|
||||
bool aItalic,
|
||||
uint8_t aStyle,
|
||||
const uint8_t *aData,
|
||||
FT_Face aFace);
|
||||
|
||||
|
@ -108,7 +108,7 @@ public:
|
|||
FcPattern* aFontPattern,
|
||||
uint16_t aWeight,
|
||||
int16_t aStretch,
|
||||
bool aItalic);
|
||||
uint8_t aStyle);
|
||||
|
||||
FcPattern* GetPattern() { return mFontPattern; }
|
||||
|
||||
|
@ -209,11 +209,12 @@ public:
|
|||
|
||||
gfxFontEntry*
|
||||
LookupLocalFont(const nsAString& aFontName, uint16_t aWeight,
|
||||
int16_t aStretch, bool aItalic) override;
|
||||
int16_t aStretch, uint8_t aStyle) override;
|
||||
|
||||
gfxFontEntry*
|
||||
MakePlatformFont(const nsAString& aFontName, uint16_t aWeight,
|
||||
int16_t aStretch, bool aItalic,
|
||||
int16_t aStretch,
|
||||
uint8_t aStyle,
|
||||
const uint8_t* aFontData,
|
||||
uint32_t aLength) override;
|
||||
|
||||
|
|
|
@ -2290,7 +2290,9 @@ gfxFont::Measure(gfxTextRun *aTextRun,
|
|||
// If the font may be rendered with a fake-italic effect, we need to allow
|
||||
// for the top-right of the glyphs being skewed to the right, and the
|
||||
// bottom-left being skewed further left.
|
||||
if (mStyle.style != NS_FONT_STYLE_NORMAL && !mFontEntry->IsItalic()) {
|
||||
if (mStyle.style != NS_FONT_STYLE_NORMAL &&
|
||||
mFontEntry->IsUpright() &&
|
||||
mStyle.allowSyntheticStyle) {
|
||||
gfxFloat extendLeftEdge =
|
||||
ceil(OBLIQUE_SKEW_FACTOR * metrics.mBoundingBox.YMost());
|
||||
gfxFloat extendRightEdge =
|
||||
|
|
|
@ -68,7 +68,7 @@ gfxCharacterMap::NotifyReleased()
|
|||
}
|
||||
|
||||
gfxFontEntry::gfxFontEntry() :
|
||||
mItalic(false), mFixedPitch(false),
|
||||
mStyle(NS_FONT_STYLE_NORMAL), mFixedPitch(false),
|
||||
mIsValid(true),
|
||||
mIsBadUnderlineFont(false),
|
||||
mIsUserFontContainer(false),
|
||||
|
@ -108,7 +108,7 @@ gfxFontEntry::gfxFontEntry() :
|
|||
}
|
||||
|
||||
gfxFontEntry::gfxFontEntry(const nsAString& aName, bool aIsStandardFace) :
|
||||
mName(aName), mItalic(false), mFixedPitch(false),
|
||||
mName(aName), mStyle(NS_FONT_STYLE_NORMAL), mFixedPitch(false),
|
||||
mIsValid(true),
|
||||
mIsBadUnderlineFont(false),
|
||||
mIsUserFontContainer(false),
|
||||
|
@ -1155,57 +1155,69 @@ gfxFontFamily::FindFontForStyle(const gfxFontStyle& aFontStyle,
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
static inline uint32_t
|
||||
StyleStretchDistance(gfxFontEntry *aFontEntry, bool aTargetItalic,
|
||||
int16_t aTargetStretch)
|
||||
{
|
||||
// Compute a measure of the "distance" between the requested style
|
||||
// and the given fontEntry,
|
||||
// considering italicness and font-stretch but not weight.
|
||||
#define STYLE_SHIFT 2 // number of bits to contain style distance
|
||||
|
||||
// style distance ==> [0,2]
|
||||
static inline uint32_t
|
||||
StyleDistance(uint32_t aFontStyle, uint32_t aTargetStyle)
|
||||
{
|
||||
if (aFontStyle == aTargetStyle) {
|
||||
return 0; // styles match exactly ==> 0
|
||||
}
|
||||
if (aFontStyle == NS_FONT_STYLE_NORMAL ||
|
||||
aTargetStyle == NS_FONT_STYLE_NORMAL) {
|
||||
return 2; // one is normal (but not the other) ==> 2
|
||||
}
|
||||
return 1; // neither is normal; must be italic vs oblique ==> 1
|
||||
}
|
||||
|
||||
#define REVERSE_STRETCH_DISTANCE 5
|
||||
|
||||
// stretch distance ==> [0,13]
|
||||
static inline uint32_t
|
||||
StretchDistance(int16_t aFontStretch, int16_t aTargetStretch)
|
||||
{
|
||||
int32_t distance = 0;
|
||||
if (aTargetStretch != aFontEntry->mStretch) {
|
||||
if (aTargetStretch != aFontStretch) {
|
||||
// stretch values are in the range -4 .. +4
|
||||
// if aTargetStretch is positive, we prefer more-positive values;
|
||||
// if zero or negative, prefer more-negative
|
||||
if (aTargetStretch > 0) {
|
||||
distance = (aFontEntry->mStretch - aTargetStretch) * 2;
|
||||
distance = (aFontStretch - aTargetStretch);
|
||||
} else {
|
||||
distance = (aTargetStretch - aFontEntry->mStretch) * 2;
|
||||
distance = (aTargetStretch - aFontStretch);
|
||||
}
|
||||
// if the computed "distance" here is negative, it means that
|
||||
// aFontEntry lies in the "non-preferred" direction from aTargetStretch,
|
||||
// so we treat that as larger than any preferred-direction distance
|
||||
// (max possible is 8) by adding an extra 10 to the absolute value
|
||||
// (max possible is 4) by adding an extra 5 to the absolute value
|
||||
if (distance < 0) {
|
||||
distance = -distance + 10;
|
||||
distance = -distance + REVERSE_STRETCH_DISTANCE;
|
||||
}
|
||||
}
|
||||
if (aFontEntry->IsItalic() != aTargetItalic) {
|
||||
distance += 1;
|
||||
}
|
||||
return uint32_t(distance);
|
||||
}
|
||||
|
||||
#define NON_DESIRED_DIRECTION_DISTANCE 1000
|
||||
#define MAX_WEIGHT_DISTANCE 2000
|
||||
|
||||
// CSS currently limits font weights to multiples of 100 but the weight
|
||||
// matching code below does not assume this.
|
||||
//
|
||||
// Calculate weight values with range (0..1000). In general, heavier weights
|
||||
// match towards even heavier weights while lighter weights match towards even
|
||||
// lighter weights. Target weight values in the range [400..500] are special,
|
||||
// since they will first match up to 500, then down to 0, then up again
|
||||
// towards 999.
|
||||
// Calculate weight distance with values in the range (0..1000). In general,
|
||||
// heavier weights match towards even heavier weights while lighter weights
|
||||
// match towards even lighter weights. Target weight values in the range
|
||||
// [400..500] are special, since they will first match up to 500, then down
|
||||
// towards 0, then up again towards 999.
|
||||
//
|
||||
// Example: with target 600 and font weight 800, distance will be 200. With
|
||||
// target 300 and font weight 600, distance will be 1300, since heavier weights
|
||||
// are farther away than lighter weights. If the target is 5 and the font weight
|
||||
// 995, the distance would be 1990 for the same reason.
|
||||
// target 300 and font weight 600, distance will be 900, since heavier
|
||||
// weights are farther away than lighter weights. If the target is 5 and the
|
||||
// font weight 995, the distance would be 1590 for the same reason.
|
||||
|
||||
#define REVERSE_WEIGHT_DISTANCE 600
|
||||
#define WEIGHT_SHIFT 11 // number of bits to contain weight distance
|
||||
|
||||
// weight distance ==> [0,1598]
|
||||
static inline uint32_t
|
||||
WeightDistance(uint32_t aTargetWeight, uint32_t aFontWeight)
|
||||
WeightDistance(uint32_t aFontWeight, uint32_t aTargetWeight)
|
||||
{
|
||||
// Compute a measure of the "distance" between the requested
|
||||
// weight and the given fontEntry
|
||||
|
@ -1235,13 +1247,34 @@ WeightDistance(uint32_t aTargetWeight, uint32_t aFontWeight)
|
|||
}
|
||||
}
|
||||
if (distance < 0) {
|
||||
distance = -distance + NON_DESIRED_DIRECTION_DISTANCE;
|
||||
distance = -distance + REVERSE_WEIGHT_DISTANCE;
|
||||
}
|
||||
distance += addedDistance;
|
||||
}
|
||||
return uint32_t(distance);
|
||||
}
|
||||
|
||||
#define MAX_DISTANCE 0xffffffff
|
||||
|
||||
static inline uint32_t
|
||||
WeightStyleStretchDistance(gfxFontEntry* aFontEntry,
|
||||
const gfxFontStyle& aTargetStyle)
|
||||
{
|
||||
// weight/style/stretch priority: stretch >> style >> weight
|
||||
uint32_t stretchDist =
|
||||
StretchDistance(aFontEntry->mStretch, aTargetStyle.stretch);
|
||||
uint32_t styleDist = StyleDistance(aFontEntry->mStyle, aTargetStyle.style);
|
||||
uint32_t weightDist =
|
||||
WeightDistance(aFontEntry->Weight(), aTargetStyle.weight);
|
||||
|
||||
NS_ASSERTION(weightDist < (1 << WEIGHT_SHIFT), "weight value out of bounds");
|
||||
NS_ASSERTION(styleDist < (1 << STYLE_SHIFT), "slope value out of bounds");
|
||||
|
||||
return (stretchDist << (STYLE_SHIFT + WEIGHT_SHIFT)) |
|
||||
(styleDist << WEIGHT_SHIFT) |
|
||||
weightDist;
|
||||
}
|
||||
|
||||
void
|
||||
gfxFontFamily::FindAllFontsForStyle(const gfxFontStyle& aFontStyle,
|
||||
nsTArray<gfxFontEntry*>& aFontEntryList,
|
||||
|
@ -1271,9 +1304,6 @@ gfxFontFamily::FindAllFontsForStyle(const gfxFontStyle& aFontStyle,
|
|||
return;
|
||||
}
|
||||
|
||||
bool wantItalic = (aFontStyle.style &
|
||||
(NS_FONT_STYLE_ITALIC | NS_FONT_STYLE_OBLIQUE)) != 0;
|
||||
|
||||
// Most families are "simple", having just Regular/Bold/Italic/BoldItalic,
|
||||
// or some subset of these. In this case, we have exactly 4 entries in mAvailableFonts,
|
||||
// stored in the above order; note that some of the entries may be nullptr.
|
||||
|
@ -1285,6 +1315,7 @@ gfxFontFamily::FindAllFontsForStyle(const gfxFontStyle& aFontStyle,
|
|||
// Family has no more than the "standard" 4 faces, at fixed indexes;
|
||||
// calculate which one we want.
|
||||
// Note that we cannot simply return it as not all 4 faces are necessarily present.
|
||||
bool wantItalic = (aFontStyle.style != NS_FONT_STYLE_NORMAL);
|
||||
uint8_t faceIndex = (wantItalic ? kItalicMask : 0) |
|
||||
(wantBold ? kBoldMask : 0);
|
||||
|
||||
|
@ -1332,16 +1363,14 @@ gfxFontFamily::FindAllFontsForStyle(const gfxFontStyle& aFontStyle,
|
|||
// weight/style/stretch combination, only the last matched font entry will
|
||||
// be added.
|
||||
|
||||
uint32_t minDistance = 0xffffffff;
|
||||
uint32_t minDistance = MAX_DISTANCE;
|
||||
gfxFontEntry* matched = nullptr;
|
||||
// iterate in forward order so that faces like 'Bold' are matched before
|
||||
// matching style distance faces such as 'Bold Outline' (see bug 1185812)
|
||||
for (uint32_t i = 0; i < count; i++) {
|
||||
fe = mAvailableFonts[i];
|
||||
uint32_t distance =
|
||||
WeightDistance(aFontStyle.weight, fe->Weight()) +
|
||||
(StyleStretchDistance(fe, wantItalic, aFontStyle.stretch) *
|
||||
MAX_WEIGHT_DISTANCE);
|
||||
// weight/style/stretch priority: stretch >> style >> weight
|
||||
uint32_t distance = WeightStyleStretchDistance(fe, aFontStyle);
|
||||
if (distance < minDistance) {
|
||||
matched = fe;
|
||||
if (!aFontEntryList.IsEmpty()) {
|
||||
|
@ -1391,8 +1420,9 @@ gfxFontFamily::CheckForSimpleFamily()
|
|||
gfxFontEntry *faces[4] = { 0 };
|
||||
for (uint8_t i = 0; i < count; ++i) {
|
||||
gfxFontEntry *fe = mAvailableFonts[i];
|
||||
if (fe->Stretch() != firstStretch) {
|
||||
return; // font-stretch doesn't match, don't treat as simple family
|
||||
if (fe->Stretch() != firstStretch || fe->IsOblique()) {
|
||||
// simple families don't have varying font-stretch or oblique
|
||||
return;
|
||||
}
|
||||
uint8_t faceIndex = (fe->IsItalic() ? kItalicMask : 0) |
|
||||
(fe->Weight() >= 600 ? kBoldMask : 0);
|
||||
|
@ -1448,9 +1478,8 @@ CalcStyleMatch(gfxFontEntry *aFontEntry, const gfxFontStyle *aStyle)
|
|||
int32_t rank = 0;
|
||||
if (aStyle) {
|
||||
// italics
|
||||
bool wantItalic =
|
||||
(aStyle->style & (NS_FONT_STYLE_ITALIC | NS_FONT_STYLE_OBLIQUE)) != 0;
|
||||
if (aFontEntry->IsItalic() == wantItalic) {
|
||||
bool wantUpright = (aStyle->style == NS_FONT_STYLE_NORMAL);
|
||||
if (aFontEntry->IsUpright() == wantUpright) {
|
||||
rank += 10;
|
||||
}
|
||||
|
||||
|
@ -1458,7 +1487,7 @@ CalcStyleMatch(gfxFontEntry *aFontEntry, const gfxFontStyle *aStyle)
|
|||
rank += 9 - DeprecatedAbs(aFontEntry->Weight() / 100 - aStyle->ComputeWeight());
|
||||
} else {
|
||||
// if no font to match, prefer non-bold, non-italic fonts
|
||||
if (!aFontEntry->IsItalic()) {
|
||||
if (aFontEntry->IsUpright()) {
|
||||
rank += 3;
|
||||
}
|
||||
if (!aFontEntry->IsBold()) {
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
#include "gfxTypes.h"
|
||||
#include "nsString.h"
|
||||
#include "gfxFontConstants.h"
|
||||
#include "gfxFontFeatures.h"
|
||||
#include "gfxFontUtils.h"
|
||||
#include "nsTArray.h"
|
||||
|
@ -121,7 +122,9 @@ public:
|
|||
bool IsUserFont() const { return mIsDataUserFont || mIsLocalUserFont; }
|
||||
bool IsLocalUserFont() const { return mIsLocalUserFont; }
|
||||
bool IsFixedPitch() const { return mFixedPitch; }
|
||||
bool IsItalic() const { return mItalic; }
|
||||
bool IsItalic() const { return mStyle == NS_FONT_STYLE_ITALIC; }
|
||||
bool IsOblique() const { return mStyle == NS_FONT_STYLE_OBLIQUE; }
|
||||
bool IsUpright() const { return mStyle == NS_FONT_STYLE_NORMAL; }
|
||||
bool IsBold() const { return mWeight >= 600; } // bold == weights 600 and above
|
||||
bool IgnoreGDEF() const { return mIgnoreGDEF; }
|
||||
bool IgnoreGSUB() const { return mIgnoreGSUB; }
|
||||
|
@ -388,7 +391,7 @@ public:
|
|||
nsString mName;
|
||||
nsString mFamilyName;
|
||||
|
||||
bool mItalic : 1;
|
||||
uint8_t mStyle : 2; // italic/oblique
|
||||
bool mFixedPitch : 1;
|
||||
bool mIsValid : 1;
|
||||
bool mIsBadUnderlineFont : 1;
|
||||
|
|
|
@ -335,10 +335,10 @@ protected:
|
|||
explicit gfxUserFcFontEntry(const nsAString& aFontName,
|
||||
uint16_t aWeight,
|
||||
int16_t aStretch,
|
||||
bool aItalic)
|
||||
uint8_t aStyle)
|
||||
: gfxFcFontEntry(aFontName)
|
||||
{
|
||||
mItalic = aItalic;
|
||||
mStyle = aStyle;
|
||||
mWeight = aWeight;
|
||||
mStretch = aStretch;
|
||||
}
|
||||
|
@ -421,9 +421,9 @@ public:
|
|||
gfxLocalFcFontEntry(const nsAString& aFontName,
|
||||
uint16_t aWeight,
|
||||
int16_t aStretch,
|
||||
bool aItalic,
|
||||
uint8_t aStyle,
|
||||
const nsTArray< nsCountedRef<FcPattern> >& aPatterns)
|
||||
: gfxUserFcFontEntry(aFontName, aWeight, aStretch, aItalic)
|
||||
: gfxUserFcFontEntry(aFontName, aWeight, aStretch, aStyle)
|
||||
{
|
||||
if (!mPatterns.SetCapacity(aPatterns.Length(), fallible))
|
||||
return; // OOM
|
||||
|
@ -458,9 +458,9 @@ public:
|
|||
gfxDownloadedFcFontEntry(const nsAString& aFontName,
|
||||
uint16_t aWeight,
|
||||
int16_t aStretch,
|
||||
bool aItalic,
|
||||
uint8_t aStyle,
|
||||
const uint8_t *aData, FT_Face aFace)
|
||||
: gfxUserFcFontEntry(aFontName, aWeight, aStretch, aItalic),
|
||||
: gfxUserFcFontEntry(aFontName, aWeight, aStretch, aStyle),
|
||||
mFontData(aData), mFace(aFace)
|
||||
{
|
||||
NS_PRECONDITION(aFace != nullptr, "aFace is NULL!");
|
||||
|
@ -1748,7 +1748,7 @@ gfxPangoFontGroup::Shutdown()
|
|||
gfxPangoFontGroup::NewFontEntry(const nsAString& aFontName,
|
||||
uint16_t aWeight,
|
||||
int16_t aStretch,
|
||||
bool aItalic)
|
||||
uint8_t aStyle)
|
||||
{
|
||||
gfxFontconfigUtils *utils = gfxFontconfigUtils::GetFontconfigUtils();
|
||||
if (!utils)
|
||||
|
@ -1791,7 +1791,7 @@ gfxPangoFontGroup::NewFontEntry(const nsAString& aFontName,
|
|||
return new gfxLocalFcFontEntry(aFontName,
|
||||
aWeight,
|
||||
aStretch,
|
||||
aItalic,
|
||||
aStyle,
|
||||
fonts);
|
||||
}
|
||||
|
||||
|
@ -1833,7 +1833,7 @@ gfxPangoFontGroup::GetFTLibrary()
|
|||
gfxPangoFontGroup::NewFontEntry(const nsAString& aFontName,
|
||||
uint16_t aWeight,
|
||||
int16_t aStretch,
|
||||
bool aItalic,
|
||||
uint8_t aStyle,
|
||||
const uint8_t* aFontData,
|
||||
uint32_t aLength)
|
||||
{
|
||||
|
@ -1851,7 +1851,7 @@ gfxPangoFontGroup::NewFontEntry(const nsAString& aFontName,
|
|||
}
|
||||
|
||||
return new gfxDownloadedFcFontEntry(aFontName, aWeight,
|
||||
aStretch, aItalic,
|
||||
aStretch, aStyle,
|
||||
aFontData, face);
|
||||
}
|
||||
|
||||
|
|
|
@ -45,12 +45,12 @@ public:
|
|||
static gfxFontEntry *NewFontEntry(const nsAString& aFontName,
|
||||
uint16_t aWeight,
|
||||
int16_t aStretch,
|
||||
bool aItalic);
|
||||
uint8_t aStyle);
|
||||
// Used for @font-face { src: url(); }
|
||||
static gfxFontEntry *NewFontEntry(const nsAString& aFontName,
|
||||
uint16_t aWeight,
|
||||
int16_t aStretch,
|
||||
bool aItalic,
|
||||
uint8_t aStyle,
|
||||
const uint8_t* aFontData,
|
||||
uint32_t aLength);
|
||||
|
||||
|
|
|
@ -177,9 +177,8 @@ gfxGDIFont::Initialize()
|
|||
|
||||
// Figure out if we want to do synthetic oblique styling.
|
||||
GDIFontEntry* fe = static_cast<GDIFontEntry*>(GetFontEntry());
|
||||
bool wantFakeItalic =
|
||||
(mStyle.style & (NS_FONT_STYLE_ITALIC | NS_FONT_STYLE_OBLIQUE)) &&
|
||||
!fe->IsItalic() && mStyle.allowSyntheticStyle;
|
||||
bool wantFakeItalic = mStyle.style != NS_FONT_STYLE_NORMAL &&
|
||||
fe->IsUpright() && mStyle.allowSyntheticStyle;
|
||||
|
||||
// If the font's family has an actual italic face (but font matching
|
||||
// didn't choose it), we have to use a cairo transform instead of asking
|
||||
|
|
|
@ -118,7 +118,8 @@ FontTypeToOutPrecision(uint8_t fontType)
|
|||
|
||||
GDIFontEntry::GDIFontEntry(const nsAString& aFaceName,
|
||||
gfxWindowsFontType aFontType,
|
||||
bool aItalic, uint16_t aWeight, int16_t aStretch,
|
||||
uint8_t aStyle, uint16_t aWeight,
|
||||
int16_t aStretch,
|
||||
gfxUserFontData *aUserFontData,
|
||||
bool aFamilyHasItalicFace)
|
||||
: gfxFontEntry(aFaceName),
|
||||
|
@ -129,7 +130,7 @@ GDIFontEntry::GDIFontEntry(const nsAString& aFaceName,
|
|||
mCharset(), mUnicodeRanges()
|
||||
{
|
||||
mUserFontData = aUserFontData;
|
||||
mItalic = aItalic;
|
||||
mStyle = aStyle;
|
||||
mWeight = aWeight;
|
||||
mStretch = aStretch;
|
||||
if (IsType1())
|
||||
|
@ -306,9 +307,10 @@ GDIFontEntry::TestCharacterMap(uint32_t aCh)
|
|||
return false;
|
||||
|
||||
// previous code was using the group style
|
||||
gfxFontStyle fakeStyle;
|
||||
if (mItalic)
|
||||
gfxFontStyle fakeStyle;
|
||||
if (!IsUpright()) {
|
||||
fakeStyle.style = NS_FONT_STYLE_ITALIC;
|
||||
}
|
||||
fakeStyle.weight = mWeight * 100;
|
||||
|
||||
RefPtr<gfxFont> tempFont = FindOrMakeFont(&fakeStyle, false);
|
||||
|
@ -387,7 +389,7 @@ GDIFontEntry::InitLogFont(const nsAString& aName,
|
|||
// do its best to give us an italic font entry, but if no face exists
|
||||
// it may give us a regular one based on weight. Windows should
|
||||
// do fake italic for us in that case.
|
||||
mLogFont.lfItalic = mItalic;
|
||||
mLogFont.lfItalic = !IsUpright();
|
||||
mLogFont.lfWeight = mWeight;
|
||||
|
||||
int len = std::min<int>(aName.Length(), LF_FACESIZE - 1);
|
||||
|
@ -397,14 +399,15 @@ GDIFontEntry::InitLogFont(const nsAString& aName,
|
|||
|
||||
GDIFontEntry*
|
||||
GDIFontEntry::CreateFontEntry(const nsAString& aName,
|
||||
gfxWindowsFontType aFontType, bool aItalic,
|
||||
gfxWindowsFontType aFontType,
|
||||
uint8_t aStyle,
|
||||
uint16_t aWeight, int16_t aStretch,
|
||||
gfxUserFontData* aUserFontData,
|
||||
bool aFamilyHasItalicFace)
|
||||
{
|
||||
// jtdfix - need to set charset, unicode ranges, pitch/family
|
||||
|
||||
GDIFontEntry *fe = new GDIFontEntry(aName, aFontType, aItalic,
|
||||
GDIFontEntry *fe = new GDIFontEntry(aName, aFontType, aStyle,
|
||||
aWeight, aStretch, aUserFontData,
|
||||
aFamilyHasItalicFace);
|
||||
|
||||
|
@ -456,7 +459,7 @@ GDIFontFamily::FamilyAddStylesProc(const ENUMLOGFONTEXW *lpelfe,
|
|||
fe = static_cast<GDIFontEntry*>(ff->mAvailableFonts[i].get());
|
||||
// check if we already know about this face
|
||||
if (fe->mWeight == logFont.lfWeight &&
|
||||
fe->mItalic == (logFont.lfItalic == 0xFF)) {
|
||||
fe->IsItalic() == (logFont.lfItalic == 0xFF)) {
|
||||
// update the charset bit here since this could be different
|
||||
fe->mCharset.set(metrics.tmCharSet);
|
||||
return 1;
|
||||
|
@ -466,8 +469,10 @@ GDIFontFamily::FamilyAddStylesProc(const ENUMLOGFONTEXW *lpelfe,
|
|||
// We can't set the hasItalicFace flag correctly here,
|
||||
// because we might not have seen the family's italic face(s) yet.
|
||||
// So we'll set that flag for all members after loading all the faces.
|
||||
uint8_t italicStyle = (logFont.lfItalic == 0xFF ?
|
||||
NS_FONT_STYLE_ITALIC : NS_FONT_STYLE_NORMAL);
|
||||
fe = GDIFontEntry::CreateFontEntry(nsDependentString(lpelfe->elfFullName),
|
||||
feType, (logFont.lfItalic == 0xFF),
|
||||
feType, italicStyle,
|
||||
(uint16_t) (logFont.lfWeight), 0,
|
||||
nullptr, false);
|
||||
if (!fe)
|
||||
|
@ -712,7 +717,7 @@ gfxFontEntry*
|
|||
gfxGDIFontList::LookupLocalFont(const nsAString& aFontName,
|
||||
uint16_t aWeight,
|
||||
int16_t aStretch,
|
||||
bool aItalic)
|
||||
uint8_t aStyle)
|
||||
{
|
||||
gfxFontEntry *lookup;
|
||||
|
||||
|
@ -729,10 +734,9 @@ gfxGDIFontList::LookupLocalFont(const nsAString& aFontName,
|
|||
// 'Arial Vet' which can be used as a key in GDI font lookups).
|
||||
GDIFontEntry *fe = GDIFontEntry::CreateFontEntry(lookup->Name(),
|
||||
gfxWindowsFontType(isCFF ? GFX_FONT_TYPE_PS_OPENTYPE : GFX_FONT_TYPE_TRUETYPE) /*type*/,
|
||||
lookup->mItalic ? NS_FONT_STYLE_ITALIC : NS_FONT_STYLE_NORMAL,
|
||||
lookup->mWeight, aStretch, nullptr,
|
||||
lookup->mStyle, lookup->mWeight, aStretch, nullptr,
|
||||
static_cast<GDIFontEntry*>(lookup)->mFamilyHasItalicFace);
|
||||
|
||||
|
||||
if (!fe)
|
||||
return nullptr;
|
||||
|
||||
|
@ -740,7 +744,7 @@ gfxGDIFontList::LookupLocalFont(const nsAString& aFontName,
|
|||
|
||||
// make the new font entry match the userfont entry style characteristics
|
||||
fe->mWeight = (aWeight == 0 ? 400 : aWeight);
|
||||
fe->mItalic = aItalic;
|
||||
fe->mStyle = aStyle;
|
||||
|
||||
return fe;
|
||||
}
|
||||
|
@ -749,7 +753,7 @@ gfxFontEntry*
|
|||
gfxGDIFontList::MakePlatformFont(const nsAString& aFontName,
|
||||
uint16_t aWeight,
|
||||
int16_t aStretch,
|
||||
bool aItalic,
|
||||
uint8_t aStyle,
|
||||
const uint8_t* aFontData,
|
||||
uint32_t aLength)
|
||||
{
|
||||
|
@ -808,17 +812,16 @@ gfxGDIFontList::MakePlatformFont(const nsAString& aFontName,
|
|||
WinUserFontData *winUserFontData = new WinUserFontData(fontRef);
|
||||
uint16_t w = (aWeight == 0 ? 400 : aWeight);
|
||||
|
||||
GDIFontEntry *fe = GDIFontEntry::CreateFontEntry(uniqueName,
|
||||
gfxWindowsFontType(isCFF ? GFX_FONT_TYPE_PS_OPENTYPE : GFX_FONT_TYPE_TRUETYPE) /*type*/,
|
||||
uint32_t(aItalic ? NS_FONT_STYLE_ITALIC : NS_FONT_STYLE_NORMAL),
|
||||
w, aStretch, winUserFontData, false);
|
||||
GDIFontEntry *fe = GDIFontEntry::CreateFontEntry(uniqueName,
|
||||
gfxWindowsFontType(isCFF ? GFX_FONT_TYPE_PS_OPENTYPE : GFX_FONT_TYPE_TRUETYPE) /*type*/,
|
||||
aStyle, w, aStretch, winUserFontData, false);
|
||||
|
||||
if (!fe)
|
||||
return fe;
|
||||
|
||||
fe->mIsDataUserFont = true;
|
||||
|
||||
// Uniscribe doesn't place CFF fonts loaded privately
|
||||
// Uniscribe doesn't place CFF fonts loaded privately
|
||||
// via AddFontMemResourceEx on XP/Vista
|
||||
if (isCFF && !IsWin7OrLater()) {
|
||||
fe->mForceGDI = true;
|
||||
|
|
|
@ -236,7 +236,7 @@ public:
|
|||
// create a font entry for a font with a given name
|
||||
static GDIFontEntry* CreateFontEntry(const nsAString& aName,
|
||||
gfxWindowsFontType aFontType,
|
||||
bool aItalic,
|
||||
uint8_t aStyle,
|
||||
uint16_t aWeight, int16_t aStretch,
|
||||
gfxUserFontData* aUserFontData,
|
||||
bool aFamilyHasItalicFace);
|
||||
|
@ -245,7 +245,7 @@ public:
|
|||
static GDIFontEntry* LoadLocalFont(const nsAString& aFontName,
|
||||
uint16_t aWeight,
|
||||
int16_t aStretch,
|
||||
bool aItalic);
|
||||
uint8_t aStyle);
|
||||
|
||||
uint8_t mWindowsFamily;
|
||||
uint8_t mWindowsPitch;
|
||||
|
@ -266,7 +266,7 @@ protected:
|
|||
friend class gfxWindowsFont;
|
||||
|
||||
GDIFontEntry(const nsAString& aFaceName, gfxWindowsFontType aFontType,
|
||||
bool aItalic, uint16_t aWeight, int16_t aStretch,
|
||||
uint8_t aStyle, uint16_t aWeight, int16_t aStretch,
|
||||
gfxUserFontData *aUserFontData, bool aFamilyHasItalicFace);
|
||||
|
||||
void InitLogFont(const nsAString& aName, gfxWindowsFontType aFontType);
|
||||
|
@ -311,12 +311,12 @@ public:
|
|||
virtual gfxFontEntry* LookupLocalFont(const nsAString& aFontName,
|
||||
uint16_t aWeight,
|
||||
int16_t aStretch,
|
||||
bool aItalic);
|
||||
uint8_t aStyle);
|
||||
|
||||
virtual gfxFontEntry* MakePlatformFont(const nsAString& aFontName,
|
||||
uint16_t aWeight,
|
||||
int16_t aStretch,
|
||||
bool aItalic,
|
||||
uint8_t aStyle,
|
||||
const uint8_t* aFontData,
|
||||
uint32_t aLength);
|
||||
|
||||
|
|
|
@ -61,11 +61,10 @@ gfxMacFont::gfxMacFont(MacOSFontEntry *aFontEntry, const gfxFontStyle *aFontStyl
|
|||
cairo_matrix_init_scale(&sizeMatrix, mAdjustedSize, mAdjustedSize);
|
||||
|
||||
// synthetic oblique by skewing via the font matrix
|
||||
bool needsOblique =
|
||||
(mFontEntry != nullptr) &&
|
||||
(!mFontEntry->IsItalic() &&
|
||||
(mStyle.style & (NS_FONT_STYLE_ITALIC | NS_FONT_STYLE_OBLIQUE))) &&
|
||||
mStyle.allowSyntheticStyle;
|
||||
bool needsOblique = mFontEntry != nullptr &&
|
||||
mFontEntry->IsUpright() &&
|
||||
mStyle.style != NS_FONT_STYLE_NORMAL &&
|
||||
mStyle.allowSyntheticStyle;
|
||||
|
||||
if (needsOblique) {
|
||||
cairo_matrix_t style;
|
||||
|
|
|
@ -33,7 +33,7 @@ public:
|
|||
|
||||
// for use with data fonts
|
||||
MacOSFontEntry(const nsAString& aPostscriptName, CGFontRef aFontRef,
|
||||
uint16_t aWeight, uint16_t aStretch, uint32_t aItalicStyle,
|
||||
uint16_t aWeight, uint16_t aStretch, uint8_t aStyle,
|
||||
bool aIsDataUserFont, bool aIsLocal);
|
||||
|
||||
virtual ~MacOSFontEntry() {
|
||||
|
@ -86,12 +86,12 @@ public:
|
|||
gfxFontEntry* LookupLocalFont(const nsAString& aFontName,
|
||||
uint16_t aWeight,
|
||||
int16_t aStretch,
|
||||
bool aItalic) override;
|
||||
|
||||
uint8_t aStyle) override;
|
||||
|
||||
gfxFontEntry* MakePlatformFont(const nsAString& aFontName,
|
||||
uint16_t aWeight,
|
||||
int16_t aStretch,
|
||||
bool aItalic,
|
||||
uint8_t aStyle,
|
||||
const uint8_t* aFontData,
|
||||
uint32_t aLength) override;
|
||||
|
||||
|
|
|
@ -268,7 +268,7 @@ MacOSFontEntry::MacOSFontEntry(const nsAString& aPostscriptName,
|
|||
MacOSFontEntry::MacOSFontEntry(const nsAString& aPostscriptName,
|
||||
CGFontRef aFontRef,
|
||||
uint16_t aWeight, uint16_t aStretch,
|
||||
uint32_t aItalicStyle,
|
||||
uint8_t aStyle,
|
||||
bool aIsDataUserFont,
|
||||
bool aIsLocalUserFont)
|
||||
: gfxFontEntry(aPostscriptName, false),
|
||||
|
@ -285,7 +285,7 @@ MacOSFontEntry::MacOSFontEntry(const nsAString& aPostscriptName,
|
|||
mWeight = aWeight;
|
||||
mStretch = aStretch;
|
||||
mFixedPitch = false; // xxx - do we need this for downloaded fonts?
|
||||
mItalic = (aItalicStyle & (NS_FONT_STYLE_ITALIC | NS_FONT_STYLE_OBLIQUE)) != 0;
|
||||
mStyle = aStyle;
|
||||
|
||||
NS_ASSERTION(!(aIsDataUserFont && aIsLocalUserFont),
|
||||
"userfont is either a data font or a local font");
|
||||
|
@ -523,7 +523,7 @@ gfxMacFontFamily::FindStyleVariations(FontInfoData *aFontInfoData)
|
|||
[facename hasSuffix:@"Italic"] ||
|
||||
[facename hasSuffix:@"Oblique"])
|
||||
{
|
||||
fontEntry->mItalic = true;
|
||||
fontEntry->mStyle = NS_FONT_STYLE_ITALIC;
|
||||
}
|
||||
if (macTraits & NSFixedPitchFontMask) {
|
||||
fontEntry->mFixedPitch = true;
|
||||
|
@ -1009,7 +1009,7 @@ gfxFontEntry*
|
|||
gfxMacPlatformFontList::LookupLocalFont(const nsAString& aFontName,
|
||||
uint16_t aWeight,
|
||||
int16_t aStretch,
|
||||
bool aItalic)
|
||||
uint8_t aStyle)
|
||||
{
|
||||
nsAutoreleasePool localPool;
|
||||
|
||||
|
@ -1026,10 +1026,7 @@ gfxMacPlatformFontList::LookupLocalFont(const nsAString& aFontName,
|
|||
"bogus font weight value!");
|
||||
|
||||
newFontEntry =
|
||||
new MacOSFontEntry(aFontName, fontRef,
|
||||
aWeight, aStretch,
|
||||
aItalic ?
|
||||
NS_FONT_STYLE_ITALIC : NS_FONT_STYLE_NORMAL,
|
||||
new MacOSFontEntry(aFontName, fontRef, aWeight, aStretch, aStyle,
|
||||
false, true);
|
||||
::CFRelease(fontRef);
|
||||
|
||||
|
@ -1045,7 +1042,7 @@ gfxFontEntry*
|
|||
gfxMacPlatformFontList::MakePlatformFont(const nsAString& aFontName,
|
||||
uint16_t aWeight,
|
||||
int16_t aStretch,
|
||||
bool aItalic,
|
||||
uint8_t aStyle,
|
||||
const uint8_t* aFontData,
|
||||
uint32_t aLength)
|
||||
{
|
||||
|
@ -1073,11 +1070,7 @@ gfxMacPlatformFontList::MakePlatformFont(const nsAString& aFontName,
|
|||
|
||||
nsAutoPtr<MacOSFontEntry>
|
||||
newFontEntry(new MacOSFontEntry(uniqueName, fontRef, aWeight,
|
||||
aStretch,
|
||||
aItalic ?
|
||||
NS_FONT_STYLE_ITALIC :
|
||||
NS_FONT_STYLE_NORMAL,
|
||||
true, false));
|
||||
aStretch, aStyle, true, false));
|
||||
::CFRelease(fontRef);
|
||||
|
||||
// if succeeded and font cmap is good, return the new font
|
||||
|
|
|
@ -1376,7 +1376,7 @@ gfxFontEntry*
|
|||
gfxPlatform::MakePlatformFont(const nsAString& aFontName,
|
||||
uint16_t aWeight,
|
||||
int16_t aStretch,
|
||||
bool aItalic,
|
||||
uint8_t aStyle,
|
||||
const uint8_t* aFontData,
|
||||
uint32_t aLength)
|
||||
{
|
||||
|
|
|
@ -348,7 +348,7 @@ public:
|
|||
virtual gfxFontEntry* LookupLocalFont(const nsAString& aFontName,
|
||||
uint16_t aWeight,
|
||||
int16_t aStretch,
|
||||
bool aItalic)
|
||||
uint8_t aStyle)
|
||||
{ return nullptr; }
|
||||
|
||||
/**
|
||||
|
@ -362,7 +362,7 @@ public:
|
|||
virtual gfxFontEntry* MakePlatformFont(const nsAString& aFontName,
|
||||
uint16_t aWeight,
|
||||
int16_t aStretch,
|
||||
bool aItalic,
|
||||
uint8_t aStyle,
|
||||
const uint8_t* aFontData,
|
||||
uint32_t aLength);
|
||||
|
||||
|
|
|
@ -153,14 +153,14 @@ public:
|
|||
virtual gfxFontEntry* LookupLocalFont(const nsAString& aFontName,
|
||||
uint16_t aWeight,
|
||||
int16_t aStretch,
|
||||
bool aItalic) = 0;
|
||||
uint8_t aStyle) = 0;
|
||||
|
||||
// create a new platform font from downloaded data (@font-face)
|
||||
// this method is responsible to ensure aFontData is free()'d
|
||||
virtual gfxFontEntry* MakePlatformFont(const nsAString& aFontName,
|
||||
uint16_t aWeight,
|
||||
int16_t aStretch,
|
||||
bool aItalic,
|
||||
uint8_t aStyle,
|
||||
const uint8_t* aFontData,
|
||||
uint32_t aLength) = 0;
|
||||
|
||||
|
|
|
@ -256,34 +256,35 @@ gfxFontEntry*
|
|||
gfxPlatformGtk::LookupLocalFont(const nsAString& aFontName,
|
||||
uint16_t aWeight,
|
||||
int16_t aStretch,
|
||||
bool aItalic)
|
||||
uint8_t aStyle)
|
||||
{
|
||||
if (sUseFcFontList) {
|
||||
gfxPlatformFontList* pfl = gfxPlatformFontList::PlatformFontList();
|
||||
return pfl->LookupLocalFont(aFontName, aWeight, aStretch, aItalic);
|
||||
return pfl->LookupLocalFont(aFontName, aWeight, aStretch,
|
||||
aStyle);
|
||||
}
|
||||
|
||||
return gfxPangoFontGroup::NewFontEntry(aFontName, aWeight,
|
||||
aStretch, aItalic);
|
||||
aStretch, aStyle);
|
||||
}
|
||||
|
||||
gfxFontEntry*
|
||||
gfxPlatformGtk::MakePlatformFont(const nsAString& aFontName,
|
||||
uint16_t aWeight,
|
||||
int16_t aStretch,
|
||||
bool aItalic,
|
||||
uint8_t aStyle,
|
||||
const uint8_t* aFontData,
|
||||
uint32_t aLength)
|
||||
{
|
||||
if (sUseFcFontList) {
|
||||
gfxPlatformFontList* pfl = gfxPlatformFontList::PlatformFontList();
|
||||
return pfl->MakePlatformFont(aFontName, aWeight, aStretch, aItalic,
|
||||
aFontData, aLength);
|
||||
return pfl->MakePlatformFont(aFontName, aWeight, aStretch,
|
||||
aStyle, aFontData, aLength);
|
||||
}
|
||||
|
||||
// passing ownership of the font data to the new font entry
|
||||
return gfxPangoFontGroup::NewFontEntry(aFontName, aWeight,
|
||||
aStretch, aItalic,
|
||||
aStretch, aStyle,
|
||||
aFontData, aLength);
|
||||
}
|
||||
|
||||
|
|
|
@ -63,7 +63,7 @@ public:
|
|||
virtual gfxFontEntry* LookupLocalFont(const nsAString& aFontName,
|
||||
uint16_t aWeight,
|
||||
int16_t aStretch,
|
||||
bool aItalic) override;
|
||||
uint8_t aStyle) override;
|
||||
|
||||
/**
|
||||
* Activate a platform font (needed to support @font-face src url() )
|
||||
|
@ -72,7 +72,7 @@ public:
|
|||
virtual gfxFontEntry* MakePlatformFont(const nsAString& aFontName,
|
||||
uint16_t aWeight,
|
||||
int16_t aStretch,
|
||||
bool aItalic,
|
||||
uint8_t aStyle,
|
||||
const uint8_t* aFontData,
|
||||
uint32_t aLength) override;
|
||||
|
||||
|
|
|
@ -152,19 +152,19 @@ gfxFontEntry*
|
|||
gfxPlatformMac::LookupLocalFont(const nsAString& aFontName,
|
||||
uint16_t aWeight,
|
||||
int16_t aStretch,
|
||||
bool aItalic)
|
||||
uint8_t aStyle)
|
||||
{
|
||||
return gfxPlatformFontList::PlatformFontList()->LookupLocalFont(aFontName,
|
||||
aWeight,
|
||||
aStretch,
|
||||
aItalic);
|
||||
aStyle);
|
||||
}
|
||||
|
||||
gfxFontEntry*
|
||||
gfxPlatformMac::MakePlatformFont(const nsAString& aFontName,
|
||||
uint16_t aWeight,
|
||||
int16_t aStretch,
|
||||
bool aItalic,
|
||||
uint8_t aStyle,
|
||||
const uint8_t* aFontData,
|
||||
uint32_t aLength)
|
||||
{
|
||||
|
@ -174,7 +174,7 @@ gfxPlatformMac::MakePlatformFont(const nsAString& aFontName,
|
|||
return gfxPlatformFontList::PlatformFontList()->MakePlatformFont(aFontName,
|
||||
aWeight,
|
||||
aStretch,
|
||||
aItalic,
|
||||
aStyle,
|
||||
aFontData,
|
||||
aLength);
|
||||
}
|
||||
|
|
|
@ -44,14 +44,14 @@ public:
|
|||
virtual gfxFontEntry* LookupLocalFont(const nsAString& aFontName,
|
||||
uint16_t aWeight,
|
||||
int16_t aStretch,
|
||||
bool aItalic) override;
|
||||
uint8_t aStyle) override;
|
||||
|
||||
virtual gfxPlatformFontList* CreatePlatformFontList() override;
|
||||
|
||||
virtual gfxFontEntry* MakePlatformFont(const nsAString& aFontName,
|
||||
uint16_t aWeight,
|
||||
int16_t aStretch,
|
||||
bool aItalic,
|
||||
uint8_t aStyle,
|
||||
const uint8_t* aFontData,
|
||||
uint32_t aLength) override;
|
||||
|
||||
|
|
|
@ -132,23 +132,23 @@ gfxFontEntry*
|
|||
gfxQtPlatform::LookupLocalFont(const nsAString& aFontName,
|
||||
uint16_t aWeight,
|
||||
int16_t aStretch,
|
||||
bool aItalic)
|
||||
uint8_t aStyle)
|
||||
{
|
||||
return gfxPangoFontGroup::NewFontEntry(aFontName, aWeight,
|
||||
aStretch, aItalic);
|
||||
aStretch, aStyle);
|
||||
}
|
||||
|
||||
gfxFontEntry*
|
||||
gfxQtPlatform::MakePlatformFont(const nsAString& aFontName,
|
||||
uint16_t aWeight,
|
||||
int16_t aStretch,
|
||||
bool aItalic,
|
||||
uint8_t aStyle,
|
||||
const uint8_t* aFontData,
|
||||
uint32_t aLength)
|
||||
{
|
||||
// passing ownership of the font data to the new font entry
|
||||
return gfxPangoFontGroup::NewFontEntry(aFontName, aWeight,
|
||||
aStretch, aItalic,
|
||||
aStretch, aStyle,
|
||||
aFontData, aLength);
|
||||
}
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ public:
|
|||
virtual gfxFontEntry* LookupLocalFont(const nsAString& aFontName,
|
||||
uint16_t aWeight,
|
||||
int16_t aStretch,
|
||||
bool aItalic) override;
|
||||
uint8_t aStyle) override;
|
||||
|
||||
/**
|
||||
* Activate a platform font (needed to support @font-face src url() )
|
||||
|
@ -63,7 +63,7 @@ public:
|
|||
virtual gfxFontEntry* MakePlatformFont(const nsAString& aFontName,
|
||||
uint16_t aWeight,
|
||||
int16_t aStretch,
|
||||
bool aItalic,
|
||||
uint8_t aStyle,
|
||||
const uint8_t* aFontData,
|
||||
uint32_t aLength) override;
|
||||
|
||||
|
|
|
@ -109,7 +109,7 @@ gfxUserFontEntry::gfxUserFontEntry(gfxUserFontSet* aFontSet,
|
|||
const nsTArray<gfxFontFaceSrc>& aFontFaceSrcList,
|
||||
uint32_t aWeight,
|
||||
int32_t aStretch,
|
||||
uint32_t aItalicStyle,
|
||||
uint8_t aStyle,
|
||||
const nsTArray<gfxFontFeature>& aFeatureSettings,
|
||||
uint32_t aLanguageOverride,
|
||||
gfxSparseBitSet* aUnicodeRanges)
|
||||
|
@ -127,9 +127,7 @@ gfxUserFontEntry::gfxUserFontEntry(gfxUserFontSet* aFontSet,
|
|||
mSrcIndex = 0;
|
||||
mWeight = aWeight;
|
||||
mStretch = aStretch;
|
||||
// XXX Currently, we don't distinguish 'italic' and 'oblique' styles;
|
||||
// we need to fix this. (Bug 543715)
|
||||
mItalic = (aItalicStyle & (NS_FONT_STYLE_ITALIC | NS_FONT_STYLE_OBLIQUE)) != 0;
|
||||
mStyle = aStyle;
|
||||
mFeatureSettings.AppendElements(aFeatureSettings);
|
||||
mLanguageOverride = aLanguageOverride;
|
||||
|
||||
|
@ -147,18 +145,14 @@ bool
|
|||
gfxUserFontEntry::Matches(const nsTArray<gfxFontFaceSrc>& aFontFaceSrcList,
|
||||
uint32_t aWeight,
|
||||
int32_t aStretch,
|
||||
uint32_t aItalicStyle,
|
||||
uint8_t aStyle,
|
||||
const nsTArray<gfxFontFeature>& aFeatureSettings,
|
||||
uint32_t aLanguageOverride,
|
||||
gfxSparseBitSet* aUnicodeRanges)
|
||||
{
|
||||
// XXX font entries don't distinguish italic from oblique (bug 543715)
|
||||
bool isItalic =
|
||||
(aItalicStyle & (NS_FONT_STYLE_ITALIC | NS_FONT_STYLE_OBLIQUE)) != 0;
|
||||
|
||||
return mWeight == aWeight &&
|
||||
mStretch == aStretch &&
|
||||
mItalic == isItalic &&
|
||||
mStyle == aStyle &&
|
||||
mFeatureSettings == aFeatureSettings &&
|
||||
mLanguageOverride == aLanguageOverride &&
|
||||
mSrcList == aFontFaceSrcList &&
|
||||
|
@ -412,7 +406,7 @@ gfxUserFontEntry::LoadNextSrc()
|
|||
gfxPlatform::GetPlatform()->LookupLocalFont(currSrc.mLocalName,
|
||||
mWeight,
|
||||
mStretch,
|
||||
mItalic);
|
||||
mStyle);
|
||||
nsTArray<gfxUserFontSet*> fontSets;
|
||||
GetUserFontSets(fontSets);
|
||||
for (gfxUserFontSet* fontSet : fontSets) {
|
||||
|
@ -612,11 +606,10 @@ gfxUserFontEntry::LoadPlatformFont(const uint8_t* aFontData, uint32_t& aLength)
|
|||
originalFullName);
|
||||
// Here ownership of saneData is passed to the platform,
|
||||
// which will delete it when no longer required
|
||||
|
||||
fe = gfxPlatform::GetPlatform()->MakePlatformFont(mName,
|
||||
mWeight,
|
||||
mStretch,
|
||||
mItalic,
|
||||
mStyle,
|
||||
saneData,
|
||||
saneLen);
|
||||
if (!fe) {
|
||||
|
@ -771,7 +764,7 @@ gfxUserFontSet::FindOrCreateUserFontEntry(
|
|||
const nsTArray<gfxFontFaceSrc>& aFontFaceSrcList,
|
||||
uint32_t aWeight,
|
||||
int32_t aStretch,
|
||||
uint32_t aItalicStyle,
|
||||
uint8_t aStyle,
|
||||
const nsTArray<gfxFontFeature>& aFeatureSettings,
|
||||
uint32_t aLanguageOverride,
|
||||
gfxSparseBitSet* aUnicodeRanges)
|
||||
|
@ -787,14 +780,14 @@ gfxUserFontSet::FindOrCreateUserFontEntry(
|
|||
gfxUserFontFamily* family = LookupFamily(aFamilyName);
|
||||
if (family) {
|
||||
entry = FindExistingUserFontEntry(family, aFontFaceSrcList, aWeight,
|
||||
aStretch, aItalicStyle,
|
||||
aStretch, aStyle,
|
||||
aFeatureSettings, aLanguageOverride,
|
||||
aUnicodeRanges);
|
||||
}
|
||||
|
||||
if (!entry) {
|
||||
entry = CreateUserFontEntry(aFontFaceSrcList, aWeight, aStretch,
|
||||
aItalicStyle, aFeatureSettings,
|
||||
aStyle, aFeatureSettings,
|
||||
aLanguageOverride, aUnicodeRanges);
|
||||
entry->mFamilyName = aFamilyName;
|
||||
}
|
||||
|
@ -807,7 +800,7 @@ gfxUserFontSet::CreateUserFontEntry(
|
|||
const nsTArray<gfxFontFaceSrc>& aFontFaceSrcList,
|
||||
uint32_t aWeight,
|
||||
int32_t aStretch,
|
||||
uint32_t aItalicStyle,
|
||||
uint8_t aStyle,
|
||||
const nsTArray<gfxFontFeature>& aFeatureSettings,
|
||||
uint32_t aLanguageOverride,
|
||||
gfxSparseBitSet* aUnicodeRanges)
|
||||
|
@ -815,7 +808,7 @@ gfxUserFontSet::CreateUserFontEntry(
|
|||
|
||||
RefPtr<gfxUserFontEntry> userFontEntry =
|
||||
new gfxUserFontEntry(this, aFontFaceSrcList, aWeight,
|
||||
aStretch, aItalicStyle, aFeatureSettings,
|
||||
aStretch, aStyle, aFeatureSettings,
|
||||
aLanguageOverride, aUnicodeRanges);
|
||||
return userFontEntry.forget();
|
||||
}
|
||||
|
@ -826,7 +819,7 @@ gfxUserFontSet::FindExistingUserFontEntry(
|
|||
const nsTArray<gfxFontFaceSrc>& aFontFaceSrcList,
|
||||
uint32_t aWeight,
|
||||
int32_t aStretch,
|
||||
uint32_t aItalicStyle,
|
||||
uint8_t aStyle,
|
||||
const nsTArray<gfxFontFeature>& aFeatureSettings,
|
||||
uint32_t aLanguageOverride,
|
||||
gfxSparseBitSet* aUnicodeRanges)
|
||||
|
@ -844,7 +837,7 @@ gfxUserFontSet::FindExistingUserFontEntry(
|
|||
gfxUserFontEntry* existingUserFontEntry =
|
||||
static_cast<gfxUserFontEntry*>(fontList[i].get());
|
||||
if (!existingUserFontEntry->Matches(aFontFaceSrcList,
|
||||
aWeight, aStretch, aItalicStyle,
|
||||
aWeight, aStretch, aStyle,
|
||||
aFeatureSettings, aLanguageOverride,
|
||||
aUnicodeRanges)) {
|
||||
continue;
|
||||
|
@ -867,7 +860,8 @@ gfxUserFontSet::AddUserFontEntry(const nsAString& aFamilyName,
|
|||
LOG(("userfonts (%p) added to \"%s\" (%p) style: %s weight: %d "
|
||||
"stretch: %d",
|
||||
this, NS_ConvertUTF16toUTF8(aFamilyName).get(), aUserFontEntry,
|
||||
(aUserFontEntry->IsItalic() ? "italic" : "normal"),
|
||||
(aUserFontEntry->IsItalic() ? "italic" :
|
||||
(aUserFontEntry->IsOblique() ? "oblique" : "normal")),
|
||||
aUserFontEntry->Weight(), aUserFontEntry->Stretch()));
|
||||
}
|
||||
}
|
||||
|
@ -1050,7 +1044,7 @@ gfxUserFontSet::UserFontCache::Entry::KeyEquals(const KeyTypePointer aKey) const
|
|||
}
|
||||
}
|
||||
|
||||
if (mFontEntry->mItalic != fe->mItalic ||
|
||||
if (mFontEntry->mStyle != fe->mStyle ||
|
||||
mFontEntry->mWeight != fe->mWeight ||
|
||||
mFontEntry->mStretch != fe->mStretch ||
|
||||
mFontEntry->mFeatureSettings != fe->mFeatureSettings ||
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
#include "nsIScriptError.h"
|
||||
#include "nsURIHashKey.h"
|
||||
#include "mozilla/net/ReferrerPolicy.h"
|
||||
#include "gfxFontConstants.h"
|
||||
|
||||
class nsFontFaceLoader;
|
||||
|
||||
|
@ -210,7 +211,7 @@ public:
|
|||
const nsTArray<gfxFontFaceSrc>& aFontFaceSrcList,
|
||||
uint32_t aWeight,
|
||||
int32_t aStretch,
|
||||
uint32_t aItalicStyle,
|
||||
uint8_t aStyle,
|
||||
const nsTArray<gfxFontFeature>& aFeatureSettings,
|
||||
uint32_t aLanguageOverride,
|
||||
gfxSparseBitSet* aUnicodeRanges) = 0;
|
||||
|
@ -222,7 +223,7 @@ public:
|
|||
const nsTArray<gfxFontFaceSrc>& aFontFaceSrcList,
|
||||
uint32_t aWeight,
|
||||
int32_t aStretch,
|
||||
uint32_t aItalicStyle,
|
||||
uint8_t aStyle,
|
||||
const nsTArray<gfxFontFeature>& aFeatureSettings,
|
||||
uint32_t aLanguageOverride,
|
||||
gfxSparseBitSet* aUnicodeRanges);
|
||||
|
@ -416,9 +417,9 @@ public:
|
|||
nsURIHashKey::HashKey(aKey->mURI),
|
||||
HashFeatures(aKey->mFontEntry->mFeatureSettings),
|
||||
mozilla::HashString(aKey->mFontEntry->mFamilyName),
|
||||
((uint32_t)aKey->mFontEntry->mItalic |
|
||||
(aKey->mFontEntry->mWeight << 1) |
|
||||
(aKey->mFontEntry->mStretch << 10) ) ^
|
||||
(aKey->mFontEntry->mStyle |
|
||||
(aKey->mFontEntry->mWeight << 2) |
|
||||
(aKey->mFontEntry->mStretch << 11) ) ^
|
||||
aKey->mFontEntry->mLanguageOverride);
|
||||
}
|
||||
|
||||
|
@ -495,7 +496,7 @@ protected:
|
|||
const nsTArray<gfxFontFaceSrc>& aFontFaceSrcList,
|
||||
uint32_t aWeight,
|
||||
int32_t aStretch,
|
||||
uint32_t aItalicStyle,
|
||||
uint8_t aStyle,
|
||||
const nsTArray<gfxFontFeature>& aFeatureSettings,
|
||||
uint32_t aLanguageOverride,
|
||||
gfxSparseBitSet* aUnicodeRanges);
|
||||
|
@ -534,7 +535,7 @@ public:
|
|||
const nsTArray<gfxFontFaceSrc>& aFontFaceSrcList,
|
||||
uint32_t aWeight,
|
||||
int32_t aStretch,
|
||||
uint32_t aItalicStyle,
|
||||
uint8_t aStyle,
|
||||
const nsTArray<gfxFontFeature>& aFeatureSettings,
|
||||
uint32_t aLanguageOverride,
|
||||
gfxSparseBitSet* aUnicodeRanges);
|
||||
|
@ -545,7 +546,7 @@ public:
|
|||
bool Matches(const nsTArray<gfxFontFaceSrc>& aFontFaceSrcList,
|
||||
uint32_t aWeight,
|
||||
int32_t aStretch,
|
||||
uint32_t aItalicStyle,
|
||||
uint8_t aStyle,
|
||||
const nsTArray<gfxFontFeature>& aFeatureSettings,
|
||||
uint32_t aLanguageOverride,
|
||||
gfxSparseBitSet* aUnicodeRanges);
|
||||
|
|
|
@ -1056,26 +1056,26 @@ gfxFontEntry*
|
|||
gfxWindowsPlatform::LookupLocalFont(const nsAString& aFontName,
|
||||
uint16_t aWeight,
|
||||
int16_t aStretch,
|
||||
bool aItalic)
|
||||
uint8_t aStyle)
|
||||
{
|
||||
return gfxPlatformFontList::PlatformFontList()->LookupLocalFont(aFontName,
|
||||
aWeight,
|
||||
aStretch,
|
||||
aItalic);
|
||||
aStyle);
|
||||
}
|
||||
|
||||
gfxFontEntry*
|
||||
gfxWindowsPlatform::MakePlatformFont(const nsAString& aFontName,
|
||||
uint16_t aWeight,
|
||||
int16_t aStretch,
|
||||
bool aItalic,
|
||||
uint8_t aStyle,
|
||||
const uint8_t* aFontData,
|
||||
uint32_t aLength)
|
||||
{
|
||||
return gfxPlatformFontList::PlatformFontList()->MakePlatformFont(aFontName,
|
||||
aWeight,
|
||||
aStretch,
|
||||
aItalic,
|
||||
aStyle,
|
||||
aFontData,
|
||||
aLength);
|
||||
}
|
||||
|
|
|
@ -193,7 +193,7 @@ public:
|
|||
virtual gfxFontEntry* LookupLocalFont(const nsAString& aFontName,
|
||||
uint16_t aWeight,
|
||||
int16_t aStretch,
|
||||
bool aItalic);
|
||||
uint8_t aStyle);
|
||||
|
||||
/**
|
||||
* Activate a platform font (needed to support @font-face src url() )
|
||||
|
@ -201,7 +201,7 @@ public:
|
|||
virtual gfxFontEntry* MakePlatformFont(const nsAString& aFontName,
|
||||
uint16_t aWeight,
|
||||
int16_t aStretch,
|
||||
bool aItalic,
|
||||
uint8_t aStyle,
|
||||
const uint8_t* aFontData,
|
||||
uint32_t aLength);
|
||||
|
||||
|
|
|
@ -8,6 +8,6 @@ support-files =
|
|||
imageX2.html
|
||||
|
||||
[browser_bug666317.js]
|
||||
skip-if = e10s # Bug 948194 - Decoded Images seem to not be discarded on memory-pressure notification with e10s enabled
|
||||
skip-if = true || e10s # Bug 1207012 - Permaorange from an uncaught exception that isn't actually turning the suite orange until it hits beta, Bug 948194 - Decoded Images seem to not be discarded on memory-pressure notification with e10s enabled
|
||||
[browser_image.js]
|
||||
skip-if = true # Bug 987616
|
||||
|
|
|
@ -144,7 +144,9 @@ this.XPCOMUtils = {
|
|||
countRef.value = _interfaces.length;
|
||||
return _interfaces;
|
||||
},
|
||||
getScriptableHelper: function XPCU_getScriptableHelper() null,
|
||||
getScriptableHelper: function XPCU_getScriptableHelper() {
|
||||
return null;
|
||||
},
|
||||
contractID: classInfo.contractID,
|
||||
classDescription: classInfo.classDescription,
|
||||
classID: classInfo.classID,
|
||||
|
|
|
@ -24,8 +24,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=533596
|
|||
}
|
||||
|
||||
var sandbox = new Components.utils.Sandbox("about:blank");
|
||||
sandbox.importFunction(function() "PASS", "foo");
|
||||
sandbox.importFunction(function bar() "PASS");
|
||||
sandbox.importFunction(function() { return "PASS"; }, "foo");
|
||||
sandbox.importFunction(function bar() { return "PASS"; });
|
||||
sandbox.importFunction(checkWrapped);
|
||||
is(Components.utils.evalInSandbox("foo()", sandbox), "PASS", "importFunction works");
|
||||
is(Components.utils.evalInSandbox("bar()", sandbox), "PASS", "importFunction works");
|
||||
|
|
|
@ -6,7 +6,9 @@ var gTS = window.location.toString;
|
|||
var gGHR = Object.getOwnPropertyDescriptor(window.location, 'href').get;
|
||||
function getTests(fromOuter) {
|
||||
|
||||
function loc() fromOuter ? window.location : location;
|
||||
function loc() {
|
||||
return fromOuter ? window.location : location;
|
||||
}
|
||||
return {
|
||||
getLocationImplicit: function() {
|
||||
return loc() + "";
|
||||
|
@ -35,14 +37,14 @@ function getTests(fromOuter) {
|
|||
function mungeNames(obj, suffix) {
|
||||
var rv = {};
|
||||
Object.getOwnPropertyNames(obj)
|
||||
.forEach(function (name) rv[name + suffix] = obj[name]);
|
||||
.forEach(name => rv[name + suffix] = obj[name]);
|
||||
return rv;
|
||||
}
|
||||
|
||||
function mergeObjects(a, b) {
|
||||
var rv = {};
|
||||
Object.getOwnPropertyNames(a).forEach(function(name) rv[name] = a[name]);
|
||||
Object.getOwnPropertyNames(b).forEach(function(name) rv[name] = b[name]);
|
||||
Object.getOwnPropertyNames(a).forEach(name => rv[name] = a[name]);
|
||||
Object.getOwnPropertyNames(b).forEach(name => rv[name] = b[name]);
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
|
|
@ -24,19 +24,19 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=478438
|
|||
catch (e) { onAllow.opposite("unable " + infinitive, ": " + e) }
|
||||
}
|
||||
|
||||
testOne(function() iwin.focus, pass,
|
||||
testOne(() => iwin.focus, pass,
|
||||
"to resolve/get allAccess property iwin.focus");
|
||||
|
||||
testOne(function() iwin.focus(), pass,
|
||||
testOne(() => iwin.focus(), pass,
|
||||
"to call allAccess method iwin.focus");
|
||||
|
||||
testOne(function() iwin.alert, fail,
|
||||
testOne(() => iwin.alert, fail,
|
||||
"to resolve/get restricted property iwin.alert");
|
||||
|
||||
testOne(function() iwin.alert(), fail,
|
||||
testOne(() => iwin.alert(), fail,
|
||||
"to call restricted method iwin.alert");
|
||||
|
||||
testOne(function() iwin.location.toString(), fail,
|
||||
testOne(() => iwin.location.toString(), fail,
|
||||
"to call restricted method iwin.location.toString");
|
||||
|
||||
testOne(function() { iwin.location = "http://example.org" }, pass,
|
||||
|
|
|
@ -21,7 +21,7 @@ function run_test() {
|
|||
for (var i = 0; i < 8; ++i)
|
||||
new Uint8Array(sb.ab)[i] = i * 10;
|
||||
sb.ta = [];
|
||||
TypedArrays.forEach(function(f) sb.ta.push(new f(sb.ab)));
|
||||
TypedArrays.forEach(f => sb.ta.push(new f(sb.ab)));
|
||||
sb.dv = new DataView(sb.ab);
|
||||
|
||||
/* Things that should throw. */
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#include "nsGkAtoms.h"
|
||||
#include "nsIScrollableFrame.h"
|
||||
#include "nsSubDocumentFrame.h"
|
||||
#include "nsCanvasFrame.h"
|
||||
#include "nsAbsoluteContainingBlock.h"
|
||||
#include "GeckoProfiler.h"
|
||||
#include "nsIMozBrowserFrame.h"
|
||||
|
@ -91,6 +92,22 @@ ShouldInTopLayerForFullscreen(Element* aElement)
|
|||
}
|
||||
#endif // DEBUG
|
||||
|
||||
static void
|
||||
BuildDisplayListForTopLayerFrame(nsDisplayListBuilder* aBuilder,
|
||||
nsIFrame* aFrame,
|
||||
nsDisplayList* aList)
|
||||
{
|
||||
nsRect dirty;
|
||||
nsDisplayListBuilder::OutOfFlowDisplayData*
|
||||
savedOutOfFlowData = nsDisplayListBuilder::GetOutOfFlowData(aFrame);
|
||||
if (savedOutOfFlowData) {
|
||||
dirty = savedOutOfFlowData->mDirtyRect;
|
||||
}
|
||||
nsDisplayList list;
|
||||
aFrame->BuildDisplayListForStackingContext(aBuilder, dirty, &list);
|
||||
aList->AppendToTop(&list);
|
||||
}
|
||||
|
||||
void
|
||||
ViewportFrame::BuildDisplayListForTopLayer(nsDisplayListBuilder* aBuilder,
|
||||
nsDisplayList* aList)
|
||||
|
@ -123,16 +140,16 @@ ViewportFrame::BuildDisplayListForTopLayer(nsDisplayListBuilder* aBuilder,
|
|||
continue;
|
||||
}
|
||||
MOZ_ASSERT(frame->GetParent() == this);
|
||||
BuildDisplayListForTopLayerFrame(aBuilder, frame, aList);
|
||||
}
|
||||
}
|
||||
|
||||
nsRect dirty;
|
||||
nsDisplayListBuilder::OutOfFlowDisplayData*
|
||||
savedOutOfFlowData = nsDisplayListBuilder::GetOutOfFlowData(frame);
|
||||
if (savedOutOfFlowData) {
|
||||
dirty = savedOutOfFlowData->mDirtyRect;
|
||||
nsIPresShell* shell = PresContext()->PresShell();
|
||||
if (nsCanvasFrame* canvasFrame = shell->GetCanvasFrame()) {
|
||||
if (Element* container = canvasFrame->GetCustomContentContainer()) {
|
||||
if (nsIFrame* frame = container->GetPrimaryFrame()) {
|
||||
BuildDisplayListForTopLayerFrame(aBuilder, frame, aList);
|
||||
}
|
||||
nsDisplayList list;
|
||||
frame->BuildDisplayListForStackingContext(aBuilder, dirty, &list);
|
||||
aList->AppendToTop(&list);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
<!DOCTYPE HTML>
|
||||
<head>
|
||||
<title>style matching - italic/oblique</title>
|
||||
<link rel="author" title="John Daggett" href="mailto:jdaggett@mozilla.com">
|
||||
<link rel="author" title="Mozilla" href="http://www.mozilla.org/">
|
||||
<link rel="help" href="http://www.w3.org/TR/css3-fonts/#font-style-prop">
|
||||
<link rel="help" href="http://www.w3.org/TR/css3-fonts/#font-style-matching">
|
||||
<link rel="match" href="italic-oblique-ref.html">
|
||||
<meta name="flags" content="font matching must distinguish between italic and oblique">
|
||||
<style>
|
||||
@font-face {
|
||||
font-family: test;
|
||||
src: url(../fonts/markA.woff);
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: test;
|
||||
src: url(../fonts/markB.woff);
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
body { margin: 30px }
|
||||
p { margin: 0; font: italic 300% test, serif; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<p>BBB</p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
<!DOCTYPE HTML>
|
||||
<head>
|
||||
<title>style matching - italic/oblique</title>
|
||||
<link rel="author" title="John Daggett" href="mailto:jdaggett@mozilla.com">
|
||||
<link rel="author" title="Mozilla" href="http://www.mozilla.org/">
|
||||
<link rel="help" href="http://www.w3.org/TR/css3-fonts/#font-style-prop">
|
||||
<link rel="help" href="http://www.w3.org/TR/css3-fonts/#font-style-matching">
|
||||
<link rel="match" href="italic-oblique-ref.html">
|
||||
<meta name="flags" content="font matching must distinguish between italic and oblique">
|
||||
<style>
|
||||
@font-face {
|
||||
font-family: test;
|
||||
src: url(../fonts/markA.woff);
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: test;
|
||||
src: url(../fonts/markC.woff);
|
||||
font-style: oblique;
|
||||
}
|
||||
|
||||
body { margin: 30px }
|
||||
p { margin: 0; font: italic 300% test, serif; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<p>CCC</p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
<!DOCTYPE HTML>
|
||||
<head>
|
||||
<title>style matching - italic/oblique</title>
|
||||
<link rel="author" title="John Daggett" href="mailto:jdaggett@mozilla.com">
|
||||
<link rel="author" title="Mozilla" href="http://www.mozilla.org/">
|
||||
<link rel="help" href="http://www.w3.org/TR/css3-fonts/#font-style-prop">
|
||||
<link rel="help" href="http://www.w3.org/TR/css3-fonts/#font-style-matching">
|
||||
<link rel="match" href="italic-oblique-ref.html">
|
||||
<meta name="flags" content="font matching must distinguish between italic and oblique">
|
||||
<style>
|
||||
@font-face {
|
||||
font-family: test;
|
||||
src: url(../fonts/markA.woff);
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: test;
|
||||
src: url(../fonts/markB.woff);
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: test;
|
||||
src: url(../fonts/mark2B.woff);
|
||||
font-style: oblique;
|
||||
}
|
||||
|
||||
body { margin: 30px }
|
||||
p { margin: 0; font: italic 300% test, serif; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<p>BBB</p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
<!DOCTYPE HTML>
|
||||
<head>
|
||||
<title>style matching - italic/oblique</title>
|
||||
<link rel="author" title="John Daggett" href="mailto:jdaggett@mozilla.com">
|
||||
<link rel="author" title="Mozilla" href="http://www.mozilla.org/">
|
||||
<link rel="help" href="http://www.w3.org/TR/css3-fonts/#font-style-prop">
|
||||
<link rel="help" href="http://www.w3.org/TR/css3-fonts/#font-style-matching">
|
||||
<link rel="match" href="italic-oblique-ref.html">
|
||||
<meta name="flags" content="font matching must distinguish between italic and oblique">
|
||||
<style>
|
||||
@font-face {
|
||||
font-family: test;
|
||||
src: url(../fonts/markA.woff);
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: test;
|
||||
src: url(../fonts/mark2B.woff);
|
||||
font-style: oblique;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: test;
|
||||
src: url(../fonts/markB.woff);
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
body { margin: 30px }
|
||||
p { margin: 0; font: italic 300% test, serif; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<p>BBB</p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
<!DOCTYPE HTML>
|
||||
<head>
|
||||
<title>style matching - italic/oblique</title>
|
||||
<link rel="author" title="John Daggett" href="mailto:jdaggett@mozilla.com">
|
||||
<link rel="author" title="Mozilla" href="http://www.mozilla.org/">
|
||||
<link rel="help" href="http://www.w3.org/TR/css3-fonts/#font-style-prop">
|
||||
<link rel="help" href="http://www.w3.org/TR/css3-fonts/#font-style-matching">
|
||||
<link rel="match" href="italic-oblique-ref.html">
|
||||
<meta name="flags" content="font matching must distinguish between italic and oblique">
|
||||
<style>
|
||||
@font-face {
|
||||
font-family: test;
|
||||
src: url(../fonts/markA.woff);
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: test;
|
||||
src: url(../fonts/mark2B.woff);
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: test;
|
||||
src: url(../fonts/markB.woff);
|
||||
font-style: oblique;
|
||||
}
|
||||
|
||||
body { margin: 30px }
|
||||
p { margin: 0; font: oblique 300% test, serif; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<p>BBB</p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
<!DOCTYPE HTML>
|
||||
<head>
|
||||
<title>style matching - italic/oblique</title>
|
||||
<link rel="author" title="John Daggett" href="mailto:jdaggett@mozilla.com">
|
||||
<link rel="author" title="Mozilla" href="http://www.mozilla.org/">
|
||||
<link rel="help" href="http://www.w3.org/TR/css3-fonts/#font-style-prop">
|
||||
<link rel="help" href="http://www.w3.org/TR/css3-fonts/#font-style-matching">
|
||||
<link rel="match" href="italic-oblique-ref.html">
|
||||
<meta name="flags" content="font matching must distinguish between italic and oblique">
|
||||
<style>
|
||||
@font-face {
|
||||
font-family: test;
|
||||
src: url(../fonts/markA.woff);
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: test;
|
||||
src: url(../fonts/markB.woff);
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: test;
|
||||
src: url(../fonts/markC.woff);
|
||||
font-style: oblique;
|
||||
}
|
||||
|
||||
body { margin: 30px }
|
||||
p { margin: 0; font: oblique 300% test, serif; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<p>CCC</p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
<!DOCTYPE HTML>
|
||||
<head>
|
||||
<title>style matching - italic/oblique</title>
|
||||
<link rel="author" title="John Daggett" href="mailto:jdaggett@mozilla.com">
|
||||
<link rel="author" title="Mozilla" href="http://www.mozilla.org/">
|
||||
<link rel="help" href="http://www.w3.org/TR/css3-fonts/#font-style-prop">
|
||||
<link rel="help" href="http://www.w3.org/TR/css3-fonts/#font-style-matching">
|
||||
<link rel="match" href="italic-oblique-ref.html">
|
||||
<meta name="flags" content="font matching must distinguish between italic and oblique">
|
||||
<style>
|
||||
@font-face {
|
||||
font-family: test;
|
||||
src: url(../fonts/markA.woff);
|
||||
font-style: oblique;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: test;
|
||||
src: url(../fonts/markB.woff);
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: test;
|
||||
src: url(../fonts/mark2B.woff);
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
body { margin: 30px }
|
||||
p { margin: 0; font: oblique 300% test, serif; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<p>AAA</p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
<!DOCTYPE HTML>
|
||||
<head>
|
||||
<title>style matching - italic/oblique</title>
|
||||
<link rel="author" title="John Daggett" href="mailto:jdaggett@mozilla.com">
|
||||
<link rel="author" title="Mozilla" href="http://www.mozilla.org/">
|
||||
<link rel="help" href="http://www.w3.org/TR/css3-fonts/#font-style-prop">
|
||||
<link rel="help" href="http://www.w3.org/TR/css3-fonts/#font-style-matching">
|
||||
<link rel="match" href="italic-oblique-ref.html">
|
||||
<meta name="flags" content="font matching must distinguish between italic and oblique">
|
||||
<style>
|
||||
@font-face {
|
||||
font-family: test1;
|
||||
src: url(../fonts/markA.woff);
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: test2;
|
||||
src: url(../fonts/markB.woff);
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: test3;
|
||||
src: url(../fonts/markC.woff);
|
||||
font-style: oblique;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: test3;
|
||||
src: url(../fonts/mark2C.woff);
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
body { margin: 30px }
|
||||
p { margin: 0; font: oblique 300% test1, test2, test3, serif; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<p>CCC</p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
<!DOCTYPE HTML>
|
||||
<head>
|
||||
<title>style matching - italic/oblique</title>
|
||||
<link rel="author" title="John Daggett" href="mailto:jdaggett@mozilla.com">
|
||||
<link rel="author" title="Mozilla" href="http://www.mozilla.org/">
|
||||
<link rel="help" href="http://www.w3.org/TR/css3-fonts/#font-style-prop">
|
||||
<link rel="help" href="http://www.w3.org/TR/css3-fonts/#font-style-matching">
|
||||
<link rel="match" href="italic-oblique-ref.html">
|
||||
<meta name="flags" content="font matching must distinguish between italic and oblique">
|
||||
<style>
|
||||
@font-face {
|
||||
font-family: test1;
|
||||
src: url(../fonts/markA.woff);
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: test2;
|
||||
src: url(../fonts/markC.woff);
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: test3;
|
||||
src: url(../fonts/mark2C.woff);
|
||||
font-style: oblique;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: test3;
|
||||
src: url(../fonts/mark2A.woff);
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
body { margin: 30px }
|
||||
p { margin: 0; font: oblique 300% test1, test2, test3, serif; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<p>CCC</p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
<!DOCTYPE HTML>
|
||||
<head>
|
||||
<title>style matching - italic/oblique</title>
|
||||
<link rel="author" title="John Daggett" href="mailto:jdaggett@mozilla.com">
|
||||
<link rel="author" title="Mozilla" href="http://www.mozilla.org/">
|
||||
<link rel="help" href="http://www.w3.org/TR/css3-fonts/#font-style-prop">
|
||||
<link rel="help" href="http://www.w3.org/TR/css3-fonts/#font-style-matching">
|
||||
<link rel="match" href="italic-oblique-ref.html">
|
||||
<meta name="flags" content="font matching must distinguish between italic and oblique">
|
||||
<style>
|
||||
@font-face {
|
||||
font-family: test;
|
||||
src: url(../fonts/mark2A.woff);
|
||||
font-style: oblique;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: test;
|
||||
src: url(../fonts/markB.woff);
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: test;
|
||||
src: url(../fonts/markA.woff);
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
body { margin: 30px }
|
||||
p { margin: 0; font: italic 300% kinnari, test, serif; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<p>AAA</p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
<!DOCTYPE HTML>
|
||||
<head>
|
||||
<title>style matching - italic/oblique</title>
|
||||
<link rel="author" title="John Daggett" href="mailto:jdaggett@mozilla.com">
|
||||
<link rel="author" title="Mozilla" href="http://www.mozilla.org/">
|
||||
<link rel="help" href="http://www.w3.org/TR/css3-fonts/#font-style-prop">
|
||||
<link rel="help" href="http://www.w3.org/TR/css3-fonts/#font-style-matching">
|
||||
<link rel="match" href="italic-oblique-ref.html">
|
||||
<meta name="flags" content="font matching must distinguish between italic and oblique">
|
||||
<style>
|
||||
@font-face {
|
||||
font-family: test;
|
||||
src: url(../fonts/mark2A.woff);
|
||||
font-style: oblique;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: test;
|
||||
src: url(../fonts/markB.woff);
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: test;
|
||||
src: url(../fonts/markA.woff);
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
body { margin: 30px }
|
||||
p { margin: 0; font: oblique 300% kinnari, test, serif; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<p>AAA</p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
<!DOCTYPE HTML>
|
||||
<head>
|
||||
<title>style matching - italic/oblique</title>
|
||||
<link rel="author" title="John Daggett" href="mailto:jdaggett@mozilla.com">
|
||||
<link rel="author" title="Mozilla" href="http://www.mozilla.org/">
|
||||
<link rel="help" href="http://www.w3.org/TR/css3-fonts/#font-style-prop">
|
||||
<link rel="help" href="http://www.w3.org/TR/css3-fonts/#font-style-matching">
|
||||
<link rel="match" href="italic-oblique-1-ref.html">
|
||||
<meta name="flags" content="font matching must distinguish between italic and oblique">
|
||||
<style>
|
||||
@font-face {
|
||||
font-family: test;
|
||||
src: url(../fonts/markA.woff);
|
||||
}
|
||||
body { margin: 30px }
|
||||
p { margin: 0; font: 300% test, serif; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<p>AAA</p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
|
@ -98,3 +98,16 @@ skip-if(Mulet) HTTP(..) == font-synthesis-2.html font-synthesis-2-ref.html # MUL
|
|||
# Bug 1060791 - support for format 10 cmap in Apple Symbols;
|
||||
# relevant fonts not present on other platforms.
|
||||
skip-if(!cocoaWidget) HTTP(..) != apple-symbols-1.html apple-symbols-1-notref.html
|
||||
|
||||
# distinguish between italic and oblique
|
||||
== simple-oblique.html simple-oblique-ref.html
|
||||
== italic-oblique-1.html italic-oblique-ref.html
|
||||
fuzzy-if(Mulet,103,144) == italic-oblique-2.html italic-oblique-ref.html
|
||||
== italic-oblique-3.html italic-oblique-ref.html
|
||||
== italic-oblique-4.html italic-oblique-ref.html
|
||||
== italic-oblique-5.html italic-oblique-ref.html
|
||||
fuzzy-if(Mulet,103,144) == italic-oblique-6.html italic-oblique-ref.html
|
||||
== italic-oblique-7.html italic-oblique-ref.html
|
||||
fuzzy-if(Mulet,103,144) == italic-oblique-8.html italic-oblique-ref.html
|
||||
fuzzy-if(Mulet,103,144) == italic-oblique-9.html italic-oblique-ref.html
|
||||
!= italic-oblique-kinnari.html italic-oblique-kinnari-ref.html
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>oblique italic equivalence</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
<style type="text/css">
|
||||
|
||||
body {
|
||||
margin: 50px;
|
||||
font-size: 300%;
|
||||
}
|
||||
|
||||
#sans { font-family: sans-serif; }
|
||||
#serif { font-family: serif; }
|
||||
#mono { font-family: monospace; }
|
||||
|
||||
p {
|
||||
margin: 0;
|
||||
font-style: italic;
|
||||
line-height: 1.3em;
|
||||
}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<p id=sans>UNICORN asteroid</p>
|
||||
<p id=serif>UNICORN asteroid</p>
|
||||
<p id=mono>UNICORN asteroid</p>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,33 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>oblique italic equivalence</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
<style type="text/css">
|
||||
|
||||
body {
|
||||
margin: 50px;
|
||||
font-size: 300%;
|
||||
}
|
||||
|
||||
#sans { font-family: sans-serif; }
|
||||
#serif { font-family: serif; }
|
||||
#mono { font-family: monospace; }
|
||||
|
||||
p {
|
||||
margin: 0;
|
||||
font-style: oblique;
|
||||
line-height: 1.3em;
|
||||
}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<p id=sans>UNICORN asteroid</p>
|
||||
<p id=serif>UNICORN asteroid</p>
|
||||
<p id=mono>UNICORN asteroid</p>
|
||||
|
||||
</body>
|
||||
</html>
|
Двоичный файл не отображается.
Двоичный файл не отображается.
Двоичный файл не отображается.
Двоичный файл не отображается.
|
@ -44,12 +44,12 @@ public:
|
|||
const nsTArray<gfxFontFaceSrc>& aFontFaceSrcList,
|
||||
uint32_t aWeight,
|
||||
int32_t aStretch,
|
||||
uint32_t aItalicStyle,
|
||||
uint8_t aStyle,
|
||||
const nsTArray<gfxFontFeature>& aFeatureSettings,
|
||||
uint32_t aLanguageOverride,
|
||||
gfxSparseBitSet* aUnicodeRanges)
|
||||
: gfxUserFontEntry(aFontSet, aFontFaceSrcList, aWeight, aStretch,
|
||||
aItalicStyle, aFeatureSettings, aLanguageOverride,
|
||||
aStyle, aFeatureSettings, aLanguageOverride,
|
||||
aUnicodeRanges) {}
|
||||
|
||||
virtual void SetLoadState(UserFontLoadState aLoadState) override;
|
||||
|
|
|
@ -169,7 +169,7 @@ FontFaceSet::ParseFontShorthandForMatching(
|
|||
RefPtr<FontFamilyListRefCnt>& aFamilyList,
|
||||
uint32_t& aWeight,
|
||||
int32_t& aStretch,
|
||||
uint32_t& aItalicStyle,
|
||||
uint8_t& aStyle,
|
||||
ErrorResult& aRv)
|
||||
{
|
||||
// Parse aFont as a 'font' property value.
|
||||
|
@ -224,7 +224,7 @@ FontFaceSet::ParseFontShorthandForMatching(
|
|||
aWeight = weight;
|
||||
|
||||
aStretch = data->ValueFor(eCSSProperty_font_stretch)->GetIntValue();
|
||||
aItalicStyle = data->ValueFor(eCSSProperty_font_style)->GetIntValue();
|
||||
aStyle = data->ValueFor(eCSSProperty_font_style)->GetIntValue();
|
||||
}
|
||||
|
||||
static bool
|
||||
|
@ -252,7 +252,7 @@ FontFaceSet::FindMatchingFontFaces(const nsAString& aFont,
|
|||
RefPtr<FontFamilyListRefCnt> familyList;
|
||||
uint32_t weight;
|
||||
int32_t stretch;
|
||||
uint32_t italicStyle;
|
||||
uint8_t italicStyle;
|
||||
ParseFontShorthandForMatching(aFont, familyList, weight, stretch, italicStyle,
|
||||
aRv);
|
||||
if (aRv.Failed()) {
|
||||
|
@ -964,7 +964,7 @@ FontFaceSet::FindOrCreateUserFontEntryFromFontFace(const nsAString& aFamilyName,
|
|||
|
||||
uint32_t weight = NS_STYLE_FONT_WEIGHT_NORMAL;
|
||||
int32_t stretch = NS_STYLE_FONT_STRETCH_NORMAL;
|
||||
uint32_t italicStyle = NS_STYLE_FONT_STYLE_NORMAL;
|
||||
uint8_t italicStyle = NS_STYLE_FONT_STYLE_NORMAL;
|
||||
uint32_t languageOverride = NO_FONT_LANGUAGE_OVERRIDE;
|
||||
|
||||
// set up weight
|
||||
|
@ -1772,13 +1772,13 @@ FontFaceSet::UserFontSet::CreateUserFontEntry(
|
|||
const nsTArray<gfxFontFaceSrc>& aFontFaceSrcList,
|
||||
uint32_t aWeight,
|
||||
int32_t aStretch,
|
||||
uint32_t aItalicStyle,
|
||||
uint8_t aStyle,
|
||||
const nsTArray<gfxFontFeature>& aFeatureSettings,
|
||||
uint32_t aLanguageOverride,
|
||||
gfxSparseBitSet* aUnicodeRanges)
|
||||
{
|
||||
RefPtr<gfxUserFontEntry> entry =
|
||||
new FontFace::Entry(this, aFontFaceSrcList, aWeight, aStretch, aItalicStyle,
|
||||
new FontFace::Entry(this, aFontFaceSrcList, aWeight, aStretch, aStyle,
|
||||
aFeatureSettings, aLanguageOverride, aUnicodeRanges);
|
||||
return entry.forget();
|
||||
}
|
||||
|
|
|
@ -83,7 +83,7 @@ public:
|
|||
const nsTArray<gfxFontFaceSrc>& aFontFaceSrcList,
|
||||
uint32_t aWeight,
|
||||
int32_t aStretch,
|
||||
uint32_t aItalicStyle,
|
||||
uint8_t aStyle,
|
||||
const nsTArray<gfxFontFeature>& aFeatureSettings,
|
||||
uint32_t aLanguageOverride,
|
||||
gfxSparseBitSet* aUnicodeRanges) override;
|
||||
|
@ -286,7 +286,7 @@ private:
|
|||
RefPtr<mozilla::css::FontFamilyListRefCnt>& aFamilyList,
|
||||
uint32_t& aWeight,
|
||||
int32_t& aStretch,
|
||||
uint32_t& aItalicStyle,
|
||||
uint8_t& aStyle,
|
||||
ErrorResult& aRv);
|
||||
void FindMatchingFontFaces(const nsAString& aFont,
|
||||
const nsAString& aText,
|
||||
|
|
|
@ -514,12 +514,10 @@ div:-moz-native-anonymous.moz-selectioncaret-right.hidden > div {
|
|||
everything else, not reacting to pointer events. */
|
||||
div:-moz-native-anonymous.moz-custom-content-container {
|
||||
pointer-events: none;
|
||||
|
||||
-moz-top-layer: top;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
z-index: 2147483648;
|
||||
}
|
||||
|
|
|
@ -336,6 +336,35 @@
|
|||
# define MOZ_WARN_UNUSED_RESULT
|
||||
#endif
|
||||
|
||||
/**
|
||||
* MOZ_FALLTHROUGH is an annotation to suppress compiler warnings about switch
|
||||
* cases that fall through without a break or return statement. MOZ_FALLTHROUGH
|
||||
* is only needed on cases that have code:
|
||||
*
|
||||
* switch (foo) {
|
||||
* case 1: // These cases have no code. No fallthrough annotations are needed.
|
||||
* case 2:
|
||||
* case 3:
|
||||
* foo = 4; // This case has code, so a fallthrough annotation is needed:
|
||||
* MOZ_FALLTHROUGH;
|
||||
* default:
|
||||
* return foo;
|
||||
* }
|
||||
*/
|
||||
#if defined(__clang__) && __cplusplus >= 201103L
|
||||
/* clang's fallthrough annotations are only available starting in C++11. */
|
||||
# define MOZ_FALLTHROUGH [[clang::fallthrough]]
|
||||
#elif defined(_MSC_VER)
|
||||
/*
|
||||
* MSVC's __fallthrough annotations are checked by /analyze (Code Analysis):
|
||||
* https://msdn.microsoft.com/en-us/library/ms235402%28VS.80%29.aspx
|
||||
*/
|
||||
# include <sal.h>
|
||||
# define MOZ_FALLTHROUGH __fallthrough
|
||||
#else
|
||||
# define MOZ_FALLTHROUGH /* FALLTHROUGH */
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
/*
|
||||
|
|
|
@ -206,7 +206,6 @@ class DesktopSingleLocale(LocalesMixin, ReleaseMixin, MockMixin, BuildbotMixin,
|
|||
self.version = None
|
||||
self.upload_urls = {}
|
||||
self.locales_property = {}
|
||||
self.l10n_dir = None
|
||||
self.package_urls = {}
|
||||
self.pushdate = None
|
||||
# upload_files is a dictionary of files to upload, keyed by locale.
|
||||
|
@ -730,7 +729,6 @@ class DesktopSingleLocale(LocalesMixin, ReleaseMixin, MockMixin, BuildbotMixin,
|
|||
"""wrapper for make installers-(locale)"""
|
||||
env = self.query_l10n_env()
|
||||
self._copy_mozconfig()
|
||||
env['L10NBASEDIR'] = self.l10n_dir
|
||||
dirs = self.query_abs_dirs()
|
||||
cwd = os.path.join(dirs['abs_locales_dir'])
|
||||
target = ["installers-%s" % locale,
|
||||
|
|
|
@ -1010,7 +1010,7 @@ GfxInfoBase::EvaluateDownloadedBlacklist(nsTArray<GfxDriverInfo>& aDriverInfo)
|
|||
} else {
|
||||
RemovePrefForDriverVersion();
|
||||
}
|
||||
// FALLTHROUGH
|
||||
MOZ_FALLTHROUGH;
|
||||
|
||||
case nsIGfxInfo::FEATURE_BLOCKED_MISMATCHED_VERSION:
|
||||
case nsIGfxInfo::FEATURE_BLOCKED_DEVICE:
|
||||
|
|
Загрузка…
Ссылка в новой задаче