Closed
Bug 1301500
Opened 9 years ago
Closed 9 years ago
Div with transform: translate(-50%, -50%) isn't centered correctly
Categories
(Core :: Layout, defect, P1)
Tracking
()
RESOLVED
FIXED
mozilla52
| Tracking | Status | |
|---|---|---|
| firefox50 | --- | unaffected |
| firefox51 | + | fixed |
| firefox52 | --- | fixed |
People
(Reporter: evilpies, Assigned: dbaron)
References
()
Details
(Keywords: regression)
Attachments
(3 files, 1 obsolete file)
|
355 bytes,
text/html
|
Details | |
|
9.17 KB,
patch
|
heycam
:
review+
gchang
:
approval-mozilla-aurora+
|
Details | Diff | Splinter Review |
|
2.51 KB,
patch
|
heycam
:
review+
gchang
:
approval-mozilla-aurora+
|
Details | Diff | Splinter Review |
This presentation was just posted (I think this even is a Mozilla presentation template :). The div should be centered, but instead the presentation content is in the bottom right corner.
Comment 1•9 years ago
|
||
Regression range on nightlies: http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=1a5b53a831e5a6c20de1b081c774feb3ff76756c&tochange=26e22af660e543ebb69930f082188b69ec756185
Probably regression from bug 1258911....
Blocks: 1258911
Comment 2•9 years ago
|
||
Bisect says:
The first bad revision is:
changeset: 311679:c206d60dc0bf
user: L. David Baron <dbaron@dbaron.org>
date: Mon Aug 29 11:43:29 2016 -0700
summary: Bug 1251075 - Optimize away nsChangeHint_UpdateContainingBlock in nsStyleContext::CalcStyleDifference when possible. r=bz
Updated•9 years ago
|
status-firefox51:
--- → affected
tracking-firefox51:
--- → ?
Comment 3•9 years ago
|
||
So the one time I see us hit the code from bug 1251075 on this testcase, we're going from "no transform" to "has a transform". Both the old and the new style test true for HasPerspectiveStyle(), which is why we optimize out the containing-block change.
I bet the problem is that in RestyleManagerBase::ProcessRestyledFrames the handling of nsChangeHint_UpdateContainingBlock does something other than just twiddling the containing block bits: it also updates the NS_FRAME_MAY_BE_TRANSFORMED bit. I had missed that somehow. And I expect in this case we're failing to update it...
Comment 4•9 years ago
|
||
Comment 5•9 years ago
|
||
It seems like the obvious thing is to add another changehint for updating the NS_FRAME_MAY_BE_TRANSFORMED flag, and not mask it out even if we mask out nsChangeHint_UpdateContainingBlock. Not sure what the pitfalls of adding a new changehint are at this point.
Comment 7•9 years ago
|
||
Hi Astley,
Not sure if you can provide any help here?
Flags: needinfo?(aschen)
Updated•9 years ago
|
status-firefox50:
--- → unaffected
status-firefox52:
--- → affected
Keywords: regression
Priority: -- → P1
| Assignee | ||
Updated•9 years ago
|
Assignee: nobody → dbaron
Status: NEW → ASSIGNED
Comment 8•9 years ago
|
||
Attachment #8789655 -
Attachment is obsolete: true
| Assignee | ||
Comment 9•9 years ago
|
||
MozReview-Commit-ID: FwEQDA327EI
Attachment #8795044 -
Flags: review?(cam)
| Assignee | ||
Comment 10•9 years ago
|
||
Test by bzbarsky; reference by dbaron.
The test passes with the patch. With the changes to
RestyleManagerBase::ProcessRestyledFrames reverted, the test shows the
expected mispositioning resulting from not applying the transform.
MozReview-Commit-ID: 7oIQFD8QKUn
Attachment #8795045 -
Flags: review?(cam)
Updated•9 years ago
|
Flags: needinfo?(aschen)
Updated•9 years ago
|
Flags: needinfo?(dbaron)
Updated•9 years ago
|
Attachment #8795045 -
Flags: review?(cam) → review+
Comment 11•9 years ago
|
||
Comment on attachment 8795044 [details] [diff] [review]
Separate change hint for adding/removing transform from UpdateContainingBlock
Review of attachment 8795044 [details] [diff] [review]:
-----------------------------------------------------------------
::: layout/base/RestyleManagerBase.cpp
@@ +1125,5 @@
> // Normally frame construction would set state bits as needed,
> // but we're not going to reconstruct the frame so we need to set them.
> // It's because we need to set this state on each affected frame
> // that we can't coalesce nsChangeHint_UpdateContainingBlock hints up
> // to ancestors (i.e. it can't be an inherited change hint).
While you're here, could you do a s/inherited change hint/change hint that is handled for descendants/ or similar?
@@ +1147,5 @@
> + cont = nsLayoutUtils::GetNextContinuationOrIBSplitSibling(cont)) {
> + if (cont->StyleDisplay()->HasTransform(cont)) {
> + cont->AddStateBits(NS_FRAME_MAY_BE_TRANSFORMED);
> + }
> + // Don't remove NS_FRAME_MAY_BE_TRANSFORMED since it may still by
May as well s/by/be/ while moving this comment.
Attachment #8795044 -
Flags: review?(cam) → review+
| Assignee | ||
Comment 12•9 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/5fd6dd2bdbfaafbd7c48d3a804c15ec7fc769782
Bug 1301500 - Separate change hint for adding/removing transform from UpdateContainingBlock. r=heycam
https://hg.mozilla.org/integration/mozilla-inbound/rev/56055d850969c7ce96aeb988079c8685428172f5
Bug 1301500 - Add reftest. r=heycam
Comment 13•9 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/5fd6dd2bdbfa
https://hg.mozilla.org/mozilla-central/rev/56055d850969
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla52
| Assignee | ||
Comment 14•9 years ago
|
||
Comment on attachment 8795044 [details] [diff] [review]
Separate change hint for adding/removing transform from UpdateContainingBlock
Approval Request Comment
[Feature/regressing bug #]: bug 1251075
[User impact if declined]: incorrect layout of web pages
[Describe test coverage new/current, TreeHerder]: reftest added
[Risks and why]: reasonably low risk; makes sure we run the code that we were previously running
[String/UUID change made/needed]: no
Attachment #8795044 -
Flags: approval-mozilla-aurora?
| Assignee | ||
Updated•9 years ago
|
Attachment #8795045 -
Flags: approval-mozilla-aurora?
Comment 15•9 years ago
|
||
Comment on attachment 8795044 [details] [diff] [review]
Separate change hint for adding/removing transform from UpdateContainingBlock
Fix a regression related to layout and add tests. Take it in 51 aurora.
Attachment #8795044 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Updated•9 years ago
|
Attachment #8795045 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Comment 16•9 years ago
|
||
| bugherder uplift | ||
https://hg.mozilla.org/releases/mozilla-aurora/rev/08a7b0b71f4e
https://hg.mozilla.org/releases/mozilla-aurora/rev/c8c205387357
Flags: in-testsuite+
Updated•9 years ago
|
Version: unspecified → 51 Branch
You need to log in
before you can comment on or make changes to this bug.
Description
•