Closed
Bug 944291
Opened 11 years ago
Closed 11 years ago
Cropping of element with css transform + animation applied, starting in Firefox 25
Categories
(Core :: Web Painting, defect)
Tracking
()
VERIFIED
FIXED
mozilla29
People
(Reporter: gwilym, Assigned: roc)
References
Details
(Keywords: dev-doc-needed, regression, site-compat)
Attachments
(4 files, 1 obsolete file)
186.80 KB,
image/png
|
Details | |
1.16 KB,
text/html
|
Details | |
814 bytes,
patch
|
Waldo
:
review+
|
Details | Diff | Splinter Review |
7.86 KB,
patch
|
MatsPalmgren_bugz
:
review+
mattwoodrow
:
feedback+
lsblakk
:
approval-mozilla-aurora+
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9) AppleWebKit/537.71 (KHTML, like Gecko) Version/7.0 Safari/537.71
Steps to reproduce:
I’ve noticed that an element on my recently launched website is being displayed incorrectly on Firefox 25. If you go to http://dice.gwil.co with Firefox 25 and scroll the red/green buttons you’ll see the odd behaviour.
Actual results:
The speech bubble elements, upon removal of a ‘.hidden’ class, have a CSS transform applied to them in combination with a CSS transition, making them visible.
In Firefox 25, the bubble pops up correctly but once the transition is complete the bubble is cropped so that only a portion of the content is displayed.
Expected results:
In all prior versions of Firefox (tested down as far as 6), the speech bubbles animate and then display as intended, without any cropping, leading me to believe that this might be an issue with Firefox 25.
Comment 1•11 years ago
|
||
wfm - 2013-05-25-06-25-25-mozilla-central-firefox-24.0a1.en-US.linux-x86_64 218785bab4bd
bug - 2013-05-26-03-10-46-mozilla-central-firefox-24.0a1.en-US.linux-x86_64 0fed3377c839
https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=218785bab4bd&tochange=0fed3377c839
Could you try making a minimized testcase, please?
Updated•11 years ago
|
Flags: needinfo?(gwilym)
I've been stripping down the elements of the page and styling trying to find what could be causing this - the culprit seems to be a CSS animation applied to the cropped element's parent intended to wobble the element with CSS rotation transforms. Removing the 'wobble' CSS animation or moving the animation to the child element stops the weird cropping behaviour - but spoils the intended effect.
Further strange behaviour: opening the speech bubble element in the Firefox Web Inspector causes the animations and transitions to work as intended.
Here's the minimised version: http://gwil.co/firefox-test.html (sorry if it doesn't seem particularly minimal, but this is a very particular bug)
Flags: needinfo?(gwilym)
Updated•11 years ago
|
Component: Untriaged → Layout
Product: Firefox → Core
Comment 3•11 years ago
|
||
Hmm. On Mac I see it even before the regression range from comment 1, on the testcase of comment 2.
Aleksej, does the 2013-05-25 Linux nightly show the problem for you on the comment 2 testcase?
Flags: needinfo?(deletesoftware+moz)
Comment 4•11 years ago
|
||
Yes (and still not with the original site).
With http://gwil.co/firefox-test.html:
w: 2012-07-27-03-05-08-mozilla-central-firefox-17.0a1.en-US.linux-x86_64
…
w: 2012-12-10-03-07-47-mozilla-central-firefox-20.0a1.en-US.linux-x86_64 725eb8792d27
https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=725eb8792d27&tochange=4dfe323a663d
b: 2012-12-11-03-08-55-mozilla-central-firefox-20.0a1.en-US.linux-x86_64 4dfe323a663d
…
b: 2013-03-20-03-11-03-mozilla-central-firefox-22.0a1.en-US.linux-x86_64 8156df33b757 — the external part splits off
https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=8156df33b757&tochange=a73a2b5c423b
b: 2013-03-21-09-07-06-mozilla-central-firefox-22.0a1.en-US.linux-x86_64 a73a2b5c423b — the external part disappears
b: 2013-05-25-06-25-25-mozilla-central-firefox-24.0a1.en-US.linux-x86_64
b: 2013-12-05-03-02-07-mozilla-central-firefox-28.0a1.ru.linux-x86_64
Flags: needinfo?(deletesoftware+moz)
Hey sorry, just a heads up - the original site will look normal now as I changed the element the wobble effect is applied to. The original setup is still on the second link I provided, though.
Comment 6•11 years ago
|
||
Aleksej: Thanks!
Matt has some layers changes in the second range from comment 4. Nothing in the first range obviously jumps out at me, though there are some layer changes in there too (by roc).
Status: UNCONFIRMED → NEW
Component: Layout → Layout: View Rendering
Ever confirmed: true
Flags: needinfo?(matt.woodrow)
Assignee | ||
Comment 7•11 years ago
|
||
Basically we have an actively-transformed element that contains another element that is zooms in and out with a break in between. When the latter element loses its transform temporarily (becoming an inactive layer), it appears to be drawn clipped. Looks like some kind of FrameLayerBuilder bug for sure.
Assignee: nobody → roc
Assignee | ||
Comment 8•11 years ago
|
||
For some reason, in the bad state, we have computed an incorrect visible rect for the yellow div:
BackgroundColor 0x7fffdb3fc020(Block(div)(1)) bounds(-3000,-3000,6000,6000) visible(-600,-600,3600,3600) componentAlpha(0,0,0,0) clip() uniform (opaque -3000,-3000,6000,6000)(rgba 255,255,0,255) layer=0x7fffcac2ddb0
Assignee | ||
Comment 9•11 years ago
|
||
This is actually looking like a layout bug in overflow area calculation:
Block(div)(1)@0x7fffd09aa738 {12000,0,15000,12000} vis-overflow=-600,-384,15600,12601 scr-overflow=-600,-384,15600,12601 [state=004012a000110200] transformed [content=0x7fffab8842e0] [sc=0x7fffd09a9bf0]<
line 0x7fffd09aacb8: count=1 state=inline,clean,prevmarginclean,not impacted,not wrapped,before:nobr,after:nobr[0x300] {0,0,0,0} <
Placeholder(div)(1)@0x7fffd09aab00 {0,0,0,0} [state=0000008000200000] [content=0x7fffab884380] [sc=0x7fffd09a86c8:-moz-non-element] outOfFlowFrame=Block(div)(1)@0x7fffd09aaa68
>
AbsoluteList 0x7fffd0995d80 <
Block(div)(1)@0x7fffd09aaa68 {-3000,-3000,6000,6000} [state=000016e000d10300] [content=0x7fffab884380] [sc=0x7fffd09a9cb0]<
The transform on 0x7fffd09aa738 is the "wobble" transform so the relative-to-self visual overflow of 0x7fffd09aa738 should be nearly the same as -600,-384,15600,12601, which is nowhere near correct.
Assignee | ||
Comment 10•11 years ago
|
||
Attachment #8346995 -
Flags: review?(jwalden+bmo)
Assignee | ||
Comment 11•11 years ago
|
||
Attachment #8346996 -
Flags: review?(matspal)
Assignee | ||
Updated•11 years ago
|
Flags: needinfo?(matt.woodrow)
Assignee | ||
Updated•11 years ago
|
Keywords: testcase-wanted
Comment 12•11 years ago
|
||
This fixes bug 938555 too. There's also a different HTML-only testcase over there.
Comment 13•11 years ago
|
||
roc, can you also update the comment documenting mInitial?
Comment 14•11 years ago
|
||
Comment on attachment 8346996 [details] [diff] [review]
Part 2: Mark parent frames whose child frames' overflow have changed as always needing UpdateOverflow called
Review of attachment 8346996 [details] [diff] [review]:
-----------------------------------------------------------------
f+ since this seems correct to me.
It might be easier to understand this function if we reversed the meaning of mInitial and called it mNeedsUpdateOverflow instead.
We could then comment that since our overflow changed, then we need to update the overflow of our parent. So we make sure our parent both exists in the tree, and is marked appropriately.
Attachment #8346996 -
Flags: feedback+
Comment 15•11 years ago
|
||
Comment on attachment 8346996 [details] [diff] [review]
Part 2: Mark parent frames whose child frames' overflow have changed as always needing UpdateOverflow called
By setting mInitial false you lose the property that 'parent' will
unconditionally update *its* parent (through the "|| entry->mInitial").
Consider the similar fix (instead of the assignment):
parent->Properties().Delete(nsIFrame::PreTransformOverflowAreasProperty());
which will also bypass the optimization and call UpdateOverflow(),
but does not depend on the return value of that call.
Is this an intentional change?
I suspect there was a reason for the "We always update the parent for
initial frames." as the comment says.
Assignee | ||
Comment 16•11 years ago
|
||
(In reply to Mats Palmgren (:mats) from comment #15)
> I suspect there was a reason for the "We always update the parent for
> initial frames." as the comment says.
I don't remember what it was. Do you, Matt?
I think instead of mInitial we should have a bool mChildrenChanged. That seems to make the code a lot easier to understand.
Assignee | ||
Comment 17•11 years ago
|
||
OK I know what it was now :-).
Assignee | ||
Comment 18•11 years ago
|
||
I think this code is much easier to understand now :-)
Attachment #8347204 -
Flags: review?(matspal)
Attachment #8347204 -
Flags: feedback?(matt.woodrow)
Comment 19•11 years ago
|
||
Comment on attachment 8347204 [details] [diff] [review]
fix v2
Yes, this is much clearer, thanks. r=mats
> void AddFrame(nsIFrame* aFrame) {
> uint32_t depth = aFrame->GetDepthInFrameTree();
> if (mEntryList.empty() ||
>- !mEntryList.contains(Entry(aFrame, depth, true))) {
>- mEntryList.insert(new Entry(aFrame, depth, true));
>+ !mEntryList.contains(Entry(aFrame, depth))) {
While we're here - remove the redundant "mEntryList.empty() ||".
>+ // We can't tell if the overflow changed, so be conservative
End the sentence with a period.
>+ // If the frame style changed (e.g. positioning offsets)
>+ // then we need to update the parent with the overflow areas of its
>+ // children.
Please reformat this comment; it looks like it should fit on two lines.
Attachment #8347204 -
Flags: review?(matspal) → review+
Updated•11 years ago
|
Attachment #8346996 -
Attachment is obsolete: true
Attachment #8346996 -
Flags: review?(matspal)
Comment 20•11 years ago
|
||
Comment on attachment 8347204 [details] [diff] [review]
fix v2
Review of attachment 8347204 [details] [diff] [review]:
-----------------------------------------------------------------
Yep, much easier to follow.
Attachment #8347204 -
Flags: feedback?(matt.woodrow) → feedback+
Comment 21•11 years ago
|
||
Comment on attachment 8346995 [details] [diff] [review]
Part 1: Add SplayTree::find
Review of attachment 8346995 [details] [diff] [review]:
-----------------------------------------------------------------
Seems like it might be better to only have this method, and remove contains() (which is identical except that it returns a bool in that final line, not the pointer). The only user is layout/base/RestyleTracker.h (there's sadly a second SplayTree that accounts for the other SplayTree.h hit in the tree, I need to fix that at some point), so it's trivial to do a few s/contains/find/ and add the preceding ! as needed.
Attachment #8346995 -
Flags: review?(jwalden+bmo) → review+
Assignee | ||
Comment 22•11 years ago
|
||
Comment 23•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/e8ba8d037365
https://hg.mozilla.org/mozilla-central/rev/5e992c8ea14f
Status: NEW → RESOLVED
Closed: 11 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla29
Assignee | ||
Comment 24•11 years ago
|
||
Comment on attachment 8347204 [details] [diff] [review]
fix v2
[Approval Request Comment]
Bug caused by (feature/regressing bug #): Unsure
User impact if declined: Broken rendering on certain Web pages (difficult to predict when it might happen)
Testing completed (on m-c, etc.): Just landed
Risk to taking this patch (and alternatives if risky): a little bit risky but the new code is a lot easier to understand
String or IDL/UUID changes made by this patch: None
Not requesting Beta approval since we've already shipped this in a few releases
Attachment #8347204 -
Flags: approval-mozilla-aurora?
Updated•11 years ago
|
Updated•11 years ago
|
Summary: Cropping of element with css transform + animation applied in Firefox 25 only → Cropping of element with css transform + animation applied, starting in Firefox 25
Comment 25•11 years ago
|
||
Comment on attachment 8347204 [details] [diff] [review]
fix v2
we can take a little risk on Aurora still so let's get this uplifted.
Attachment #8347204 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Comment 26•11 years ago
|
||
Verified fixed using the testcases on 29.0a1 (2014-01-07), win 7 x64.
Status: RESOLVED → VERIFIED
Comment 27•11 years ago
|
||
https://hg.mozilla.org/releases/mozilla-aurora/rev/1c16411289e4
https://hg.mozilla.org/releases/mozilla-aurora/rev/89680c49db3b
status-firefox28:
--- → fixed
status-firefox29:
--- → fixed
Comment 28•11 years ago
|
||
Also fixes bug 953055 and bug 946920 (which are in release and have been for a while I think) if that affects any uplifting decisions.
Comment 29•11 years ago
|
||
Verified as fixed on latest Aurora 28.0a2 as well using Ubuntu 12.04 x32 and Windown 8.1 x32
Updated•11 years ago
|
Updated•6 years ago
|
Component: Layout: View Rendering → Layout: Web Painting
You need to log in
before you can comment on or make changes to this bug.
Description
•