Closed Bug 211657 Opened 21 years ago Closed 21 years ago

[FIXr]Should use '::' for anonymous boxes and other -moz pseudo-elements

Categories

(Core :: CSS Parsing and Computation, defect, P1)

defect

Tracking

()

RESOLVED FIXED
mozilla1.5beta

People

(Reporter: bzbarsky, Assigned: bzbarsky)

Details

Attachments

(4 files, 5 obsolete files)

Filing this per bug 62843 comment 38.  The idea is to fix all the stylesheets
that use this stuff, then stop accepting the single-':' form.
Priority: -- → P1
Target Milestone: --- → mozilla1.5beta
This patch was generated in a clean tree with the following commands, run from
the mozilla/ dir:

find . -name "*.css" -exec grep -H ":-moz-tree-" {} \; | 
  sed 's/:.*//' | 
  sed 's|^./||' | 
  sort | 
  uniq > ~/fileList.txt

perl -pi -e 's/:-moz-tree-/::-moz-tree-/g' `cat ~/fileList.txt`
cvs diff -u `cat ~/fileList.txt ` > ~/test.patch
Comment on attachment 127136 [details] [diff] [review]
Patch for the various ::-moz-tree-* pseudos

David, could you review?  The patch itself is pretty unreviewable, but the
procedure I used to generate it is reviwable, of course...
Attachment #127136 - Flags: superreview?(dbaron)
Attachment #127136 - Flags: review?(dbaron)
Comment on attachment 127136 [details] [diff] [review]
Patch for the various ::-moz-tree-* pseudos

r+sr=dbaron, although you should probably do toolkit/, browser/, and mail/ as
well.
Attachment #127136 - Flags: superreview?(dbaron)
Attachment #127136 - Flags: superreview+
Attachment #127136 - Flags: review?(dbaron)
Attachment #127136 - Flags: review+
(You might want to check with hyatt or ben about whether they're happy about
switching to this syntax, though.)
I'll file separate bugs for mail/ and browser/, since I don't have checkin
permission to those, once I hear back from hyatt or ben.
Attachment #127137 - Flags: superreview?(dbaron)
Attachment #127137 - Flags: review?(dbaron)
Comment on attachment 127138 [details] [diff] [review]
Patch for all the non-moz-tree pseudo-elements

There is an edge of some cleanup in nsPresShell.cpp, but it's pretty
straightforward, so I just left it in the diff...
Attachment #127138 - Flags: superreview?(dbaron)
Attachment #127138 - Flags: review?(dbaron)
Summary: Should use '::' for anonymous boxes and other -moz pseudo-elements → [FIX]Should use '::' for anonymous boxes and other -moz pseudo-elements
Re: comment 1, and FYI only (Unix cmd lines were my thing in past lives):

find . -name "*.css" -exec grep -H ":-moz-tree-" {} \; | 
  sed 's/:.*//' | 
  sed 's|^./||' | 
  sort | 
  uniq > ~/fileList.txt
perl -pi -e 's/:-moz-tree-/::-moz-tree-/g' `cat ~/fileList.txt`

would be shorter and possibly much faster if written this way:

find . -name "*.css" -print | xargs grep -l ':-moz-tree-' |
  sed 's|^\./||' |
  sort -u |
  xargs perl -pi -e 's/:-moz-tree-/::-moz-tree-/g'

(find | xargs wins over find -exec; use grep -l, which stops on first match;
combine sort | uniq into sort -u; escape dot in sed r.e. [cosmetic only, not
necessary for correctness]; add perl to the pipeline via xargs).

/be
Comment on attachment 127136 [details] [diff] [review]
Patch for the various ::-moz-tree-* pseudos

