Open
Bug 393325
Opened 18 years ago
Updated 3 years ago
Reflow whenever ThemeSupportsWidget changes (was: "ASSERTION: Incorrect size computed by ComputeAutoSize?")
Categories
(Core :: Layout, defect)
Tracking
()
NEW
People
(Reporter: jruderman, Unassigned)
References
(Blocks 6 open bugs)
Details
(Keywords: assertion, regression, testcase)
Attachments
(1 file)
398 bytes,
image/svg+xml
|
Details |
###!!! ASSERTION: Incorrect size computed by ComputeAutoSize?: 'ancestorAutoSize.width == autoSize.width', file /Users/jruderman/trunk/mozilla/layout/forms/nsTextControlFrame.cpp, line 1743
The testcase uses SVG, but I'm pretty sure it's possible to trigger the assertion without SVG as well.
The assertion was added in bug 385870.
![]() |
||
Comment 1•18 years ago
|
||
This worskforme, in the build that has that patch, on Linux.
Could this be Mac-specific? Or dependent on native theming somehow?
What are your ancestorAutoSize and autoSize in this case?
Reporter | ||
Comment 2•18 years ago
|
||
(gdb) f 4
#4 0x17abdc69 in nsTextControlFrame::ComputeAutoSize (this=0x3eb5b210, aRenderingContext=0x3e3673a0, aCBSize=@0xbfffbb98, aAvailableWidth=30000, aMargin=@0xbfffbb90, aBorder=@0xbfffbb88, aPadding=@0xbfffbb80, aShrinkWrap=1) at /Users/jruderman/trunk/mozilla/layout/forms/nsTextControlFrame.cpp:1742
1742 NS_ASSERTION(ancestorAutoSize.width == autoSize.width,
(gdb) p ancestorAutoSize.width
$1 = 9060
(gdb) p autoSize.width
$2 = 8940
(gdb) p ancestorAutoSize.height
$3 = 1073741824
(gdb) p autoSize.height
$4 = 777
![]() |
||
Comment 3•18 years ago
|
||
Huh. So I can reproduce this on Mac, but I get complete garbage in autoSize.width according to gdb... I wonder what's going on. :(
![]() |
||
Comment 4•18 years ago
|
||
So the key here, I think, is that our computed border has changed but we didn't dirty our mPrefSize in the process.
The problem is, as far as I can tell, that our border-style (and color) has changed. In particular, that change means that ThemeSupportsWidget starts returning false instead of true, and that therefore the value that nsBox::GetBorder returns changes. But the style change only gives a repaint hint, so we never do a FrameNeedsReflow which would dirty our cached mPrefSize.
Then we try to compute our size based on the cached mPrefSize and the new border (which is 1px smaller), and of course this gives a different answer from the direct computation, triggering the assertion. Ideally we'd also have asserts in place that mPrefSize is still correct (as in, recompute it in debug builds), but whatever.
Really, we need to do a reflow whenever ThemeSupportsWidget changes... Question is how to detect that efficiently.
Component: Layout: Form Controls → Layout
Flags: blocking1.9?
QA Contact: layout.form-controls → layout
Reporter | ||
Updated•18 years ago
|
Summary: "ASSERTION: Incorrect size computed by ComputeAutoSize?" → Reflow whenever ThemeSupportsWidget changes (was: "ASSERTION: Incorrect size computed by ComputeAutoSize?")
Flags: blocking1.9? → blocking1.9-
Whiteboard: [wanted-1.9]
![]() |
||
Comment 5•18 years ago
|
||
Perhaps we should actually store the "has author style" bit on the style context (and only compute it if moz-appearance is set)? Then we'd only compute it once, and we could set a reflow hint if that bit differs from old context to new context... David, what do you think?
Sounds good to me; it would address bug 240117 comment 9 as well. It might be better to make the bit mean "is themed", though, since that would be easier to compute correctly in the normal case (default to 0).
I wonder if IsWidgetStyled could take an nsIContent* instead of an nsIFrame*. That would help guarantee that this was safe.
And note that I think IsWidgetStyled could be called CanThemeWidget, or something like that, and the user of nsITheme (in layout) could be the ones checking style data.
And perhaps even a PRBool aIsHTML rather than nsIContent *aContent.
![]() |
||
Comment 8•18 years ago
|
||
So the idea would be to replace the checks for mAppearance for checks of this style context bit in layout? And remove all the style-checking from widget/ code altogether?
I think so, especially if the only thing nsITheme implementations do with the frame is check IsContentOfType(eHTML). (It would mainly be changing nsIFrame::IsThemed.)
Updated•18 years ago
|
Flags: wanted1.9+
Whiteboard: [wanted-1.9]
Flags: wanted1.9-
Flags: wanted1.9+
Flags: wanted-next+
![]() |
||
Comment 10•16 years ago
|
||
This causes real problems like bug 494507.
Blocks: 525854
Comment 11•5 years ago
|
||
Changing the backgroundColor of a select caused problems on Linux. Is that a separate issue or is the platform of this bug incorrect?
That is a separate bug.
Updated•3 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•