Closed
Bug 321073
Opened 19 years ago
Closed 18 years ago
ASSERTION: Should not be called: 'Error' (nsGridLayout2::GetRowCount should not be called)
Categories
(Core :: XUL, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: jruderman, Assigned: anlan)
References
Details
(Keywords: assertion, testcase)
Attachments
(2 files, 1 obsolete file)
(deleted),
application/vnd.mozilla.xul+xml
|
Details | |
(deleted),
patch
|
enndeakin
:
review+
neil
:
superreview+
|
Details | Diff | Splinter Review |
Steps to reproduce: Load the testcase in a (trunk) debug build.
Result:
###!!! ASSERTION: Should not be called: 'Error', file /Users/admin/trunk/mozilla/layout/xul/base/src/grid/nsGridLayout2.cpp, line 302
Reporter | ||
Comment 1•19 years ago
|
||
299 NS_IMETHODIMP
300 nsGridLayout2::GetRowCount(PRInt32& aRowCount)
301 {
302 NS_ERROR("Should not be called");
303 return NS_OK;
304 }
Not assigning to an out-param and returning NS_OK seems like an odd thing to do...
Summary: ASSERTION: Should not be called: 'Error' (nsGridLayout2.cpp) → ASSERTION: Should not be called: 'Error' (nsGridLayout2::GetRowCount should not be called)
Reporter | ||
Comment 2•19 years ago
|
||
Reporter | ||
Comment 3•19 years ago
|
||
Btw, the assertion happens about 8 times when I load the testcase.
Reporter | ||
Updated•19 years ago
|
Blocks: randomstyles
Reporter | ||
Comment 4•18 years ago
|
||
Andreas, are you interested in fixing this bug?
Assignee | ||
Comment 5•18 years ago
|
||
I can have a look at it. Even if I know my way around those files now, debugging takes a bit more understanding of the code than just a read-through deCOM does.
I'll fix the return stuff in bug 363879. Is NS_ERROR() best to have when a function is forced by an interface but should not be used in that class, or should I change to some other macro?
Assignee | ||
Comment 6•18 years ago
|
||
The assert is now at line 81 in nsGridLayout2.h (http://landfill.mozilla.org/mxr-test/seamonkey/source/layout/xul/base/src/grid/nsGridLayout2.h#81).
The call is from GetGrid() in nsGridRowLayout.cpp (http://landfill.mozilla.org/mxr-test/seamonkey/source/layout/xul/base/src/grid/nsGridRowLayout.cpp#148).
The code iterates the children and QI to nsIGridPart, not expecting a GridLayout.
There are a few more such places in the grid code, but I'm not sure it is possible to trigger those.
Status: NEW → ASSIGNED
Assignee | ||
Comment 7•18 years ago
|
||
Avoid grids and get rid of an unused rv at the same time.
Assignee: nobody → mozilla
Reporter | ||
Updated•18 years ago
|
Attachment #249963 -
Flags: superreview?(neil)
Attachment #249963 -
Flags: review?(enndeakin)
Comment 8•18 years ago
|
||
Comment on attachment 249963 [details] [diff] [review]
Avoid calling the assertion
IMHO this call is not unexpected, because we already allow <grid><rows><box> and I don't see why we can't allow <grid><rows><grid>.
Instead I would have thought that nsIGridPart::GetRowCount should return 1 and only nsGridRowGroupLayout needs to override it.
Attachment #249963 -
Flags: superreview?(neil) → superreview-
Assignee | ||
Updated•18 years ago
|
Attachment #249963 -
Attachment is obsolete: true
Attachment #249963 -
Flags: review?(enndeakin)
Assignee | ||
Comment 9•18 years ago
|
||
> Instead I would have thought that nsIGridPart::GetRowCount should return 1 and
> only nsGridRowGroupLayout needs to override it.
Better. Lets do that.
Attachment #250654 -
Flags: superreview?(neil)
Attachment #250654 -
Flags: review?(enndeakin)
Assignee | ||
Updated•18 years ago
|
Attachment #250654 -
Attachment description: Default to rowcount to 1 row → Default rowcount to 1 row
Attachment #250654 -
Attachment filename: 3.patch → 321073-2.patch
Comment 10•18 years ago
|
||
Comment on attachment 250654 [details] [diff] [review]
Default rowcount to 1 row
Nice diffstats ;-)
Attachment #250654 -
Flags: superreview?(neil) → superreview+
Updated•18 years ago
|
Attachment #250654 -
Flags: review?(enndeakin) → review+
Reporter | ||
Comment 11•18 years ago
|
||
I checked in the patch (2007-01-07 21:58).
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Component: XP Toolkit/Widgets: XUL → XUL
QA Contact: xptoolkit.xul → xptoolkit.widgets
You need to log in
before you can comment on or make changes to this bug.
Description
•