ngeorga / flying-saucer

Automatically exported from code.google.com/p/flying-saucer
0 stars 0 forks source link

CSS lang pseudo-class is not honored #131

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Flying Saucer, when generating PDF files, does not honor the lang pseudo-class.

Given the following html snippet, Flying Saucer only displays the font color as 
blue. It should be displayed as red.

Example:
...
<meta http-equiv="Content-Language" content="ja-JP" />
<style type="text/css">
body {
  font-family: sans-serif;
  color: blue;
}
body:lang(en-US) {
  color: green;
}
body:lang(ja-JP) {
  color: red;
}
</style>
...

Original issue reported on code.google.com by loe...@gmail.com on 23 Mar 2011 at 3:17

GoogleCodeExporter commented 8 years ago
The :lang pseudo-class is already parsed by CSSParser and added to the internal 
selector representation.  The language to use for a particular element is 
determined by the NamespaceHandler (NamespaceHandler#getLang(element).  
Currently the default implementation just consults the lang attribute on the 
element itself.

The NamespaceHandler implementation to use can be customized by the user so 
improving this wouldn't require any changes to FS proper.  Improvements here 
that can be incorporated back into the default implementation would definitely 
be appreciated though.

Original comment by Peter.Br...@gmail.com on 24 Mar 2011 at 12:47

GoogleCodeExporter commented 8 years ago
To those with the same issue. A patch has been supplied and I believe been 
merged into the stream. 

Original comment by loe...@gmail.com on 18 May 2012 at 4:59