Closed Bug 316180 Opened 19 years ago Closed 19 years ago

abs pos table elements should create block frames

Categories

(Core :: Layout: Tables, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: bernd_mozilla, Assigned: bernd_mozilla)

References

()

Details

Attachments

(1 file)

I don't really understand why the code in nsCSSFrameConstructor does not follow the CSS2.1 spec. The spec is crystal clear  on this. And we have allready the hooks for this in the code.
Attached patch patchSplinter Review
(1) This patch is incorrect, since 'display:table' elements can be absolutely positioned (although we have some bugs with not using them as a containing block, but that goes for relative positioning too)
(2) None of this code should be needed, due to EnsureBlockDisplay in nsRuleNode.cpp.   But assertions would be fine.
> I don't really understand why the code in nsCSSFrameConstructor does not follow
> the CSS2.1 spec.

Because this part of the spec is implemented in nsRuleNode::ComputeDisplayData:

2904     // 2) if position is 'absolute' or 'fixed' then display must be
2905     // block-level and float must be 'none'
2906     if (display->IsAbsolutelyPositioned()) {
2907       // Backup original display value for calculation of a hypothetical
2908       // box (CSS2 10.6.4/10.6.5).
2909       // See nsHTMLReflowState::CalculateHypotheticalBox
2910       display->mOriginalDisplay = display->mDisplay;
2911       EnsureBlockDisplay(display->mDisplay);
2912       display->mFloats = NS_STYLE_FLOAT_NONE;
2913       
2914       // We can't cache the data in the rule tree since if a more specific
2915       // rule has 'position: static' we'll end up with problems with the
2916       // 'display' and 'float' properties.
2917       inherited = PR_TRUE;
2918     }

Hence the only "table related" display type that a node with position:absolute can possibly end up having is "table".  Anything else gets converted to "block" or "table" by EnsureBlockDisplay().

As David said, some asserts that this works right couldn't hurt.
sorry for the spam, I probably had to much beer and/or the bugs are too long for me I assumed that abs. pos does not work on td and tr. They work flawless.  There is the issue that abs. pos tables cause issues as containing blocks for other abs.pos elements but I have no clue how to tackle this, e.g. where to start.
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: