зеркало из https://github.com/mozilla/gecko-dev.git
Merge backout on a CLOSED TREE
This commit is contained in:
Коммит
9e8a8df579
|
@ -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
|
||||
|
|
|
@ -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>
|
||||
ඔ‌ෘ
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
<html>
|
||||
<body>
|
||||
ඔෘ
|
||||
</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>
|
||||
|
||||
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>
|
||||
|
||||
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);
|
||||
|
|
Загрузка…
Ссылка в новой задаче