Merge last PGO-green changeset of mozilla-inbound to mozilla-central

This commit is contained in:
Ed Morley 2012-08-20 16:45:41 +01:00
commit 86bd51ea45
43 changed files with 637 additions and 221 deletions

View File

@ -34,6 +34,7 @@ MOCHITEST_FILES = \
test_bug405632.html \
test_bug409604.html \
test_bug412567.html \
test_bug422132.html \
test_bug426082.html \
test_bug427537.html \
test_bug432698.html \

View File

@ -0,0 +1,96 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=422132
-->
<head>
<title>Test for Bug 422132</title>
<script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=422132">Mozilla Bug 422132</a>
<p id="display"></p>
<div id="target" style="font-size: 0; width: 200px; height: 200px; overflow: auto;">
<div style="width: 1000px; height: 1000px;"></div>
</div>
<div id="content" style="display: none">
</div>
<pre id="test">
<script class="testbody" type="text/javascript">
/** Test for Bug 422132 **/
SimpleTest.waitForExplicitFinish();
SimpleTest.waitForFocus(runTests, window);
function hitEventLoop(aFunc, aTimes)
{
if (--aTimes) {
setTimeout(hitEventLoop, 0, aFunc, aTimes);
} else {
setTimeout(aFunc, 20);
}
}
function runTests()
{
SpecialPowers.setBoolPref("general.smoothScroll", false);
SpecialPowers.setIntPref("mousewheel.min_line_scroll_amount", 1);
SpecialPowers.setIntPref("mousewheel.transaction.timeout", 100000);
var target = document.getElementById("target");
var scrollLeft = target.scrollLeft;
var scrollTop = target.scrollTop;
synthesizeWheel(target, 10, 10,
{ deltaMode: WheelEvent.DOM_DELTA_PIXEL,
deltaX: 0.5, deltaY: 0.5, lineOrPageDeltaX: 0, lineOrPageDeltaY: 0 });
hitEventLoop(function () {
is(target.scrollLeft, scrollLeft, "scrolled to right by 0.5px delta value");
is(target.scrollTop, scrollTop, "scrolled to bottom by 0.5px delta value");
scrollLeft = target.scrollLeft;
scrollTop = target.scrollTop;
synthesizeWheel(target, 10, 10,
{ deltaMode: WheelEvent.DOM_DELTA_PIXEL,
deltaX: 0.5, deltaY: 0.5, lineOrPageDeltaX: 0, lineOrPageDeltaY: 0 });
hitEventLoop(function () {
ok(target.scrollLeft > scrollLeft,
"not scrolled to right by 0.5px delta value with pending 0.5px delta");
ok(target.scrollTop > scrollTop,
"not scrolled to bottom by 0.5px delta value with pending 0.5px delta");
scrollLeft = target.scrollLeft;
scrollTop = target.scrollTop;
synthesizeWheel(target, 10, 10,
{ deltaMode: WheelEvent.DOM_DELTA_LINE,
deltaX: 0.5, deltaY: 0.5, lineOrPageDeltaX: 0, lineOrPageDeltaY: 0 });
hitEventLoop(function () {
is(target.scrollLeft, scrollLeft, "scrolled to right by 0.5 line delta value");
is(target.scrollTop, scrollTop, "scrolled to bottom by 0.5 line delta value");
scrollLeft = target.scrollLeft;
scrollTop = target.scrollTop;
synthesizeWheel(target, 10, 10,
{ deltaMode: WheelEvent.DOM_DELTA_LINE,
deltaX: 0.5, deltaY: 0.5, lineOrPageDeltaX: 1, lineOrPageDeltaY: 1 });
hitEventLoop(function () {
ok(target.scrollLeft > scrollLeft,
"not scrolled to right by 0.5 line delta value with pending 0.5 line delta");
ok(target.scrollTop > scrollTop,
"not scrolled to bottom by 0.5 line delta value with pending 0.5 line delta");
SpecialPowers.clearUserPref("general.smoothScroll");
SpecialPowers.clearUserPref("mousewheel.min_line_scroll_amount");
SpecialPowers.clearUserPref("mousewheel.transaction.timeout");
SimpleTest.finish();
}, 20);
}, 20);
}, 20);
}, 20);
}
</script>
</pre>
</body>
</html>

View File

