Bug 169629

Summary: Nested @media rules should be parsed as an error
Product: [Applications] konqueror Reporter: Gérard Talbot (no longer involved) <browserbugs2>
Component: khtmlAssignee: Konqueror Developers <konq-bugs>
Status: VERIFIED FIXED    
Severity: normal CC: germain
Priority: NOR    
Version: 4.1.0   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed In:
Attachments: patch

Description Gérard Talbot (no longer involved) 2008-08-23 00:38:28 UTC
Version:            (using KDE 4.1.0)
Compiler:          cc 
OS:                Linux
Installed from:    Ubuntu Packages

Bug entry:
http://www.gtalbot.org/BrowserBugsSection/MSIE7Bugs/#bug83

Screenshot (actual results):

http://browsershots.org/http://www.gtalbot.org/BrowserBugsSection/MSIE7Bugs/NestedMediaRules.html

http://browsershots.org/screenshots/d18196d33b39680029cf31ff8957cece/

http://api.browsershots.org/png/original/d1/d18196d33b39680029cf31ff8957cece.png

Testcase:
http://www.gtalbot.org/BrowserBugsSection/MSIE7Bugs/NestedMediaRules.html

Code explanation:

  @media all
  {
  p {background-color: white; color: green;}
  @media screen
    {
    p {background-color: white; color: red;}
    }
  }

  <p>This should be green.</p>

should be parsed as an error. The CSS validator will report such parsing error and will give

@media all  {
p {
background-color : white;
color : green;
}
} 

as resulting valid CSS information.

Konqueror does not parse correctly as the tested <p> is not green.

Regards, Gérard
Comment 1 Gérard Talbot (no longer involved) 2008-08-23 00:53:26 UTC
See also
https://bugs.webkit.org/show_bug.cgi?id=16013
Comment 2 Germain Garand 2008-08-29 16:32:21 UTC
Created attachment 27126 [details]
patch
Comment 3 Germain Garand 2008-08-31 17:10:34 UTC
SVN commit 855321 by ggarand:

do proper error handling inside @media blocks

BUG: 169629


 M  +490 -475  parser.cpp  
 M  +9 -1      parser.y  
Comment 4 Gérard Talbot (no longer involved) 2008-12-06 20:38:55 UTC
The testcase is passed with Konqueror 4.1.2

Marking as VERIFIED