Skip to content

Commit

Permalink
Bug 1560179 - Image should not accept eSHAPE r=longsonr
Browse files Browse the repository at this point in the history
  • Loading branch information
violette77 committed Jun 20, 2019
1 parent bb1786f commit 8e17e58
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dom/svg/SVGImageElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,8 @@ already_AddRefed<Path> SVGImageElement::BuildPath(PathBuilder* aBuilder) {
// To get bound, the faster method GetGeometryBounds() should already return
// success. For render and hittest, nsSVGImageFrame should have its own
// implementation that doesn't need to build path for an image.
MOZ_CRASH("There is no reason to call BuildPath for SVGImageElement");
MOZ_ASSERT_UNREACHABLE(
"There is no reason to call BuildPath for SVGImageElement");
return nullptr;
}

Expand Down
6 changes: 6 additions & 0 deletions dom/svg/SVGImageElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ class SVGImageElement : public SVGImageElementBase,
const nsAttrValue* aOldValue,
nsIPrincipal* aSubjectPrincipal,
bool aNotify) override;
bool IsNodeOfType(uint32_t aFlags) const override {
// <imag> is not really a SVGGeometryElement, we should
// ignore eSHAPE flag accepted by SVGGeometryElement.
return SVGGraphicsElement::IsNodeOfType(aFlags);
}

virtual nsresult BindToTree(BindContext&, nsINode& aParent) override;
virtual void UnbindFromTree(bool aNullParent) override;

Expand Down
5 changes: 5 additions & 0 deletions dom/svg/crashtests/1560179.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<svg class="">
<image class="" id="id_1" systemLanguage="">
<text class="" xml:space="preserve">
<textPath class="" xlink:href="#id_1">

1 change: 1 addition & 0 deletions dom/svg/crashtests/crashtests.list
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,4 @@ skip-if(Android) load 1507961-1.html # times out on Android due to the test siz
load 1531578-1.html
load test_nested_svg.html
load 1555795.html
load 1560179.html

0 comments on commit 8e17e58

Please sign in to comment.