Closed Bug 170644 Opened 22 years ago Closed 20 years ago

[RR]dynamic offset changes not working on fixed-positioned elements (auto only?)

Categories

(Core :: Layout: Positioned, defect, P2)

defect

Tracking

()

RESOLVED FIXED
mozilla1.8alpha1

People

(Reporter: coscatmu, Assigned: bzbarsky)

References

()

Details

(Keywords: testcase)

Attachments

(4 files, 4 obsolete files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.1) Gecko/20020826
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.1) Gecko/20020826

If you goto http://www.w3.org/Style/CSS/ and switch the style sheet via View 
| Use Style to the "Gold (left,fixed)" stylesheet it appears correctly. 
However, if you switch from that stylesheet to the "Gold (right,fixed)", the
text makes the switch, but the left DIV remains in the left position.

If you follow the progression of "Gold (left,fixed)", "Gold (left, fixed) +
navbar", and finally "Gold (right, fixed)", the elements appears to be rendered
correctly.  

Duplicated on two different machines on two different networks (home and work)

Reproducible: Always

Steps to Reproduce:
1.  Go to http://www.w3.org/Style/CSS/
2.  Switch stylesheet using View : Use Style to "Gold (left, fixed)"
3.  Switch stylesheet using View : Use Style to "Gold (right, fixed)"
4.  NOTE:  LEFT DIV does not move to the right side.
5.  Now switch stylesheet to "Steely"
6.  Switch to "Gold (right, fixed).  Pages is rendered as intended.

Actual Results:  
Demonstrated the odd behavior (fixed layer not moving correctly) and in steps 5
and 6, how it should behave.

Expected Results:  
When "Gold (right, fixed)" stylesheet is selected, the fixed layer should have
moved to the right side.
Attached file default style sheet (obsolete) —
Attached file alternate style - left , fixed (obsolete) —
Attached file alternate style -- right , fixed (obsolete) —
Component: Style System → Layout
Summary: View : Use Style not applied correctly when switching between style sheets. → dynamic offset changes not working on fixed-positioned elements (auto only?)
Attached file reduced testcase (obsolete) —
This is an incremental reflow problem -- resizing the window makes the layout
correct itself.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: dynamic offset changes not working on fixed-positioned elements (auto only?) → {inc}dynamic offset changes not working on fixed-positioned elements (auto only?)
I did not find a dup to this bug.
Confirming the bug and adding keyword 'testcase'
setting QA priority to [QA-P3] based on severity * visibility

Visibiltiy is high since it is seen in a top site http://www.w3.org/Style/CSS/
Severity is low since it is a cosmetic related issue
Component: Layout → Style System
Keywords: testcase
Summary: {inc}dynamic offset changes not working on fixed-positioned elements (auto only?) → dynamic offset changes not working on fixed-positioned elements (auto only?)
Whiteboard: [QA-P3]
Component: Style System → Layout
Summary: dynamic offset changes not working on fixed-positioned elements (auto only?) → {inc}dynamic offset changes not working on fixed-positioned elements (auto only?)
Attached file simpler "left" sheet
Attachment #100765 - Attachment is obsolete: true
Attached file simpler "right" sheet
Attachment #100766 - Attachment is obsolete: true
Attached file simpler testcase
Attachment #100764 - Attachment is obsolete: true
Attachment #100767 - Attachment is obsolete: true
So here's what's going on:

1)  The sheet change happens
2)  We reresolve style on the tree starting at the root
3)  We do not reresolve style on frames in the fixed list on the vieport,
    because they are out of flow
4)  We get a "reflow" style hint for the body (because the margins changed)
5)  We get to the placeholders and reresolve them and their out-of-flows (the
    fixed frames), but do _not_ append them to the change list, since their hint
    is "reflow" and we already have a "parent" with a "reflow" hint in the list.
6)  We reflow.  Unfortunately, reflowing the body does not reflow the fixed-pos
    frames, since reflow does not propagate through placeholders.

So possible thoughts:

a)  Append out-of-flows to the changelist even if their hint is already present
    in the list
b)  Have reflow propagate through placeholders (we may need this anyway; eg
    consider a fixed-pos top:auto/bottom:auto frame whose placeholder moves
    because the body reflows)

Component: Layout → Layout: R & A Pos
OS: Windows 2000 → All
Hardware: PC → All
Summary: {inc}dynamic offset changes not working on fixed-positioned elements (auto only?) → [RR]dynamic offset changes not working on fixed-positioned elements (auto only?)
Yep.  As expected, adding a ReflowDirtyChild() call in
nsPlaceHolderFrame::Reflow() to schedule its out-of-flow to be reflown fixes
this bug...

That approach seems very wrong, though.  If nothing else, that should only apply
to abs/fixed pos frames.
Priority: -- → P3
Whiteboard: [QA-P3]
Blocks: 189833
Blocks: 180142
Blocks: 170916
Blocks: 180242
Additional testcase:

http://weblogs.mozillazine.org/asa/

Steps:
1. Switch to Clean theme.
2. Switch back to DefaultStyle theme.

The text will be misaligned. Resize or refresh window and it looks fine again.
Blocks: 226076
Blocks: 225342
The "simpler testcase" attachment WFM.
So does Madhur's testcase... the problem stands, however (see dependencies).  If
someone really cares, I can look up when the testcases in this bug started
working... the code changes described in comment 10 haven't happened or anything.
Blocks: 231962
Attached patch Possible fixSplinter Review
I can't reproduce with the testcases in this bug, but the patch _does_ fix the
testcases in bug 170916, bug 180242, bug 225342, bug 231962.

It does not fix the testcase in bug 180142, though I'm not sure why.

The remaining dependencies of this bug do not have usable testcases.
Comment on attachment 146862 [details] [diff] [review]
Possible fix

David, what do you think?  We need to either do this or to always reflow all
out-of-flow descendants on any style-change reflow.  I think doing this is
cheaper...

The reflow hint is the only one we need to worry about because
ApplyRenderingChangeToTree does walk all out of flows and reframing naturally
deals with out of flows.
Attachment #146862 - Flags: superreview?(dbaron)
Attachment #146862 - Flags: review?(dbaron)
Comment on attachment 146862 [details] [diff] [review]
Possible fix

If you're confident that we won't do a reflow on something that we've already
reframed, r+sr=dbaron.	(rbs's code handles that, right?)  I can't think of any
other assumptions that might break, but there could be some...
Attachment #146862 - Flags: superreview?(dbaron)
Attachment #146862 - Flags: superreview+
Attachment #146862 - Flags: review?(dbaron)
Attachment #146862 - Flags: review+
Yeah, rbs' code should handle that....
Assignee: dbaron → bzbarsky
Target Milestone: --- → mozilla1.8alpha
Checked in.
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: