01-28-2013, 09:00 AM | #1 | ||
A Hairy Wizard
Posts: 3,093
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
Flightcrew error or bad coding?
Hi,
I've been playing with different ways of inserting images at the beginning of each chapter. Normally I would just insert a <div|p> tag with the appropriate class and an <img> tag. But I was saying to myself: "Self, there has to be a more automatic way of doing this that decreases bloat." I used the :after pseudo selector in my CSS like this: Quote:
The problem is that when I check the ePub with Flightcrew I get an error that my image is not being used: Quote:
I figured since ":after" is implemented in CSS2 that it would be supported and recognized by the current version of Sigil/Flightcrew... Anyone have any ideas - Is this warning something I can safely ignore? |
||
01-28-2013, 09:43 AM | #2 |
Grand Sorcerer
Posts: 27,547
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Not everything implemented in CSS2 is valid in the ePub2 spec... which is what Flightcrew is focused on compliance with. I believe pseudo elements are in one of the dark-gray areas of epub2 compliance... if not downright unsupported.
Last edited by DiapDealer; 01-28-2013 at 09:48 AM. |
Advert | |
|
01-28-2013, 09:57 AM | #3 | |
A Hairy Wizard
Posts: 3,093
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
Really?? No Pseudo Classes?!!? I checked the 2.01 OPS and section 3.1 Selectors says:
Quote:
I could see if a particular device/app didn't fully implement the spec, but I would hope Flightcrew would follow it "exactly"...or at least try to. Maybe I'm reading the spec wrong? |
|
01-28-2013, 10:05 AM | #4 |
Grand Sorcerer
Posts: 27,547
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
I did say I believe… so you very well could be correct.
If so, it could clearly be a gap in Flightcrew's compliance-check. What does the official IDPF ePubchecker have to say about it? |
01-28-2013, 10:10 AM | #5 |
A Hairy Wizard
Posts: 3,093
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
now you gone an dunnit...I'm going to have to actually install it...and remember what jars are.....hasn't anyone developed a nice ePubchecker GUI yet?
|
Advert | |
|
01-28-2013, 10:14 AM | #6 |
Grand Sorcerer
Posts: 27,547
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Just use the online version.
|
01-28-2013, 10:20 AM | #7 | |
Well trained by Cats
Posts: 29,785
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
Even if flightcrew passes... Those pesky manufacturers do it their way Go read the EPUB forum and see all the workarounds (or just plain give-ups) needed |
|
01-28-2013, 11:31 AM | #8 | |
A Hairy Wizard
Posts: 3,093
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
Actually that wasn't too bad. I ended up using elibrarans batch file process and set it up to drag&drop the epub onto it...worked great. The only downside is having to have java installed...with all of its inherent security risks...
The result: Quote:
- It displays fine in Sigil - It displays fine in ePubReader plugin for Firefox - It displays fine in Azardi - It displays fine in Kobo iOS - It displays fine in Stanza iOS - It displays perfectly in Marvin - It compiles in ADE but does NOT display the images - It compiles in Kindle Previewer but does NOT display the images (no warnings) - It does NOT display the images in Nook/Blio/Bluefire/iBooks iOS So...in my very Sherlock-like fashion I deduce that 1) Lots of vendors SUCK - and don't comply with standards! 2) The Pseudo elements/classes MUST be supported - but aren't and the answer to my question 3) Yes, it appears that Flightcrew is giving an error where there should NOT be one...and it is safe to ignore the error (it's legal), but depending on the reader/device the user may or may not enjoy the produce of your hard earned efforts... |
|
01-28-2013, 11:35 AM | #9 | |
Guru
Posts: 696
Karma: 150000
Join Date: Feb 2010
Device: none
|
on a somewhat related topic, I have noticed that Sigil 0.6.2 release validates CSS against CSS level 3, whereas the latest git build validates against 2.1, and as far as I can understand it, the epub 2.0.1 specification is based on CSS 2.0:
Quote:
Just wondering what the rationale is for the choices / changes? Albert (who apologizes for the attempted thread hijack) |
|
01-28-2013, 11:50 AM | #10 |
A Hairy Wizard
Posts: 3,093
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
Hey Albert, I don't mind...it does appear to be related...although I assume that if it is checking against CSS3 then pseudo elements/classes should DEFINITELY be supported.
I'm not sure of the intricacies of Flightcrew...perhaps one of the "brains" around here could enlighten us mere mortals. |
01-28-2013, 03:46 PM | #11 |
Sigil developer
Posts: 1,275
Karma: 1101600
Join Date: Jan 2011
Location: UK
Device: Kindle PW, K4 NT, K3, Kobo Touch
|
CSS 2.1 was chosen for the Validation with W3C simply because I mistakenly thought that was the version used by EPUB 2. I mainly wanted to downgrade from CSS 3 in order to highlight some more obvious errors.
I just tried changing to CSS 2 on the W3C site but get some unexpected and undecipherable error message. So for now at least in the beta it will stay CSS 2.1. But if anyone who knows the spec and the site well can confirm it really should be CSS 2 let me know. It is only meant to be a helpful guide - and as everyone is aware, you still have to check on the actual readers to see what really happens. In addition to FlightCrew picking up on "content" as the OP noted, I've noticed it also correctly picks up on 'background-image' not being valid. I've added an extra check in the Delete Unused Images / Files tool to check the CSS for references to images in that attribute (and 'background') - even though its not valid EPUB 2 its better to not delete it than to delete it. |
01-28-2013, 05:49 PM | #12 |
Wizard
Posts: 1,071
Karma: 412718
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: Kindle Paperwhite
|
Is there any reason why ADE would not show the :after jpg?
I made very simple epub in Sigil with a jpg and Sigil has no problems displaying it in BV. I get the FlightCrew warning, but I was expecting that. Saving it and using ADE does not display the :after image, just the text. Paul |
01-28-2013, 06:24 PM | #13 |
A Hairy Wizard
Posts: 3,093
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
The only reason I can think of is that they did not feel it important enough to implement pseudo classes?? Or, more likely, they had already developed their own software to the point where changing it would cost too much, so they decided to continue as they were. Hopefully they will decide to become fully compliant in the (near) future...
If you are creating this ePub for yourself you can just use one of the better devices/apps to display...but if you are making it for others it is probably better to just put the <img> tag within the html document to make sure it gets displayed. Last edited by Turtle91; 01-28-2013 at 06:26 PM. |
01-28-2013, 09:42 PM | #14 |
Wizard
Posts: 1,071
Karma: 412718
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: Kindle Paperwhite
|
@Turtle91 -- Just for me, but it would have been nice to automatically get separators using :after. I was hoping I could added a gif or jpg as a fancy (and easy to see) heading marker
Both Calibre and Sigil display the epub properly, but ADE and my Kindle (after conversion) don't seem to to honor the :after, or the others I tried Code:
h3 { text-align:center; display:block; margin:0 auto; } h3:after { text-align:center; display:block; margin:0 auto; content:url("../Images/130px-Pointy-Haired_Boss.jpg"); } h3:first-letter { font-size: 4em; } h3:first-line { color:blue; } Thanks Paul Last edited by phossler; 01-28-2013 at 09:45 PM. |
01-29-2013, 03:42 AM | #15 | |
frumious Bandersnatch
Posts: 7,515
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Quote:
This specification defines a style language based on CSS 2. (Note that the CSS 2.1 specification is currently still at "Working Draft" status.) [...] A conforming Reading System must render all OPS CSS 2.0 required subset properties. A Reading System may support CSS properties beyond the OPS CSS 2.0 required subset, however, any unsupported properties must be gracefully degraded per the CSS 2.0 specification. Regarding the syntax, I don't think there's any difference between standard CSS and ePub-flavoured one, but as for the supported properties and values there are some important changes/limitations. |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Do Inadequate Writing Skills Engender Bad Coding? | Prestidigitweeze | News | 81 | 11-30-2012 01:24 PM |
error: bad character in group name? | theleftymop | Calibre | 3 | 04-28-2012 02:31 PM |
bad database error in linux mint 10 after reinstall | gbowlds | Calibre | 2 | 10-14-2011 12:57 AM |
Flightcrew validation error | Jellby | Sigil | 6 | 09-01-2011 08:20 AM |
Getting Bad Database Error | oak | Calibre | 4 | 04-06-2010 07:10 AM |