Merge cvs-trunk-mirror to mozilla-central. No conflicts.

--HG--
rename : js/src/jsmath.c => js/src/jsmath.cpp
This commit is contained in:
Vladimir Vukicevic 2008-04-30 15:34:49 -07:00
commit ce3a5f0097
24 changed files with 2075 additions and 1896 deletions

View File

@ -194,7 +194,7 @@
// Force a copy action if parent node is a query or not-removable
if (aEvent.ctrlKey ||
PlacesUtils.nodeIsQuery(aEvent.target.node.parent) ||
PlacesControllerDragHelper.canMoveContainerNode(aEvent.target.node))
!PlacesControllerDragHelper.canMoveContainerNode(aEvent.target.node))
aDragAction.action = Ci.nsIDragService.DRAGDROP_ACTION_COPY;
// activate the view and cache the dragged node

View File

@ -1311,6 +1311,11 @@ tabpanels {
margin: 0px;
}
.tabs-alltabs-box-animate {
background-color: Highlight;
opacity: 0.0;
}
/* All tabs menupopup */
.alltabs-item > .menu-iconic-left > .menu-iconic-icon {
list-style-image: url("chrome://global/skin/icons/folder-item.png");

View File

@ -80,7 +80,6 @@
}
#infoPaneBox {
border-top: 1px solid ThreeDShadow;
padding: 5px;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.9 KiB

After

Width:  |  Height:  |  Size: 24 KiB

View File

@ -1264,6 +1264,10 @@ statusbarpanel#statusbar-display {
background-color: Window;
}
#sidebar-title {
-moz-padding-start: 0px;
}
#status-bar {
border-top: none;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

After

Width:  |  Height:  |  Size: 9.1 KiB

View File

@ -2410,12 +2410,12 @@ dnl the qsort routine under solaris is faulty
AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
if test "$CPU_ARCH" != "sparc"; then
CFLAGS="$CFLAGS -xstrconst -xbuiltin=%all"
CXXFLAGS="$CXXFLAGS -xbuiltin=%all -features=tmplife -norunpath"
CFLAGS="$CFLAGS -xlibmieee -xstrconst -xbuiltin=%all"
CXXFLAGS="$CXXFLAGS -xlibmieee -xbuiltin=%all -features=tmplife -norunpath"
else
# Do not use -xbuiltin on SPARC to get around a bug of compiler
CFLAGS="$CFLAGS -xstrconst -xbuiltin=%none"
CXXFLAGS="$CXXFLAGS -xbuiltin=%none -features=tmplife -norunpath"
CFLAGS="$CFLAGS -xlibmieee -xstrconst -xbuiltin=%none"
CXXFLAGS="$CXXFLAGS -xlibmieee -xbuiltin=%none -features=tmplife -norunpath"
fi
LDFLAGS="-xildoff -z lazyload -z combreloc $LDFLAGS"

View File

@ -50,6 +50,8 @@ class nsIFrame;
class nsIRenderingContext;
class nsICanvasRenderingContextInternal;
struct _cairo_surface;
class nsICanvasElement : public nsISupports {
@ -92,6 +94,13 @@ public:
* is relative to the origin of the canvas frame.
*/
NS_IMETHOD InvalidateFrameSubrect (const nsRect& damageRect) = 0;
/*
* Get the number of contexts in this canvas, and request a context at
* an index.
*/
virtual PRInt32 CountContexts () = 0;
virtual nsICanvasRenderingContextInternal *GetContextAtIndex (PRInt32 index) = 0;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsICanvasElement, NS_ICANVASELEMENT_IID)

View File

