![]() |
#1 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 368
Karma: 1000000
Join Date: Mar 2016
Device: none
|
CSS validation uses wrong validator?
The 'Validate Stylesheets With W3C' option under 'Tools' gave me repeated errors. But this was because it was validating against CSS 2.1 instead of CSS 3.
When I manually checked for myself by uploading the CSS file I got no errors, because it validated against CSS 3. I'm not sure why when the CSS is uploaded by Sigil it is being checked against CSS 2.1 and not 3. |
![]() |
![]() |
![]() |
#2 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 368
Karma: 1000000
Join Date: Mar 2016
Device: none
|
I've since discovered this thread:
https://www.mobileread.com/forums/sho...d.php?t=206894 Seems the problem has been around for a long time. I wasn't aware that CSS 2.1 was supposedly 'closer' to the epub 2 standard than CSS 3. That seems crazy, but then I'm new to epub (but not to CSS). Does the epub standard specify a specific level of CSS? I was using CSS like font-family and font-style and font-weight on websites an aeon ago, so it is interesting to see that CSS 2.1 regards these as errors. But I can't believe that epub doesn't like them. Clearly Sigil needs to specify CSS 3 or have it unspecified. Why was CSS 2.1 specified at all, when these things aren't even an error in CSS 2.0? |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,542
Karma: 204127028
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Been an argument going on for a long time, but the short of it is: EPUB2 CSS validation in Sigil is probably going to continue to specify CSS 2.1 for the time being. Because yes ... CSS 2.1 is a much, much, much closer match for what EPUB2 allows than CSS 3 is. There's scads and scads of CSS 3 stuff that can't be used in an EPUB2 compared to the handful of things that are allowed in EPUB2 that CSS 2.1 balks at.
Having said that, however, this reminds me that we need to find a way to allow EPUB3s to specify CSS 3 when validating CSS Last edited by DiapDealer; 03-14-2016 at 08:05 PM. |
![]() |
![]() |
![]() |
#4 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 368
Karma: 1000000
Join Date: Mar 2016
Device: none
|
I can understand that some of the more fancy CSS 3.0 would want to be ruled out, but the font rules are not fancy stuff, and are allowed in CSS 2.0. I'm not really sure what the difference is between CSS 2.0 and 2.1, but am curious what it is about CSS 2.1 that is closer to EPUB 2 than say CSS 2.0.
Is there a specific list somewhere of the CSS that EPUB 2 allows? Or is it the old problem of different readers having different ideas, the re-run of the old Internet Explorer problem. Incidentally, does the epub validator check CSS compatibility? http://validator.idpf.org/ |
![]() |
![]() |
![]() |
#5 | |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,732
Karma: 5703586
Join Date: Nov 2009
Device: many
|
Quote:
KevinH |
|
![]() |
![]() |
Advert | |
|
![]() |
#6 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,542
Karma: 204127028
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
A user selectable setting for EPUB2 and EPUB3 that can be passed as an argument to the form submitted in ResourceObjects/CSSResource.cpp. It may even be something I'm capable of doing! ![]() |
|
![]() |
![]() |
![]() |
#7 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,732
Karma: 5703586
Join Date: Nov 2009
Device: many
|
Sounds good to me. We can add it to the preference page (CleanSource or General) since I think both have room.
|
![]() |
![]() |
![]() |
#8 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 368
Karma: 1000000
Join Date: Mar 2016
Device: none
|
If you can build that in, then why not have the ability to select validation against CSS 2.1 or CSS 3 irrespective of whether it is EPUB 2 or EPUB 3, because, frankly, even if working on EPUB 2 I still want to test against CSS 3 and if I can't do it automatically in Sigil I'll just have to do it manually outside. Making this a preference would be far more useful, since validation against CSS 2.1 isn't much use if valid styles that work in epubs are being reported as errors. So basically I have to trust myself not to use any style that won't work, which I'll see in testing anyway. All I want to know from the validator is that my CSS file itself is correctly formed and doesn't contain errors as a CSS file, no matter whether I'm using EPUB 2 or 3. This is the proper use of a CSS validator.
Last edited by bookman156; 03-15-2016 at 02:26 AM. |
![]() |
![]() |
![]() |
#9 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
Quote:
|
|
![]() |
![]() |
![]() |
#10 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 368
Karma: 1000000
Join Date: Mar 2016
Device: none
|
In fact, having the ability to choose CSS model for validation seems far more useful than choosing EPUB 2 or 3, since the correlation between EPUB and CSS is obviously currently inexact. Having CSS version as a selector in the drop-down menu also means I could easily validate against both CSS 2.1 and 3.
|
![]() |
![]() |
![]() |
#11 | |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 368
Karma: 1000000
Join Date: Mar 2016
Device: none
|
Quote:
This underscores that CSS validation should be about whether the CSS file is syntactically correct, not about whether epubs do or do not support various cherry-picked parts of the CSS specification. If I use CSS that is too advanced for epub, I'll soon find out, but if I have missed off a semi-colon from my CSS or not enclosed a font-name in quote-marks I'd rather just discover that than try to second-guess which CSS spec best suits EPUB 2 or 3, when it is essentially a bit of a guessing game when perfectly good CSS for some reason doesn't make it in CSS 2.1 yet is given the thumbs up in the document you have linked to. Last edited by bookman156; 03-15-2016 at 02:58 AM. |
|
![]() |
![]() |
![]() |
#12 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 368
Karma: 1000000
Join Date: Mar 2016
Device: none
|
From: http://www.idpf.org/epub/30/spec/epub30-changes.html
I note it says: "EPUB 3 defines a profile of CSS based on CSS 2.1 with added modules from CSS3, whereas EPUB 2 was based on a specific subset of CSS 2." So I'm not sure where this idea that EPUB 2 is based on CSS 2.1 comes from, when it says there that it is based on a portion of CSS 2. |
![]() |
![]() |
![]() |
#13 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,542
Karma: 204127028
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
Regardless: the user will have a preference setting (in the next version) allowing them to choose which CSS version they wish to validate against. Last edited by DiapDealer; 03-15-2016 at 06:25 AM. |
|
![]() |
![]() |
![]() |
#14 | |
Banned
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 272
Karma: 1224588
Join Date: Sep 2014
Device: Sony PRS 650
|
Quote:
The way its chosen now is closest to RMSDK 2.x and if you wanna sell books working on a lot of different readers its a good way to stick there. |
|
![]() |
![]() |
![]() |
#15 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,732
Karma: 5703586
Join Date: Nov 2009
Device: many
|
For the record ... The current epub 3 spec is version "3.0.1" (not to be confused with the recently proposed epub 3.1 spec that really should have been called epub 4) that basically specifies CSS 3 with some extensions.
The full link to the relevant section regarding stylesheets is provided here: http://www.idpf.org/epub/301/spec/ep...s.html#sec-css As far as I know, no one implements the epub3 epub specific -epub extensions to CSS 3. |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Suggestion] Sigil validator should check missing type="text/css" attribute | quiris | Sigil | 13 | 01-21-2018 02:00 PM |
W3C css Validator problem? | pete6055 | Sigil | 14 | 02-28-2013 09:19 AM |
CSS validation error | kamanza | Sigil | 3 | 12-17-2012 04:40 PM |
CSS validation error | kamanza | Conversion | 11 | 12-12-2012 02:21 AM |
ADE breaks CSS --> CSS Validation: Parse Error / Value Error | dasboeh | ePub | 4 | 12-10-2012 03:25 AM |