Bug 17521 - Revise of background-attachment: fixed and transforms [editorial]
Summary: Revise of background-attachment: fixed and transforms [editorial]
Status: RESOLVED FIXED
Alias: None
Product: CSS
Classification: Unclassified
Component: Transforms (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Simon Fraser
QA Contact: public-css-bugzilla
URL:
Whiteboard:
Keywords:
: 19636 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-06-16 22:47 UTC by Simon Fraser
Modified: 2012-10-19 19:46 UTC (History)
8 users (show)

See Also:


Attachments
Testcase (1.72 KB, text/html)
2012-06-20 17:05 UTC, Simon Fraser
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Fraser 2012-06-16 22:47:55 UTC
The spec describes a behavior for background-attachment:fixed where the transformed element behaves as if it were a "porthole" through which the fixed background shows.

This is tricky, but implementable for 2D transforms, but very difficult for implementors of 3D transforms.

We may wish to punt and just say that any background-attachment:fixed on an element that is transformed, or has a transformed container, behaves like background-attachment:scroll.
Comment 1 Aryeh Gregor 2012-06-17 09:53:30 UTC
I'm okay with this if implementers agree.  What do other implementers think?  If it's easy for some implementers but not others, and if we agree that the proposed behavior is a punt and not really correct, I'd say we should leave the spec more "correct" for now even though we know not all implementations will be able to make it -- much like for intersections.
Comment 2 L. David Baron (Mozilla) 2012-06-20 17:03:53 UTC
Another option is to say that you draw the same piece of background as though there were no transforms, and then you transform it.
Comment 3 Simon Fraser 2012-06-20 17:05:06 UTC
Created attachment 1145 [details]
Testcase
Comment 4 Sylvain Galineau 2012-06-21 14:21:28 UTC
IE10 Release Preview does what David suggests i.e.:  
1. Render the fixed background as if there were no transform
2. Transform the result from #1

As a result:
- Subsequent adjustments to the position of the element preserves the 'porthole'-like behavior of background-attachment:fixed i.e. as the element moves around its background continues to adjust
- But any transform applied to the element applies to the rendering of the fixed background within that element.
Comment 5 L. David Baron (Mozilla) 2012-06-26 18:34:07 UTC
(In reply to comment #2)
> Another option is to say that you draw the same piece of background as though
> there were no transforms, and then you transform it.

This is also what we already do (although we don't get the invalidation right when scrolling), and it's our preference as well.
Comment 6 Simon Fraser 2012-06-27 17:01:07 UTC
Proposal at <http://lists.w3.org/Archives/Public/www-style/2012Jun/0635.html>
Comment 7 Simon Fraser 2012-07-12 18:12:46 UTC
Consensus is to follow my proposal.

One final question: for an element with a transform or transformed ancestor, what's the computed value for background-attachment, if the specified value is 'fixed'?
Comment 8 Simon Fraser 2012-07-12 18:28:06 UTC
https://dvcs.w3.org/hg/csswg/rev/8039e489eeb0

Leaving bug open for the computed style issue.
Comment 9 L. David Baron (Mozilla) 2012-07-12 19:11:52 UTC
My inclination is that it's better for the computed value not to change (i.e., still be 'fixed' even if it won't actually be fixed).
Comment 10 Sylvain Galineau 2012-07-18 22:25:42 UTC
I would also background-attachment's computed value to remain 'fixed' in thie case; the property's computed value is 'as specified' and I'd rather leave it that way. We're only changing the used value.
Comment 11 Dirk Schulze 2012-10-19 15:08:25 UTC
*** Bug 19636 has been marked as a duplicate of this bug. ***
Comment 12 Simon Fraser 2012-10-19 17:13:45 UTC
We resolved that the computed values are not affected.
Comment 13 Dirk Schulze 2012-10-19 17:20:08 UTC
Do we need to state this on the spec?
Comment 14 Dirk Schulze 2012-10-19 17:26:53 UTC
What about this sentence at the end of the paragraph, right before the issue text: "The computed style of 'background-attached' is not affected." If it is ok, I go ahead and do the change.
Comment 15 Simon Fraser 2012-10-19 17:42:59 UTC
The same issue applies to transform-style when combined with opacity. I think it's fine to say that the computed value of the property is not affected.
Comment 16 Dirk Schulze 2012-10-19 19:46:20 UTC
Fixed after 177d757a1f34.