Bug 1409277 - Ignore non-URLs for background pres attr. r=manishearth

Check background attribute values for the same types (URL, image) in Stylo mode
as we do in Gecko mode.

In particular, this ignores the edge case of the empty attribute, which comes
through as a string value type, and leads Stylo to trigger a load of the page
itself as the background image (since the empty URL is interpreted as relative
to the page).

MozReview-Commit-ID: CUhq5nS8kVw

--HG--
extra : rebase_source : 8a04a3175cb1a873ee7e597ad881ae64720c01ef
This commit is contained in:
J. Ryan Stinnett 2017-10-20 15:24:51 -05:00
parent 3961574fa2
commit 8766fcbe53

View File

@ -121,6 +121,10 @@ ServoSpecifiedValues::SetTextDecorationColorOverride()
void
ServoSpecifiedValues::SetBackgroundImage(nsAttrValue& aValue)
{
if (aValue.Type() != nsAttrValue::eURL &&
aValue.Type() != nsAttrValue::eImage) {
return;
}
nsAutoString str;
aValue.ToString(str);
Servo_DeclarationBlock_SetBackgroundImage(