commit 4a74980d5d86 Author: J. Ryan Stinnett Date: Fri Oct 20 15:24:51 2017 -0500 Bug 1409277 - Ignore non-URLs for background pres attr. r=manishearth, a=ritu 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 : source : 1fe7b56a29c6a2cac69fc986c5fb4b99a92d7781 extra : histedit_source : cc3086f60235d56bb69368fb754fd61c3dffe86f --- layout/style/ServoSpecifiedValues.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git layout/style/ServoSpecifiedValues.cpp layout/style/ServoSpecifiedValues.cpp index bb8d425316b0..c374a6061ac9 100644 --- layout/style/ServoSpecifiedValues.cpp +++ layout/style/ServoSpecifiedValues.cpp @@ -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(