Bug 722463 - Transforms should not work on non-replaced inline elements. r=roc

This commit is contained in:
Aryeh Gregor 2012-02-14 15:33:06 -05:00
parent b2dbea52cc
commit ac56e5e0b6
6 changed files with 31 additions and 3 deletions

View File

@ -71,6 +71,20 @@ NS_NewInlineFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
return new (aPresShell) nsInlineFrame(aContext);
}
NS_IMETHODIMP
nsInlineFrame::Init(nsIContent* aContent,
nsIFrame* aParent,
nsIFrame* aPrevInFlow)
{
// Let the base class do its processing
nsresult rv = nsContainerFrame::Init(aContent, aParent, aPrevInFlow);
// Transforms do not affect regular inline elements (bug 722463)
mState &= ~NS_FRAME_MAY_BE_TRANSFORMED;
return rv;
}
NS_IMPL_FRAMEARENA_HELPERS(nsInlineFrame)
NS_QUERYFRAME_HEAD(nsInlineFrame)

View File

@ -69,6 +69,13 @@ public:
friend nsIFrame* NS_NewInlineFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
/** sets defaults for inline-specific style.
* @see nsIFrame::Init
*/
NS_IMETHOD Init(nsIContent* aContent,
nsIFrame* aParent,
nsIFrame* aPrevInFlow);
// nsIFrame overrides
NS_IMETHOD BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,

View File

@ -9,14 +9,14 @@
span {
background: yellow;
}
#div1 span {-moz-transform: translate(20px, 150px);
-moz-transform-origin: 0% 0%;
#div1 div {-moz-transform: translate(20px, 150px);
-moz-transform-origin: 0% 0%;
}
</style>
</head>
<body>
<div id="div1">
<span>span 1</span>
<div><span>span 1</span></div>
</div>
<span>span 2</span>
</body>

View File

@ -0,0 +1,2 @@
<!doctype html>
This is some text<br>that is not transformed

View File

@ -0,0 +1,3 @@
<!doctype html>
This is some <span style="-moz-transform:rotate(180deg)">text<br>
that is</span> not transformed

View File

@ -118,3 +118,5 @@ fails-if(Android) == stresstest-1.html stresstest-1-ref.html
== table-1c.html table-1-ref.html
== table-2a.html table-2-ref.html
== table-2b.html table-2-ref.html
# Bug 722463
== inline-1a.html inline-1-ref.html