@ -47,6 +47,7 @@
{ 0xeab854fd, 0xaa5e, 0x44bb, { 0x8c, 0xc5, 0x8d, 0x02, 0xf8, 0x4b, 0x02, 0x16 } }
class gfxContext;
class gfxASurface;
class nsICanvasRenderingContextInternal : public nsISupports {
public:
@ -72,6 +73,10 @@ public:
NS_IMETHOD GetInputStream(const char *aMimeType,
const PRUnichar *aEncoderOptions,
nsIInputStream **aStream) = 0;
// If this canvas context can be represented with a simple Thebes surface,
// return the surface. Otherwise returns an error.
NS_IMETHOD GetThebesSurface(gfxASurface **surface) = 0;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsICanvasRenderingContextInternal,

View File

@ -295,6 +295,7 @@ public:
NS_IMETHOD GetInputStream(const char* aMimeType,
const PRUnichar* aEncoderOptions,
nsIInputStream **aStream);
NS_IMETHOD GetThebesSurface(gfxASurface **surface);
// nsISupports interface
NS_DECL_ISUPPORTS
@ -411,8 +412,8 @@ protected:
// cairo helpers
nsresult CairoSurfaceFromElement(nsIDOMElement *imgElt,
PRBool forceCopy,
cairo_surface_t **aCairoSurface,
PRUint8 **imgDataOut,
PRInt32 *widthOut, PRInt32 *heightOut,
nsIPrincipal **prinOut,
PRBool *forceWriteOnlyOut);
@ -1089,12 +1090,11 @@ nsCanvasRenderingContext2D::CreatePattern(nsIDOMHTMLElement *image,
}
cairo_surface_t *imgSurf = nsnull;
PRUint8 *imgData = nsnull;
PRInt32 imgWidth, imgHeight;
nsCOMPtr<nsIPrincipal> principal;
PRBool forceWriteOnly = PR_FALSE;
rv = CairoSurfaceFromElement(image, &imgSurf, &imgData,
&imgWidth, &imgHeight,
rv = CairoSurfaceFromElement(image, PR_TRUE,
&imgSurf, &imgWidth, &imgHeight,
getter_AddRefs(principal), &forceWriteOnly);
if (NS_FAILED(rv))
return rv;
@ -1918,12 +1918,11 @@ nsCanvasRenderingContext2D::DrawImage()
cairo_matrix_t surfMat;
cairo_pattern_t *pat;
cairo_path_t *old_path;
PRUint8 *imgData = nsnull;
PRInt32 imgWidth, imgHeight;
nsCOMPtr<nsIPrincipal> principal;
PRBool forceWriteOnly = PR_FALSE;
rv = CairoSurfaceFromElement(imgElt, &imgSurf, &imgData,
&imgWidth, &imgHeight,
rv = CairoSurfaceFromElement(imgElt, PR_FALSE,
&imgSurf, &imgWidth, &imgHeight,
getter_AddRefs(principal), &forceWriteOnly);
if (NS_FAILED(rv))
return rv;
@ -2154,12 +2153,15 @@ nsCanvasRenderingContext2D::ConvertJSValToXPCObject(nsISupports** aSupports, REF
/* cairo ARGB32 surfaces are ARGB stored as a packed 32-bit integer; on little-endian
* platforms, they appear as BGRA bytes in the surface data. The color values are also
* stored with premultiplied alpha.
*
* If forceCopy is FALSE, a surface may be returned that's only valid during the current
* operation. If it's TRUE, a copy will always be made that can safely be retained.
*/
nsresult
nsCanvasRenderingContext2D::CairoSurfaceFromElement(nsIDOMElement *imgElt,
PRBool forceCopy,
cairo_surface_t **aCairoSurface,
PRUint8 **imgData,
PRInt32 *widthOut,
PRInt32 *heightOut,
nsIPrincipal **prinOut,
@ -2202,20 +2204,35 @@ nsCanvasRenderingContext2D::CairoSurfaceFromElement(nsIDOMElement *imgElt,
rv = canvas->GetSize(&w, &h);
NS_ENSURE_SUCCESS(rv, rv);
nsRefPtr<gfxImageSurface> surf =
new gfxImageSurface (gfxIntSize(w, h), gfxASurface::ImageFormatARGB32);
nsRefPtr<gfxContext> ctx = new gfxContext(surf);
ctx->SetOperator(gfxContext::OPERATOR_CLEAR);
ctx->Paint();
ctx->SetOperator(gfxContext::OPERATOR_OVER);
nsRefPtr<gfxASurface> sourceSurface;
rv = canvas->RenderContexts(ctx);
if (NS_FAILED(rv))
return rv;
if (!forceCopy && canvas->CountContexts() == 1) {
nsICanvasRenderingContextInternal *srcCanvas = canvas->GetContextAtIndex(0);
rv = srcCanvas->GetThebesSurface(getter_AddRefs(sourceSurface));
if (NS_FAILED(rv))
sourceSurface = nsnull;
}
*aCairoSurface = surf->CairoSurface();
if (sourceSurface == nsnull) {
nsRefPtr<gfxASurface> surf =
gfxPlatform::GetPlatform()->CreateOffscreenSurface
(gfxIntSize(w, h), gfxASurface::ImageFormatARGB32);
nsRefPtr<gfxContext> ctx = new gfxContext(surf);
// we have to clear first, since some platform surfaces (X11, I'm
// looking at you) don't follow the cleared-surface convention.
ctx->SetOperator(gfxContext::OPERATOR_CLEAR);
ctx->Paint();
ctx->SetOperator(gfxContext::OPERATOR_OVER);
rv = canvas->RenderContexts(ctx);
if (NS_FAILED(rv))
return rv;
sourceSurface = surf;
}
*aCairoSurface = sourceSurface->CairoSurface();
cairo_surface_reference(*aCairoSurface);
*imgData = surf->Data();
*widthOut = w;
*heightOut = h;
@ -2264,7 +2281,6 @@ nsCanvasRenderingContext2D::CairoSurfaceFromElement(nsIDOMElement *imgElt,
*aCairoSurface = gfxsurf->CairoSurface();
cairo_surface_reference (*aCairoSurface);
*imgData = nsnull;
return NS_OK;
}
@ -2647,3 +2663,18 @@ nsCanvasRenderingContext2D::PutImageData()
return Redraw();
}
NS_IMETHODIMP
nsCanvasRenderingContext2D::GetThebesSurface(gfxASurface **surface)
{
if (!mThebesSurface) {
*surface = nsnull;
return NS_ERROR_NOT_AVAILABLE;
}
*surface = mThebesSurface.get();
NS_ADDREF(*surface);
return NS_OK;
}

View File

@ -93,6 +93,8 @@ public:
virtual void SetWriteOnly();
NS_IMETHOD InvalidateFrame ();
NS_IMETHOD InvalidateFrameSubrect (const nsRect& damageRect);
virtual PRInt32 CountContexts();
virtual nsICanvasRenderingContextInternal *GetContextAtIndex (PRInt32 index);
NS_IMETHOD_(PRBool) IsAttributeMapped(const nsIAtom* aAttribute) const;
nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
@ -553,3 +555,21 @@ nsHTMLCanvasElement::InvalidateFrameSubrect(const nsRect& damageRect)
return NS_OK;
}
PRInt32
nsHTMLCanvasElement::CountContexts()
{
if (mCurrentContext)
return 1;
return 0;
}
nsICanvasRenderingContextInternal *
nsHTMLCanvasElement::GetContextAtIndex (PRInt32 index)
{
if (mCurrentContext && index == 0)
return mCurrentContext.get();
return NULL;
}

View File

@ -22,6 +22,9 @@ Some specific things:
cairo git commit ea6dbfd36f2182fda16cb82bca92007e0f7b8d77 -
[cairo-meta-surface] Save and restore the original clip.
cairo git commit d96fdd58abf8d6c8692dbb08ec54cdd80accba79 -
win32: Fix broken printing of type1 fonts
max-font-size.patch: Clamp freetype font size to 1000 to avoid overflow issues
win32-logical-font-scale.patch: set CAIRO_WIN32_LOGICAL_FONT_SCALE to 1

View File

@ -490,6 +490,16 @@ _cairo_win32_scaled_font_select_unscaled_font (cairo_scaled_font_t *scaled_font,
return CAIRO_STATUS_SUCCESS;
}
cairo_bool_t
_cairo_win32_scaled_font_is_type1 (cairo_scaled_font_t *scaled_font)
{
cairo_win32_scaled_font_t *win32_scaled_font;
win32_scaled_font = (cairo_win32_scaled_font_t *) scaled_font;
return win32_scaled_font->is_type1;
}
static void
_cairo_win32_scaled_font_done_unscaled_font (cairo_scaled_font_t *scaled_font)
{

View File

@ -1341,6 +1341,7 @@ _cairo_win32_printing_surface_show_glyphs (void *abstract_surfac
}
if (cairo_scaled_font_get_type (scaled_font) == CAIRO_FONT_TYPE_WIN32 &&
! _cairo_win32_scaled_font_is_type1 (scaled_font) &&
source->type == CAIRO_PATTERN_TYPE_SOLID)
{
cairo_matrix_t ctm;

View File

@ -181,4 +181,7 @@ _cairo_win32_restore_initial_clip (cairo_win32_surface_t *surface);
void
_cairo_win32_debug_dump_hrgn (HRGN rgn, char *header);
cairo_bool_t
_cairo_win32_scaled_font_is_type1 (cairo_scaled_font_t *scaled_font);
#endif /* CAIRO_WIN32_PRIVATE_H */

View File

@ -120,6 +120,12 @@ math_acos(JSContext *cx, uintN argc, jsval *vp)
x = js_ValueToNumber(cx, &vp[2]);
if (JSVAL_IS_NULL(vp[2]))
return JS_FALSE;
#if !JS_USE_FDLIBM_MATH && defined(SOLARIS) && defined(__GNUC__)
if (x < -1 || 1 < x) {
*vp = DOUBLE_TO_JSVAL(cx->runtime->jsNaN);
return JS_TRUE;
}
#endif
z = fd_acos(x);
return js_NewNumberInRootedValue(cx, z, vp);
}
@ -132,6 +138,12 @@ math_asin(JSContext *cx, uintN argc, jsval *vp)
x = js_ValueToNumber(cx, &vp[2]);
if (JSVAL_IS_NULL(vp[2]))
return JS_FALSE;
#if !JS_USE_FDLIBM_MATH && defined(SOLARIS) && defined(__GNUC__)
if (x < -1 || 1 < x) {
*vp = DOUBLE_TO_JSVAL(cx->runtime->jsNaN);
return JS_TRUE;
}
#endif
z = fd_asin(x);
return js_NewNumberInRootedValue(cx, z, vp);
}
@ -174,6 +186,19 @@ math_atan2(JSContext *cx, uintN argc, jsval *vp)
return js_NewDoubleInRootedValue(cx, z, vp);
}
#endif
#if !JS_USE_FDLIBM_MATH && defined(SOLARIS) && defined(__GNUC__)
if (x == 0) {
if (JSDOUBLE_IS_NEGZERO(y)) {
z = fd_copysign(M_PI, x);
return js_NewDoubleInRootedValue(cx, z, vp);
}
if (y == 0) {
z = x;
return js_NewDoubleInRootedValue(cx, z, vp);
}
}
#endif
z = fd_atan2(x, y);
return js_NewNumberInRootedValue(cx, z, vp);
}
@ -246,6 +271,12 @@ math_log(JSContext *cx, uintN argc, jsval *vp)
x = js_ValueToNumber(cx, &vp[2]);
if (JSVAL_IS_NULL(vp[2]))
return JS_FALSE;
#if !JS_USE_FDLIBM_MATH && defined(SOLARIS) && defined(__GNUC__)
if (x < 0) {
*vp = DOUBLE_TO_JSVAL(cx->runtime->jsNaN);
return JS_TRUE;
}
#endif
z = fd_log(x);
return js_NewNumberInRootedValue(cx, z, vp);
}

View File

@ -1048,7 +1048,7 @@ PRBool nsCaret::IsMenuPopupHidingCaret()
return PR_FALSE;
}
if (popupFrame->PopupType() == ePopupTypeMenu) {
if (popupFrame->PopupType() == ePopupTypeMenu && !popupFrame->IsContextMenu()) {
// This is an open menu popup. It does not contain the caret (else we'd
// have returned above). Even if the caret is in a subsequent popup,
// or another document/frame, it should be hidden.

View File

@ -28,7 +28,16 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=420499
</menupopup>
</menu>
<popupset>
<popup id="contextmenu">
<menuitem label="Cut"/>
<menuitem label="Copy"/>
<menuitem label="Paste"/>
</popup>
<tooltip id="tooltip" orient="vertical">
<description value="This is a tooltip"/>
</tooltip>
</popupset>
<!-- test results are displayed in the html:body -->
<body xmlns="http://www.w3.org/1999/xhtml" bgcolor="white">
@ -88,8 +97,35 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=420499
function ensureParagraphFocused() {
window.removeEventListener("popuphidden", ensureParagraphFocused, false);
ok(isCaretVisible(), "Caret should have returned to previous focus");
SimpleTest.finish();
window.addEventListener("popupshown", popupMenuShownHandler2, false);
$("contextmenu").openPopup($('text-input'), "topleft" , -1 , -1 , true, true);
}
function popupMenuShownHandler2() {
window.removeEventListener("popupshown", popupMenuShownHandler2, false);
ok(isCaretVisible(), "Caret should be visible when context menu open");
window.addEventListener("popuphidden", ensureParagraphFocused2, false);
document.getElementById("contextmenu").hidePopup();
}
function ensureParagraphFocused2() {
window.removeEventListener("popuphidden", ensureParagraphFocused2, false);
ok(isCaretVisible(), "Caret should still be visible");
window.addEventListener("popupshown", tooltipShownHandler, false);
$("tooltip").openPopup($('text-input'), "topleft" , -1 , -1 , false, true);
}
function tooltipShownHandler() {
window.removeEventListener("popupshown", tooltipShownHandler, false);
ok(isCaretVisible(), "Caret should be visible when tooltip is visible");
window.addEventListener("popuphidden", ensureParagraphFocused3, false);
document.getElementById("tooltip").hidePopup();
}
function ensureParagraphFocused3() {
window.removeEventListener("popuphidden", ensureParagraphFocused2, false);
ok(isCaretVisible(), "Caret should still be visible");
SimpleTest.finish();
}
]]></script>
</window>

