sdglhm / dompdf

Automatically exported from code.google.com/p/dompdf
0 stars 0 forks source link

CSS media type @media print,screen is not accepted #375

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Put @media print,screen { ... } into CSS file
2. CSS is not included
3. @media screen { } is working OK

What is the expected output? What do you see instead?
List of medias must be accepted

What version of the product are you using? On what operating system?
0.6.0 beta2

Original issue reported on code.google.com by indrek.k...@gmail.com on 31 Oct 2011 at 2:31

GoogleCodeExporter commented 9 years ago

Original comment by eclecticgeek on 2 Nov 2011 at 2:35

GoogleCodeExporter commented 9 years ago

Original comment by eclecticgeek on 2 Nov 2011 at 2:36

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r452.

Original comment by fabien.menager on 14 Jan 2012 at 3:05

GoogleCodeExporter commented 9 years ago
Beat me to it! I had a solution sitting on my server, but hadn't tested it 
fully yet. For reference:

case "media":
  $acceptedmedia = self::$ACCEPTED_GENERIC_MEDIA_TYPES;
  if ( defined("DOMPDF_DEFAULT_MEDIA_TYPE") ) {
    $acceptedmedia[] = DOMPDF_DEFAULT_MEDIA_TYPE;
  } else {
    $acceptedmedia[] = self::$ACCEPTED_DEFAULT_MEDIA_TYPE;
  }
  $specifiedmedia = explode(',', $match[3]);
  foreach ($specifiedmedia as $media) {
    if ( in_array(mb_strtolower(trim($media)), $acceptedmedia ) ) {
      $this->_parse_sections($match[5]);
      break;
    }
  }
  break;

Original comment by eclecticgeek on 15 Jan 2012 at 2:51

GoogleCodeExporter commented 9 years ago
Hehe :)
Do you think it would be worth supporting @media features ?
http://www.w3.org/TR/css3-mediaqueries/#media1

Original comment by fabien.menager on 15 Jan 2012 at 11:01

GoogleCodeExporter commented 9 years ago
Certainly! The technique has really taken off lately. Plus the media queries 
seem like they shouldn't be too difficult to implement.

Original comment by eclecticgeek on 16 Jan 2012 at 12:48

GoogleCodeExporter commented 9 years ago

Original comment by eclecticgeek on 30 May 2013 at 5:16