Closed
Bug 242368
Opened 21 years ago
Closed 21 years ago
Setting dynamically a table column's visibility in 1.8a will crash
Categories
(Core :: Layout: Tables, defect)
Core
Layout: Tables
Tracking
()
RESOLVED
FIXED
People
(Reporter: bugzilla, Unassigned)
Details
(4 keywords)
Attachments
(2 files, 1 obsolete file)
2.42 KB,
text/html
|
Details | |
666 bytes,
patch
|
bernd_mozilla
:
review+
rbs
:
superreview+
asa
:
approval1.7+
|
Details | Diff | Splinter Review |
While working on a global testcase for bug 77019, bug 76497 and bug 242253 with
Mozilla 1.8a build 2004050108, I stumbled across a reproducible crash.
It seems that
var ColumnCollection =
document.getElementById("idTable").getElementsByTagName("col");
ColumnCollection[2].style.visibility = "hidden"; // or collapse
cannot be executed.
Testcase coming up.
XP Pro here.
Reporter | ||
Comment 1•21 years ago
|
||
Please make sure you're using a recent Mozilla 1.8a build.
Note that Opera 7.50 beta1 does not crash on this testcase.
Reporter | ||
Comment 2•21 years ago
|
||
I must say that while trying attachment 31308 [details] of bugfile 76497, I do not crash
and I get the expected results (correct column visibility). Somehow, accessing
the node via nodeList from
getElementsByTagName("col")
instead of
getElementById("idTargetedColumn")
causes the crash.
![]() |
||
Comment 3•21 years ago
|
||
Happens on Linux too. Stack:
#6 0x4117f35f in nsStyleBorder::GetBorder(nsMargin&) const (this=0xbfffdd10,
aBorder=@0x8832844) at nsStyleStruct.h:350
#7 0x412d6830 in TableBackgroundPainter::PaintTable(nsTableFrame*, nsMargin*) (
this=0xbfffdd10, aTableFrame=0x8832844, aDeflate=0x0)
at
/home/bzbarsky/mozilla/xlib/mozilla/layout/html/table/src/nsTablePainter.cpp:435
#8 0x412b438b in nsTableFrame::Paint(nsIPresContext*, nsIRenderingContext&,
nsRect const&, nsFramePaintLayer, unsigned) (this=0x8832844,
aPresContext=0x87659c0,
aRenderingContext=@0x8677860, aDirtyRect=@0xbfffde60,
aWhichLayer=eFramePaintLayer_Underlay, aFlags=0)
at
/home/bzbarsky/mozilla/xlib/mozilla/layout/html/table/src/nsTableFrame.cpp:1427
#9 0x4119db6e in nsContainerFrame::PaintChild(nsIPresContext*,
nsIRenderingContext&, nsRect const&, nsIFrame*, nsFramePaintLayer, unsigned)
(this=0x88326e4,
aPresContext=0x87659c0, aRenderingContext=@0x8677860, aDirtyRect=@0xbfffdf00,
aFrame=0x8832844, aWhichLayer=eFramePaintLayer_Underlay, aFlags=0)
at
/home/bzbarsky/mozilla/xlib/mozilla/layout/html/base/src/nsContainerFrame.cpp:303
And data:
(gdb) frame 7
#7 0x412d6830 in TableBackgroundPainter::PaintTable(nsTableFrame*, nsMargin*) (
this=0xbfffdd10, aTableFrame=0x8832844, aDeflate=0x0)
at
/home/bzbarsky/mozilla/xlib/mozilla/layout/html/table/src/nsTablePainter.cpp:435
435 mCols[colIndex].mCol.mBorder->GetBorder(border);
(gdb) p mCols[colIndex].mCol.mBorder
$2 = (const nsStyleBorder *) 0x0
(gdb) p colIndex
$3 = 2
(gdb) p mCols[colIndex].mCol
$4 = {mFrame = 0x883a514, mRect = {x = 1162, y = 0, width = 546, height = 1512},
mBackground = 0x0, mBorder = 0x0, mSynthBorder = 0x0}
mBorder is not set by TableBackgroundData::SetFull if
mFrame->IsVisibleForPainting() is false (as here). But the loop over cols in
PaintTable() doesn't check visibility of the col.... It probable should.
Severity: normal → critical
OS: Windows XP → All
Hardware: PC → All
Reporter | ||
Comment 4•21 years ago
|
||
This is strange: attachment 31308 [details] of bug 76497 works perfectly for me while
this testcase crashes (while using getElementById or getElementsByTagName) and
I don't know why.
Attachment #147512 -
Attachment is obsolete: true
drunclear does it crash the 1.7rc1, the visibilty:hidden should be handled
identical for strict mode rendering.
Reporter | ||
Comment 8•21 years ago
|
||
Yes, I crash with 1.7RC1 while trying attachment 147514 [details] (both buttons will crash
the application).
Removing
mCols[colIndex].mCol.mBorder->GetBorder(border);
seems to fix it. At least, it's not crashing. It's not hiding the columns, either...
(That line doesn't seem to be doing anything, and the relevant background tests
work fine without it.)
Bernd, does that seem right to you? Do you want a patch?
![]() |
||
Comment 10•21 years ago
|
||
Er... wouldn't that break the border when cols have a border? Or am I missing
something?
I'm still confused why the change I proposed (to check whether the col is
visible before doing anything with it) is wrong...
Comment 11•21 years ago
|
||
> Er... wouldn't that break the border when cols have a border? Or am I missing
> something?
It gets the border and then... does what?
http://lxr.mozilla.org/seamonkey/source/layout/html/table/src/nsTablePainter.cpp#414
> I'm still confused why the change I proposed (to check whether the col is
> visible before doing anything with it) is wrong...
Because if that line is not necessary, checking to see whether it's a valid
operation is not necessary. :)
![]() |
||
Comment 12•21 years ago
|
||
> It gets the border and then... does what?
Doesn't it affect the border that gets set on the next col?
Comment 13•21 years ago
|
||
That's stashed in lastLeftBorder...
which really should be called nextLeftBorder. :/
![]() |
||
Comment 14•21 years ago
|
||
Er, yeah. Then removing the line sounds fine to me. ;)
Comment 15•21 years ago
|
||
fantasai: could you please explain what this code inside the bordercollapse
switch should in theory do.
Comment 16•21 years ago
|
||
Attachment #147637 -
Flags: superreview?(bzbarsky)
Attachment #147637 -
Flags: review?(bernd_mozilla)
Attachment #147637 -
Flags: approval1.7?
Attachment #147637 -
Flags: review?(bernd_mozilla) → review+
![]() |
||
Comment 17•21 years ago
|
||
fantasai, I'm not really doing srs at the moment... poke roc or rbs?
Comment 18•21 years ago
|
||
Comment on attachment 147637 [details] [diff] [review]
patch
Oh, sorry bz! *didn't notice that*
Attachment #147637 -
Flags: superreview?(bzbarsky) → superreview?(rbs)
Attachment #147637 -
Flags: superreview?(rbs) → superreview+
Comment 19•21 years ago
|
||
Comment on attachment 147637 [details] [diff] [review]
patch
a=asa (on behalf of drivers) for checkin to 1.7
Attachment #147637 -
Flags: approval1.7? → approval1.7+
Comment 20•21 years ago
|
||
fix checked in trunk & branch
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Reporter | ||
Comment 21•21 years ago
|
||
I tried the testcase with Mozilla 1.8a build 2004050609 and I did not crash: so
this is FIXED.
You need to log in
before you can comment on or make changes to this bug.
Description
•