diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp index d95bc99848e..74a2df065c6 100644 --- a/layout/base/nsCSSFrameConstructor.cpp +++ b/layout/base/nsCSSFrameConstructor.cpp @@ -4748,8 +4748,8 @@ nsCSSFrameConstructor::FindSVGData(nsIContent* aContent, } static const FrameConstructionData sSuppressData = SUPPRESS_FCDATA(); - static const FrameConstructionData sGenericContainerData = - SIMPLE_SVG_FCDATA(NS_NewSVGGenericContainerFrame); + static const FrameConstructionData sContainerData = + SIMPLE_SVG_FCDATA(NS_NewSVGContainerFrame); PRBool parentIsSVG = PR_FALSE; nsIContent* parentContent = @@ -4792,17 +4792,11 @@ nsCSSFrameConstructor::FindSVGData(nsIContent* aContent, return &sSuppressData; } - // Reduce the number of frames we create unnecessarily. Note that this is not - // where we select which frame in a to render! That happens in - // nsSVGSwitchFrame::PaintSVG. + // Elements with failing conditional processing attributes never get + // rendered. Note that this is not where we select which frame in a + // to render! That happens in nsSVGSwitchFrame::PaintSVG. if (!nsSVGFeatures::PassesConditionalProcessingTests(aContent)) { - // Note that just returning is probably not right. According - // to the spec, is allowed to use an element that fails its - // conditional, but because we never actually create the frame when - // a conditional fails and when we use GetReferencedFrame to find the - // references, things don't work right. - // XXX FIXME XXX - return &sSuppressData; + return &sContainerData; } // Special case for aTag == nsGkAtoms::svg because we don't want to @@ -4860,6 +4854,7 @@ nsCSSFrameConstructor::FindSVGData(nsIContent* aContent, SIMPLE_SVG_CREATE(rect, NS_NewSVGPathGeometryFrame), SIMPLE_SVG_CREATE(path, NS_NewSVGPathGeometryFrame), SIMPLE_SVG_CREATE(defs, NS_NewSVGContainerFrame), + SIMPLE_SVG_CREATE(generic, NS_NewSVGGenericContainerFrame), { &nsGkAtoms::foreignObject, FULL_CTOR_FCDATA(FCDATA_DISALLOW_OUT_OF_FLOW, &nsCSSFrameConstructor::ConstructSVGForeignObjectFrame) }, @@ -4908,7 +4903,7 @@ nsCSSFrameConstructor::FindSVGData(nsIContent* aContent, NS_ARRAY_LENGTH(sSVGData)); if (!data) { - data = &sSuppressData; + data = &sContainerData; } return data; diff --git a/layout/reftests/svg/conditions-02.svg b/layout/reftests/svg/conditions-02.svg new file mode 100644 index 00000000000..b8b8e9fb46f --- /dev/null +++ b/layout/reftests/svg/conditions-02.svg @@ -0,0 +1,17 @@ + + + + Test that paint servers inside a failing conditional attribute subtree work + + + + + + + + + + diff --git a/layout/reftests/svg/conditions-03.svg b/layout/reftests/svg/conditions-03.svg new file mode 100644 index 00000000000..cb16e9c043b --- /dev/null +++ b/layout/reftests/svg/conditions-03.svg @@ -0,0 +1,16 @@ + + + + Test that 'use'ing elements inside a failing conditional attribute subtree works + + + + + + + + diff --git a/layout/reftests/svg/conditions-04.svg b/layout/reftests/svg/conditions-04.svg new file mode 100644 index 00000000000..d174518c69c --- /dev/null +++ b/layout/reftests/svg/conditions-04.svg @@ -0,0 +1,15 @@ + + + + Test that 'use'ing an element with a failing conditional fails + + + + + + + diff --git a/layout/reftests/svg/moz-only/reftest.list b/layout/reftests/svg/moz-only/reftest.list index b0ecb974721..8118cedf14a 100644 --- a/layout/reftests/svg/moz-only/reftest.list +++ b/layout/reftests/svg/moz-only/reftest.list @@ -2,6 +2,7 @@ # XBL tests == xbl-basic-01.svg pass.svg == xbl-basic-02.svg pass.svg +== xbl-basic-03.svg pass.svg == xbl-grad-ref--grad-in-binding-01.svg pass.svg == xbl-grad-ref--grad-in-binding-02.svg pass.svg == xbl-grad-ref--grad-in-bound-01.svg pass.svg diff --git a/layout/reftests/svg/moz-only/xbl-basic-03.svg b/layout/reftests/svg/moz-only/xbl-basic-03.svg new file mode 100644 index 00000000000..79d6b4f1cf6 --- /dev/null +++ b/layout/reftests/svg/moz-only/xbl-basic-03.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + diff --git a/layout/reftests/svg/reftest.list b/layout/reftests/svg/reftest.list index 598328a6107..c2145ccde54 100644 --- a/layout/reftests/svg/reftest.list +++ b/layout/reftests/svg/reftest.list @@ -32,6 +32,9 @@ include svg-integration/reftest.list == clipPath-winding-01.svg pass.svg == clip-surface-clone-01.svg clip-surface-clone-01-ref.svg == conditions-01.svg pass.svg +== conditions-02.svg pass.svg +== conditions-03.svg pass.svg +== conditions-04.svg pass.svg == currentColor-01.svg pass.svg == currentColor-02.svg pass.svg == currentColor-03.svg pass.svg