Backing out bug 288064 because of the Tp hit.

This commit is contained in:
bzbarsky%mit.edu 2005-10-01 01:35:56 +00:00
parent 209713220c
commit 79185165c1
8 changed files with 8 additions and 33 deletions

View File

@ -98,7 +98,6 @@ nsImageLoadingContent::nsImageLoadingContent()
mImageBlockingStatus(nsIContentPolicy::ACCEPT),
mLoadingEnabled(PR_TRUE),
mStartingLoad(PR_FALSE),
mLoading(PR_FALSE),
// mBroken starts out true, since an image without a URI is broken....
mBroken(PR_TRUE),
mUserDisabled(PR_FALSE),
@ -163,10 +162,6 @@ nsImageLoadingContent::OnStartContainer(imgIRequest* aRequest,
imgIContainer* aContainer)
{
LOOP_OVER_OBSERVERS(OnStartContainer(aRequest, aContainer));
// Have to check for state changes here, since we might have been in
// the LOADING state before.
UpdateImageState(PR_TRUE);
return NS_OK;
}
@ -545,8 +540,7 @@ nsImageLoadingContent::ImageState() const
return
(mBroken * NS_EVENT_STATE_BROKEN) |
(mUserDisabled * NS_EVENT_STATE_USERDISABLED) |
(mSuppressed * NS_EVENT_STATE_SUPPRESSED) |
(mLoading * NS_EVENT_STATE_LOADING);
(mSuppressed * NS_EVENT_STATE_SUPPRESSED);
}
void
@ -568,7 +562,7 @@ nsImageLoadingContent::UpdateImageState(PRBool aNotify)
PRInt32 oldState = ImageState();
mLoading = mBroken = mUserDisabled = mSuppressed = PR_FALSE;
mBroken = mUserDisabled = mSuppressed = PR_FALSE;
// If we were blocked by server-based content policy, we claim to be
// suppressed. If we were blocked by type-based content policy, we claim to
@ -585,8 +579,6 @@ nsImageLoadingContent::UpdateImageState(PRBool aNotify)
nsresult rv = mCurrentRequest->GetImageStatus(&currentLoadStatus);
if (NS_FAILED(rv) || (currentLoadStatus & imgIRequest::STATUS_ERROR)) {
mBroken = PR_TRUE;
} else if (!(currentLoadStatus & imgIRequest::STATUS_SIZE_AVAILABLE)) {
mLoading = PR_TRUE;
}
}

View File

@ -250,7 +250,6 @@ private:
* The state we had the last time we checked whether we needed to notify the
* document of a state change. These are maintained by UpdateImageState.
*/
PRPackedBool mLoading : 1;
PRPackedBool mBroken : 1;
PRPackedBool mUserDisabled : 1;
PRPackedBool mSuppressed : 1;

View File

@ -177,8 +177,5 @@ public:
#define NS_EVENT_STATE_USERDISABLED 0x00010000
// Content suppressed by the user (ad blocking, etc)
#define NS_EVENT_STATE_SUPPRESSED 0x00020000
// Content is still loading such that there is nothing to show the
// user (eg an image which hasn't started coming in yet)
#define NS_EVENT_STATE_LOADING 0x00040000
#endif // nsIEventStateManager_h__

View File

