Back out changeset f5aecf9010ef (bug 672014) due to build bustage.

This commit is contained in:
Boris Zbarsky 2011-07-29 15:29:01 -04:00
parent 23f2cddc95
commit 1242922ac9
12 changed files with 225 additions and 259 deletions

View File

@ -126,8 +126,8 @@ class Element;
#define NS_IDOCUMENT_IID \
{ 0xe4bc7342, 0x6528, 0x4979, \
{ 0x9e, 0xb5, 0x12, 0xef, 0x4a, 0x97, 0xe1, 0xea } }
{ 0x18e4d4bd, 0x006b, 0x4008, \
{ 0x90, 0x05, 0x27, 0x57, 0x35, 0xf0, 0xd4, 0x85 } }
// Flag for AddStyleSheet().
#define NS_STYLESHEET_FROM_CATALOG (1 << 0)
@ -1386,8 +1386,7 @@ public:
* to nsPreloadURIs::PreloadURIs() in file nsParser.cpp whenever the
* parser-module is linked with gklayout-module.
*/
virtual void MaybePreLoadImage(nsIURI* uri,
const nsAString& aCrossOriginAttr) = 0;
virtual void MaybePreLoadImage(nsIURI* uri) = 0;
/**
* Called by nsParser to preload style sheets. Can also be merged into

View File

@ -7668,7 +7668,7 @@ FireOrClearDelayedEvents(nsTArray<nsCOMPtr<nsIDocument> >& aDocuments,
}
void
nsDocument::MaybePreLoadImage(nsIURI* uri, const nsAString &aCrossOriginAttr)
nsDocument::MaybePreLoadImage(nsIURI* uri)
{
// Early exit if the img is already present in the img-cache
// which indicates that the "real" load has already started and
@ -7680,17 +7680,6 @@ nsDocument::MaybePreLoadImage(nsIURI* uri, const nsAString &aCrossOriginAttr)
return;
}
nsLoadFlags loadFlags = nsIRequest::LOAD_NORMAL;
PRInt32 corsmode = GetCORSMode();
if (aCrossOriginAttr.LowercaseEqualsLiteral("anonymous")) {
loadFlags |= imgILoader::LOAD_CORS_ANONYMOUS;
} else if (aCrossOriginAttr.LowercaseEqualsLiteral("use-credentials")) {
loadFlags |= imgILoader::LOAD_CORS_USE_CREDENTIALS;
}
// else should we err on the side of not doing the preload if
// aCrossOriginAttr is nonempty? Let's err on the side of doing the
// preload as CORS_NONE.
// Image not in cache - trigger preload
nsCOMPtr<imgIRequest> request;
nsresult rv =
@ -7699,7 +7688,7 @@ nsDocument::MaybePreLoadImage(nsIURI* uri, const nsAString &aCrossOriginAttr)
NodePrincipal(),
mDocumentURI, // uri of document used as referrer
nsnull, // no observer
loadFlags,
nsIRequest::LOAD_NORMAL,
getter_AddRefs(request));
// Pin image-reference to avoid evicting it from the img-cache before

View File

@ -1094,7 +1094,6 @@ public final class AttributeName
public static final AttributeName CELLPADDING = new AttributeName(ALL_NO_NS, SAME_LOCAL("cellpadding"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG);
public static final AttributeName CELLSPACING = new AttributeName(ALL_NO_NS, SAME_LOCAL("cellspacing"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG);
public static final AttributeName COLUMNWIDTH = new AttributeName(ALL_NO_NS, SAME_LOCAL("columnwidth"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG);
public static final AttributeName CROSSORIGIN = new AttributeName(ALL_NO_NS, SAME_LOCAL("crossorigin"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG);
public static final AttributeName COLUMNALIGN = new AttributeName(ALL_NO_NS, SAME_LOCAL("columnalign"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG);
public static final AttributeName COLUMNLINES = new AttributeName(ALL_NO_NS, SAME_LOCAL("columnlines"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG);
public static final AttributeName CONTEXTMENU = new AttributeName(ALL_NO_NS, SAME_LOCAL("contextmenu"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG);
@ -1677,7 +1676,6 @@ public final class AttributeName
CELLPADDING,
CELLSPACING,
COLUMNWIDTH,
CROSSORIGIN,
COLUMNALIGN,
COLUMNLINES,
CONTEXTMENU,
@ -2261,7 +2259,6 @@ public final class AttributeName
371448425,
371448430,
371545055,
371593469,
371596922,
371758751,
371964792,

View File

@ -458,7 +458,6 @@ HTML5_ATOM(arabic_form, "arabic-form")
HTML5_ATOM(cellpadding, "cellpadding")
HTML5_ATOM(cellspacing, "cellspacing")
HTML5_ATOM(columnwidth, "columnwidth")
HTML5_ATOM(crossorigin, "crossorigin")
HTML5_ATOM(columnalign, "columnalign")
HTML5_ATOM(columnlines, "columnlines")
HTML5_ATOM(contextmenu, "contextmenu")

File diff suppressed because one or more lines are too long

View File

@ -473,7 +473,6 @@ class nsHtml5AttributeName
static nsHtml5AttributeName* ATTR_CELLPADDING;
static nsHtml5AttributeName* ATTR_CELLSPACING;
static nsHtml5AttributeName* ATTR_COLUMNWIDTH;
static nsHtml5AttributeName* ATTR_CROSSORIGIN;
static nsHtml5AttributeName* ATTR_COLUMNALIGN;
static nsHtml5AttributeName* ATTR_COLUMNLINES;
static nsHtml5AttributeName* ATTR_CONTEXTMENU;

View File

@ -61,13 +61,13 @@ nsHtml5SpeculativeLoad::Perform(nsHtml5TreeOpExecutor* aExecutor)
aExecutor->SetSpeculationBase(mUrl);
break;
case eSpeculativeLoadImage:
aExecutor->PreloadImage(mUrl, mCharsetOrCrossOrigin);
aExecutor->PreloadImage(mUrl);
break;
case eSpeculativeLoadScript:
aExecutor->PreloadScript(mUrl, mCharsetOrCrossOrigin, mType);
aExecutor->PreloadScript(mUrl, mCharset, mType);
break;
case eSpeculativeLoadStyle:
aExecutor->PreloadStyle(mUrl, mCharsetOrCrossOrigin);
aExecutor->PreloadStyle(mUrl, mCharset);
break;
case eSpeculativeLoadManifest:
aExecutor->ProcessOfflineManifest(mUrl);

View File

@ -65,13 +65,11 @@ class nsHtml5SpeculativeLoad {
mUrl.Assign(aUrl);
}
inline void InitImage(const nsAString& aUrl,
const nsAString& aCrossOrigin) {
inline void InitImage(const nsAString& aUrl) {
NS_PRECONDITION(mOpCode == eSpeculativeLoadUninitialized,
"Trying to reinitialize a speculative load!");
mOpCode = eSpeculativeLoadImage;
mUrl.Assign(aUrl);
mCharsetOrCrossOrigin.Assign(aCrossOrigin);
}
inline void InitScript(const nsAString& aUrl,
@ -81,7 +79,7 @@ class nsHtml5SpeculativeLoad {
"Trying to reinitialize a speculative load!");
mOpCode = eSpeculativeLoadScript;
mUrl.Assign(aUrl);
mCharsetOrCrossOrigin.Assign(aCharset);
mCharset.Assign(aCharset);
mType.Assign(aType);
}
@ -90,7 +88,7 @@ class nsHtml5SpeculativeLoad {
"Trying to reinitialize a speculative load!");
mOpCode = eSpeculativeLoadStyle;
mUrl.Assign(aUrl);
mCharsetOrCrossOrigin.Assign(aCharset);
mCharset.Assign(aCharset);
}
/**
@ -116,11 +114,7 @@ class nsHtml5SpeculativeLoad {
private:
eHtml5SpeculativeLoad mOpCode;
nsString mUrl;
// If mOpCode is eSpeculativeLoadImage, this is the value of the
// "crossorigin" attribute. If mOpCode is eSpeculativeLoadStyle
// or eSpeculativeLoadScript then this is the value of the
// "charset" attribute. Otherwise it's empty.
nsString mCharsetOrCrossOrigin;
nsString mCharset;
nsString mType;
};

View File

@ -105,13 +105,7 @@ nsHtml5TreeBuilder::createElement(PRInt32 aNamespace, nsIAtom* aName, nsHtml5Htm
if (nsHtml5Atoms::img == aName) {
nsString* url = aAttributes->getValue(nsHtml5AttributeName::ATTR_SRC);
if (url) {
nsString* crossOrigin =
aAttributes->getValue(nsHtml5AttributeName::ATTR_CROSSORIGIN);
if (crossOrigin) {
mSpeculativeLoadQueue.AppendElement()->InitImage(*url, *crossOrigin);
} else {
mSpeculativeLoadQueue.AppendElement()->InitImage(*url, EmptyString());
}
mSpeculativeLoadQueue.AppendElement()->InitImage(*url);
}
} else if (nsHtml5Atoms::script == aName) {
nsHtml5TreeOperation* treeOp = mOpQueue.AppendElement();
@ -144,7 +138,7 @@ nsHtml5TreeBuilder::createElement(PRInt32 aNamespace, nsIAtom* aName, nsHtml5Htm
} else if (nsHtml5Atoms::video == aName) {
nsString* url = aAttributes->getValue(nsHtml5AttributeName::ATTR_POSTER);
if (url) {
mSpeculativeLoadQueue.AppendElement()->InitImage(*url, EmptyString());
mSpeculativeLoadQueue.AppendElement()->InitImage(*url);
}
} else if (nsHtml5Atoms::style == aName) {
nsHtml5TreeOperation* treeOp = mOpQueue.AppendElement();
@ -169,7 +163,7 @@ nsHtml5TreeBuilder::createElement(PRInt32 aNamespace, nsIAtom* aName, nsHtml5Htm
if (nsHtml5Atoms::image == aName) {
nsString* url = aAttributes->getValue(nsHtml5AttributeName::ATTR_XLINK_HREF);
if (url) {
mSpeculativeLoadQueue.AppendElement()->InitImage(*url, EmptyString());
mSpeculativeLoadQueue.AppendElement()->InitImage(*url);
}
} else if (nsHtml5Atoms::script == aName) {
nsHtml5TreeOperation* treeOp = mOpQueue.AppendElement();

View File

@ -891,14 +891,13 @@ nsHtml5TreeOpExecutor::PreloadStyle(const nsAString& aURL,
}
void
nsHtml5TreeOpExecutor::PreloadImage(const nsAString& aURL,
const nsAString& aCrossOrigin)
nsHtml5TreeOpExecutor::PreloadImage(const nsAString& aURL)
{
nsCOMPtr<nsIURI> uri = ConvertIfNotPreloadedYet(aURL);
if (!uri) {
return;
}
mDocument->MaybePreLoadImage(uri, aCrossOrigin);
mDocument->MaybePreLoadImage(uri);
}
void

View File

@ -401,7 +401,7 @@ class nsHtml5TreeOpExecutor : public nsContentSink,
void PreloadStyle(const nsAString& aURL, const nsAString& aCharset);
void PreloadImage(const nsAString& aURL, const nsAString& aCrossOrigin);
void PreloadImage(const nsAString& aURL);
void SetSpeculationBase(const nsAString& aURL);

View File

@ -362,7 +362,7 @@ nsPreloadURIs::PreloadURIs(const nsAutoTArray<nsSpeculativeScriptThread::Prefetc
doc->ScriptLoader()->PreloadURI(uri, pe.charset, pe.elementType);
break;
case nsSpeculativeScriptThread::IMAGE:
doc->MaybePreLoadImage(uri, EmptyString());
doc->MaybePreLoadImage(uri);
break;
case nsSpeculativeScriptThread::STYLESHEET:
doc->PreloadStyle(uri, pe.charset);