@ -148,12 +148,12 @@ VideoData* VideoData::Create(nsVideoInfo& aInfo,
aInfo.mDisplay));
// Currently our decoder only knows how to output to PLANAR_YCBCR
// format.
ImageFormat format = ImageFormat::PLANAR_YCBCR;
ImageFormat format = PLANAR_YCBCR;
v->mImage = aContainer->CreateImage(&format, 1);
if (!v->mImage) {
return nullptr;
}
NS_ASSERTION(v->mImage->GetFormat() == ImageFormat::PLANAR_YCBCR,
NS_ASSERTION(v->mImage->GetFormat() == PLANAR_YCBCR,
"Wrong format?");
PlanarYCbCrImage* videoImage = static_cast<PlanarYCbCrImage*>(v->mImage.get());

View File

@ -462,7 +462,7 @@ public:
if (!v->mImage) {
return nullptr;
}
NS_ASSERTION(v->mImage->GetFormat() == mozilla::ImageFormat::PLANAR_YCBCR,
NS_ASSERTION(v->mImage->GetFormat() == mozilla::PLANAR_YCBCR,
"Wrong format?");
mozilla::layers::PlanarYCbCrImage* vi = static_cast<mozilla::layers::PlanarYCbCrImage*>(v->mImage.get());

View File

@ -380,7 +380,6 @@ nsBuiltinDecoderStateMachine::nsBuiltinDecoderStateMachine(nsBuiltinDecoder* aDe
bool aRealTime) :
mDecoder(aDecoder),
mState(DECODER_STATE_DECODING_METADATA),
mCbCrSize(0),
mPlayDuration(0),
mStartTime(-1),
mEndTime(-1),

View File

@ -468,13 +468,6 @@ protected:
// Accessed on state machine, audio, main, and AV thread.
State mState;
// The size of the decoded YCbCr frame.
// Accessed on state machine thread.
PRUint32 mCbCrSize;
// Accessed on state machine thread.
nsAutoArrayPtr<unsigned char> mCbCrBuffer;
// Thread for pushing audio onto the audio hardware.
// The "audio push thread".
nsCOMPtr<nsIThread> mAudioThread;
@ -566,6 +559,11 @@ protected:
// Time at which we started decoding. Synchronised via decoder monitor.
TimeStamp mDecodeStartTime;
// The maximum number of second we spend buffering when we are short on
// unbuffered data.
PRUint32 mBufferingWait;
PRInt64 mLowDataThresholdUsecs;
// True if we shouldn't play our audio (but still write it to any capturing
// streams).
bool mAudioCaptured;
@ -647,11 +645,6 @@ protected:
// created. Synchronized by the decoder monitor.
bool mRequestedNewDecodeThread;
// The maximum number of second we spend buffering when we are short on
// unbuffered data.
PRUint32 mBufferingWait;
PRInt64 mLowDataThresholdUsecs;
private:
// Manager for queuing and dispatching MozAudioAvailable events. The
// event manager is accessed from the state machine and audio threads,

View File

@ -17,13 +17,11 @@ LIBXUL_LIBRARY = 1
EXPORTS += \
nsOggDecoder.h \
nsOggDecoderStateMachine.h \
nsOggCodecState.h \
$(NULL)
CPPSRCS = \
nsOggDecoder.cpp \
nsOggDecoderStateMachine.cpp \
nsOggCodecState.cpp \
nsOggReader.cpp \
$(NULL)

View File

@ -4,11 +4,11 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsOggDecoderStateMachine.h"
#include "nsBuiltinDecoderStateMachine.h"
#include "nsOggReader.h"
#include "nsOggDecoder.h"
nsDecoderStateMachine* nsOggDecoder::CreateStateMachine()
{
return new nsOggDecoderStateMachine(this);
return new nsBuiltinDecoderStateMachine(this, new nsOggReader(this));
}

View File

@ -1,14 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cindent: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsOggDecoderStateMachine.h"
#include "nsOggReader.h"
#include "nsOggDecoder.h"
nsOggDecoderStateMachine::nsOggDecoderStateMachine(nsBuiltinDecoder* aDecoder) :
nsBuiltinDecoderStateMachine(aDecoder, new nsOggReader(aDecoder))
{
}

View File

@ -1,17 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cindent: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#if !defined(nsOggDecoderStateMachine_h_)
#define nsOggDecoderStateMachine_h_
#include "nsBuiltinDecoderStateMachine.h"
class nsOggDecoderStateMachine : public nsBuiltinDecoderStateMachine
{
public:
nsOggDecoderStateMachine(nsBuiltinDecoder* aDecoder);
};
#endif

View File

@ -95,7 +95,7 @@ MediaEngineDefaultVideoSource::Start(SourceMediaStream* aStream, TrackID aID)
mSource = aStream;
// Allocate a single blank Image
ImageFormat format = ImageFormat::PLANAR_YCBCR;
ImageFormat format = PLANAR_YCBCR;
mImageContainer = layers::LayerManager::CreateImageContainer();
nsRefPtr<layers::Image> image = mImageContainer->CreateImage(&format, 1);

View File

@ -48,7 +48,7 @@ MediaEngineWebRTCVideoSource::DeliverFrame(
}
// Create a video frame and append it to the track.
ImageFormat format = ImageFormat::PLANAR_YCBCR;
ImageFormat format = PLANAR_YCBCR;
nsRefPtr<layers::Image> image = mImageContainer->CreateImage(&format, 1);
layers::PlanarYCbCrImage* videoImage = static_cast<layers::PlanarYCbCrImage*>(image.get());

View File

@ -14,12 +14,14 @@
#include "BluetoothTypes.h"
#include "BluetoothReplyRunnable.h"
#include "BluetoothUtils.h"
#include "GeneratedEvents.h"
#include "nsDOMClassInfo.h"
#include "nsDOMEvent.h"
#include "nsThreadUtils.h"
#include "nsXPCOMCIDInternal.h"
#include "nsIDOMDOMRequest.h"
#include "nsIDOMBluetoothDeviceAddressEvent.h"
#include "nsContentUtils.h"
#include "mozilla/LazyIdleThread.h"
@ -298,6 +300,18 @@ BluetoothAdapter::Notify(const BluetoothSignal& aData)
nsRefPtr<BluetoothDevice> d = BluetoothDevice::Create(GetOwner(), mPath, aData.value());
nsRefPtr<BluetoothDeviceEvent> e = BluetoothDeviceEvent::Create(d);
e->Dispatch(ToIDOMEventTarget(), NS_LITERAL_STRING("devicefound"));
} else if (aData.name().EqualsLiteral("DeviceDisappeared")) {
const nsAString& deviceAddress = aData.value().get_nsString();
nsCOMPtr<nsIDOMEvent> event;
NS_NewDOMBluetoothDeviceAddressEvent(getter_AddRefs(event), nullptr, nullptr);
nsCOMPtr<nsIDOMBluetoothDeviceAddressEvent> e = do_QueryInterface(event);
e->InitBluetoothDeviceAddressEvent(NS_LITERAL_STRING("devicedisappeared"),
false, false, deviceAddress);
e->SetTrusted(true);
bool dummy;
DispatchEvent(event, &dummy);
} else if (aData.name().EqualsLiteral("PropertyChanged")) {
// Get BluetoothNamedValue, make sure array length is 1
arr = aData.value().get_ArrayOfBluetoothNamedValue();

View File

@ -46,6 +46,7 @@ XPIDLSRCS = \
nsIDOMBluetoothAdapter.idl \
nsIDOMBluetoothDevice.idl \
nsIDOMBluetoothDeviceEvent.idl \
nsIDOMBluetoothDeviceAddressEvent.idl \
nsIDOMBluetoothPropertyEvent.idl \
nsIDOMBluetoothPairingEvent.idl \
$(NULL)

View File

@ -0,0 +1,21 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsIDOMEvent.idl"
[scriptable, builtinclass, uuid(afcb832f-bbb5-45fa-b703-f8185bd2d26d)]
interface nsIDOMBluetoothDeviceAddressEvent : nsIDOMEvent
{
readonly attribute DOMString deviceAddress;
[noscript] void initBluetoothDeviceAddressEvent(in DOMString aType,
in boolean aCanBubble,
in boolean aCancelable,
in DOMString aDeviceAddress);
};
dictionary BluetoothDeviceAddressEventInit : EventInit
{
DOMString deviceAddress;
};

View File

@ -9,14 +9,19 @@ let connection = navigator.mozMobileConnection;
ok(connection instanceof MozMobileConnection,
"connection is instanceof " + connection.constructor);
let emulatorCmdPendingCount = 0;
function setEmulatorVoiceState(state) {
emulatorCmdPendingCount++;
runEmulatorCmd("gsm voice " + state, function (result) {
emulatorCmdPendingCount--;
is(result[0], "OK");
});
}
function setEmulatorGsmLocation(lac, cid) {
emulatorCmdPendingCount++;
runEmulatorCmd("gsm location " + lac + " " + cid, function (result) {
emulatorCmdPendingCount--;
is(result[0], "OK");
});
}
@ -136,6 +141,11 @@ function testHome() {
}
function cleanUp() {
if (emulatorCmdPendingCount > 0) {
setTimeout(cleanUp, 100);
return;
}
SpecialPowers.removePermission("mobileconnection", document);
finish();
}

View File

@ -211,7 +211,7 @@ nsPluginInstanceOwner::GetImageContainer()
#ifdef XP_MACOSX
AutoLockImage autoLock(container);
Image* image = autoLock.GetImage();
if (image && image->GetFormat() == ImageFormat::MAC_IO_SURFACE && mObjectFrame) {
if (image && image->GetFormat() == MAC_IO_SURFACE && mObjectFrame) {
MacIOSurfaceImage *oglImage = static_cast<MacIOSurfaceImage*>(image);
NS_ADDREF_THIS();
oglImage->SetUpdateCallback(&DrawPlugin, this);
@ -3717,7 +3717,7 @@ void nsPluginInstanceOwner::SetFrame(nsObjectFrame *aFrame)
#ifdef XP_MACOSX
AutoLockImage autoLock(container);
Image *image = autoLock.GetImage();
if (image && (image->GetFormat() == ImageFormat::MAC_IO_SURFACE) && mObjectFrame) {
if (image && (image->GetFormat() == MAC_IO_SURFACE) && mObjectFrame) {
// Undo what we did to the current image in SetCurrentImageInTransaction().
MacIOSurfaceImage *oglImage = static_cast<MacIOSurfaceImage*>(image);
oglImage->SetUpdateCallback(nullptr, nullptr);

View File

@ -1091,9 +1091,10 @@ PluginInstanceChild::AnswerNPP_SetWindow(const NPRemoteWindow& aWindow)
mWindow.type = aWindow.type;
mWsInfo.colormap = aWindow.colormap;
if (!XVisualIDToInfo(mWsInfo.display, aWindow.visualID,
&mWsInfo.visual, &mWsInfo.depth))
return false;
int depth;
FindVisualAndDepth(mWsInfo.display, aWindow.visualID,
&mWsInfo.visual, &depth);
mWsInfo.depth = depth;
if (!mWindow.window && mWindow.type == NPWindowTypeWindow) {
CreateWindow(aWindow);

View File

@ -731,10 +731,10 @@ PluginInstanceParent::GetImageContainer(ImageContainer** aContainer)
#endif
return NS_ERROR_NOT_AVAILABLE;
ImageFormat format = ImageFormat::CAIRO_SURFACE;
ImageFormat format = CAIRO_SURFACE;
#ifdef XP_MACOSX
if (ioSurface) {
format = ImageFormat::MAC_IO_SURFACE;
format = MAC_IO_SURFACE;
}
#endif
@ -758,7 +758,7 @@ PluginInstanceParent::GetImageContainer(ImageContainer** aContainer)
#ifdef XP_MACOSX
if (ioSurface) {
NS_ASSERTION(image->GetFormat() == ImageFormat::MAC_IO_SURFACE, "Wrong format?");
NS_ASSERTION(image->GetFormat() == MAC_IO_SURFACE, "Wrong format?");
MacIOSurfaceImage* ioImage = static_cast<MacIOSurfaceImage*>(image.get());
MacIOSurfaceImage::Data ioData;
ioData.mIOSurface = ioSurface;
@ -771,7 +771,7 @@ PluginInstanceParent::GetImageContainer(ImageContainer** aContainer)
}
#endif
NS_ASSERTION(image->GetFormat() == ImageFormat::CAIRO_SURFACE, "Wrong format?");
NS_ASSERTION(image->GetFormat() == CAIRO_SURFACE, "Wrong format?");
CairoImage* pluginImage = static_cast<CairoImage*>(image.get());
CairoImage::Data cairoData;
cairoData.mSurface = mFrontSurface;

View File

@ -118,7 +118,6 @@ GLXLibrary::EnsureInitialized()
{ (PRFuncPtr*) &xGetFBConfigAttribInternal, { "glXGetFBConfigAttrib", NULL } },
// WARNING: xGetFBConfigs not set in symbols13_ext
{ (PRFuncPtr*) &xGetFBConfigsInternal, { "glXGetFBConfigs", NULL } },
{ (PRFuncPtr*) &xGetVisualFromFBConfigInternal, { "glXGetVisualFromFBConfig", NULL } },
// WARNING: symbols13_ext sets xCreateGLXPixmapWithConfig instead
{ (PRFuncPtr*) &xCreatePixmapInternal, { "glXCreatePixmap", NULL } },
{ (PRFuncPtr*) &xDestroyPixmapInternal, { "glXDestroyPixmap", NULL } },
@ -132,7 +131,6 @@ GLXLibrary::EnsureInitialized()
{ (PRFuncPtr*) &xChooseFBConfigInternal, { "glXChooseFBConfigSGIX", NULL } },
{ (PRFuncPtr*) &xGetFBConfigAttribInternal, { "glXGetFBConfigAttribSGIX", NULL } },
// WARNING: no xGetFBConfigs equivalent in extensions
{ (PRFuncPtr*) &xGetVisualFromFBConfigInternal, { "glXGetVisualFromFBConfig", NULL } },
// WARNING: different from symbols13:
{ (PRFuncPtr*) &xCreateGLXPixmapWithConfigInternal, { "glXCreateGLXPixmapWithConfigSGIX", NULL } },
{ (PRFuncPtr*) &xDestroyPixmapInternal, { "glXDestroyGLXPixmap", NULL } }, // not from ext
@ -270,14 +268,16 @@ GLXLibrary::CreatePixmap(gfxASurface* aSurface)
if (!format || format->type != PictTypeDirect) {
return None;
}
bool withAlpha =
aSurface->GetContentType() == gfxASurface::CONTENT_COLOR_ALPHA;
const XRenderDirectFormat& direct = format->direct;
int alphaSize;
PR_FLOOR_LOG2(alphaSize, direct.alphaMask + 1);
NS_ASSERTION((1 << alphaSize) - 1 == direct.alphaMask,
"Unexpected render format with non-adjacent alpha bits");
int attribs[] = { GLX_DOUBLEBUFFER, False,
GLX_DRAWABLE_TYPE, GLX_PIXMAP_BIT,
GLX_ALPHA_SIZE, (withAlpha ? 1 : 0),
(withAlpha ? GLX_BIND_TO_TEXTURE_RGBA_EXT
GLX_ALPHA_SIZE, alphaSize,
(alphaSize ? GLX_BIND_TO_TEXTURE_RGBA_EXT
: GLX_BIND_TO_TEXTURE_RGB_EXT), True,
GLX_RENDER_TYPE, GLX_RGBA_BIT,
None };
@ -291,42 +291,83 @@ GLXLibrary::CreatePixmap(gfxASurface* aSurface)
attribs,
&numConfigs));
// Find an fbconfig that matches the pixel format used on the Pixmap.
int matchIndex = -1;
const XRenderDirectFormat& direct = format->direct;
unsigned long redMask =
static_cast<unsigned long>(direct.redMask) << direct.red;
unsigned long greenMask =
static_cast<unsigned long>(direct.greenMask) << direct.green;
unsigned long blueMask =
static_cast<unsigned long>(direct.blueMask) << direct.blue;
// XVisualInfo doesn't have information on the alpha channel, so just
// check the number of bits.
int alphaSize;
PR_FLOOR_LOG2(alphaSize, direct.alphaMask + 1);
NS_ASSERTION((1 << alphaSize) - 1 == direct.alphaMask,
"Unexpected render format with non-adjacent alpha bits");
ScopedXFree<XVisualInfo> vinfo;
// This is true if the Pixmap has bits for alpha or unused bits.
bool haveNonColorBits =
~(redMask | greenMask | blueMask) != -1UL << format->depth;
for (int i = 0; i < numConfigs; i++) {
int size;
if (sGLXLibrary.xGetFBConfigAttrib(display, cfgs[i],
GLX_ALPHA_SIZE, &size) != Success ||
size != alphaSize) {
int id = None;
sGLXLibrary.xGetFBConfigAttrib(display, cfgs[i], GLX_VISUAL_ID, &id);
Visual *visual;
int depth;
FindVisualAndDepth(display, id, &visual, &depth);
if (!visual ||
visual->c_class != TrueColor ||
visual->red_mask != redMask ||
visual->green_mask != greenMask ||
visual->blue_mask != blueMask ) {
continue;
}
// The visual depth won't necessarily match the render format depth as
// it may not include the alpha channel.
vinfo = sGLXLibrary.xGetVisualFromFBConfig(display, cfgs[i]);
if (!vinfo ||
vinfo->c_class != TrueColor ||
vinfo->red_mask != redMask ||
vinfo->green_mask != greenMask ||
vinfo->blue_mask != blueMask ) {
// Historically Xlib Visuals did not try to represent an alpha channel
// and there was no means to use an alpha channel on a Pixmap. The
// Xlib Visual from the fbconfig was not intended to have any
// information about alpha bits.
//
// Since then, RENDER has added formats for 32 bit depth Pixmaps.
// Some of these formats have bits for alpha and some have unused
// bits.
//
// Then the Composite extension added a 32 bit depth Visual intended
// for Windows with an alpha channel, so bits not in the visual color
// masks were expected to be treated as alpha bits.
//
// Usually GLX counts only color bits in the Visual depth, but the
// depth of Composite's ARGB Visual includes alpha bits. However,
// bits not in the color masks are not necessarily alpha bits because
// sometimes (NVIDIA) 32 bit Visuals are added for fbconfigs with 32
// bit BUFFER_SIZE but zero alpha bits and 24 color bits (NVIDIA
// again).
//
// This checks that the depth matches in one of the two ways.
if (depth != format->depth && depth != format->depth - alphaSize) {
continue;
}
// If all bits of the Pixmap are color bits and the Pixmap depth
// matches the depth of the fbconfig visual, then we can assume that
// the driver will do whatever is necessary to ensure that any
// GLXPixmap alpha bits are treated as set. We can skip the
// ALPHA_SIZE check in this situation. We need to skip this check for
// situations (ATI) where there are no fbconfigs without alpha bits.
//
// glXChooseFBConfig should prefer configs with smaller
// GLX_BUFFER_SIZE, so we should still get zero alpha bits if
// available, except perhaps with NVIDIA drivers where buffer size is
// not the specified sum of the component sizes.
if (haveNonColorBits) {
// There are bits in the Pixmap format that haven't been matched
// against the fbconfig visual. These bits could either represent
// alpha or be unused, so just check that the number of alpha bits
// matches.
int size = 0;
sGLXLibrary.xGetFBConfigAttrib(display, cfgs[i],
GLX_ALPHA_SIZE, &size);
if (size != alphaSize) {
continue;
}
}
matchIndex = i;
break;
}
if (matchIndex == -1) {
NS_WARNING("[GLX] Couldn't find a FBConfig matching Pixmap format");
@ -335,7 +376,7 @@ GLXLibrary::CreatePixmap(gfxASurface* aSurface)
int pixmapAttribs[] = { GLX_TEXTURE_TARGET_EXT, GLX_TEXTURE_2D_EXT,
GLX_TEXTURE_FORMAT_EXT,
(withAlpha ? GLX_TEXTURE_FORMAT_RGBA_EXT
(alphaSize ? GLX_TEXTURE_FORMAT_RGBA_EXT
: GLX_TEXTURE_FORMAT_RGB_EXT),
None};
@ -519,16 +560,6 @@ GLXLibrary::xCreateNewContext(Display* display,
return result;
}
XVisualInfo*
GLXLibrary::xGetVisualFromFBConfig(Display* display,
GLXFBConfig config)
{
BEFORE_GLX_CALL;
XVisualInfo* result = xGetVisualFromFBConfigInternal(display, config);
AFTER_GLX_CALL;
return result;
}
int
GLXLibrary::xGetFBConfigAttrib(Display *display,
GLXFBConfig config,
@ -612,18 +643,6 @@ GLXLibrary::xDestroyPixmap(Display *display, GLXPixmap pixmap)
AFTER_GLX_CALL;
}
GLXContext
GLXLibrary::xCreateContext(Display *display,
XVisualInfo *vis,
GLXContext shareList,
Bool direct)
{
BEFORE_GLX_CALL;
GLXContext result = xCreateContextInternal(display, vis, shareList, direct);
AFTER_GLX_CALL;
return result;
}
Bool
GLXLibrary::xQueryVersion(Display *display,
int *major,
@ -699,7 +718,6 @@ public:
Display *display,
GLXDrawable drawable,
GLXFBConfig cfg,
XVisualInfo *vinfo,
GLContextGLX *shareContext,
bool deleteDrawable,
gfxXlibSurface *pixmap = nullptr)
@ -1073,16 +1091,12 @@ GetGlobalContextGLX()
}
static bool
AreCompatibleVisuals(XVisualInfo *one, XVisualInfo *two)
AreCompatibleVisuals(Visual *one, Visual *two)
{
if (one->c_class != two->c_class) {
return false;
}
if (one->depth != two->depth) {
return false;
}
if (one->red_mask != two->red_mask ||
one->green_mask != two->green_mask ||
one->blue_mask != two->blue_mask) {
@ -1150,34 +1164,25 @@ GLContextProviderGLX::CreateForWindow(nsIWidget *aWidget)
printf("[GLX] widget has VisualID 0x%lx\n", widgetVisualID);
#endif
ScopedXFree<XVisualInfo> vi;
if (gIsATI) {
XVisualInfo vinfo_template;
int nvisuals;
vinfo_template.visual = widgetAttrs.visual;
vinfo_template.visualid = XVisualIDFromVisual(vinfo_template.visual);
vinfo_template.depth = widgetAttrs.depth;
vinfo_template.screen = xscreen;
vi = XGetVisualInfo(display, VisualIDMask|VisualDepthMask|VisualScreenMask,
&vinfo_template, &nvisuals);
NS_ASSERTION(vi && nvisuals == 1, "Could not locate unique matching XVisualInfo for Visual");
}
int matchIndex = -1;
ScopedXFree<XVisualInfo> vinfo;
for (int i = 0; i < numConfigs; i++) {
vinfo = sGLXLibrary.xGetVisualFromFBConfig(display, cfgs[i]);
if (!vinfo) {
int visid = None;
sGLXLibrary.xGetFBConfigAttrib(display, cfgs[i], GLX_VISUAL_ID, &visid);
if (!visid) {
continue;
}
if (gIsATI) {
if (AreCompatibleVisuals(vi, vinfo)) {
int depth;
Visual *visual;
FindVisualAndDepth(display, visid, &visual, &depth);
if (depth == widgetAttrs.depth &&
AreCompatibleVisuals(widgetAttrs.visual, visual)) {
matchIndex = i;
break;
}
} else {
if (widgetVisualID == vinfo->visualid) {
if (widgetVisualID == static_cast<VisualID>(visid)) {
matchIndex = i;
break;
}
@ -1195,7 +1200,6 @@ GLContextProviderGLX::CreateForWindow(nsIWidget *aWidget)
display,
window,
cfgs[matchIndex],
vinfo,
shareContext,
false);
@ -1239,11 +1243,11 @@ CreateOffscreenPixmapContext(const gfxIntSize& aSize,
NS_ASSERTION(numConfigs > 0,
"glXChooseFBConfig() failed to match our requested format and violated its spec (!)");
ScopedXFree<XVisualInfo> vinfo;
int visid = None;
int chosenIndex = 0;
for (int i = 0; i < numConfigs; ++i) {
int dtype, visid;
int dtype;
if (sGLXLibrary.xGetFBConfigAttrib(display, cfgs[i], GLX_DRAWABLE_TYPE, &dtype) != Success
|| !(dtype & GLX_PIXMAP_BIT))
@ -1256,25 +1260,24 @@ CreateOffscreenPixmapContext(const gfxIntSize& aSize,
continue;
}
vinfo = sGLXLibrary.xGetVisualFromFBConfig(display, cfgs[i]);
if (vinfo) {
chosenIndex = i;
break;
}
chosenIndex = i;
break;
}
if (!vinfo) {
if (!visid) {
NS_WARNING("glXChooseFBConfig() didn't give us any configs with visuals!");
return nullptr;
}
Visual *visual;
int depth;
FindVisualAndDepth(display, visid, &visual, &depth);
ScopedXErrorHandler xErrorHandler;
GLXPixmap glxpixmap = 0;
bool error = false;
nsRefPtr<gfxXlibSurface> xsurface = gfxXlibSurface::Create(DefaultScreenOfDisplay(display),
vinfo->visual,
visual,
gfxIntSize(16, 16));
if (xsurface->CairoStatus() != 0) {
error = true;
@ -1312,7 +1315,6 @@ DONE_CREATING_PIXMAP:
display,
glxpixmap,
cfgs[chosenIndex],
vinfo,
aShare ? GetGlobalContextGLX() : nullptr,
true,
xsurface);

View File

@ -38,8 +38,6 @@ public:
int render_type,
GLXContext share_list,
Bool direct);
XVisualInfo* xGetVisualFromFBConfig(Display* display,
GLXFBConfig config);
int xGetFBConfigAttrib(Display *display,
GLXFBConfig config,
int attribute,
@ -59,10 +57,6 @@ public:
GLXFBConfig config,
Pixmap pixmap);
void xDestroyPixmap(Display *display, GLXPixmap pixmap);
GLXContext xCreateContext(Display *display,
XVisualInfo *vis,
GLXContext shareList,
Bool direct);
Bool xQueryVersion(Display *display,
int *major,
int *minor);
@ -121,9 +115,6 @@ private:
GLXContext,
Bool);
PFNGLXCREATENEWCONTEXT xCreateNewContextInternal;
typedef XVisualInfo* (GLAPIENTRY * PFNGLXGETVISUALFROMFBCONFIG) (Display *,
GLXFBConfig);
PFNGLXGETVISUALFROMFBCONFIG xGetVisualFromFBConfigInternal;
typedef int (GLAPIENTRY * PFNGLXGETFBCONFIGATTRIB) (Display *,
GLXFBConfig,
int,
@ -157,11 +148,6 @@ private:
typedef void (GLAPIENTRY * PFNGLXDESTROYPIXMAP) (Display *,
GLXPixmap);
PFNGLXDESTROYPIXMAP xDestroyPixmapInternal;
typedef GLXContext (GLAPIENTRY * PFNGLXCREATECONTEXT) (Display *,
XVisualInfo *,
GLXContext,
Bool);
PFNGLXCREATECONTEXT xCreateContextInternal;
typedef Bool (GLAPIENTRY * PFNGLXQUERYVERSION) (Display *,
int *,
int *);

View File

@ -47,18 +47,18 @@ ImageFactory::CreateImage(const ImageFormat *aFormats,
return nullptr;
}
nsRefPtr<Image> img;
if (FormatInList(aFormats, aNumFormats, ImageFormat::PLANAR_YCBCR)) {
if (FormatInList(aFormats, aNumFormats, PLANAR_YCBCR)) {
img = new PlanarYCbCrImage(aRecycleBin);
} else if (FormatInList(aFormats, aNumFormats, ImageFormat::CAIRO_SURFACE)) {
} else if (FormatInList(aFormats, aNumFormats, CAIRO_SURFACE)) {
img = new CairoImage();
} else if (FormatInList(aFormats, aNumFormats, ImageFormat::SHARED_TEXTURE)) {
} else if (FormatInList(aFormats, aNumFormats, SHARED_TEXTURE)) {
img = new SharedTextureImage();
#ifdef XP_MACOSX
} else if (FormatInList(aFormats, aNumFormats, ImageFormat::MAC_IO_SURFACE)) {
} else if (FormatInList(aFormats, aNumFormats, MAC_IO_SURFACE)) {
img = new MacIOSurfaceImage();
#endif
#ifdef MOZ_WIDGET_GONK
} else if (FormatInList(aFormats, aNumFormats, ImageFormat::GONK_IO_SURFACE)) {
} else if (FormatInList(aFormats, aNumFormats, GONK_IO_SURFACE)) {
img = new GonkIOSurfaceImage();
#endif
}
@ -239,7 +239,7 @@ ImageContainer::LockCurrentAsSurface(gfxIntSize *aSize, Image** aCurrentImage)
return nullptr;
}
if (mActiveImage->GetFormat() == ImageFormat::REMOTE_IMAGE_BITMAP) {
if (mActiveImage->GetFormat() == REMOTE_IMAGE_BITMAP) {
nsRefPtr<gfxImageSurface> newSurf =
new gfxImageSurface(mRemoteData->mBitmap.mData, mRemoteData->mSize, mRemoteData->mBitmap.mStride,
mRemoteData->mFormat == RemoteImageData::BGRX32 ?
@ -549,4 +549,4 @@ RemoteBitmapImage::GetAsSurface()
}
} // namespace
} // namespace
} // namespace

View File

@ -281,7 +281,7 @@ BasicShadowableImageLayer::Paint(gfxContext* aContext, Layer* aMaskLayer)
->Paint(aContext, nullptr);
}
if (image->GetFormat() == ImageFormat::SHARED_TEXTURE &&
if (image->GetFormat() == SHARED_TEXTURE &&
BasicManager()->GetParentBackendType() == mozilla::layers::LAYERS_OPENGL) {
SharedTextureImage *sharedImage = static_cast<SharedTextureImage*>(image);
const SharedTextureImage::Data *data = sharedImage->GetData();
@ -292,7 +292,7 @@ BasicShadowableImageLayer::Paint(gfxContext* aContext, Layer* aMaskLayer)
return;
}
if (image->GetFormat() == ImageFormat::PLANAR_YCBCR && BasicManager()->IsCompositingCheap()) {
if (image->GetFormat() == PLANAR_YCBCR && BasicManager()->IsCompositingCheap()) {
PlanarYCbCrImage *YCbCrImage = static_cast<PlanarYCbCrImage*>(image);
const PlanarYCbCrImage::Data *data = YCbCrImage->GetData();
NS_ASSERTION(data, "Must be able to retrieve yuv data from image!");

View File

@ -67,7 +67,7 @@ public:
}
nsRefPtr<Image> image;
if (aFormats[0] == ImageFormat::PLANAR_YCBCR) {
if (aFormats[0] == PLANAR_YCBCR) {
image = new BasicPlanarYCbCrImage(aScaleHint, gfxPlatform::GetPlatform()->GetOffscreenFormat(), aRecycleBin);
return image.forget();
}

View File

@ -121,7 +121,7 @@ void ImageContainerChild::DestroySharedImage(const SharedImage& aImage)
bool ImageContainerChild::CopyDataIntoSharedImage(Image* src, SharedImage* dest)
{
if ((src->GetFormat() == ImageFormat::PLANAR_YCBCR) &&
if ((src->GetFormat() == PLANAR_YCBCR) &&
(dest->type() == SharedImage::TYUVImage)) {
PlanarYCbCrImage *YCbCrImage = static_cast<PlanarYCbCrImage*>(src);
const PlanarYCbCrImage::Data *data = YCbCrImage->GetData();
@ -161,7 +161,7 @@ SharedImage* ImageContainerChild::CreateSharedImageFromData(Image* image)
++mActiveImageCount;
if (image->GetFormat() == ImageFormat::PLANAR_YCBCR ) {
if (image->GetFormat() == PLANAR_YCBCR ) {
PlanarYCbCrImage *YCbCrImage = static_cast<PlanarYCbCrImage*>(image);
const PlanarYCbCrImage::Data *data = YCbCrImage->GetData();
NS_ASSERTION(data, "Must be able to retrieve yuv data from image!");
@ -202,7 +202,7 @@ SharedImage* ImageContainerChild::CreateSharedImageFromData(Image* image)
"SharedImage type not set correctly");
return result;
#ifdef MOZ_WIDGET_GONK
} else if (image->GetFormat() == ImageFormat::GONK_IO_SURFACE) {
} else if (image->GetFormat() == GONK_IO_SURFACE) {
GonkIOSurfaceImage* gonkImage = static_cast<GonkIOSurfaceImage*>(image);
SharedImage* result = new SharedImage(gonkImage->GetSurfaceDescriptor());
return result;
@ -236,7 +236,7 @@ SharedImageCompatibleWith(SharedImage* aSharedImage, Image* aImage)
{
// TODO accept more image formats
switch (aImage->GetFormat()) {
case ImageFormat::PLANAR_YCBCR: {
case PLANAR_YCBCR: {
if (aSharedImage->type() != SharedImage::TYUVImage) {
return false;
}

View File

@ -77,9 +77,9 @@ SurfaceDescriptorX11::OpenForeign() const
if (pictFormat) {
surf = new gfxXlibSurface(screen, mId, pictFormat, mSize);
} else {
Visual* visual = NULL;
unsigned int depth;
XVisualIDToInfo(display, mFormat, &visual, &depth);
Visual* visual;
int depth;
FindVisualAndDepth(display, mFormat, &visual, &depth);
if (!visual)
return nullptr;

View File

@ -244,12 +244,12 @@ ImageLayerOGL::RenderLayer(int,
return;
}
NS_ASSERTION(image->GetFormat() != ImageFormat::REMOTE_IMAGE_BITMAP,
NS_ASSERTION(image->GetFormat() != REMOTE_IMAGE_BITMAP,
"Remote images aren't handled yet in OGL layers!");
NS_ASSERTION(mScaleMode == SCALE_NONE,
"Scale modes other than none not handled yet in OGL layers!");
if (image->GetFormat() == ImageFormat::PLANAR_YCBCR) {
if (image->GetFormat() == PLANAR_YCBCR) {
PlanarYCbCrImage *yuvImage =
static_cast<PlanarYCbCrImage*>(image);
@ -309,7 +309,7 @@ ImageLayerOGL::RenderLayer(int,
// We shouldn't need to do this, but do it anyway just in case
// someone else forgets.
gl()->fActiveTexture(LOCAL_GL_TEXTURE0);
} else if (image->GetFormat() == ImageFormat::CAIRO_SURFACE) {
} else if (image->GetFormat() == CAIRO_SURFACE) {
CairoImage *cairoImage =
static_cast<CairoImage*>(image);
@ -385,7 +385,7 @@ ImageLayerOGL::RenderLayer(int,
}
#endif
#ifdef XP_MACOSX
} else if (image->GetFormat() == ImageFormat::MAC_IO_SURFACE) {
} else if (image->GetFormat() == MAC_IO_SURFACE) {
MacIOSurfaceImage *ioImage =
static_cast<MacIOSurfaceImage*>(image);
@ -441,7 +441,7 @@ ImageLayerOGL::RenderLayer(int,
gl()->fBindTexture(LOCAL_GL_TEXTURE_RECTANGLE_ARB, 0);
#endif
#ifdef MOZ_WIDGET_GONK
} else if (image->GetFormat() == ImageFormat::GONK_IO_SURFACE) {
} else if (image->GetFormat() == GONK_IO_SURFACE) {
GonkIOSurfaceImage *ioImage = static_cast<GonkIOSurfaceImage*>(image);
if (!ioImage) {
@ -636,7 +636,7 @@ ImageLayerOGL::LoadAsTexture(GLuint aTextureUnit, gfxIntSize* aSize)
return false;
}
if (image->GetFormat() != ImageFormat::CAIRO_SURFACE) {
if (image->GetFormat() != CAIRO_SURFACE) {
return false;
}

View File

@ -9,16 +9,10 @@
namespace mozilla {
bool
XVisualIDToInfo(Display* aDisplay, VisualID aVisualID,
Visual** aVisual, unsigned int* aDepth)
void
FindVisualAndDepth(Display* aDisplay, VisualID aVisualID,
Visual** aVisual, int* aDepth)
{
if (aVisualID == None) {
*aVisual = NULL;
*aDepth = 0;
return true;
}
const Screen* screen = DefaultScreenOfDisplay(aDisplay);
for (int d = 0; d < screen->ndepths; d++) {
@ -28,13 +22,15 @@ XVisualIDToInfo(Display* aDisplay, VisualID aVisualID,
if (visual->visualid == aVisualID) {
*aVisual = visual;
*aDepth = d_info->depth;
return true;
return;
}
}
}
NS_ERROR("VisualID not on Screen.");
return false;
NS_ASSERTION(aVisualID == None, "VisualID not on Screen.");
*aVisual = nullptr;
*aDepth = 0;
return;
}
void

View File

@ -45,12 +45,11 @@ DefaultXDisplay()
* Sets *aVisual to point to aDisplay's Visual struct corresponding to
* aVisualID, and *aDepth to its depth. When aVisualID is None, these are set
* to NULL and 0 respectively. Both out-parameter pointers are assumed
* non-NULL. Returns true in both of these situations, but false if aVisualID
* is not None and not found on the Display.
* non-NULL.
*/
bool
XVisualIDToInfo(Display* aDisplay, VisualID aVisualID,
Visual** aVisual, unsigned int* aDepth);
void
FindVisualAndDepth(Display* aDisplay, VisualID aVisualID,
Visual** aVisual, int* aDepth);
/**

View File

@ -883,7 +883,7 @@ RasterImage::GetImageContainer(ImageContainer **_retval)
mImageContainer = LayerManager::CreateImageContainer();
// Now create a CairoImage to display the surface.
ImageFormat cairoFormat = ImageFormat::CAIRO_SURFACE;
ImageFormat cairoFormat = CAIRO_SURFACE;
nsRefPtr<layers::Image> image = mImageContainer->CreateImage(&cairoFormat, 1);
NS_ASSERTION(image, "Failed to create Image");

View File

@ -17,7 +17,7 @@
extern "C" {
extern JSBool
C_ValueToObject(JSContext *cx, jsval v, JSMutableHandleObject obj);
C_ValueToObject(JSContext *cx, jsval v, JSObject **obj);
extern jsval
C_GetEmptyStringValue(JSContext *cx);
@ -32,7 +32,7 @@ BEGIN_TEST(testValueABI_retparam)
JS::RootedObject obj(cx, JS_GetGlobalObject(cx));
jsval v = OBJECT_TO_JSVAL(obj);
obj = NULL;
CHECK(C_ValueToObject(cx, v, &obj));
CHECK(C_ValueToObject(cx, v, obj.address()));
JSBool equal;
CHECK(JS_StrictlyEqual(cx, v, OBJECT_TO_JSVAL(obj), &equal));
CHECK(equal);

View File

@ -30,11 +30,9 @@ namespace js {
class CallObject;
#ifdef JS_METHODJIT
namespace mjit {
struct JITScript;
}
#endif
namespace types {

View File

@ -21,6 +21,9 @@ simple_events = [
'DeviceOrientationEvent',
'DeviceLightEvent',
'MozApplicationEvent',
#ifdef MOZ_B2G_BT
'BluetoothDeviceAddressEvent',
#endif
'DeviceStorageChangeEvent'
]

View File

@ -3188,7 +3188,7 @@ ContainerState::SetupMaskLayer(Layer *aLayer, const FrameLayerBuilder::Clip& aCl
// build the image and container
container = aLayer->Manager()->CreateImageContainer();
NS_ASSERTION(container, "Could not create image container for mask layer.");
static const ImageFormat format = ImageFormat::CAIRO_SURFACE;
static const ImageFormat format = CAIRO_SURFACE;
nsRefPtr<Image> image = container->CreateImage(&format, 1);
NS_ASSERTION(image, "Could not create image container for mask layer.");
CairoImage::Data data;

View File

@ -0,0 +1,57 @@
<!DOCTYPE HTML>
<html><head>
<title>min-/max-height testcase for bug 308801</title>
<style type="text/css">
html,body {
color:black; background-color:white; font-size:16px; padding:0; margin:0;
}
.test1 {
height:35px;
border:1px solid black;
}
.test2 {
height:37px;
background:black;
}
.test3 {
height:21px;
border:8px solid black;
}
p { height:43px; margin:0; padding:0; }
</style>
</head>
<body>
<div class="box min test1"></div>
<br><div class="box min test2"></div>
<br><div class="box min test3"></div>
<br><div class="box max test1"><p></div>
<br><div class="box max test2"><p></div>
<br><div class="box max test3"><p></div>
<br><!-- overflow:hidden -->
<div class="hidden box min test1"></div>
<br><div class="hidden box min test2"></div>
<br><div class="hidden box min test3"></div>
<br><div class="hidden box max test1"><p></div>
<br><div class="hidden box max test2"><p></div>
<br><div class="hidden box max test3"><p></div>
</body>
</html>

View File

@ -0,0 +1,71 @@
<!DOCTYPE HTML>
<html><head>
<title>min-/max-height testcase for bug 308801</title>
<style type="text/css">
html,body {
color:black; background-color:white; font-size:16px; padding:0; margin:0;
}
div {
margin:0;
padding:0;
}
.min { min-height:37px; }
.max { max-height:37px; }
.hidden { overflow:hidden; }
.box {
box-sizing: border-box;
-moz-box-sizing: border-box;
}
.test1 {
border:1px solid black;
}
.test2 {
padding:3px;
background:black;
}
.test3 {
border:8px solid black;
padding:5px;
}
p { height:43px; margin:0; padding:0; }
</style>
</head>
<body>
<div class="box min test1"></div>
<br><div class="box min test2"></div>
<br><div class="box min test3"></div>
<br><div class="box max test1"><p></div>
<br><div class="box max test2"><p></div>
<br><div class="box max test3"><p></div>
<br><!-- overflow:hidden -->
<div class="hidden box min test1"></div>
<br><div class="hidden box min test2"></div>
<br><div class="hidden box min test3"></div>
<br><div class="hidden box max test1"><p></div>
<br><div class="hidden box max test2"><p></div>
<br><div class="hidden box max test3"><p></div>
</body>
</html>

View File

@ -0,0 +1,68 @@
<!DOCTYPE HTML>
<html><head>
<title>min-/max-width testcase for bug 308801</title>
<style type="text/css">
html,body {
color:black; background-color:white; font-size:16px;
}
.test1, .test2 {
width:100px;
height:20px;
background:black;
}
.test3 {
width:30px;
border:10px solid black;
padding:25px;
}
br { margin-top:13px; }
</style>
</head>
<body>
<div style="float:left"><div class="box min test1"></div></div>
<br clear="all">
<div style="float:left"><div class="box min test2"></div></div>
<br clear="all">
<div style="float:left"><div class="box min test3"></div></div>
<br clear="all">
<br clear="all">
<div class="box max test1"></div>
<br clear="all">
<div class="box max test2"></div>
<br clear="all">
<div class="box max test3"></div>
<br clear="all">
<!-- overflow:hidden -->
<div style="float:left"><div class="hidden box min test1"></div></div>
<br clear="all">
<div style="float:left"><div class="hidden box min test2"></div></div>
<br clear="all">
<div style="float:left"><div class="hidden box min test3"></div></div>
<br clear="all">
<br clear="all">
<div class="hidden box max test1"></div>
<br clear="all">
<div class="hidden box max test2"></div>
<br clear="all">
<div class="hidden box max test3"></div>
</body>
</html>

View File

@ -0,0 +1,84 @@
<!DOCTYPE HTML>
<html><head>
<title>min-/max-width testcase for bug 308801</title>
<style type="text/css">
html,body {
color:black; background-color:white; font-size:16px;
}
div {
margin:0;
padding:0;
}
.min { min-width:100px; }
.max { max-width:100px; }
.hidden { overflow:hidden; }
.box {
box-sizing: border-box;
-moz-box-sizing: border-box;
}
.test1 {
border:10px solid black;
}
.test2 {
padding:10px;
background:black;
}
.test3 {
border:10px solid black;
padding:25px;
}
br { margin-top:13px; }
</style>
</head>
<body>
<div style="float:left"><div class="box min test1"></div></div>
<br clear="all">
<div style="float:left"><div class="box min test2"></div></div>
<br clear="all">
<div style="float:left"><div class="box min test3"></div></div>
<br clear="all">
<br clear="all">
<div class="box max test1"></div>
<br clear="all">
<div class="box max test2"></div>
<br clear="all">
<div class="box max test3"></div>
<br clear="all">
<!-- overflow:hidden -->
<div style="float:left"><div class="hidden box min test1"></div></div>
<br clear="all">
<div style="float:left"><div class="hidden box min test2"></div></div>
<br clear="all">
<div style="float:left"><div class="hidden box min test3"></div></div>
<br clear="all">
<br clear="all">
<div class="hidden box max test1"></div>
<br clear="all">
<div class="hidden box max test2"></div>
<br clear="all">
<div class="hidden box max test3"></div>
</body>
</html>

View File

@ -16,6 +16,8 @@
== box-sizing-2.html box-sizing-2-ref.html
== box-sizing-3.html box-sizing-1-ref.html
== box-sizing-4.html box-sizing-4-ref.html
== box-sizing-minmax-height.html box-sizing-minmax-height-ref.html
== box-sizing-minmax-width.html box-sizing-minmax-width-ref.html
== abspos-non-replaced-width-offset-margin.html abspos-non-replaced-width-offset-margin-ref.html
== abspos-replaced-width-offset-margin.html abspos-replaced-width-offset-margin-ref.html
HTTP(..) == CSS21-t100301.xhtml CSS21-t100301-ref.xhtml

View File

@ -220,10 +220,6 @@ pref("accessibility.typeaheadfind.casesensitive", 0);
// zoom key(F7) conflicts with caret browsing on maemo
pref("accessibility.browsewithcaret_shortcut.enabled", false);
// Whether or not we show a dialog box informing the user that the update was
// successfully applied.
pref("app.update.showInstalledUI", false);
// Whether the character encoding menu is under the main Firefox button. This
// preference is a string so that localizers can alter it.
pref("browser.menu.showCharacterEncoding", "chrome://browser/locale/browser.properties");
@ -381,12 +377,22 @@ pref("geo.enabled", true);
// Disable methodjit in chrome to save memory
pref("javascript.options.methodjit.chrome", false);
pref("javascript.options.mem.high_water_mark", 32);
// Disable the JS engine's gc on memory pressure, since we do one in the mobile
// browser (bug 669346).
pref("javascript.options.gc_on_memory_pressure", false);
#ifdef MOZ_PKG_SPECIAL
// low memory devices
pref("javascript.options.mem.gc_high_frequency_heap_growth_max", 120);
pref("javascript.options.mem.gc_high_frequency_heap_growth_min", 101);
pref("javascript.options.mem.gc_high_frequency_high_limit_mb", 40);
pref("javascript.options.mem.gc_high_frequency_low_limit_mb", 10);
pref("javascript.options.mem.gc_low_frequency_heap_growth", 105);
pref("javascript.options.mem.high_water_mark", 16);
#else
pref("javascript.options.mem.high_water_mark", 32);
#endif
pref("dom.max_chrome_script_run_time", 0); // disable slow script dialog for chrome
pref("dom.max_script_run_time", 20);
@ -477,12 +483,13 @@ pref("browser.search.param.yahoo-fr-cjkt", "moz35");
pref("browser.search.param.yahoo-fr-ja", "mozff");
#endif
/* app update prefs */
pref("app.update.timer", 60000); // milliseconds (1 min)
/* prefs used by the update timer system (including blocklist pings) */
pref("app.update.timerFirstInterval", 30000); // milliseconds
pref("app.update.timerMinimumDelay", 30); // seconds
#ifdef MOZ_UPDATER
/* prefs used specifically for updating the app */
pref("app.update.enabled", true);
pref("app.update.timerFirstInterval", 20000); // milliseconds
pref("app.update.auto", false);
pref("app.update.channel", "@MOZ_UPDATE_CHANNEL@");
pref("app.update.mode", 1);
@ -503,7 +510,7 @@ pref("app.update.interval", 86400);
pref("app.update.url.manual", "http://www.mozilla.com/%LOCALE%/m/");
pref("app.update.url.details", "http://www.mozilla.com/%LOCALE%/mobile/releases/");
#else
pref("app.update.interval", 28800);
pref("app.update.interval", 3600);
pref("app.update.url.manual", "http://www.mozilla.com/%LOCALE%/mobile/");
pref("app.update.url.details", "http://www.mozilla.com/%LOCALE%/mobile/");
#endif
@ -688,7 +695,7 @@ pref("reader.color_scheme", "light");
pref("reader.has_used_toolbar", false);
// Media plugins for libstagefright playback on android
pref("media.plugins.enabled", false);
pref("media.plugins.enabled", true);
// Coalesce touch events to prevent them from flooding the event queue
pref("dom.event.touch.coalescing.enabled", true);

View File

@ -10,6 +10,7 @@ import android.graphics.Color;
import android.graphics.drawable.AnimationDrawable;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.graphics.Rect;
import android.os.Build;
import android.os.Handler;
import android.os.SystemClock;
@ -18,6 +19,8 @@ import android.util.Log;
import android.view.ContextMenu;
import android.view.LayoutInflater;
import android.view.MenuInflater;
import android.view.MotionEvent;
import android.view.TouchDelegate;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
@ -224,6 +227,19 @@ public class BrowserToolbar implements ViewSwitcher.ViewFactory,
mActivity.openOptionsMenu();
}
});
// Set a touch delegate to Tabs button, so the touch events on its tail
// are passed to the menu button.
mLayout.post(new Runnable() {
@Override
public void run() {
int height = mTabs.getHeight();
int width = mTabs.getWidth();
int tail = (width - height) / 2;
Rect bounds = new Rect(width - tail, 0, width, height);
mTabs.setTouchDelegate(new TailTouchDelegate(bounds, mMenu));
}
});
}
if (Build.VERSION.SDK_INT >= 11) {
@ -601,4 +617,28 @@ public class BrowserToolbar implements ViewSwitcher.ViewFactory,
mPanel.addView(view);
}
}
private class TailTouchDelegate extends TouchDelegate {
public TailTouchDelegate(Rect bounds, View delegateView) {
super(bounds, delegateView);
}
@Override
public boolean onTouchEvent(MotionEvent event) {
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
// Android bug 36445: Touch Delegation not reset on ACTION_DOWN.
if (!super.onTouchEvent(event)) {
MotionEvent cancelEvent = MotionEvent.obtain(event);
cancelEvent.setAction(MotionEvent.ACTION_CANCEL);
super.onTouchEvent(cancelEvent);
return false;
} else {
return true;
}
default:
return super.onTouchEvent(event);
}
}
}
}

View File

@ -37,7 +37,7 @@
</div>
<div id="main-container">
<div id="noapps" class="hidden">
&aboutApps.noApps.pre;<a id="marketplaceURL" pref="app.marketplaceURL">&aboutApps.noApps.middle;</a>&aboutApps.noApps.post;
&aboutApps.noApps.pre;<a id="marketplaceURL" pref="app.marketplaceURL">&aboutApps.noApps.middle2;</a>&aboutApps.noApps.post;
</div>
<div>
<div class="spacer" id="spacer1"> </div>

View File

@ -8,5 +8,5 @@
<!-- LOCALIZATION NOTE (aboutApps.noApps.middle): avoid leading/trailing spaces, this text is a link -->
<!-- LOCALIZATION NOTE (aboutApps.noApps.post): include a starting space as needed -->
<!ENTITY aboutApps.noApps.pre "No web apps installed. Get some from the ">
<!ENTITY aboutApps.noApps.middle "app store">
<!ENTITY aboutApps.noApps.middle2 "Mozilla Marketplace">
<!ENTITY aboutApps.noApps.post ".">