@ -10436,7 +10436,7 @@ nsCSSFrameConstructor::DoContentStateChanged(nsIContent* aContent,
nsIFrame* primaryFrame = mPresShell->GetPrimaryFrameFor(aContent);
if (primaryFrame) {
if (aStateMask & (NS_EVENT_STATE_BROKEN | NS_EVENT_STATE_USERDISABLED |
NS_EVENT_STATE_SUPPRESSED | NS_EVENT_STATE_LOADING)) {
NS_EVENT_STATE_SUPPRESSED)) {
hint = nsChangeHint_ReconstructFrame;
} else {
PRUint8 app = primaryFrame->GetStyleDisplay()->mAppearance;

View File

@ -438,15 +438,14 @@ nsImageFrame::SourceRectToDest(const nsRect& aRect)
}
static PRBool
ImageOK(PRInt32 aContentState)
ImageOK(nsIContent* aContent)
{
// Note that we treat NS_EVENT_STATE_SUPPRESSED images as "OK". This means
// that we'll construct image frames for them as needed if their display is
// toggled from "none" (though we won't paint them, unless their visibility
// is changed too).
return !(aContentState &
(NS_EVENT_STATE_BROKEN | NS_EVENT_STATE_USERDISABLED |
NS_EVENT_STATE_LOADING));
return !(aContent->IntrinsicState() &
(NS_EVENT_STATE_BROKEN | NS_EVENT_STATE_USERDISABLED));
}
/* static */
@ -454,16 +453,10 @@ PRBool
nsImageFrame::ShouldCreateImageFrameFor(nsIContent* aContent,
nsStyleContext* aStyleContext)
{
PRInt32 state = aContent->IntrinsicState();
if (ImageOK(state)) {
if (ImageOK(aContent)) {
// Image is fine; do the image frame thing
return PR_TRUE;
}
if ((state & NS_EVENT_STATE_LOADING) &&
HaveFixedSize(aStyleContext->GetStylePosition())) {
return PR_TRUE;
}
// Check if we want to use a placeholder box with an icon or just
// let the the presShell make us into inline text. Decide as follows:
@ -1280,7 +1273,7 @@ nsImageFrame::Paint(nsPresContext* aPresContext,
getter_AddRefs(currentRequest));
}
PRBool imageOK = ImageOK(mContent->IntrinsicState());
PRBool imageOK = ImageOK(mContent);
nsCOMPtr<imgIContainer> imgCon;
if (currentRequest) {

View File

@ -394,7 +394,6 @@ hr[size="1"] {
img:-moz-broken::before, input:-moz-broken::before,
img:-moz-user-disabled::before, input:-moz-user-disabled::before,
img:-moz-loading::before, input:-moz-loading::before,
/* Nonempty applets should just show their kids.
XXXbz do we need a selector that will ignore <param> elements? */
applet:empty:-moz-broken::before,

View File

@ -80,7 +80,6 @@ CSS_PSEUDO_CLASS(onlyChild, ":only-child")
CSS_PSEUDO_CLASS(mozBroken, ":-moz-broken")
CSS_PSEUDO_CLASS(mozUserDisabled, ":-moz-user-disabled")
CSS_PSEUDO_CLASS(mozSuppressed, ":-moz-suppressed")
CSS_PSEUDO_CLASS(mozLoading, ":-moz-loading")
// CSS 3 UI
// http://www.w3.org/TR/2004/CR-css3-ui-20040511/#pseudo-classes

View File

@ -3145,9 +3145,6 @@ static PRBool SelectorMatches(RuleProcessorData &data,
else if (nsCSSPseudoClasses::mozSuppressed == pseudoClass->mAtom) {
result = STATE_CHECK(NS_EVENT_STATE_SUPPRESSED);
}
else if (nsCSSPseudoClasses::mozLoading == pseudoClass->mAtom) {
result = STATE_CHECK(NS_EVENT_STATE_LOADING);
}
else if (nsCSSPseudoClasses::required == pseudoClass->mAtom) {
result = STATE_CHECK(NS_EVENT_STATE_REQUIRED);
}
@ -3692,7 +3689,6 @@ PRBool IsStateSelector(nsCSSSelector& aSelector)
(pseudoClass->mAtom == nsCSSPseudoClasses::mozBroken) ||
(pseudoClass->mAtom == nsCSSPseudoClasses::mozUserDisabled) ||
(pseudoClass->mAtom == nsCSSPseudoClasses::mozSuppressed) ||
(pseudoClass->mAtom == nsCSSPseudoClasses::mozLoading) ||
(pseudoClass->mAtom == nsCSSPseudoClasses::required) ||
(pseudoClass->mAtom == nsCSSPseudoClasses::optional) ||
(pseudoClass->mAtom == nsCSSPseudoClasses::valid) ||