Closed Bug 266968 Opened 20 years ago Closed 20 years ago

[FIXr]Auto offsets wrong for abs pos kid of block kid of a rel pos inline

Categories

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

x86
Linux
defect

Tracking

()

RESOLVED FIXED
mozilla1.8alpha5

People

(Reporter: bzbarsky, Assigned: bzbarsky)

References

Details

Attachments

(2 files, 3 obsolete files)

In brief, the CalculateHypotheticalBox code in nsHTMLReflowState doesn't handle
the case of a relatively positioned inline having a block kid with an abs pos
descendant, because in this case the cb and the block are not ancestors of each
other.
Attached file There should be no red (obsolete) —
Attached patch Patch (obsolete) — Splinter Review
Comment on attachment 164105 [details] [diff] [review]
Patch

roc, would you review?	This makes the following changes:

1)  Adds two new methods to nsLayoutUtils (the other changes here are
header-fanout cleanup I already had in my tree that I couldn't easily 
disentangle; this is a good chance to check it in  :) ).

2)  Makes nsHTMLReflowState use the new code (that fixes this bug).

3)  Clarifies some code in nsCSSFrameConstructor, since it really doesn't need
to deal with absolutely positioned elements now that reflow is fixed.

4)  Fixes various callers in the tree to use the new methods.

Of particular note in #4 are the changes to nsGfxScrollFrame, which actually
change the functionality.  The code without these changes is a no-op; that
seems to be a regression introduced in revision 3.126 of the file...

For the rest, I think the big danger is getting signs wrong... that's something
to expecially watch for when reviewing this patch.
Attachment #164105 - Flags: superreview?(roc)
Attachment #164105 - Flags: review?(roc)
Assignee: nobody → bzbarsky
Priority: -- → P1
Summary: Auto offsets wrong for abs pos kid of block kid of a rel pos inline → [FIX]Auto offsets wrong for abs pos kid of block kid of a rel pos inline
Target Milestone: --- → mozilla1.8alpha5
Oh, one more thing.  There is another common pattern around -- walking up to the
first widget, then converting to screen coordinates... I didn't really mess with
those callers, but maybe we want a helper for that too.
Attachment #164105 - Attachment is obsolete: true
Attachment #164135 - Flags: superreview?(roc)
Attachment #164135 - Flags: review?(roc)
Attachment #164105 - Flags: superreview?(roc)
Attachment #164105 - Flags: superreview-
Attachment #164105 - Flags: review?(roc)
Attachment #164105 - Flags: review-
Comment on attachment 164135 [details] [diff] [review]
Updated to handle scrollviews right

Roc and I talked about this some, and decided on a slightly different api.
Attachment #164135 - Flags: superreview?(roc)
Attachment #164135 - Flags: superreview-
Attachment #164135 - Flags: review?(roc)
Attachment #164135 - Flags: review-
Attachment #164135 - Attachment is obsolete: true
Comment on attachment 164146 [details] [diff] [review]
Better yet api, as discussed

Comment 3 still describes the patch, with the change to the nsIFrame/nsIView
member method api.
Attachment #164146 - Flags: superreview?(roc)
Attachment #164146 - Flags: review?(roc)
Comment on attachment 164146 [details] [diff] [review]
Better yet api, as discussed

+  return offset;
+
+}

Stray blank line.

accessible isn't linked to gklayout, so won't linking to nsIFrame::GetOffsetTo
fail? Maybe we need a virtual nsIFrame::GetOffsetToExternal.

Other than that, looks fantastic.
Attachment #164146 - Flags: superreview?(roc)
Attachment #164146 - Flags: superreview+
Attachment #164146 - Flags: review?(roc)
Attachment #164146 - Flags: review+
Yeah, you're right.  I'll add a GetOffsetToInternal() before checking in.
Summary: [FIX]Auto offsets wrong for abs pos kid of block kid of a rel pos inline → [FIXr]Auto offsets wrong for abs pos kid of block kid of a rel pos inline
Fix checked in, with those changes.
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Blocks: 276154
The testcase shows partly red again on the trunk: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.9a1) Gecko/20060516 Minefield/3.0a1.

Is it a regression?
No, the testcase isn't quite right...  I could create one that is, I guess.  Compare the rendering in a November 3, 2004 build, though.
Attached file Fixed testcase
Attachment #164045 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: