Closed
Bug 379741
Opened 17 years ago
Closed 17 years ago
We have eStyleUnit_Null nsStyleCoords for margin, etc.
Categories
(Core :: CSS Parsing and Computation, defect)
Core
CSS Parsing and Computation
Tracking
()
RESOLVED
FIXED
mozilla1.9alpha5
People
(Reporter: dbaron, Assigned: dbaron)
References
Details
Attachments
(3 files)
3.08 KB,
patch
|
bzbarsky
:
review+
bzbarsky
:
superreview+
|
Details | Diff | Splinter Review |
10.79 KB,
patch
|
bzbarsky
:
review+
bzbarsky
:
superreview+
|
Details | Diff | Splinter Review |
5.06 KB,
patch
|
bzbarsky
:
review+
bzbarsky
:
superreview+
|
Details | Diff | Splinter Review |
We have eStyleUnit_Null nsStyleCoords for a bunch of CSS properties where the null duplicates some other initial value that is representable in nsStyleCoord. We should instead represent these initial values so we don't have to worry about two different nsStyleCoord values representing the same thing. This also causes some bugs in the computed style code: we show (since some recent refactoring that bz did, I think) 'none' as the computed value for margin, padding, etc. properties on elements that don't have frames.
Assignee | ||
Comment 1•17 years ago
|
||
Attachment #263767 -
Flags: superreview?(bzbarsky)
Attachment #263767 -
Flags: review?(bzbarsky)
Comment 2•17 years ago
|
||
Comment on attachment 263767 [details] [diff] [review] patch So you can remove the check for eStyleUnit_Null from IsFixedPaddingSize() and IsFixedMarginSize() in nsAbsoluteContainingBlock.cpp, right? Or better yet expose IsFixedUnit from nsStyleStruct.cpp and make this code use that (and remove the check for _Null in that as well)? Also, can the line-height be eStyleUnit_Null at http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/layout/generic/nsLineLayout.cpp&rev=3.261#2012 ? Or can that check be removed too? Same for the check in NonZeroStyleCoord() in nsContainerFrame.cpp (only used for border-radius). Same for NonZeroStyleCoord() in nsDisplayList.cpp. Similar for IsPaddingZero() and IsMarginZero() in nsInlineFrame.cpp. Similar for functions with the same names in nsBlockFrame.cpp r+sr=bzbarsky for the patch as-is if you want to do the cleanups in a different bug. Followup: Do we want to avoid duplicating IsAutoHeight() between nsLayoutUtils and nsFrame.cpp?
Attachment #263767 -
Flags: superreview?(bzbarsky)
Attachment #263767 -
Flags: superreview+
Attachment #263767 -
Flags: review?(bzbarsky)
Attachment #263767 -
Flags: review+
Assignee | ||
Comment 3•17 years ago
|
||
I'm thinking I should eventually move to where GetUnit() can NS_ASSERTION(mUnit != eStyleUnit_Null, "reading uninitialized value");
Assignee | ||
Comment 4•17 years ago
|
||
This removes the remaining use of null units to mean anything other than uninitialized.
Attachment #264423 -
Flags: superreview?(bzbarsky)
Attachment #264423 -
Flags: review?(bzbarsky)
Assignee | ||
Comment 5•17 years ago
|
||
This removes the remaining eStyleUnit_Null checks (mostly obsoleted by attachment 263767 [details] [diff] [review]; some unneeded before it) and makes GetUnit assert that mUnit is not null.
Attachment #264424 -
Flags: superreview?(bzbarsky)
Attachment #264424 -
Flags: review?(bzbarsky)
Comment 6•17 years ago
|
||
Comment on attachment 264423 [details] [diff] [review] add eStyleUnit_None and use it for max-width/height r+sr=bzbarsky
Attachment #264423 -
Flags: superreview?(bzbarsky)
Attachment #264423 -
Flags: superreview+
Attachment #264423 -
Flags: review?(bzbarsky)
Attachment #264423 -
Flags: review+
Comment 7•17 years ago
|
||
Comment on attachment 264424 [details] [diff] [review] remove the remaining eStyelUnit_Null checks r+sr=bzbarsky
Attachment #264424 -
Flags: superreview?(bzbarsky)
Attachment #264424 -
Flags: superreview+
Attachment #264424 -
Flags: review?(bzbarsky)
Attachment #264424 -
Flags: review+
Assignee | ||
Comment 8•17 years ago
|
||
All 3 patches checked in to trunk.
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 9•17 years ago
|
||
One of these patches (probably the first) also fixed the marker-offset:auto failure in test_value_computation.html.
Updated•17 years ago
|
Flags: in-testsuite+
You need to log in
before you can comment on or make changes to this bug.
Description
•