mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-21 17:59:34 +00:00
Correctly deal with BODY tag BACKGROUND attribute that is an empty string.
This commit is contained in:
parent
552d205f90
commit
b7ad94a52c
@ -873,24 +873,26 @@ nsHTMLContainer::MapBackgroundAttributesInto(nsIStyleContext* aContext,
|
||||
// background
|
||||
if (eContentAttr_HasValue == GetAttribute(nsHTMLAtoms::background, value)) {
|
||||
if (eHTMLUnit_String == value.GetUnit()) {
|
||||
// Resolve url to an absolute url
|
||||
nsIURL* docURL = nsnull;
|
||||
nsIDocument* doc = mDocument;
|
||||
if (nsnull != doc) {
|
||||
docURL = doc->GetDocumentURL();
|
||||
}
|
||||
|
||||
nsAutoString absURLSpec;
|
||||
nsAutoString spec;
|
||||
value.GetStringValue(spec);
|
||||
nsresult rv = NS_MakeAbsoluteURL(docURL, "", spec, absURLSpec);
|
||||
if (nsnull != docURL) {
|
||||
NS_RELEASE(docURL);
|
||||
if (spec.Length() > 0) {
|
||||
// Resolve url to an absolute url
|
||||
nsIURL* docURL = nsnull;
|
||||
nsIDocument* doc = mDocument;
|
||||
if (nsnull != doc) {
|
||||
docURL = doc->GetDocumentURL();
|
||||
}
|
||||
|
||||
nsresult rv = NS_MakeAbsoluteURL(docURL, "", spec, absURLSpec);
|
||||
if (nsnull != docURL) {
|
||||
NS_RELEASE(docURL);
|
||||
}
|
||||
nsStyleColor* color = (nsStyleColor*)aContext->GetMutableStyleData(eStyleStruct_Color);
|
||||
color->mBackgroundImage = absURLSpec;
|
||||
color->mBackgroundFlags &= ~NS_STYLE_BG_IMAGE_NONE;
|
||||
color->mBackgroundRepeat = NS_STYLE_BG_REPEAT_XY;
|
||||
}
|
||||
nsStyleColor* color = (nsStyleColor*)aContext->GetMutableStyleData(eStyleStruct_Color);
|
||||
color->mBackgroundImage = absURLSpec;
|
||||
color->mBackgroundFlags &= ~NS_STYLE_BG_IMAGE_NONE;
|
||||
color->mBackgroundRepeat = NS_STYLE_BG_REPEAT_XY;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user