зеркало из https://github.com/mozilla/gecko-dev.git
Bug 901955 - Get 'opacity' property changes on SVG working again. r=roc
This commit is contained in:
Родитель
c76062a817
Коммит
de06458c91
|
@ -0,0 +1,25 @@
|
|||
<!--
|
||||
Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/
|
||||
-->
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="reftest-wait">
|
||||
|
||||
<title>Test repainting for opacity property changes</title>
|
||||
|
||||
<script>
|
||||
|
||||
function doTest() {
|
||||
document.getElementById("r").style.opacity = 1;
|
||||
document.documentElement.removeAttribute("class");
|
||||
}
|
||||
|
||||
document.addEventListener("MozReftestInvalidate", doTest, false);
|
||||
setTimeout(doTest, 4000); // fallback for running outside reftest
|
||||
|
||||
</script>
|
||||
|
||||
<rect width="100%" height="100%" fill="lime"/>
|
||||
<rect width="100" height="100" fill="red"/>
|
||||
<rect id="r" width="100" height="100" fill="lime" style="opacity:0.5"/>
|
||||
|
||||
</svg>
|
После Ширина: | Высота: | Размер: 705 B |
|
@ -89,6 +89,7 @@ skip-if(B2G) == dynamic-marker-02.svg dynamic-marker-02-ref.svg
|
|||
skip-if(B2G) == dynamic-marker-03.svg pass.svg
|
||||
== dynamic-mask-01.svg pass.svg
|
||||
skip-if(B2G) == dynamic-mask-contents-01.svg pass.svg
|
||||
== dynamic-opacity-property-01.svg pass.svg
|
||||
skip-if(B2G) == dynamic-pattern-01.svg pass.svg
|
||||
skip-if(B2G) == dynamic-pattern-02.svg pass.svg
|
||||
skip-if(B2G) == dynamic-pattern-contents-01.svg pass.svg
|
||||
|
|
|
@ -120,6 +120,23 @@ nsSVGPathGeometryFrame::AttributeChanged(int32_t aNameSpaceID,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
/* virtual */ void
|
||||
nsSVGPathGeometryFrame::DidSetStyleContext(nsStyleContext* aOldStyleContext)
|
||||
{
|
||||
nsSVGPathGeometryFrameBase::DidSetStyleContext(aOldStyleContext);
|
||||
|
||||
if (aOldStyleContext) {
|
||||
float oldOpacity = aOldStyleContext->PeekStyleDisplay()->mOpacity;
|
||||
float newOpacity = StyleDisplay()->mOpacity;
|
||||
if (newOpacity != oldOpacity &&
|
||||
nsSVGUtils::CanOptimizeOpacity(this)) {
|
||||
// nsIFrame::BuildDisplayListForStackingContext() is not going to create an
|
||||
// nsDisplayOpacity display list item, so DLBI won't invalidate for us.
|
||||
InvalidateFrame();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
nsIAtom *
|
||||
nsSVGPathGeometryFrame::GetType() const
|
||||
{
|
||||
|
|
|
@ -56,6 +56,8 @@ public:
|
|||
nsIAtom* aAttribute,
|
||||
int32_t aModType) MOZ_OVERRIDE;
|
||||
|
||||
virtual void DidSetStyleContext(nsStyleContext* aOldStyleContext);
|
||||
|
||||
/**
|
||||
* Get the "type" of the frame
|
||||
*
|
||||
|
|
Загрузка…
Ссылка в новой задаче