ASSERTION: if you have an mtable in a table

RESOLVED FIXED in mozilla1.4final

Status

()

Core
MathML
RESOLVED FIXED
15 years ago
15 years ago

People

(Reporter: steve.swanson, Assigned: rbs)

Tracking

Trunk
mozilla1.4final
x86
Windows XP
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Reporter)

Description

15 years ago
For each cell in an mtable in a table, I'm getting the following ASSERT

###!!! ASSERTION: not implemented: '!IsBorderCollapse(aParentFrame)', file 
c:/Mozilla/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp, line 1181

I don't understand what the ASSERTION is guarding against, but it seems a bit 
eager.  Or some style on the table is leaking into the mtable.
(Reporter)

Comment 1

15 years ago
Created attachment 123964 [details]
testcase

A very simple mtable in a single cell table.
Yep, the <mtable> is ending up with a computed border-collapse of "collapse"....
that seems wrong, since I don't see any style rules explicitly telling it to
inherit the border-collapse value.
(Assignee)

Comment 3

15 years ago
The collapse is being inherited from the fact that there is <table rules="all">. 

It is defined in the spec as:
http://www.w3.org/TR/1998/REC-CSS2-19980512/tables.html#borders
'border-collapse'
    Value:   collapse | separate | inherit
    Initial:   collapse
    Applies to:   'table' and 'inline-table' elements
    Inherited:   yes
    Percentages:   N/A
    Media:   visual

Aside from this bug, there seems to be a discrepancy with the code, though.
Why isn't |NS_STYLE_BORDER_COLLAPSE| the default in nsStyleStruct?

// -----------------------
// nsStyleTableBorder

nsStyleTableBorder::nsStyleTableBorder(nsIPresContext* aPresContext) 
{ 
  mBorderCollapse = NS_STYLE_BORDER_SEPARATE;

  nsCompatibility compatMode = eCompatibility_FullStandards;
  if (aPresContext)
    aPresContext->GetCompatibilityMode(&compatMode);
  mEmptyCells = (compatMode == eCompatibility_NavQuirks)
                  ? NS_STYLE_TABLE_EMPTY_CELLS_SHOW_BACKGROUND     
                  : NS_STYLE_TABLE_EMPTY_CELLS_SHOW;
  mCaptionSide = NS_SIDE_TOP;
  mBorderSpacingX.Reset();
  mBorderSpacingY.Reset();
}
Oh, right. I forgot that border-collapse inherits by default....

As for the initial value, see
http://www.w3.org/Style/css2-updates/REC-CSS2-19980512-errata#s-17-6 (the
"section 17.6 borders" item).  And in general, it's just easier to look at the
CSS2.1 spec, which incorporates the CSS2 errata....
(Reporter)

Comment 5

15 years ago
Sorry, I'm confused.  Is the firing of the ASSERTION a bug, or not?  If it's 
not a bug, why does mtable have problems with border-collapse?
(Assignee)

Comment 6

15 years ago
Created attachment 123979 [details] [diff] [review]
patch - reset the two sole border properties that are inherited

it is weird (and counter-intuitive) that |border-collapse| and |border-spacing|
set on a table get inherited down to other deeper tables. All the other border
related properties are not inherited, which is more in line with the intuition.


Oh well. Anyway, here is patch to reset what is irrelevant to the <mtable>
case.
(Assignee)

Updated

15 years ago
Attachment #123979 - Flags: superreview?(bz-bugspam)
Attachment #123979 - Flags: review?(bz-bugspam)
Attachment #123979 - Flags: superreview?(bz-bugspam)
Attachment #123979 - Flags: superreview+
Attachment #123979 - Flags: review?(bz-bugspam)
Attachment #123979 - Flags: review+
(Assignee)

Comment 7

15 years ago
Comment on attachment 123979 [details] [diff] [review]
patch - reset the two sole border properties that are inherited

asking a= for some simple CSS rules to reset certain properties not relevant to
MathML <mtable>s.
Attachment #123979 - Flags: approval1.4?

Comment 8

15 years ago
Comment on attachment 123979 [details] [diff] [review]
patch - reset the two sole border properties that are inherited

a=asa (on behalf of drivers) for checkin to 1.4
Attachment #123979 - Flags: approval1.4? → approval1.4+
(Assignee)

Comment 9

15 years ago
Checked in.
Status: NEW → RESOLVED
Last Resolved: 15 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.4final
You need to log in before you can comment on or make changes to this bug.