Bug 1310463 - Part 2: Simplify nsComputedDOMStyle::DoGetListStyleImage a little. r=xidorn
MozReview-Commit-ID: Kxbxu8mZcQs
--- a/layout/style/nsComputedDOMStyle.cpp
+++ b/layout/style/nsComputedDOMStyle.cpp
@@ -2081,17 +2081,17 @@ nsComputedDOMStyle::SetValueToStyleImage
{
switch (aStyleImage.GetType()) {
case eStyleImageType_Image:
{
imgIRequest* req = aStyleImage.GetImageData();
if (!req) {
// XXXheycam If we had some problem resolving the imgRequestProxy,
// maybe we should just use the URL stored in the nsStyleImage's
- // mImageValue?
+ // mImageValue? (Similarly in DoGetListStyleImage.)
aValue->SetIdent(eCSSKeyword_none);
break;
}
nsCOMPtr<nsIURI> uri;
req->GetURI(getter_AddRefs(uri));
const UniquePtr<nsStyleSides>& cropRect = aStyleImage.GetCropRect();
@@ -3498,23 +3498,26 @@ nsComputedDOMStyle::DoGetZIndex()
already_AddRefed<CSSValue>
nsComputedDOMStyle::DoGetListStyleImage()
{
RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
const nsStyleList* list = StyleList();
- if (!list->GetListStyleImage()) {
+ // XXXheycam As in SetValueToStyleImage, we might want to use the
+ // URL stored in the nsStyleImageRequest's mImageValue if we
+ // failed to resolve the imgRequestProxy.
+
+ imgRequestProxy* image = list->GetListStyleImage();
+ if (!image) {
val->SetIdent(eCSSKeyword_none);
} else {
nsCOMPtr<nsIURI> uri;
- if (list->GetListStyleImage()) {
- list->GetListStyleImage()->GetURI(getter_AddRefs(uri));
- }
+ image->GetURI(getter_AddRefs(uri));
val->SetURI(uri);
}
return val.forget();
}
already_AddRefed<CSSValue>
nsComputedDOMStyle::DoGetListStylePosition()