hyatt says this is good with him; patch checked in.
Attachment #127136 - Attachment is obsolete: true
Attachment #127137 - Flags: superreview?(dbaron)
Attachment #127137 - Flags: superreview+
Attachment #127137 - Flags: review?(dbaron)
Attachment #127137 - Flags: review+
Attachment #127138 - Flags: superreview?(dbaron)
Attachment #127138 - Flags: superreview+
Attachment #127138 - Flags: review?(dbaron)
Attachment #127138 - Flags: review+
Attached patch Patch for -moz-tree for browser/ (obsolete) — Splinter Review
Attached patch Patch for -moz-tree for mail/ (obsolete) — Splinter Review
Attachment #127197 - Flags: superreview?(dbaron)
Attachment #127197 - Flags: review?(dbaron)
Attachment #127198 - Flags: superreview?(dbaron)
Attachment #127198 - Flags: review?(dbaron)
Attachment #127197 - Flags: superreview?(dbaron)
Attachment #127197 - Flags: superreview+
Attachment #127197 - Flags: review?(dbaron)
Attachment #127197 - Flags: review+
Attachment #127198 - Flags: superreview?(dbaron)
Attachment #127198 - Flags: superreview+
Attachment #127198 - Flags: review?(dbaron)
Attachment #127198 - Flags: review+
Attachment #127197 - Attachment is obsolete: true
Attachment #127138 - Attachment is obsolete: true
Attachment #127137 - Attachment is obsolete: true
Checked in the patches, except the mail/ one.  mscott, could you land that, please?
Boris thanks for making a mozilla/mail patch for this. I just checked it in. 
Attachment #127198 - Attachment is obsolete: true
I'll probably check this in near the end of 1.5b
Attachment #127207 - Flags: superreview?(dbaron)
Attachment #127207 - Flags: review?(dbaron)
Attachment #127207 - Flags: superreview?(dbaron)
Attachment #127207 - Flags: superreview+
Attachment #127207 - Flags: review?(dbaron)
Attachment #127207 - Flags: review+
Summary: [FIX]Should use '::' for anonymous boxes and other -moz pseudo-elements → [FIXr]Should use '::' for anonymous boxes and other -moz pseudo-elements
Asa suggested I do this, and it's a good idea.
Attachment #128247 - Flags: superreview?(dbaron)
Attachment #128247 - Flags: review?(dbaron)
Comment on attachment 128247 [details] [diff] [review]
Also bump skinversion

Once you land this, make sure you got all of them by checking:
 * LXR
 * your generated chrome.rdf in your chrome/ directory.

Also, these should probably land a bit before the end of 1.5b so we have time
to catch any regressions (e.g., from people landing code they had tested
against older trees, things you missed, etc.).

Have you checked toolkit/, browser/, and mail/ ?  If you haven't, please do...
Attachment #128247 - Flags: superreview?(dbaron)
Attachment #128247 - Flags: superreview+
Attachment #128247 - Flags: review?(dbaron)
Attachment #128247 - Flags: review+
Doh.  I did miss those...  

I guess I'll land this coming Friday or so and that will give me a few days to
sort out issues that may arise before I disappear...
Attachment #128268 - Flags: superreview?(dbaron)
Attachment #128268 - Flags: review?(dbaron)
Attachment #128267 - Flags: superreview?(dbaron)
Attachment #128267 - Flags: review?(dbaron)
Attachment #128267 - Flags: superreview?(dbaron)
Attachment #128267 - Flags: superreview+
Attachment #128267 - Flags: review?(dbaron)
Attachment #128267 - Flags: review+
Attachment #128268 - Flags: superreview?(dbaron)
Attachment #128268 - Flags: superreview+
Attachment #128268 - Flags: review?(dbaron)
Attachment #128268 - Flags: review+
Checked in all but the mail/ patches today (I don't have permissions for mail/,
but I dropped mscott an e-mail asking him to check in that part).
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
For the record, chatzilla needs to work on *all* versions of mozilla, not just
the latest.  Please keep this in mind when making chatzilla changes in the
future.  I fixed this on the trunk by adding back the ":" versions of these
selectors.  Combining the old and new rules with a comma didn't seem to work,
either, I had to make two distinct rules.

This works on all versions:

treechildren:-moz-tree-image(voice-true) {
    list-style-image: url(chrome://chatzilla/skin/images/is-voice.png);
}

treechildren::-moz-tree-image(voice-true) {
    list-style-image: url(chrome://chatzilla/skin/images/is-voice.png);
}


This didn't...

treechildren:-moz-tree-image(voice-true),
treechildren::-moz-tree-image(voice-true) {
    list-style-image: url(chrome://chatzilla/skin/images/is-voice.png);
}
> Combining the old and new rules with a comma didn't seem to work

That's correct.  If any selector in a comma-separated list is not recognized, 
the whole rule must be dropped, per spec.
"For the record, chatzilla needs to work on *all* versions of mozilla, not just
the latest."

Eh, but the skin number also changed, did I miss anything?
Sorry for this noise but is mozilla's skin number check a strict/exact match?

For example, when I use 1.6 (or higher) as version number in my skin, and use
mozilla 1.5b, does that allow mozilla to startup without errors and to accept
the skin as valid? 

I have no clue as to where I should look for this kind of info (:
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: