Merge Places and mozilla-central

This commit is contained in:
Marco Bonardo 2011-07-01 18:26:04 +02:00
Родитель fbd02c1c52 20aa536dab
Коммит d18e66c8d1
28 изменённых файлов: 350 добавлений и 102 удалений

Просмотреть файл

@ -947,6 +947,7 @@
this._tabAttrModified(this.mCurrentTab);
// Adjust focus
oldBrowser._urlbarFocused = (gURLBar && gURLBar.focused);
do {
// If there's a tabmodal prompt showing, focus it.
@ -961,7 +962,6 @@
// Focus the location bar if it was previously focused for that tab.
// In full screen mode, only bother making the location bar visible
// if the tab is a blank one.
oldBrowser._urlbarFocused = (gURLBar && gURLBar.focused);
if (newBrowser._urlbarFocused && gURLBar) {
// Explicitly close the popup if the URL bar retains focus

Просмотреть файл

@ -1,3 +1,5 @@
# -*- makefile -*-
# vim:set ts=8 sw=8 sts=8 noet:
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
@ -23,6 +25,7 @@
# Benjamin Smedberg <bsmedberg@covad.net>
# Chase Phillips <chase@mozilla.org>
# Mark Mentovai <mark@moxienet.com>
# Joey Armstrong <joey@mozilla.com>
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
@ -95,14 +98,11 @@ endif
AUTOCONF ?= $(shell which autoconf-2.13 autoconf2.13 autoconf213 2>/dev/null | grep -v '^no autoconf' | head -1)
ifeq (,$(strip $(AUTOCONF)))
AUTOCONF=$(error Couldn't find autoconf 2.13)
AUTOCONF=$(error Could not find autoconf 2.13)
endif
MKDIR := mkdir
SH := /bin/sh
ifndef MAKE
MAKE := gmake
endif
PERL ?= perl
PYTHON ?= python

Просмотреть файл

@ -982,7 +982,10 @@ AC_SUBST(NSINSTALL_BIN)
MOZ_PATH_PROG(DOXYGEN, doxygen, :)
MOZ_PATH_PROG(AUTOCONF, autoconf, :)
MOZ_PATH_PROG(UNZIP, unzip, :)
MOZ_PATH_PROGS(UNZIP, unzip)
if test -z "$UNZIP" -o "$UNZIP" = ":"; then
AC_MSG_ERROR([unzip not found in \$PATH])
fi
MOZ_PATH_PROGS(ZIP, zip)
if test -z "$ZIP" -o "$ZIP" = ":"; then
AC_MSG_ERROR([zip not found in \$PATH])
@ -7825,7 +7828,11 @@ dnl done during packaging with omnijar.
if test "$MOZ_CHROME_FILE_FORMAT" = "omni"; then
MOZ_OMNIJAR=1
AC_DEFINE(MOZ_OMNIJAR)
MOZ_CHROME_FILE_FORMAT=flat
if test "$OS_ARCH" = "WINNT"; then
MOZ_CHROME_FILE_FORMAT=flat
else
MOZ_CHROME_FILE_FORMAT=symlink
fi
elif test "$MOZ_CHROME_FILE_FORMAT" = "jar"; then
AC_DEFINE(MOZ_CHROME_FILE_FORMAT_JAR)
fi
@ -8451,7 +8458,10 @@ if test -z "${GLIB_CFLAGS}" -o -z "${GLIB_LIBS}" ; then
fi
fi
if test -z "${GLIB_GMODULE_LIBS}" -a -n "${GLIB_CONFIG}"; then
if test -z "${GLIB_GMODULE_LIBS}" \
-a -n "${GLIB_CONFIG}"\
-a "${GLIB_CONFIG}" != no\
; then
GLIB_GMODULE_LIBS=`$GLIB_CONFIG gmodule --libs`
fi

Просмотреть файл

@ -72,8 +72,10 @@ public:
NS_DECL_NSIDOMFILE
NS_DECL_NSIXHRSENDABLE
nsDOMFile(nsIFile *aFile, const nsAString& aContentType)
nsDOMFile(nsIFile *aFile, const nsAString& aContentType,
nsISupports *aCacheToken = nsnull)
: mFile(aFile),
mCacheToken(aCacheToken),
mContentType(aContentType),
mIsFullFile(true)
{}
@ -86,6 +88,7 @@ public:
nsDOMFile(const nsDOMFile* aOther, PRUint64 aStart, PRUint64 aLength,
const nsAString& aContentType)
: mFile(aOther->mFile),
mCacheToken(aOther->mCacheToken),
mStart(aOther->mIsFullFile ? aStart :
(aOther->mStart + aStart)),
mLength(aLength),
@ -112,6 +115,7 @@ public:
protected:
nsCOMPtr<nsIFile> mFile;
nsCOMPtr<nsISupports> mCacheToken;
// start and length in
PRUint64 mStart;

Просмотреть файл

@ -1616,8 +1616,25 @@ void nsXMLHttpRequest::CreateResponseBlob(nsIRequest *request)
if (file) {
nsCAutoString contentType;
mChannel->GetContentType(contentType);
mResponseBlob = new nsDOMFile(file,
NS_ConvertASCIItoUTF16(contentType));
nsCOMPtr<nsISupports> cacheToken;
if (cc) {
cc->GetCacheToken(getter_AddRefs(cacheToken));
}
NS_ConvertASCIItoUTF16 wideContentType(contentType);
nsCOMPtr<nsIDOMBlob> blob =
new nsDOMFile(file, wideContentType, cacheToken);
// XXXkhuey this is a complete hack ... but we need to get 6 out the door
// The response blob here should not be a File object, it should only
// be a Blob. Unfortunately, because nsDOMFile has grown through
// accretion over the years and is in dangerous need of a refactoring,
// slicing it is the easiest way to get there ...
PRUint64 size = 0;
blob->GetSize(&size);
blob->MozSlice(0, size, wideContentType, 2, getter_AddRefs(mResponseBlob));
mResponseBody.Truncate();
mResponseBodyUnicode.SetIsVoid(PR_TRUE);
}
@ -1888,9 +1905,20 @@ nsXMLHttpRequest::OnStopRequest(nsIRequest *request, nsISupports *ctxt, nsresult
void *blobData = PR_Malloc(blobLen);
if (blobData) {
memcpy(blobData, mResponseBody.BeginReading(), blobLen);
mResponseBlob =
NS_ConvertASCIItoUTF16 wideContentType(contentType);
nsCOMPtr<nsIDOMBlob> blob =
new nsDOMMemoryFile(blobData, blobLen, EmptyString(),
NS_ConvertASCIItoUTF16(contentType));
wideContentType);
// XXXkhuey this is a complete hack ... but we need to get 6 out the door
// The response blob here should not be a File object, it should only
// be a Blob. Unfortunately, because nsDOMFile has grown through
// accretion over the years and is in dangerous need of a refactoring,
// slicing it is the easiest way to get there ...
blob->MozSlice(0, blobLen, wideContentType,
2, getter_AddRefs(mResponseBlob));
mResponseBody.Truncate();
}
NS_ASSERTION(mResponseBodyUnicode.IsVoid(),

Просмотреть файл

@ -160,6 +160,8 @@ checkResponseTextAccessThrows(xhr);
checkResponseXMLAccessThrows(xhr);
b = xhr.response;
ok(b, "should have a non-null blob");
ok(b instanceof Blob, "should be a Blob");
ok(!(b instanceof File), "should not be a File");
is(b.size, "hello pass\n".length, "wrong blob size");
var fr = new FileReader();

Просмотреть файл

@ -47,8 +47,10 @@ LIBXUL_LIBRARY = 1
FORCE_STATIC_LIB = 1
EXPORT_LIBRARY = 1
ifdef ENABLE_TESTS
ifneq (cocoa,$(MOZ_WIDGET_TOOLKIT))
DIRS = tests
DIRS += tests
endif
endif
EXPORTS = TabMessageUtils.h PCOMContentPermissionRequestChild.h

Просмотреть файл

@ -612,6 +612,33 @@ gfxDWriteFont::CairoScaledFont()
return mCairoScaledFont;
}
gfxFont::RunMetrics
gfxDWriteFont::Measure(gfxTextRun *aTextRun,
PRUint32 aStart, PRUint32 aEnd,
BoundingBoxType aBoundingBoxType,
gfxContext *aRefContext,
Spacing *aSpacing)
{
gfxFont::RunMetrics metrics =
gfxFont::Measure(aTextRun, aStart, aEnd,
aBoundingBoxType, aRefContext, aSpacing);
// if aBoundingBoxType is LOOSE_INK_EXTENTS
// and the underlying cairo font may be antialiased,
// we can't trust Windows to have considered all the pixels
// so we need to add "padding" to the bounds.
// (see bugs 475968, 439831, compare also bug 445087)
if (aBoundingBoxType == LOOSE_INK_EXTENTS &&
mAntialiasOption != kAntialiasNone &&
GetMeasuringMode() == DWRITE_MEASURING_MODE_GDI_CLASSIC &&
metrics.mBoundingBox.width > 0) {
metrics.mBoundingBox.x -= aTextRun->GetAppUnitsPerDevUnit();
metrics.mBoundingBox.width += aTextRun->GetAppUnitsPerDevUnit() * 3;
}
return metrics;
}
// Access to font tables packaged in hb_blob_t form
// object attached to the Harfbuzz blob, used to release

Просмотреть файл

@ -75,6 +75,13 @@ public:
IDWriteFontFace *GetFontFace();
/* override Measure to add padding for antialiasing */
virtual RunMetrics Measure(gfxTextRun *aTextRun,
PRUint32 aStart, PRUint32 aEnd,
BoundingBoxType aBoundingBoxType,
gfxContext *aContextForTightBoundingBox,
Spacing *aSpacing);
// override gfxFont table access function to bypass gfxFontEntry cache,
// use DWrite API to get direct access to system font data
virtual hb_blob_t *GetFontTable(PRUint32 aTag);

Просмотреть файл

@ -2572,9 +2572,9 @@ gfxFontGroup::FindFontForChar(PRUint32 aCh, PRUint32 aPrevCh,
{
nsRefPtr<gfxFont> selectedFont;
// if this character or the previous one is a join-causer,
// if this character is a join-control or the previous is a join-causer,
// use the same font as the previous range if we can
if (gfxFontUtils::IsJoinCauser(aCh) || gfxFontUtils::IsJoinCauser(aPrevCh)) {
if (gfxFontUtils::IsJoinControl(aCh) || gfxFontUtils::IsJoinCauser(aPrevCh)) {
if (aPrevMatchedFont && aPrevMatchedFont->HasCharacter(aCh)) {
selectedFont = aPrevMatchedFont;
return selectedFont.forget();

Просмотреть файл

@ -755,6 +755,10 @@ public:
return (ch == 0x200D);
}
static inline bool IsJoinControl(PRUint32 ch) {
return (ch == 0x200C || ch == 0x200D);
}
enum {
kUnicodeVS1 = 0xFE00,
kUnicodeVS16 = 0xFE0F,

Просмотреть файл

@ -2889,6 +2889,62 @@ nsLayoutUtils::GetStringWidth(const nsIFrame* aFrame,
return aContext->GetWidth(aString, aLength);
}
/* static */ void
nsLayoutUtils::PaintTextShadow(const nsIFrame* aFrame,
nsRenderingContext* aContext,
const nsRect& aTextRect,
const nsRect& aDirtyRect,
const nscolor& aForegroundColor,
TextShadowCallback aCallback,
void* aCallbackData)
{
const nsStyleText* textStyle = aFrame->GetStyleText();
if (!textStyle->mTextShadow)
return;
// Text shadow happens with the last value being painted at the back,
// ie. it is painted first.
gfxContext* aDestCtx = aContext->ThebesContext();
for (PRUint32 i = textStyle->mTextShadow->Length(); i > 0; --i) {
nsCSSShadowItem* shadowDetails = textStyle->mTextShadow->ShadowAt(i - 1);
nsPoint shadowOffset(shadowDetails->mXOffset,
shadowDetails->mYOffset);
nscoord blurRadius = NS_MAX(shadowDetails->mRadius, 0);
nsRect shadowRect(aTextRect);
shadowRect.MoveBy(shadowOffset);
nsPresContext* presCtx = aFrame->PresContext();
nsContextBoxBlur contextBoxBlur;
gfxContext* shadowContext = contextBoxBlur.Init(shadowRect, 0, blurRadius,
presCtx->AppUnitsPerDevPixel(),
aDestCtx, aDirtyRect, nsnull);
if (!shadowContext)
continue;
nscolor shadowColor;
if (shadowDetails->mHasColor)
shadowColor = shadowDetails->mColor;
else
shadowColor = aForegroundColor;
// Conjure an nsRenderingContext from a gfxContext for drawing the text
// to blur.
nsRefPtr<nsRenderingContext> renderingContext = new nsRenderingContext();
renderingContext->Init(presCtx->DeviceContext(), shadowContext);
aDestCtx->Save();
aDestCtx->NewPath();
aDestCtx->SetColor(gfxRGBA(shadowColor));
// The callback will draw whatever we want to blur as a shadow.
aCallback(renderingContext, shadowOffset, shadowColor, aCallbackData);
contextBoxBlur.DoPaint();
aDestCtx->Restore();
}
}
/* static */ nscoord
nsLayoutUtils::GetCenteredFontBaseline(nsFontMetrics* aFontMetrics,
nscoord aLineHeight)

Просмотреть файл

@ -946,6 +946,23 @@ public:
const PRUnichar* aString,
PRInt32 aLength);
/**
* Helper function for drawing text-shadow. The callback's job
* is to draw whatever needs to be blurred onto the given context.
*/
typedef void (* TextShadowCallback)(nsRenderingContext* aCtx,
nsPoint aShadowOffset,
const nscolor& aShadowColor,
void* aData);
static void PaintTextShadow(const nsIFrame* aFrame,
nsRenderingContext* aContext,
const nsRect& aTextRect,
const nsRect& aDirtyRect,
const nscolor& aForegroundColor,
TextShadowCallback aCallback,
void* aCallbackData);
/**
* Gets the baseline to vertically center text from a font within a
* line of specified height.

Просмотреть файл

@ -21,6 +21,7 @@
*
* Contributor(s):
* Mats Palmgren <matspal@gmail.com> (original author)
* Michael Ventnor <m.ventnor@gmail.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
@ -204,10 +205,14 @@ public:
}
#endif
virtual nsRect GetBounds(nsDisplayListBuilder* aBuilder) {
return mRect;
nsRect shadowRect =
nsLayoutUtils::GetTextShadowRectsUnion(mRect, mFrame);
return mRect.Union(shadowRect);
}
virtual void Paint(nsDisplayListBuilder* aBuilder,
nsRenderingContext* aCtx);
void PaintTextToContext(nsRenderingContext* aCtx,
nsPoint aOffsetFromRect);
NS_DISPLAY_DECL_NAME("TextOverflow", TYPE_TEXT_OVERFLOW)
private:
nsRect mRect; // in reference frame coordinates
@ -215,17 +220,43 @@ private:
nscoord mAscent; // baseline for the marker text in mRect
};
static void
PaintTextShadowCallback(nsRenderingContext* aCtx,
nsPoint aShadowOffset,
const nscolor& aShadowColor,
void* aData)
{
reinterpret_cast<nsDisplayTextOverflowMarker*>(aData)->
PaintTextToContext(aCtx, aShadowOffset);
}
void
nsDisplayTextOverflowMarker::Paint(nsDisplayListBuilder* aBuilder,
nsRenderingContext* aCtx)
{
nscolor foregroundColor = nsLayoutUtils::GetTextColor(mFrame);
// Paint the text-shadows for the overflow marker
nsLayoutUtils::PaintTextShadow(mFrame, aCtx, mRect, mVisibleRect,
foregroundColor, PaintTextShadowCallback,
(void*)this);
aCtx->SetColor(foregroundColor);
PaintTextToContext(aCtx, nsPoint(0, 0));
}
void
nsDisplayTextOverflowMarker::PaintTextToContext(nsRenderingContext* aCtx,
nsPoint aOffsetFromRect)
{
nsStyleContext* sc = mFrame->GetStyleContext();
nsLayoutUtils::SetFontFromStyle(aCtx, sc);
aCtx->SetColor(nsLayoutUtils::GetTextColor(mFrame));
nsPoint baselinePt = mRect.TopLeft();
baselinePt.y += mAscent;
nsLayoutUtils::DrawString(mFrame, aCtx, mString.get(), mString.Length(),
baselinePt);
nsLayoutUtils::DrawString(mFrame, aCtx, mString.get(),
mString.Length(), baselinePt + aOffsetFromRect);
}
/* static */ TextOverflow*

Просмотреть файл

@ -731,8 +731,8 @@ nsMathMLContainerFrame::ReLayoutChildren(nsIFrame* aParentFrame)
NS_ASSERTION(content, "dangling frame without a content node");
if (!content)
break;
// XXXldb This should check namespaces too.
if (content->Tag() == nsGkAtoms::math)
if (content->GetNameSpaceID() == kNameSpaceID_MathML &&
content->Tag() == nsGkAtoms::math)
break;
// mark the frame dirty, and continue to climb up. It's important that
@ -1404,10 +1404,9 @@ nsMathMLContainerFrame::FixInterFrameSpacing(nsHTMLReflowMetrics& aDesiredSize)
if (NS_UNLIKELY(!parentContent)) {
return 0;
}
// XXXldb This should check namespaces too.
nsIAtom *parentTag = parentContent->Tag();
if (parentTag == nsGkAtoms::math ||
parentTag == nsGkAtoms::mtd_) {
if (parentContent->GetNameSpaceID() == kNameSpaceID_MathML &&
(parentTag == nsGkAtoms::math || parentTag == nsGkAtoms::mtd_)) {
gap = GetInterFrameSpacingFor(GetStyleFont()->mScriptLevel, mParent, this);
// add our own italic correction
nscoord leftCorrection = 0, italicCorrection = 0;

Просмотреть файл

@ -0,0 +1,6 @@
<html>
<body>
&#xD94;&#x200C;&#xDD8;
</body>
</html>

Просмотреть файл

@ -0,0 +1,6 @@
<html>
<body>
&#xD94;&#xDD8;
</body>
</html>

Просмотреть файл

@ -1477,6 +1477,9 @@ random-if(!haveTestPlugin) == 546071-1.html 546071-1-ref.html
== 551463-1.html 551463-1-ref.html
== 551699-1.html 551699-1-ref.html
== 552334-1.html 552334-1-ref.html
# 553571 depends on MS Indic shaping behavior and Win7 font support;
# not expected to be reliable on XP or non-Windows platforms
random-if(!winWidget) random-if(/^Windows\x20NT\x205/.test(http.oscpu)) != 553571-1.html 553571-1-notref.html # expect dotted circle in test, not in ref
random-if(d2d) == 555388-1.html 555388-1-ref.html
== 556661-1.html 556661-1-ref.html
fails-if(Android) == 557087-1.html 557087-ref.html

Просмотреть файл

@ -0,0 +1,30 @@
<!DOCTYPE HTML>
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/licenses/publicdomain/
-->
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<style type="text/css">
@font-face {
font-family: DejaVuSansMono;
src: url(../fonts/DejaVuSansMono.woff);
}
div {
font-family: DejaVuSansMono;
width: 60px;
overflow: hidden;
white-space: nowrap;
font-size: 14px;
text-overflow: "...";
}
</style>
</head>
<body>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;a</div>
</body>
</html>

Просмотреть файл

@ -0,0 +1,33 @@
<!DOCTYPE HTML>
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/licenses/publicdomain/
Test: Marker should have text-shadow applied to it
-->
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<style type="text/css">
@font-face {
font-family: DejaVuSansMono;
src: url(../fonts/DejaVuSansMono.woff);
}
div {
font-family: DejaVuSansMono;
width: 60px;
overflow: hidden;
white-space: nowrap;
font-size: 14px;
text-overflow: "...";
text-shadow: 0px 2px 2px red;
}
</style>
</head>
<body>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;a</div>
</body>
</html>

Просмотреть файл

@ -13,3 +13,4 @@ HTTP(..) == quirks-line-height.html quirks-line-height-ref.html
HTTP(..) == standards-decorations.html standards-decorations-ref.html
HTTP(..) == standards-line-height.html standards-line-height-ref.html
HTTP(..) == selection.html selection-ref.html
HTTP(..) != marker-shadow.html marker-shadow-notref.html

Просмотреть файл

@ -347,17 +347,48 @@ public:
virtual void DisableComponentAlpha() { mDisableSubpixelAA = PR_TRUE; }
void PaintTextWithOffset(nsRenderingContext* aCtx,
nsPoint aOffset,
const nscolor* aColor);
PRPackedBool mDisableSubpixelAA;
};
static void
PaintTextShadowCallback(nsRenderingContext* aCtx,
nsPoint aShadowOffset,
const nscolor& aShadowColor,
void* aData)
{
reinterpret_cast<nsDisplayXULTextBox*>(aData)->
PaintTextWithOffset(aCtx, aShadowOffset, &aShadowColor);
}
void
nsDisplayXULTextBox::Paint(nsDisplayListBuilder* aBuilder,
nsRenderingContext* aCtx)
{
gfxContextAutoDisableSubpixelAntialiasing disable(aCtx->ThebesContext(),
mDisableSubpixelAA);
// Paint the text shadow before doing any foreground stuff
nsRect drawRect = static_cast<nsTextBoxFrame*>(mFrame)->mTextDrawRect;
nsLayoutUtils::PaintTextShadow(mFrame, aCtx,
drawRect, mVisibleRect,
mFrame->GetStyleColor()->mColor,
PaintTextShadowCallback,
(void*)this);
PaintTextWithOffset(aCtx, nsPoint(0, 0), nsnull);
}
void
nsDisplayXULTextBox::PaintTextWithOffset(nsRenderingContext* aCtx,
nsPoint aOffset,
const nscolor* aColor)
{
static_cast<nsTextBoxFrame*>(mFrame)->
PaintTitle(*aCtx, mVisibleRect, ToReferenceFrame());
PaintTitle(*aCtx, mVisibleRect, ToReferenceFrame() + aOffset, aColor);
}
nsRect
@ -390,28 +421,13 @@ nsTextBoxFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
void
nsTextBoxFrame::PaintTitle(nsRenderingContext& aRenderingContext,
const nsRect& aDirtyRect,
nsPoint aPt)
nsPoint aPt,
const nscolor* aOverrideColor)
{
if (mTitle.IsEmpty())
return;
nsRect textRect = mTextDrawRect + aPt;
// Paint the text shadow before doing any foreground stuff
const nsStyleText* textStyle = GetStyleText();
if (textStyle->mTextShadow) {
// Text shadow happens with the last value being painted at the back,
// ie. it is painted first.
for (PRUint32 i = textStyle->mTextShadow->Length(); i > 0; --i) {
PaintOneShadow(aRenderingContext.ThebesContext(),
textRect,
textStyle->mTextShadow->ShadowAt(i - 1),
GetStyleColor()->mColor,
aDirtyRect);
}
}
DrawText(aRenderingContext, textRect, nsnull);
DrawText(aRenderingContext, mTextDrawRect + aPt, aOverrideColor);
}
void
@ -609,49 +625,6 @@ nsTextBoxFrame::DrawText(nsRenderingContext& aRenderingContext,
}
}
void nsTextBoxFrame::PaintOneShadow(gfxContext* aCtx,
const nsRect& aTextRect,
nsCSSShadowItem* aShadowDetails,
const nscolor& aForegroundColor,
const nsRect& aDirtyRect) {
nsPoint shadowOffset(aShadowDetails->mXOffset,
aShadowDetails->mYOffset);
nscoord blurRadius = NS_MAX(aShadowDetails->mRadius, 0);
nsRect shadowRect(aTextRect);
shadowRect.MoveBy(shadowOffset);
nsContextBoxBlur contextBoxBlur;
gfxContext* shadowContext = contextBoxBlur.Init(shadowRect, 0, blurRadius,
PresContext()->AppUnitsPerDevPixel(),
aCtx, aDirtyRect, nsnull);
if (!shadowContext)
return;
nscolor shadowColor;
if (aShadowDetails->mHasColor)
shadowColor = aShadowDetails->mColor;
else
shadowColor = aForegroundColor;
// Conjure an nsRenderingContext from a gfxContext for DrawText
nsRefPtr<nsRenderingContext> renderingContext = new nsRenderingContext();
renderingContext->Init(PresContext()->DeviceContext(), shadowContext);
aCtx->Save();
aCtx->NewPath();
aCtx->SetColor(gfxRGBA(shadowColor));
// Draw the text onto our alpha-only surface to capture the alpha
// values. Remember that the box blur context has a device offset
// on it, so we don't need to translate any coordinates to fit on
// the surface.
DrawText(*renderingContext, shadowRect, &shadowColor);
contextBoxBlur.DoPaint();
aCtx->Restore();
}
void
nsTextBoxFrame::CalculateUnderline(nsRenderingContext& aRenderingContext)
{

Просмотреть файл

@ -86,7 +86,8 @@ public:
void PaintTitle(nsRenderingContext& aRenderingContext,
const nsRect& aDirtyRect,
nsPoint aPt);
nsPoint aPt,
const nscolor* aOverrideColor);
nsRect GetComponentAlphaBounds();
@ -94,6 +95,7 @@ public:
protected:
friend class nsAsyncAccesskeyUpdate;
friend class nsDisplayXULTextBox;
// Should be called only by nsAsyncAccesskeyUpdate.
// Returns PR_TRUE if accesskey was updated.
PRBool UpdateAccesskey(nsWeakFrame& aWeakThis);
@ -134,12 +136,6 @@ private:
const nsRect& aTextRect,
const nscolor* aOverrideColor);
void PaintOneShadow(gfxContext * aCtx,
const nsRect& aTextRect,
nsCSSShadowItem* aShadowDetails,
const nscolor& aForegroundColor,
const nsRect& aDirtyRect);
nsString mTitle;
nsString mCroppedTitle;
nsString mAccessKey;

Просмотреть файл

@ -84,7 +84,7 @@
oncommand="_filterPasswords();"/>
</hbox>
<description control="signonsTree" id="signonsIntro"/>
<label control="signonsTree" id="signonsIntro"/>
<separator class="thin"/>
<tree id="signonsTree" flex="1" style="height: 20em;" hidecolumnpicker="true"
onkeypress="HandleSignonKeyPress(event)"

Просмотреть файл

@ -189,7 +189,6 @@ iframe {
notificationbox {
-moz-binding: url("chrome://global/content/bindings/notification.xml#notificationbox");
-moz-box-orient: vertical;
overflow-y: hidden;
}
notification {

Просмотреть файл

@ -943,12 +943,13 @@ nsNativeThemeWin::GetThemePartAndState(nsIFrame* aFrame, PRUint8 aWidgetType,
case NS_THEME_DROPDOWN: {
nsIContent* content = aFrame->GetContent();
PRBool isHTML = content && content->IsHTML();
PRBool useDropBorder = isHTML || IsMenuListEditable(aFrame);
nsEventStates eventState = GetContentState(aFrame, aWidgetType);
/* On vista, in HTML, we use CBP_DROPBORDER instead of DROPFRAME for HTML content;
* this gives us the thin outline in HTML content, instead of the gradient-filled
* background */
if (isHTML)
/* On Vista/Win7, we use CBP_DROPBORDER instead of DROPFRAME for HTML
* content or for editable menulists; this gives us the thin outline,
* instead of the gradient-filled background */
if (useDropBorder)
aPart = CBP_DROPBORDER;
else
aPart = CBP_DROPFRAME;
@ -960,7 +961,7 @@ nsNativeThemeWin::GetThemePartAndState(nsIFrame* aFrame, PRUint8 aWidgetType,
} else if (IsOpenButton(aFrame)) {
aState = TS_ACTIVE;
} else {
if (isHTML && eventState.HasState(NS_EVENT_STATE_FOCUS))
if (useDropBorder && (eventState.HasState(NS_EVENT_STATE_FOCUS) || IsFocused(aFrame)))
aState = TS_ACTIVE;
else if (eventState.HasAllStates(NS_EVENT_STATE_HOVER | NS_EVENT_STATE_ACTIVE))
aState = TS_ACTIVE;
@ -1004,7 +1005,7 @@ nsNativeThemeWin::GetThemePartAndState(nsIFrame* aFrame, PRUint8 aWidgetType,
isOpen = IsOpenButton(aFrame);
if (nsUXThemeData::sIsVistaOrLater) {
if (isHTML) {
if (isHTML || IsMenuListEditable(aFrame)) {
if (isOpen) {
/* Hover is propagated, but we need to know whether we're
* hovering just the combobox frame, not the dropdown frame.

Просмотреть файл

@ -47,6 +47,7 @@
#include "nsString.h"
#include "nsINameSpaceManager.h"
#include "nsIDOMHTMLInputElement.h"
#include "nsIDOMXULMenuListElement.h"
#include "nsILookAndFeel.h"
#include "nsThemeConstants.h"
#include "nsIComponentManager.h"
@ -518,6 +519,16 @@ nsNativeTheme::IsRegularMenuItem(nsIFrame *aFrame)
menuFrame->GetParentMenuListType() != eNotMenuList));
}
PRBool
nsNativeTheme::IsMenuListEditable(nsIFrame *aFrame)
{
PRBool isEditable = PR_FALSE;
nsCOMPtr<nsIDOMXULMenuListElement> menulist = do_QueryInterface(aFrame->GetContent());
if (menulist)
menulist->GetEditable(&isEditable);
return isEditable;
}
PRBool
nsNativeTheme::QueueAnimatedContentForRefresh(nsIContent* aContent,
PRUint32 aMinimumFrameRate)

Просмотреть файл

@ -175,6 +175,8 @@ class nsNativeTheme : public nsITimerCallback
// True if it's not a menubar item or menulist item
PRBool IsRegularMenuItem(nsIFrame *aFrame);
PRBool IsMenuListEditable(nsIFrame *aFrame);
nsIPresShell *GetPresShell(nsIFrame* aFrame);
PRInt32 CheckIntAttr(nsIFrame* aFrame, nsIAtom* aAtom, PRInt32 defaultValue);
PRBool CheckBooleanAttr(nsIFrame* aFrame, nsIAtom* aAtom);