Open
      
        Bug 876585
      
      
        Opened 12 years ago
          Updated 3 years ago
      
        
    
  
nsCSSScanner::Backup doesn't handle escapes correctly 
    Categories
(Core :: CSS Parsing and Computation, defect)
        Core
          
        
        
      
        
    
        CSS Parsing and Computation
          
        
        
      
        
    Tracking
()
        NEW
        
        
    
  
People
(Reporter: dbaron, Unassigned)
Details
(Keywords: css3)
Attachments
(4 files)
As I pointed out in bug 543151 comment 81 (which I noticed while reviewing bug 750388), nsCSSScanner::Backup behaves incorrectly when it's being used where escapes are involved.  I don't see an obvious fix here.
I haven't yet managed to find a testcase where we incorrectly accept something that we should reject, but it wouldn't surprise me if such a testcase exists.
| Reporter | ||
| Comment 1•12 years ago
           | ||
| Reporter | ||
| Updated•12 years ago
           | 
        Attachment #754678 -
        Attachment description: testcase (post-bug 750388) → testcase (post-bug 876570)
| Reporter | ||
| Comment 2•12 years ago
           | ||
| Comment 3•12 years ago
           | ||
Here's another testcase: Firefox 21 displays alternating green and blue rows, trunk displays all green.  This may be functionally equivalent to attachment 754683 [details] but I'm not sure.
We can fix most of this pretty easily by abandoning the notion of backing up, instead parsing 'b' directly out of the dimension suffix when necessary.  However, when the value of 'b' consists entirely of escaped digits (as in this testcase) I'm not sure whether it's supposed to be accepted.
Assignee: nobody → zackw
| Comment 4•12 years ago
           | ||
Correction: Firefox 20 is the one that displays alternating green and blue rows on attachment 754835 [details].
| Comment 5•12 years ago
           | ||
Here's a patch which attempts to handle an+b without backing up at all.  It's not quite right yet: in particular, :nth-child(n-/**/2) is rejected, contra test_selectors.html's expectations.  Also, ExtractInteger is probably reinventing the wheel.  Still, this should be good enough for am-I-barking-up-the-wrong-tree-entirely reactions.
        Attachment #754861 -
        Flags: feedback?(dbaron)
| Reporter | ||
| Comment 6•12 years ago
           | ||
We might want to wait on this until the current discussion on www-style about an+b syntax finishes up...
| Comment 7•12 years ago
           | ||
(In reply to David Baron [:dbaron] (don't cc:, use needinfo? instead) from comment #6)
> We might want to wait on this until the current discussion on www-style
> about an+b syntax finishes up...
OK, I sent a note to www-style so they know about this wrinkle as well as the other stuff being discussed under that head.
| Updated•12 years ago
           | 
        Attachment #754861 -
        Flags: feedback?(dbaron)
| Updated•3 years ago
           | 
Severity: normal → S3
          You need to log in
          before you can comment on or make changes to this bug.
        
Description
•