mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-12 12:55:46 +00:00
(no bug) Remove whitespace at end of line in nsPresShell, nsIPresShell, and nsPresContext. (whitespace-only, DONTBUILD)
This commit is contained in:
parent
3c922f78cb
commit
799418c0d4
@ -148,11 +148,11 @@ typedef struct CapturingContentInfo {
|
||||
|
||||
#undef NOISY_INTERRUPTIBLE_REFLOW
|
||||
|
||||
enum nsRectVisibility {
|
||||
nsRectVisibility_kVisible,
|
||||
nsRectVisibility_kAboveViewport,
|
||||
nsRectVisibility_kBelowViewport,
|
||||
nsRectVisibility_kLeftOfViewport,
|
||||
enum nsRectVisibility {
|
||||
nsRectVisibility_kVisible,
|
||||
nsRectVisibility_kAboveViewport,
|
||||
nsRectVisibility_kBelowViewport,
|
||||
nsRectVisibility_kLeftOfViewport,
|
||||
nsRectVisibility_kRightOfViewport
|
||||
};
|
||||
|
||||
@ -542,7 +542,7 @@ public:
|
||||
/**
|
||||
* Determine if it is safe to flush all pending notifications
|
||||
* @param aIsSafeToFlush true if it is safe, false otherwise.
|
||||
*
|
||||
*
|
||||
*/
|
||||
virtual NS_HIDDEN_(bool) IsSafeToFlush() const = 0;
|
||||
|
||||
@ -688,7 +688,7 @@ public:
|
||||
/**
|
||||
* Scrolls the view of the document so that the given area of a frame
|
||||
* is visible, if possible. Layout is not flushed before scrolling.
|
||||
*
|
||||
*
|
||||
* @param aRect relative to aFrame
|
||||
* @param aVertical see ScrollContentIntoView and ScrollAxis
|
||||
* @param aHorizontal see ScrollContentIntoView and ScrollAxis
|
||||
@ -711,18 +711,18 @@ public:
|
||||
uint32_t aFlags) = 0;
|
||||
|
||||
/**
|
||||
* Determine if a rectangle specified in the frame's coordinate system
|
||||
* Determine if a rectangle specified in the frame's coordinate system
|
||||
* intersects the viewport "enough" to be considered visible.
|
||||
* @param aFrame frame that aRect coordinates are specified relative to
|
||||
* @param aRect rectangle in twips to test for visibility
|
||||
* @param aRect rectangle in twips to test for visibility
|
||||
* @param aMinTwips is the minimum distance in from the edge of the viewport
|
||||
* that an object must be to be counted visible
|
||||
* @return nsRectVisibility_kVisible if the rect is visible
|
||||
* nsRectVisibility_kAboveViewport
|
||||
* nsRectVisibility_kBelowViewport
|
||||
* nsRectVisibility_kLeftOfViewport
|
||||
* nsRectVisibility_kBelowViewport
|
||||
* nsRectVisibility_kLeftOfViewport
|
||||
* nsRectVisibility_kRightOfViewport rectangle is outside the viewport
|
||||
* in the specified direction
|
||||
* in the specified direction
|
||||
*/
|
||||
virtual nsRectVisibility GetRectVisibility(nsIFrame *aFrame,
|
||||
const nsRect &aRect,
|
||||
@ -774,7 +774,7 @@ public:
|
||||
*/
|
||||
NS_IMETHOD SetSelectionFlags(int16_t aInEnable) = 0;
|
||||
|
||||
/**
|
||||
/**
|
||||
* Gets the current state of non text selection effects
|
||||
* @return current state of non text selection,
|
||||
* as set by SetDisplayNonTextSelection
|
||||
@ -822,7 +822,7 @@ public:
|
||||
mozilla::WidgetEvent* aEvent) = 0;
|
||||
|
||||
/**
|
||||
* Get and set the history state for the current document
|
||||
* Get and set the history state for the current document
|
||||
*/
|
||||
|
||||
virtual NS_HIDDEN_(nsresult) CaptureHistoryState(nsILayoutHistoryState** aLayoutHistoryState) = 0;
|
||||
@ -1323,7 +1323,7 @@ public:
|
||||
virtual void DidPaintWindow() = 0;
|
||||
|
||||
/**
|
||||
* Ensures that the refresh driver is running, and schedules a view
|
||||
* Ensures that the refresh driver is running, and schedules a view
|
||||
* manager flush on the next tick.
|
||||
*
|
||||
* @param aType PAINT_DELAYED_COMPRESS : Schedule a paint to be executed after a delay, and
|
||||
@ -1639,7 +1639,7 @@ protected:
|
||||
// The maximum width of a line box. Text on a single line that exceeds this
|
||||
// width will be wrapped. A value of 0 indicates that no limit is enforced.
|
||||
nscoord mMaxLineBoxWidth;
|
||||
|
||||
|
||||
// If a document belongs to an invisible DocShell, this flag must be set
|
||||
// to true, so we can avoid any paint calls for widget related to this
|
||||
// presshell.
|
||||
|
@ -165,7 +165,7 @@ static void DumpPresContextState(nsPresContext* aPC)
|
||||
}
|
||||
|
||||
bool
|
||||
nsPresContext::IsDOMPaintEventPending()
|
||||
nsPresContext::IsDOMPaintEventPending()
|
||||
{
|
||||
if (mFireAfterPaintEvents) {
|
||||
return true;
|
||||
@ -266,7 +266,7 @@ nsPresContext::nsPresContext(nsIDocument* aDocument, nsPresContextType aType)
|
||||
SetBackgroundColorDraw(true);
|
||||
|
||||
mBackgroundColor = NS_RGB(0xFF, 0xFF, 0xFF);
|
||||
|
||||
|
||||
mUseDocumentColors = true;
|
||||
mUseDocumentFonts = true;
|
||||
|
||||
@ -471,8 +471,8 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_END
|
||||
static const char* const kGenericFont[] = {
|
||||
".variable.",
|
||||
".fixed.",
|
||||
".serif.",
|
||||
".sans-serif.",
|
||||
".serif.",
|
||||
".sans-serif.",
|
||||
".monospace.",
|
||||
".cursive.",
|
||||
".fantasy."
|
||||
@ -634,11 +634,11 @@ nsPresContext::GetFontPrefsForLang(nsIAtom *aLanguage) const
|
||||
if (!value.IsEmpty()) {
|
||||
prefs->mDefaultVariableFont.name.Assign(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (eType == eDefaultFont_Monospace) {
|
||||
// This takes care of the confusion whereby people often expect "monospace"
|
||||
// This takes care of the confusion whereby people often expect "monospace"
|
||||
// to have the same default font-size as "-moz-fixed" (this tentative
|
||||
// size may be overwritten with the specific value for "monospace" when
|
||||
// "font.size.monospace.[langGroup]" is read -- see below)
|
||||
@ -829,7 +829,7 @@ nsPresContext::GetUserPreferences()
|
||||
Preferences::GetInt("browser.display.focus_ring_style", mFocusRingStyle);
|
||||
|
||||
mBodyTextColor = mDefaultColor;
|
||||
|
||||
|
||||
// * use fonts?
|
||||
mUseDocumentFonts =
|
||||
Preferences::GetInt("browser.display.use_document_fonts") != 0;
|
||||
@ -1155,7 +1155,7 @@ nsPresContext::SetShell(nsIPresShell* aShell)
|
||||
if (doc) {
|
||||
doc->RemoveCharSetObserver(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mShell = aShell;
|
||||
|
||||
@ -1254,7 +1254,7 @@ nsPresContext::UpdateCharSet(const nsCString& aCharSet)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsPresContext::Observe(nsISupports* aSubject,
|
||||
nsPresContext::Observe(nsISupports* aSubject,
|
||||
const char* aTopic,
|
||||
const char16_t* aData)
|
||||
{
|
||||
@ -1393,7 +1393,7 @@ static void SetImgAnimModeOnImgReq(imgIRequest* aImgReq, uint16_t aMode)
|
||||
}
|
||||
}
|
||||
|
||||
// IMPORTANT: Assumption is that all images for a Presentation
|
||||
// IMPORTANT: Assumption is that all images for a Presentation
|
||||
// have the same Animation Mode (pavlov said this was OK)
|
||||
//
|
||||
// Walks content and set the animation mode
|
||||
@ -1407,7 +1407,7 @@ void nsPresContext::SetImgAnimations(nsIContent *aParent, uint16_t aMode)
|
||||
getter_AddRefs(imgReq));
|
||||
SetImgAnimModeOnImgReq(imgReq, aMode);
|
||||
}
|
||||
|
||||
|
||||
uint32_t count = aParent->GetChildCount();
|
||||
for (uint32_t i = 0; i < count; ++i) {
|
||||
SetImgAnimations(aParent->GetChildAt(i), aMode);
|
||||
@ -1447,7 +1447,7 @@ nsPresContext::SetImageAnimationModeInternal(uint16_t aMode)
|
||||
if (!IsDynamic())
|
||||
return;
|
||||
|
||||
// Now walk the content tree and set the animation mode
|
||||
// Now walk the content tree and set the animation mode
|
||||
// on all the images.
|
||||
if (mShell != nullptr) {
|
||||
nsIDocument *doc = mShell->GetDocument();
|
||||
@ -1498,7 +1498,7 @@ nsPresContext::GetDefaultFont(uint8_t aFontID, nsIAtom *aLanguage) const
|
||||
case kGenericFont_cursive:
|
||||
font = &prefs->mDefaultCursiveFont;
|
||||
break;
|
||||
case kGenericFont_fantasy:
|
||||
case kGenericFont_fantasy:
|
||||
font = &prefs->mDefaultFantasyFont;
|
||||
break;
|
||||
default:
|
||||
@ -1674,7 +1674,7 @@ nsPresContext::SetBidi(uint32_t aSource, bool aForceRestyle)
|
||||
return;
|
||||
}
|
||||
|
||||
NS_ASSERTION(!(aForceRestyle && (GetBidi() == 0)),
|
||||
NS_ASSERTION(!(aForceRestyle && (GetBidi() == 0)),
|
||||
"ForceReflow on new prescontext");
|
||||
|
||||
Document()->SetBidiOptions(aSource);
|
||||
@ -1748,14 +1748,14 @@ nsPresContext::ThemeChanged()
|
||||
if (NS_SUCCEEDED(NS_DispatchToCurrentThread(ev))) {
|
||||
mPendingThemeChanged = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
nsPresContext::ThemeChangedInternal()
|
||||
{
|
||||
mPendingThemeChanged = false;
|
||||
|
||||
|
||||
// Tell the theme that it changed, so it can flush any handles to stale theme
|
||||
// data.
|
||||
if (mTheme && sThemeChanged) {
|
||||
@ -1797,13 +1797,13 @@ void
|
||||
nsPresContext::SysColorChangedInternal()
|
||||
{
|
||||
mPendingSysColorChanged = false;
|
||||
|
||||
|
||||
if (sLookAndFeelChanged) {
|
||||
// Don't use the cached values for the system colors
|
||||
LookAndFeel::Refresh();
|
||||
sLookAndFeelChanged = false;
|
||||
}
|
||||
|
||||
|
||||
// Reset default background and foreground colors for the document since
|
||||
// they may be using system colors
|
||||
GetDocumentColorPreferences();
|
||||
@ -2198,7 +2198,7 @@ nsPresContext::RebuildUserFontSet()
|
||||
if (NS_SUCCEEDED(NS_DispatchToCurrentThread(ev))) {
|
||||
mPostedFlushUserFontSet = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
@ -2385,7 +2385,7 @@ nsPresContext::NotifyInvalidation(const nsRect& aRect, uint32_t aFlags)
|
||||
// MayHavePaintEventListener is pretty cheap and we could make it
|
||||
// even cheaper by providing a more efficient
|
||||
// nsPIDOMWindow::GetListenerManager.
|
||||
|
||||
|
||||
if (mAllInvalidated) {
|
||||
return;
|
||||
}
|
||||
@ -2412,11 +2412,11 @@ nsPresContext::NotifyInvalidation(const nsRect& aRect, uint32_t aFlags)
|
||||
request->mFlags = aFlags;
|
||||
}
|
||||
|
||||
/* static */ void
|
||||
/* static */ void
|
||||
nsPresContext::NotifySubDocInvalidation(ContainerLayer* aContainer,
|
||||
const nsIntRegion& aRegion)
|
||||
{
|
||||
ContainerLayerPresContext *data =
|
||||
ContainerLayerPresContext *data =
|
||||
static_cast<ContainerLayerPresContext*>(
|
||||
aContainer->GetUserData(&gNotifySubDocInvalidationData));
|
||||
if (!data) {
|
||||
|
@ -299,7 +299,7 @@ public:
|
||||
{ SetImageAnimationModeExternal(aMode); }
|
||||
#endif
|
||||
|
||||
/**
|
||||
/**
|
||||
* Get medium of presentation
|
||||
*/
|
||||
nsIAtom* Medium() {
|
||||
@ -338,7 +338,7 @@ public:
|
||||
* If aLanguage is nullptr, the document's language is used.
|
||||
*
|
||||
* This object is read-only, you must copy the font to modify it.
|
||||
*
|
||||
*
|
||||
* When aFontID is kPresContext_DefaultVariableFontID or
|
||||
* kPresContext_DefaultFixedFontID (which equals
|
||||
* kGenericFont_moz_fixed, which is used for the -moz-fixed generic),
|
||||
@ -393,7 +393,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Get the default colors
|
||||
*/
|
||||
const nscolor DefaultColor() const { return mDefaultColor; }
|
||||
@ -468,7 +468,7 @@ public:
|
||||
* context.
|
||||
*/
|
||||
bool IsPaginated() const { return mPaginated; }
|
||||
|
||||
|
||||
/**
|
||||
* Sets whether the presentation context can scroll for a paginated
|
||||
* context.
|
||||
@ -543,7 +543,7 @@ public:
|
||||
const LangGroupFontPrefs *prefs = GetFontPrefsForLang(aLanguage);
|
||||
return std::max(mBaseMinFontSize, prefs->mMinimumFontSize);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the per-presentation base minimum font size. This size is
|
||||
* independent of the language-specific global preference.
|
||||
@ -551,7 +551,7 @@ public:
|
||||
int32_t BaseMinFontSize() const {
|
||||
return mBaseMinFontSize;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set the per-presentation base minimum font size. This size is
|
||||
* independent of the language-specific global preference.
|
||||
@ -681,7 +681,7 @@ public:
|
||||
{
|
||||
mDrawColorBackground = aCanDraw;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Getter and setter for OMTA time counters
|
||||
*/
|
||||
@ -720,7 +720,7 @@ public:
|
||||
*
|
||||
* Visual directionality is a presentation method that displays text
|
||||
* as if it were a uni-directional, according to the primary display
|
||||
* direction only.
|
||||
* direction only.
|
||||
*
|
||||
* Implicit directionality is a presentation method in which the
|
||||
* direction is determined by the Bidi algorithm according to the
|
||||
@ -745,7 +745,7 @@ public:
|
||||
|
||||
/**
|
||||
* Set the Bidi options for the presentation context
|
||||
*/
|
||||
*/
|
||||
NS_HIDDEN_(void) SetBidi(uint32_t aBidiOptions,
|
||||
bool aForceRestyle = false);
|
||||
|
||||
@ -807,7 +807,7 @@ public:
|
||||
whether the prescontext is now being shown.
|
||||
*/
|
||||
NS_HIDDEN_(bool) EnsureVisible();
|
||||
|
||||
|
||||
#ifdef MOZ_REFLOW_PERF
|
||||
NS_HIDDEN_(void) CountReflows(const char * aName,
|
||||
nsIFrame * aFrame);
|
||||
@ -850,7 +850,7 @@ public:
|
||||
bool GetPaintFlashing() const;
|
||||
|
||||
bool SupressingResizeReflow() const { return mSupressResizeReflow; }
|
||||
|
||||
|
||||
virtual NS_HIDDEN_(gfxUserFontSet*) GetUserFontSetExternal();
|
||||
NS_HIDDEN_(gfxUserFontSet*) GetUserFontSetInternal();
|
||||
#ifdef MOZILLA_INTERNAL_API
|
||||
@ -949,7 +949,7 @@ public:
|
||||
bool mInterruptsEnabled;
|
||||
bool mHasPendingInterrupt;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Check for interrupts. This may return true if a pending event is
|
||||
* detected. Once it has returned true, it will keep returning true
|
||||
@ -1136,7 +1136,7 @@ public:
|
||||
bool MayHavePaintEventListener();
|
||||
|
||||
/**
|
||||
* Checks for MozAfterPaint listeners on the document and
|
||||
* Checks for MozAfterPaint listeners on the document and
|
||||
* any subdocuments, except for subdocuments that are non-top-level
|
||||
* content documents.
|
||||
*/
|
||||
@ -1499,7 +1499,7 @@ protected:
|
||||
#ifdef MOZ_REFLOW_PERF
|
||||
|
||||
#define DO_GLOBAL_REFLOW_COUNT(_name) \
|
||||
aPresContext->CountReflows((_name), (nsIFrame*)this);
|
||||
aPresContext->CountReflows((_name), (nsIFrame*)this);
|
||||
#else
|
||||
#define DO_GLOBAL_REFLOW_COUNT(_name)
|
||||
#endif // MOZ_REFLOW_PERF
|
||||
|
@ -285,7 +285,7 @@ public:
|
||||
void SetMgr(ReflowCountMgr * aMgr) { mMgr = aMgr; }
|
||||
|
||||
uint32_t GetTotal() { return mTotal; }
|
||||
|
||||
|
||||
protected:
|
||||
void DisplayTotals(uint32_t aTotal, const char * aTitle);
|
||||
void DisplayHTMLTotals(uint32_t aTotal, const char * aTitle);
|
||||
@ -381,7 +381,7 @@ protected:
|
||||
PLHashTable * mCounts;
|
||||
PLHashTable * mIndiFrameCounts;
|
||||
FILE * mFD;
|
||||
|
||||
|
||||
bool mDumpFrameCounts;
|
||||
bool mDumpFrameByFrameCounts;
|
||||
bool mPaintFrameByFrameCounts;
|
||||
@ -606,8 +606,8 @@ nsIPresShell::GetVerifyReflowEnable()
|
||||
#endif
|
||||
return gVerifyReflowEnabled;
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
void
|
||||
PresShell::AddInvalidateHiddenPresShellObserver(nsRefreshDriver *aDriver)
|
||||
{
|
||||
if (!mHiddenInvalidationObserverRefreshDriver && !mIsDestroying && !mHaveShutDown) {
|
||||
@ -852,14 +852,14 @@ PresShell::Init(nsIDocument* aDocument,
|
||||
mOriginalCaret = mCaret;
|
||||
|
||||
//SetCaretEnabled(true); // make it show in browser windows
|
||||
#endif
|
||||
#endif
|
||||
//set up selection to be displayed in document
|
||||
// Don't enable selection for print media
|
||||
nsPresContext::nsPresContextType type = aPresContext->Type();
|
||||
if (type != nsPresContext::eContext_PrintPreview &&
|
||||
type != nsPresContext::eContext_Print)
|
||||
SetDisplaySelection(nsISelectionController::SELECTION_DISABLED);
|
||||
|
||||
|
||||
if (gMaxRCProcessingTime == -1) {
|
||||
gMaxRCProcessingTime =
|
||||
Preferences::GetInt("layout.reflow.timeslice", NS_MAX_REFLOW_TIME);
|
||||
@ -1189,7 +1189,7 @@ PresShell::Destroy()
|
||||
|
||||
if (mPresContext) {
|
||||
// We hold a reference to the pres context, and it holds a weak link back
|
||||
// to us. To avoid the pres context having a dangling reference, set its
|
||||
// to us. To avoid the pres context having a dangling reference, set its
|
||||
// pres shell to nullptr
|
||||
mPresContext->SetShell(nullptr);
|
||||
|
||||
@ -1248,11 +1248,11 @@ PresShell::SetPreferenceStyleRules(bool aForceReflow)
|
||||
|
||||
if (!window) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
}
|
||||
|
||||
NS_PRECONDITION(mPresContext, "presContext cannot be null");
|
||||
if (mPresContext) {
|
||||
// first, make sure this is not a chrome shell
|
||||
// first, make sure this is not a chrome shell
|
||||
if (nsContentUtils::IsInChromeDocshell(mDocument)) {
|
||||
return NS_OK;
|
||||
}
|
||||
@ -1263,10 +1263,10 @@ PresShell::SetPreferenceStyleRules(bool aForceReflow)
|
||||
// if here, we need to create rules for the prefs
|
||||
// - this includes the background-color, the text-color,
|
||||
// the link color, the visited link color and the link-underlining
|
||||
|
||||
|
||||
// first clear any exising rules
|
||||
nsresult result = ClearPreferenceStyleRules();
|
||||
|
||||
|
||||
// now the link rules (must come after the color rules, or links will not be correct color!)
|
||||
// XXX - when there is both an override and agent pref stylesheet this won't matter,
|
||||
// as the color rules will be overrides and the links rules will be agent
|
||||
@ -1301,7 +1301,7 @@ nsresult PresShell::ClearPreferenceStyleRules(void)
|
||||
if (mPrefStyleSheet) {
|
||||
NS_ASSERTION(mStyleSet, "null styleset entirely unexpected!");
|
||||
if (mStyleSet) {
|
||||
// remove the sheet from the styleset:
|
||||
// remove the sheet from the styleset:
|
||||
// - note that we have to check for success by comparing the count before and after...
|
||||
#ifdef DEBUG
|
||||
int32_t numBefore = mStyleSet->SheetCount(nsStyleSet::eUserSheet);
|
||||
@ -1396,14 +1396,14 @@ nsresult PresShell::SetPrefNoFramesRule(void)
|
||||
}
|
||||
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
|
||||
if (!mPrefStyleSheet) {
|
||||
rv = CreatePreferenceStyleSheet();
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
|
||||
|
||||
NS_ASSERTION(mPrefStyleSheet, "prefstylesheet should not be null");
|
||||
|
||||
|
||||
bool allowSubframes = true;
|
||||
nsCOMPtr<nsIDocShell> docShell(mPresContext->GetDocShell());
|
||||
if (docShell) {
|
||||
@ -1421,7 +1421,7 @@ nsresult PresShell::SetPrefNoFramesRule(void)
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
||||
nsresult PresShell::SetPrefLinkRules(void)
|
||||
{
|
||||
NS_ASSERTION(mPresContext,"null prescontext not allowed");
|
||||
@ -1430,24 +1430,24 @@ nsresult PresShell::SetPrefLinkRules(void)
|
||||
}
|
||||
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
|
||||
if (!mPrefStyleSheet) {
|
||||
rv = CreatePreferenceStyleSheet();
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
|
||||
|
||||
NS_ASSERTION(mPrefStyleSheet, "prefstylesheet should not be null");
|
||||
|
||||
// support default link colors:
|
||||
// this means the link colors need to be overridable,
|
||||
|
||||
// support default link colors:
|
||||
// this means the link colors need to be overridable,
|
||||
// which they are if we put them in the agent stylesheet,
|
||||
// though if using an override sheet this will cause authors grief still
|
||||
// In the agent stylesheet, they are !important when we are ignoring document colors
|
||||
|
||||
|
||||
nscolor linkColor(mPresContext->DefaultLinkColor());
|
||||
nscolor activeColor(mPresContext->DefaultActiveLinkColor());
|
||||
nscolor visitedColor(mPresContext->DefaultVisitedLinkColor());
|
||||
|
||||
|
||||
NS_NAMED_LITERAL_STRING(ruleClose, "}");
|
||||
uint32_t index = 0;
|
||||
nsAutoString strColor;
|
||||
@ -1494,7 +1494,7 @@ nsresult PresShell::SetPrefLinkRules(void)
|
||||
sInsertPrefSheetRulesAt, &index);
|
||||
}
|
||||
|
||||
return rv;
|
||||
return rv;
|
||||
}
|
||||
|
||||
nsresult PresShell::SetPrefFocusRules(void)
|
||||
@ -1564,7 +1564,7 @@ nsresult PresShell::SetPrefFocusRules(void)
|
||||
result = mPrefStyleSheet->
|
||||
InsertRuleInternal(strRule, sInsertPrefSheetRulesAt, &index);
|
||||
NS_ENSURE_SUCCESS(result, result);
|
||||
|
||||
|
||||
strRule.AssignLiteral("button:focus::-moz-focus-inner, input[type=\"reset\"]:focus::-moz-focus-inner,");
|
||||
strRule.AppendLiteral("input[type=\"button\"]:focus::-moz-focus-inner, input[type=\"submit\"]:focus::-moz-focus-inner {");
|
||||
strRule.AppendLiteral("border-color: ButtonText !important; }");
|
||||
@ -1588,7 +1588,7 @@ PresShell::AddUserSheet(nsISupports* aSheet)
|
||||
do_GetService(NS_STYLESHEETSERVICE_CONTRACTID);
|
||||
|
||||
mStyleSet->BeginUpdate();
|
||||
|
||||
|
||||
nsStyleSheetService *sheetService = nsStyleSheetService::gInstance;
|
||||
nsCOMArray<nsIStyleSheet> & userSheets = *sheetService->UserStyleSheets();
|
||||
int32_t i;
|
||||
@ -1637,7 +1637,7 @@ PresShell::AddAuthorSheet(nsISupports* aSheet)
|
||||
if (firstAuthorSheet) {
|
||||
mStyleSet->InsertStyleSheetBefore(nsStyleSet::eDocSheet, sheet, firstAuthorSheet);
|
||||
} else {
|
||||
mStyleSet->AppendStyleSheet(nsStyleSet::eDocSheet, sheet);
|
||||
mStyleSet->AppendStyleSheet(nsStyleSet::eDocSheet, sheet);
|
||||
}
|
||||
|
||||
ReconstructStyleData();
|
||||
@ -1896,7 +1896,7 @@ PresShell::Initialize(nscoord aWidth, nscoord aHeight)
|
||||
PAINTLOCK_EVENT_DELAY);
|
||||
|
||||
mPaintSuppressionTimer->InitWithFuncCallback(sPaintSuppressionCallback,
|
||||
this, delay,
|
||||
this, delay,
|
||||
nsITimer::TYPE_ONE_SHOT);
|
||||
}
|
||||
}
|
||||
@ -1947,7 +1947,7 @@ PresShell::ResizeReflowIgnoreOverride(nscoord aWidth, nscoord aHeight)
|
||||
NS_PRECONDITION(!mIsReflowing, "Shouldn't be in reflow here!");
|
||||
NS_PRECONDITION(aWidth != NS_UNCONSTRAINEDSIZE,
|
||||
"shouldn't use unconstrained widths anymore");
|
||||
|
||||
|
||||
// If we don't have a root frame yet, that means we haven't had our initial
|
||||
// reflow... If that's the case, and aWidth or aHeight is unconstrained,
|
||||
// ignore them altogether.
|
||||
@ -2107,7 +2107,7 @@ PresShell::NotifyDestroyingFrame(nsIFrame* aFrame)
|
||||
mCurrentEventFrameStack[i] = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
mFramesToDirty.RemoveEntry(aFrame);
|
||||
} else {
|
||||
// We must delete this property in situ so that its destructor removes the
|
||||
@ -2208,10 +2208,10 @@ NS_IMETHODIMP PresShell::GetSelectionFlags(int16_t *aOutEnable)
|
||||
|
||||
//implementation of nsISelectionController
|
||||
|
||||
NS_IMETHODIMP
|
||||
NS_IMETHODIMP
|
||||
PresShell::CharacterMove(bool aForward, bool aExtend)
|
||||
{
|
||||
return mSelection->CharacterMove(aForward, aExtend);
|
||||
return mSelection->CharacterMove(aForward, aExtend);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
@ -2226,7 +2226,7 @@ PresShell::CharacterExtendForBackspace()
|
||||
return mSelection->CharacterExtendForBackspace();
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
NS_IMETHODIMP
|
||||
PresShell::WordMove(bool aForward, bool aExtend)
|
||||
{
|
||||
nsresult result = mSelection->WordMove(aForward, aExtend);
|
||||
@ -2237,32 +2237,32 @@ PresShell::WordMove(bool aForward, bool aExtend)
|
||||
return result;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
NS_IMETHODIMP
|
||||
PresShell::WordExtendForDelete(bool aForward)
|
||||
{
|
||||
return mSelection->WordExtendForDelete(aForward);
|
||||
return mSelection->WordExtendForDelete(aForward);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
NS_IMETHODIMP
|
||||
PresShell::LineMove(bool aForward, bool aExtend)
|
||||
{
|
||||
nsresult result = mSelection->LineMove(aForward, aExtend);
|
||||
// if we can't go down/up any more we must then move caret completely to
|
||||
nsresult result = mSelection->LineMove(aForward, aExtend);
|
||||
// if we can't go down/up any more we must then move caret completely to
|
||||
// end/beginning respectively.
|
||||
if (NS_FAILED(result))
|
||||
if (NS_FAILED(result))
|
||||
result = CompleteMove(aForward,aExtend);
|
||||
return result;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
NS_IMETHODIMP
|
||||
PresShell::IntraLineMove(bool aForward, bool aExtend)
|
||||
{
|
||||
return mSelection->IntraLineMove(aForward, aExtend);
|
||||
return mSelection->IntraLineMove(aForward, aExtend);
|
||||
}
|
||||
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
NS_IMETHODIMP
|
||||
PresShell::PageMove(bool aForward, bool aExtend)
|
||||
{
|
||||
nsIScrollableFrame *scrollableFrame =
|
||||
@ -2280,7 +2280,7 @@ PresShell::PageMove(bool aForward, bool aExtend)
|
||||
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
NS_IMETHODIMP
|
||||
PresShell::ScrollPage(bool aForward)
|
||||
{
|
||||
nsIScrollableFrame* scrollFrame =
|
||||
@ -2354,15 +2354,15 @@ PresShell::CompleteMove(bool aForward, bool aExtend)
|
||||
// HandleClick resets ancestorLimiter, so set it again.
|
||||
mSelection->SetAncestorLimiter(limiter);
|
||||
}
|
||||
|
||||
|
||||
// After ScrollSelectionIntoView(), the pending notifications might be
|
||||
// flushed and PresShell/PresContext/Frames may be dead. See bug 418470.
|
||||
return ScrollSelectionIntoView(nsISelectionController::SELECTION_NORMAL,
|
||||
return ScrollSelectionIntoView(nsISelectionController::SELECTION_NORMAL,
|
||||
nsISelectionController::SELECTION_FOCUS_REGION,
|
||||
nsISelectionController::SCROLL_SYNCHRONOUS);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
NS_IMETHODIMP
|
||||
PresShell::SelectAll()
|
||||
{
|
||||
return mSelection->SelectAll();
|
||||
@ -2503,7 +2503,7 @@ PresShell::RestoreRootScrollPosition()
|
||||
|
||||
void
|
||||
PresShell::BeginLoad(nsIDocument *aDocument)
|
||||
{
|
||||
{
|
||||
mDocumentLoading = true;
|
||||
|
||||
#ifdef PR_LOGGING
|
||||
@ -2534,9 +2534,9 @@ void
|
||||
PresShell::EndLoad(nsIDocument *aDocument)
|
||||
{
|
||||
NS_PRECONDITION(aDocument == mDocument, "Wrong document");
|
||||
|
||||
|
||||
RestoreRootScrollPosition();
|
||||
|
||||
|
||||
mDocumentLoading = false;
|
||||
}
|
||||
|
||||
@ -2580,13 +2580,13 @@ PresShell::VerifyHasDirtyRootAncestor(nsIFrame* aFrame)
|
||||
{
|
||||
// XXXbz due to bug 372769, can't actually assert anything here...
|
||||
return;
|
||||
|
||||
|
||||
// XXXbz shouldn't need this part; remove it once FrameNeedsReflow
|
||||
// handles the root frame correctly.
|
||||
if (!aFrame->GetParent()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Make sure that there is a reflow root ancestor of |aFrame| that's
|
||||
// in mDirtyRoots already.
|
||||
while (aFrame && (aFrame->GetStateBits() & NS_FRAME_HAS_DIRTY_CHILDREN)) {
|
||||
@ -2639,7 +2639,7 @@ PresShell::FrameNeedsReflow(nsIFrame *aFrame, IntrinsicDirty aIntrinsicDirty,
|
||||
rootElement->List(stdout, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
nsAutoTArray<nsIFrame*, 4> subtrees;
|
||||
@ -2725,7 +2725,7 @@ PresShell::FrameNeedsReflow(nsIFrame *aFrame, IntrinsicDirty aIntrinsicDirty,
|
||||
VerifyHasDirtyRootAncestor(f);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@ -2751,7 +2751,7 @@ PresShell::FrameNeedsReflow(nsIFrame *aFrame, IntrinsicDirty aIntrinsicDirty,
|
||||
void
|
||||
PresShell::FrameNeedsToContinueReflow(nsIFrame *aFrame)
|
||||
{
|
||||
NS_ASSERTION(mIsReflowing, "Must be in reflow when marking path dirty.");
|
||||
NS_ASSERTION(mIsReflowing, "Must be in reflow when marking path dirty.");
|
||||
NS_PRECONDITION(mCurrentReflowRoot, "Must have a current reflow root here");
|
||||
NS_ASSERTION(aFrame == mCurrentReflowRoot ||
|
||||
nsLayoutUtils::IsProperAncestorFrame(mCurrentReflowRoot, aFrame),
|
||||
@ -2913,7 +2913,7 @@ PresShell::GoToAnchor(const nsAString& aAnchorName, bool aScroll)
|
||||
if (!mDocument) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
|
||||
const Element *root = mDocument->GetRootElement();
|
||||
if (root && root->IsSVG(nsGkAtoms::svg)) {
|
||||
// We need to execute this even if there is an empty anchor name
|
||||
@ -2937,7 +2937,7 @@ PresShell::GoToAnchor(const nsAString& aAnchorName, bool aScroll)
|
||||
nsCOMPtr<nsIContent> content;
|
||||
|
||||
// Search for an element with a matching "id" attribute
|
||||
if (mDocument) {
|
||||
if (mDocument) {
|
||||
content = mDocument->GetElementById(aAnchorName);
|
||||
}
|
||||
|
||||
@ -3266,7 +3266,7 @@ ComputeWhereToScroll(int16_t aWhereToScroll,
|
||||
* of the scrolled frame, and a desired percentage-based scroll
|
||||
* position and attempts to scroll the rect to that position in the
|
||||
* scrollport.
|
||||
*
|
||||
*
|
||||
* This needs to work even if aRect has a width or height of zero.
|
||||
*/
|
||||
static void ScrollToShowRect(nsIFrame* aFrame,
|
||||
@ -3528,7 +3528,7 @@ PresShell::ScrollFrameRectIntoView(nsIFrame* aFrame,
|
||||
nsPoint extraOffset(0,0);
|
||||
parent = nsLayoutUtils::GetCrossDocParentFrame(container, &extraOffset);
|
||||
if (parent) {
|
||||
int32_t APD = container->PresContext()->AppUnitsPerDevPixel();
|
||||
int32_t APD = container->PresContext()->AppUnitsPerDevPixel();
|
||||
int32_t parentAPD = parent->PresContext()->AppUnitsPerDevPixel();
|
||||
rect = rect.ConvertAppUnitsRoundOut(APD, parentAPD);
|
||||
rect += extraOffset;
|
||||
@ -3738,13 +3738,13 @@ PresShell::CaptureHistoryState(nsILayoutHistoryState** aState)
|
||||
|
||||
*aState = historyState;
|
||||
NS_IF_ADDREF(*aState);
|
||||
|
||||
|
||||
// Capture frame state for the entire frame hierarchy
|
||||
nsIFrame* rootFrame = mFrameConstructor->GetRootFrame();
|
||||
if (!rootFrame) return NS_OK;
|
||||
|
||||
mFrameConstructor->CaptureFrameState(rootFrame, historyState);
|
||||
|
||||
mFrameConstructor->CaptureFrameState(rootFrame, historyState);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -3825,7 +3825,7 @@ PresShell::PostReflowCallback(nsIReflowCallback* aCallback)
|
||||
mFirstCallbackEventRequest = request;
|
||||
mLastCallbackEventRequest = request;
|
||||
}
|
||||
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -3838,7 +3838,7 @@ PresShell::CancelReflowCallback(nsIReflowCallback* aCallback)
|
||||
{
|
||||
nsIReflowCallback* callback = node->callback;
|
||||
|
||||
if (callback == aCallback)
|
||||
if (callback == aCallback)
|
||||
{
|
||||
nsCallbackEventRequest* toFree = node;
|
||||
if (node == mFirstCallbackEventRequest) {
|
||||
@ -4253,11 +4253,11 @@ PresShell::ContentAppended(nsIDocument *aDocument,
|
||||
NS_PRECONDITION(!mIsDocumentGone, "Unexpected ContentAppended");
|
||||
NS_PRECONDITION(aDocument == mDocument, "Unexpected aDocument");
|
||||
NS_PRECONDITION(aContainer, "must have container");
|
||||
|
||||
|
||||
if (!mDidInitialize) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
nsAutoCauseReflowNotifier crNotifier(this);
|
||||
|
||||
// Call this here so it only happens for real content mutations and
|
||||
@ -4293,7 +4293,7 @@ PresShell::ContentInserted(nsIDocument* aDocument,
|
||||
if (!mDidInitialize) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
nsAutoCauseReflowNotifier crNotifier(this);
|
||||
|
||||
// Call this here so it only happens for real content mutations and
|
||||
@ -4354,7 +4354,7 @@ PresShell::ContentRemoved(nsIDocument *aDocument,
|
||||
} else {
|
||||
oldNextSibling = nullptr;
|
||||
}
|
||||
|
||||
|
||||
if (aContainer && aContainer->IsElement()) {
|
||||
mPresContext->RestyleManager()->
|
||||
RestyleForRemove(aContainer->AsElement(), aChild, oldNextSibling);
|
||||
@ -4487,7 +4487,7 @@ PresShell::StyleSheetAdded(nsIDocument *aDocument,
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
void
|
||||
PresShell::StyleSheetRemoved(nsIDocument *aDocument,
|
||||
nsIStyleSheet* aStyleSheet,
|
||||
bool aDocumentSheet)
|
||||
@ -4522,7 +4522,7 @@ PresShell::StyleRuleChanged(nsIDocument *aDocument,
|
||||
void
|
||||
PresShell::StyleRuleAdded(nsIDocument *aDocument,
|
||||
nsIStyleSheet* aStyleSheet,
|
||||
nsIStyleRule* aStyleRule)
|
||||
nsIStyleRule* aStyleRule)
|
||||
{
|
||||
RecordStyleSheetChange(aStyleSheet);
|
||||
}
|
||||
@ -4530,7 +4530,7 @@ PresShell::StyleRuleAdded(nsIDocument *aDocument,
|
||||
void
|
||||
PresShell::StyleRuleRemoved(nsIDocument *aDocument,
|
||||
nsIStyleSheet* aStyleSheet,
|
||||
nsIStyleRule* aStyleRule)
|
||||
nsIStyleRule* aStyleRule)
|
||||
{
|
||||
RecordStyleSheetChange(aStyleSheet);
|
||||
}
|
||||
@ -5022,7 +5022,7 @@ PresShell::RenderNode(nsIDOMNode* aNode,
|
||||
nsCOMPtr<nsINode> node = do_QueryInterface(aNode);
|
||||
if (!node->IsInDoc())
|
||||
return nullptr;
|
||||
|
||||
|
||||
nsRefPtr<nsRange> range = new nsRange(node);
|
||||
if (NS_FAILED(range->SelectNode(aNode)))
|
||||
return nullptr;
|
||||
@ -5039,7 +5039,7 @@ PresShell::RenderNode(nsIDOMNode* aNode,
|
||||
|
||||
nsRect rrect = rrectPixels.ToAppUnits(nsPresContext::AppUnitsPerCSSPixel());
|
||||
area.IntersectRect(area, rrect);
|
||||
|
||||
|
||||
nsPresContext* pc = GetPresContext();
|
||||
if (!pc)
|
||||
return nullptr;
|
||||
@ -5140,7 +5140,7 @@ PresShell::AddCanvasBackgroundColorItem(nsDisplayListBuilder& aBuilder,
|
||||
if (NS_GET_A(bgcolor) == 0)
|
||||
return;
|
||||
|
||||
// To make layers work better, we want to avoid having a big non-scrolled
|
||||
// To make layers work better, we want to avoid having a big non-scrolled
|
||||
// color background behind a scrolled transparent background. Instead,
|
||||
// we'll try to move the color background into the scrolled content
|
||||
// by making nsDisplayCanvasBackground paint it.
|
||||
@ -5346,7 +5346,7 @@ void PresShell::SynthesizeMouseMove(bool aFromScroll)
|
||||
* view hierarchy (i.e., added later) are preferred over their siblings.
|
||||
* This is adequate for finding the "topmost" floating view under a point,
|
||||
* given that floating views don't supporting having a specific z-index.
|
||||
*
|
||||
*
|
||||
* We cannot exit early when aPt is outside the view bounds, because floating
|
||||
* views aren't necessarily included in their parent's bounds, so this could
|
||||
* traverse the entire view hierarchy --- use carefully.
|
||||
@ -5374,7 +5374,7 @@ static nsView* FindFloatingViewContaining(nsView* aView, nsPoint aPt)
|
||||
if (aView->GetFloating() && aView->HasWidget() &&
|
||||
aView->GetDimensions().Contains(aPt))
|
||||
return aView;
|
||||
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@ -5439,7 +5439,7 @@ PresShell::ProcessSynthMouseMoveEvent(bool aFromScroll)
|
||||
// Hold a ref to ourselves so DispatchEvent won't destroy us (since
|
||||
// we need to access members after we call DispatchEvent).
|
||||
nsCOMPtr<nsIPresShell> kungFuDeathGrip(this);
|
||||
|
||||
|
||||
#ifdef DEBUG_MOUSE_LOCATION
|
||||
printf("[ps=%p]synthesizing mouse move to (%d,%d)\n",
|
||||
this, mMouseLocation.x, mMouseLocation.y);
|
||||
@ -5683,7 +5683,7 @@ PresShell::ScheduleImageVisibilityUpdate()
|
||||
if (mUpdateImageVisibilityEvent.IsPending())
|
||||
return;
|
||||
|
||||
nsRefPtr<nsRunnableMethod<PresShell> > ev =
|
||||
nsRefPtr<nsRunnableMethod<PresShell> > ev =
|
||||
NS_NewRunnableMethod(this, &PresShell::UpdateImageVisibility);
|
||||
if (NS_SUCCEEDED(NS_DispatchToCurrentThread(ev))) {
|
||||
mUpdateImageVisibilityEvent = ev;
|
||||
@ -5879,8 +5879,8 @@ PresShell::Paint(nsView* aViewToPaint,
|
||||
bool computeInvalidRect = computeInvalidFunc ||
|
||||
(layerManager->GetBackendType() == LayersBackend::LAYERS_BASIC);
|
||||
|
||||
nsAutoPtr<LayerProperties> props(computeInvalidRect ?
|
||||
LayerProperties::CloneFrom(layerManager->GetRoot()) :
|
||||
nsAutoPtr<LayerProperties> props(computeInvalidRect ?
|
||||
LayerProperties::CloneFrom(layerManager->GetRoot()) :
|
||||
nullptr);
|
||||
|
||||
if (layerManager->EndEmptyTransaction((aFlags & PAINT_COMPOSITE) ?
|
||||
@ -5992,7 +5992,7 @@ PresShell::GetCurrentEventFrame()
|
||||
if (MOZ_UNLIKELY(mIsDestroying)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
// GetCurrentEventContent() makes sure the content is still in the
|
||||
// same document that this pres shell belongs to. If not, then the
|
||||
// frame shouldn't get an event, nor should we even assume its safe
|
||||
@ -6508,7 +6508,7 @@ PresShell::HandleEvent(nsIFrame* aFrame,
|
||||
nsPresContext* framePresContext = frame->PresContext();
|
||||
nsPresContext* rootPresContext = framePresContext->GetRootPresContext();
|
||||
NS_ASSERTION(rootPresContext == mPresContext->GetRootPresContext(),
|
||||
"How did we end up outside the connected prescontext/viewmanager hierarchy?");
|
||||
"How did we end up outside the connected prescontext/viewmanager hierarchy?");
|
||||
// If we aren't starting our event dispatch from the root frame of the root prescontext,
|
||||
// then someone must be capturing the mouse. In that case we don't want to search the popup
|
||||
// list.
|
||||
@ -6633,7 +6633,7 @@ PresShell::HandleEvent(nsIFrame* aFrame,
|
||||
// jump up to the containing document.
|
||||
f = f->PresContext()->GetPresShell()->GetRootFrame();
|
||||
}
|
||||
|
||||
|
||||
// if we couldn't find a target frame in the same document as
|
||||
// anyTarget, remove the touch from the capture touch list, as
|
||||
// well as the event->touches array. touchmove events that aren't
|
||||
@ -6727,13 +6727,13 @@ PresShell::HandleEvent(nsIFrame* aFrame,
|
||||
if (!touch) {
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
nsRefPtr<dom::Touch> oldTouch =
|
||||
gCaptureTouchList->GetWeak(touch->Identifier());
|
||||
if (!oldTouch) {
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
nsCOMPtr<nsIContent> content =
|
||||
do_QueryInterface(oldTouch->Target());
|
||||
if (!content) {
|
||||
@ -6792,9 +6792,9 @@ PresShell::HandleEvent(nsIFrame* aFrame,
|
||||
|
||||
return HandlePositionedEvent(frame, aEvent, aEventStatus);
|
||||
}
|
||||
|
||||
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
|
||||
if (frame) {
|
||||
PushCurrentEventInfo(nullptr, nullptr);
|
||||
|
||||
@ -6863,7 +6863,7 @@ PresShell::HandleEvent(nsIFrame* aFrame,
|
||||
} else {
|
||||
mCurrentEventContent = eventTarget;
|
||||
}
|
||||
|
||||
|
||||
if (!GetCurrentEventContent() || !GetCurrentEventFrame() ||
|
||||
InZombieDocument(mCurrentEventContent)) {
|
||||
rv = RetargetEventToParent(aEvent, aEventStatus);
|
||||
@ -6876,7 +6876,7 @@ PresShell::HandleEvent(nsIFrame* aFrame,
|
||||
if (GetCurrentEventFrame()) {
|
||||
rv = HandleEventInternal(aEvent, aEventStatus);
|
||||
}
|
||||
|
||||
|
||||
#ifdef DEBUG
|
||||
ShowEventTargetDebug();
|
||||
#endif
|
||||
@ -6950,9 +6950,9 @@ PresShell::HandlePositionedEvent(nsIFrame* aTargetFrame,
|
||||
nsEventStatus* aEventStatus)
|
||||
{
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
|
||||
PushCurrentEventInfo(nullptr, nullptr);
|
||||
|
||||
|
||||
mCurrentEventFrame = aTargetFrame;
|
||||
|
||||
if (mCurrentEventFrame) {
|
||||
@ -7426,12 +7426,12 @@ bool
|
||||
PresShell::AdjustContextMenuKeyEvent(WidgetMouseEvent* aEvent)
|
||||
{
|
||||
#ifdef MOZ_XUL
|
||||
// if a menu is open, open the context menu relative to the active item on the menu.
|
||||
// if a menu is open, open the context menu relative to the active item on the menu.
|
||||
nsXULPopupManager* pm = nsXULPopupManager::GetInstance();
|
||||
if (pm) {
|
||||
nsIFrame* popupFrame = pm->GetTopPopup(ePopupTypeMenu);
|
||||
if (popupFrame) {
|
||||
nsIFrame* itemFrame =
|
||||
nsIFrame* itemFrame =
|
||||
(static_cast<nsMenuPopupFrame *>(popupFrame))->GetCurrentMenuItem();
|
||||
if (!itemFrame)
|
||||
itemFrame = popupFrame;
|
||||
@ -7453,7 +7453,7 @@ PresShell::AdjustContextMenuKeyEvent(WidgetMouseEvent* aEvent)
|
||||
// If we're here because of the key-equiv for showing context menus, we
|
||||
// have to twiddle with the NS event to make sure the context menu comes
|
||||
// up in the upper left of the relevant content area before we create
|
||||
// the DOM event. Since we never call InitMouseEvent() on the event,
|
||||
// the DOM event. Since we never call InitMouseEvent() on the event,
|
||||
// the client X/Y will be 0,0. We can make use of that if the widget is null.
|
||||
// Use the root view manager's widget since it's most likely to have one,
|
||||
// and the coordinates returned by GetCurrentItemAndPositionForElement
|
||||
@ -7540,7 +7540,7 @@ PresShell::PrepareToUseCaretPosition(nsIWidget* aEventWidget, nsIntPoint& aTarge
|
||||
if (NS_FAILED(rv) || ! caretVisible)
|
||||
return false;
|
||||
|
||||
// caret selection, this is a temporary weak reference, so no refcounting is
|
||||
// caret selection, this is a temporary weak reference, so no refcounting is
|
||||
// needed
|
||||
nsISelection* domSelection = caret->GetCaretDOMSelection();
|
||||
NS_ENSURE_TRUE(domSelection, false);
|
||||
@ -7662,7 +7662,7 @@ PresShell::GetCurrentItemAndPositionForElement(nsIDOMElement *aCurrentEl,
|
||||
do_QueryInterface(aCurrentEl);
|
||||
if (multiSelect) {
|
||||
checkLineHeight = false;
|
||||
|
||||
|
||||
int32_t currentIndex;
|
||||
multiSelect->GetCurrentIndex(¤tIndex);
|
||||
if (currentIndex >= 0) {
|
||||
@ -7745,7 +7745,7 @@ PresShell::GetCurrentItemAndPositionForElement(nsIDOMElement *aCurrentEl,
|
||||
|
||||
// Start context menu down and to the right from top left of frame
|
||||
// use the lineheight. This is a good distance to move the context
|
||||
// menu away from the top left corner of the frame. If we always
|
||||
// menu away from the top left corner of the frame. If we always
|
||||
// used the frame height, the context menu could end up far away,
|
||||
// for example when we're focused on linked images.
|
||||
// On the other hand, we want to use the frame height if it's less
|
||||
@ -7856,7 +7856,7 @@ PresShell::IsVisible()
|
||||
view = view->GetParent();
|
||||
if (!view)
|
||||
return true;
|
||||
|
||||
|
||||
// subdoc view
|
||||
view = view->GetParent();
|
||||
if (!view)
|
||||
@ -8082,7 +8082,7 @@ void
|
||||
PresShell::DidDoReflow(bool aInterruptible, bool aWasInterrupted)
|
||||
{
|
||||
mFrameConstructor->EndUpdate();
|
||||
|
||||
|
||||
HandlePostedReflowCallbacks(aInterruptible);
|
||||
|
||||
nsCOMPtr<nsIDocShell> docShell = mPresContext->GetDocShell();
|
||||
@ -8524,7 +8524,7 @@ PresShell::WindowSizeMoveDone()
|
||||
|
||||
// Return value says whether to walk children.
|
||||
typedef bool (* frameWalkerFn)(nsIFrame *aFrame, void *aClosure);
|
||||
|
||||
|
||||
static bool
|
||||
ReResolveMenusAndTrees(nsIFrame *aFrame, void *aClosure)
|
||||
{
|
||||
@ -8582,7 +8582,7 @@ WalkFramesThroughPlaceholders(nsPresContext *aPresContext, nsIFrame *aFrame,
|
||||
#endif
|
||||
|
||||
NS_IMETHODIMP
|
||||
PresShell::Observe(nsISupports* aSubject,
|
||||
PresShell::Observe(nsISupports* aSubject,
|
||||
const char* aTopic,
|
||||
const char16_t* aData)
|
||||
{
|
||||
@ -8834,7 +8834,7 @@ LogVerifyMessage(nsIFrame* k1, nsIFrame* k2, const char* aMsg,
|
||||
}
|
||||
|
||||
static bool
|
||||
CompareTrees(nsPresContext* aFirstPresContext, nsIFrame* aFirstFrame,
|
||||
CompareTrees(nsPresContext* aFirstPresContext, nsIFrame* aFirstFrame,
|
||||
nsPresContext* aSecondPresContext, nsIFrame* aSecondFrame)
|
||||
{
|
||||
if (!aFirstPresContext || !aFirstFrame || !aSecondPresContext || !aSecondFrame)
|
||||
@ -9037,7 +9037,7 @@ DumpToPNG(nsIPresShell* shell, nsAString& name) {
|
||||
|
||||
nsRefPtr<gfxContext> imgContext = new gfxContext(imgSurface);
|
||||
|
||||
nsRefPtr<gfxASurface> surface =
|
||||
nsRefPtr<gfxASurface> surface =
|
||||
gfxPlatform::GetPlatform()->
|
||||
CreateOffscreenSurface(IntSize(width, height),
|
||||
gfxASurface::ContentFromFormat(gfxImageFormat::ARGB32));
|
||||
@ -9304,7 +9304,7 @@ ReflowCounter::ReflowCounter(ReflowCountMgr * aMgr) :
|
||||
//------------------------------------------------------------------
|
||||
ReflowCounter::~ReflowCounter()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------
|
||||
@ -9388,9 +9388,9 @@ void ReflowCounter::DisplayHTMLTotals(uint32_t aTotal, const char * aTitle)
|
||||
|
||||
ReflowCountMgr::ReflowCountMgr()
|
||||
{
|
||||
mCounts = PL_NewHashTable(10, PL_HashString, PL_CompareStrings,
|
||||
mCounts = PL_NewHashTable(10, PL_HashString, PL_CompareStrings,
|
||||
PL_CompareValues, nullptr, nullptr);
|
||||
mIndiFrameCounts = PL_NewHashTable(10, PL_HashString, PL_CompareStrings,
|
||||
mIndiFrameCounts = PL_NewHashTable(10, PL_HashString, PL_CompareStrings,
|
||||
PL_CompareValues, nullptr, nullptr);
|
||||
mCycledOnce = false;
|
||||
mDumpFrameCounts = false;
|
||||
@ -9431,8 +9431,8 @@ void ReflowCountMgr::Add(const char * aName, nsIFrame * aFrame)
|
||||
counter->Add();
|
||||
}
|
||||
|
||||
if ((mDumpFrameByFrameCounts || mPaintFrameByFrameCounts) &&
|
||||
nullptr != mIndiFrameCounts &&
|
||||
if ((mDumpFrameByFrameCounts || mPaintFrameByFrameCounts) &&
|
||||
nullptr != mIndiFrameCounts &&
|
||||
aFrame != nullptr) {
|
||||
char key[KEY_BUF_SIZE_FOR_PTR];
|
||||
sprintf(key, "%p", (void*)aFrame);
|
||||
@ -9592,8 +9592,8 @@ void ReflowCountMgr::DoGrandTotals()
|
||||
}
|
||||
}
|
||||
|
||||
static void RecurseIndiTotals(nsPresContext* aPresContext,
|
||||
PLHashTable * aHT,
|
||||
static void RecurseIndiTotals(nsPresContext* aPresContext,
|
||||
PLHashTable * aHT,
|
||||
nsIFrame * aParentFrame,
|
||||
int32_t aLevel)
|
||||
{
|
||||
@ -9707,7 +9707,7 @@ void ReflowCountMgr::DisplayHTMLTotals(const char * aStr)
|
||||
{
|
||||
#ifdef WIN32x // XXX NOT XP!
|
||||
char name[1024];
|
||||
|
||||
|
||||
char * sptr = strrchr(aStr, '/');
|
||||
if (sptr) {
|
||||
sptr++;
|
||||
|
@ -422,7 +422,7 @@ protected:
|
||||
friend struct RenderingState;
|
||||
|
||||
struct RenderingState {
|
||||
RenderingState(PresShell* aPresShell)
|
||||
RenderingState(PresShell* aPresShell)
|
||||
: mXResolution(aPresShell->mXResolution)
|
||||
, mYResolution(aPresShell->mYResolution)
|
||||
, mRenderFlags(aPresShell->mRenderFlags)
|
||||
@ -598,7 +598,7 @@ protected:
|
||||
}
|
||||
|
||||
NS_INLINE_DECL_REFCOUNTING(nsSynthMouseMoveEvent)
|
||||
|
||||
|
||||
void Revoke() {
|
||||
if (mPresShell) {
|
||||
mPresShell->GetPresContext()->RefreshDriver()->
|
||||
@ -658,7 +658,7 @@ protected:
|
||||
*/
|
||||
bool AdjustContextMenuKeyEvent(mozilla::WidgetMouseEvent* aEvent);
|
||||
|
||||
//
|
||||
//
|
||||
bool PrepareToUseCaretPosition(nsIWidget* aEventWidget, nsIntPoint& aTargetPt);
|
||||
|
||||
// Get the selected item and coordinates in device pixels relative to root
|
||||
@ -730,7 +730,7 @@ protected:
|
||||
nsPoint mMouseLocation;
|
||||
|
||||
// mStyleSet owns it but we maintain a ref, may be null
|
||||
nsRefPtr<nsCSSStyleSheet> mPrefStyleSheet;
|
||||
nsRefPtr<nsCSSStyleSheet> mPrefStyleSheet;
|
||||
|
||||
// Set of frames that we should mark with NS_FRAME_HAS_DIRTY_CHILDREN after
|
||||
// we finish reflowing mCurrentReflowRoot.
|
||||
@ -786,7 +786,7 @@ protected:
|
||||
// middle of frame construction and the like... it really shouldn't be
|
||||
// needed, one hopes, but it is for now.
|
||||
uint16_t mChangeNestCount;
|
||||
|
||||
|
||||
bool mDocumentLoading : 1;
|
||||
bool mIgnoreFrameDestruction : 1;
|
||||
bool mHaveShutDown : 1;
|
||||
|
Loading…
Reference in New Issue
Block a user