Closed Bug 975741 Opened 10 years ago Closed 10 years ago

initial value of 'perspective' should be stored as 'none' rather than '0', and computed style should not work around the invalid storage

Categories

(Core :: CSS Parsing and Computation, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla30

People

(Reporter: dbaron, Assigned: dbaron)

References

Details

Attachments

(2 files)

Right now we internally implement the initial value of perspective as '0' rather than 'none', although we allow an explicitly-specified 'none' to reflect its way through our internal representation.  Then we fix up the value in nsComputedDOMStyle to report a '0' as 'none' to hide the other bugs.

We don't have any differences in behavior between the '0' and 'none' values (I checked).  But:

 (1) it's a minor spec conformance bug, in that we don't properly reflect '0' as different from 'none'

 (2) we will likely want to add some internal differences in behavior, for example, for bug 968555; having this data incorrect internally seems likely to things being implemented incorrectly in the future
Er, I said that backwards in both the bug summary and the patch description.
Summary: initial value of 'perspective' should be '0' rather than 'none', and computed style should properly distinguish the two → initial value of 'perspective' should be 'none' rather than '0', and computed style should properly distinguish the two
Attachment #8380209 - Attachment description: Make the initial value of 'perspective' be '0' rather than 'none', and make the nsComputedDOMStyle computed value implementation of 'perspective' properly distinguish between '0' and 'none'. → Make the initial value of 'perspective' be 'none' rather than '0', and make the nsComputedDOMStyle computed value implementation of 'perspective' properly distinguish between '0' and 'none'.
Attachment #8380209 - Flags: review?(cam) → review+
Oops, I missed the fact that 'perspective' only allows positive values, so the summary of the bug should be slightly different, and I need to change the test to list '0px' in invalid_values.  But the patch is fine as-is, and still simplifies the code and makes the storage of identical values more consistent.

(Though we can also remove the >0 checks now, actually.
Summary: initial value of 'perspective' should be 'none' rather than '0', and computed style should properly distinguish the two → initial value of 'perspective' should be stored as 'none' rather than '0', and computed style should not work around the invalid storage
Now that the first patch in this bug changed things so that 'none' is
reliably stored as eStyleUnit_None (rather than being stored as a 0
length when it comes from the initial value), we know mChildPerspective
is always > 0 when it is eStyleUnit_Coord, and there's no point making
the additional check.
Attachment #8380982 - Flags: review?(matt.woodrow)
Whiteboard: [leave open]
Attachment #8380982 - Flags: review?(matt.woodrow) → review+
https://hg.mozilla.org/mozilla-central/rev/e8eaec0c9198
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla30
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: