Closed
Bug 208729
Opened 22 years ago
Closed 20 years ago
[FIXr]consider creating an nsCSSValuePair type
Categories
(Core :: CSS Parsing and Computation, defect, P2)
Core
CSS Parsing and Computation
Tracking
()
RESOLVED
FIXED
mozilla1.8alpha4
People
(Reporter: dbaron, Assigned: bzbarsky)
References
(Blocks 1 open bug)
Details
Attachments
(2 files, 2 obsolete files)
745 bytes,
text/html
|
Details | |
60.55 KB,
patch
|
Details | Diff | Splinter Review |
If we create an nsCSSValuePair type (as bz suggested in bug 125246 comment 41),
we might be able to get rid of some shorthand hacks:
Looking over this code, could we introduce a nsCSSValuePair type of data and
then eliminate the -x-* properties for 'border-spacing', 'size', 'play-during',
'background-position'? That could simplify some more code, and arguably make
some more correct (see the XXX comment you added in nsCSSPropList.h). Probably
do this as a separate patch after this one lands...
This would be a seventh type in the eCSSType enumeration, I think.
![]() |
Assignee | |
Comment 1•22 years ago
|
||
![]() |
Assignee | |
Comment 2•21 years ago
|
||
This doesn't convert background-position because I've not yet been able to get
the shorthand code to play nice with this setup... The problem, of course, is
that background-position can be a shorthand of its own _or_ part of the
background shorthand. Yay.
![]() |
Assignee | |
Comment 3•21 years ago
|
||
By "shorthand code" I mean the code that outputs shorthands when
nsCSSDeclaration is converted into a string.
Blocks: 223718
Reporter | ||
Comment 4•20 years ago
|
||
So I wouldn't mind using this for something new (bug 72747). Is it reviewable
(in its 'background-position'-not-yet-converted state)?
I note the XXXldb where you added the #ifdef DEBUG could probably be removed, as
could the "debugging methods only".
Reporter | ||
Comment 5•20 years ago
|
||
Er, well, now that I think about it for 10 seconds, I actually don't want to use
this. So never mind the dependency, but it could still be worth landing.
![]() |
Assignee | |
Comment 6•20 years ago
|
||
Yeah, the patch should be reviewable as it is, with background-position to be
fixed later.
Let me post a diff against current trunk for review.
![]() |
Assignee | |
Comment 7•20 years ago
|
||
![]() |
Assignee | |
Updated•20 years ago
|
Attachment #134188 -
Attachment is obsolete: true
![]() |
Assignee | |
Updated•20 years ago
|
Attachment #156555 -
Flags: superreview?(dbaron)
Attachment #156555 -
Flags: review?(dbaron)
Reporter | ||
Comment 8•20 years ago
|
||
Comment on attachment 156555 [details] [diff] [review]
Diff against tip
>+#ifdef DEBUG
>+void nsCSSValuePair::AppendToString(nsAString& aString,
>+ nsCSSProperty aPropName) const
>+{
>+ if (mXValue.GetUnit() != eCSSUnit_Null) {
>+ AppendUTF8toUTF16(nsCSSProps::GetStringValue(aPropName), aString);
>+ aString.Append(NS_LITERAL_STRING(": "));
>+ mXValue.AppendToString(aString);
>+ NS_ASSERTION(mYValue.GetUnit() != eCSSUnit_Null,
>+ nsPrintfCString("Parsed half of a %s?",
>+ nsCSSProps::GetStringValue(aPropName).get()).get());
>+ mYValue.AppendToString(aString);
Appending a space might be good, I think, unless something else does it.
A little more context in this diff might have been nice, but r+sr=dbaron.
Attachment #156555 -
Flags: superreview?(dbaron)
Attachment #156555 -
Flags: superreview+
Attachment #156555 -
Flags: review?(dbaron)
Attachment #156555 -
Flags: review+
![]() |
Assignee | |
Comment 9•20 years ago
|
||
> Appending a space might be good, I think, unless something else does it.
Yeah, I need to do that. Good catch.
Assignee: dbaron → bzbarsky
Priority: -- → P2
Summary: consider creating an nsCSSValuePair type → [FIXr]consider creating an nsCSSValuePair type
Target Milestone: --- → mozilla1.8alpha4
![]() |
Assignee | |
Comment 10•20 years ago
|
||
Note that while getting play-during directly will work with this patch, cssText
for it will still be broken. I'll file a bug on that, as well on the
background-position issue.
![]() |
Assignee | |
Updated•20 years ago
|
Attachment #156555 -
Attachment is obsolete: true
![]() |
Assignee | |
Comment 11•20 years ago
|
||
Filed bug 258080 on the background-position issue and bug 258079 on a related
play-during issue I noticed.
![]() |
Assignee | |
Comment 12•20 years ago
|
||
Fix checked in for 1.8a4
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•