View File

@ -0,0 +1,10 @@
<html>
<head>
<title>Bug 429849 marquee text not on one line , part of this line on top and second part on bottom</title>
</head>
<body>
<marquee behavior=alternate scrollamount=0 direction=right>
This text should be on one line
</marquee>
</body>
</html>

View File

@ -0,0 +1,10 @@
<html>
<head>
<title>Bug 429849 marquee text not on one line , part of this line on top and second part on bottom</title>
</head>
<body>
<marquee behavior=alternate scrollamount=0 direction=right>
This text <script>document.body.offsetHeight;</script>should be on one line
</marquee>
</body>
</html>

View File

@ -815,5 +815,6 @@ fails-if(MOZ_WIDGET_TOOLKIT=="gtk2") == 424074-1-ref2.xul 424074-1-ref3.xul
== 428521-1a.html 428521-1-ref.html
== 428521-1b.html 428521-1-ref.html
== 428521-1c.html 428521-1-ref.html
== 429849-1.html 429849-1-ref.html
== 430412-1.html 430412-1-ref.html

View File

@ -673,8 +673,10 @@
<html:div style="display: -moz-box; overflow: hidden; width: -moz-available;"
><html:div style="display: -moz-box;"
><html:div class="innerDiv" style="display: table; border-spacing: 0;"
><children
/></html:div
><html:div
><children
/></html:div
></html:div
></html:div
></html:div>
</content>

File diff suppressed because it is too large Load Diff