-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CSS selector failures from our test suite #176
Comments
You didn't tell how many work (%, nb?), so all that red..., mhhpf :) I guess the only serious one is that Some are quite twisted and related to parsing (
The last ones involve more than 2 rules ( |
Most of 'em work, not counting stuff that isn't implemented at all. I didn't tally but I'm sure there's 30+ out of 65 that work. ;-) I don't really know why the test suite is an incomplete copy containing these specific files anyway. Btw, if you don't mention the test identifiers it's really hard to know what we're talking about, so I'm not directly referring to any tests here but just to the selectors mentioned.
Yes, and the point is that only the invalid selector should be dropped rather than the whole statement.
It should be nothing. It's an invalid selector that should fail to match anything.
It's very old: https://www.w3.org/TR/CSS1/#background-color |
css3-modsel-156.epub seems to expect the whole statement should be dropped. crengine does what you say.
css3-modsel-15b.epub seems to expect |
Then obviously I'm wrong, though for my own piece of mind mostly because I misinterpreted what you were saying. :-) I thought you were mentioning them because they went against what one would expect, so I thought "if the entire statement That being said, |
Okay, so as half expected it's not stupid per se, but not something we should care too much about: https://www.w3.org/TR/CSS21/selector.html#id-selectors
|
Should that match (another thing that should be case insensitive but is currently not) ?
This works as expected:
|
I was wrong, it seems to support more:
I'll add
|
There's some mismatched tag stuff going on in your HTML there btw. The parsed DOM may be different than you were going for, although since you're not testing Edit: d'oh, accidentally removed this:
Should not in EPUB/XHTML (case sensitive), should in HTML. |
Should be soon fixed: css3-modsel-86 and css3-modsel-88 looked like they should work, but I understand now the test (that includes Nondeterministic in their description...): the check could and should take multiple paths to find a match. The current code takes only one direct path. |
Wow, I was really just documenting this for some value of later. :-) I wonder if there's an easy way to unit test against regressions in this area. Something like an md5sum of the rendered bitmap, perhaps. |
Then everytime we fix something else that shifts a pixel, or update freetype, we'll have to remake screenshots to get new md5sum... No thanks :) |
That particular example (known FT/CSS change) could probably be easily automated, but sure. Just brainstorming. It looks like Mozilla uses something they call reftests. The principle is pretty simple. You have the actual unit test and a fake simpler page that simply sets the background to green without fancy selectors. Combine it with a couple of failsafes for the simple tests (e.g., this is what a green background looks like) and you've got yourself a testsuite that Just Works™ without that issue. Maybe I'll set up some test scaffolding in base. Ideally it'd be here but for the moment I'm not sure if I see a sensible way of doing that. (Without putting in hours.) |
css3-modsel-43b, 44b with --- a/crengine/src/lvstsheet.cpp
+++ b/crengine/src/lvstsheet.cpp
@@ -687,6 +687,13 @@ bool parse_color_value( const char * & str, css_length_t & value )
return true;
}
}
+ if ( substr_icompare( "transparent", str ) ) {
+ // Make it an invalid color, but a valid parsing so it
+ // can be inherited or flagged with !important
+ value.type = css_val_unspecified;
+ value.value = 0;
+ return true;
+ }
return false;
}
|
Oh, it's as simple as not supporting transparent? Yes, please add that. :-) |
Going through some of these quickly because at least some of these should fall in easy to fix territory. Ignoring XML namespaces which are unsupported and probably not very important to us.
tl;dr The recent improvements greatly reduced the previously disturbingly large failure rate. Fantastic work!
css3-modsel-15.epub [fixed]
css3-modsel-155d.epub
css3-modsel-156.epub [fixed]
css3-modsel-15b.epub [fixed]
css3-modsel-170d.epub [fixed]
I don't think
:first-child
is supported atm. If it is, all the test involving it (including much more basic ones) seem to be failing. ;-) Same for:first-line
,::first-letter
and the whole family.css3-modsel-175c.epub
css3-modsel-22.epub
css3-modsel-4 [fixed]
@poire-z Might be relatively easy to fix this one?
css3-modsel-43b, 44b [fixed]
@poire-z Hm,
!important
is complicated. :-Pcss3-modsel-45 [fixed]
css3-modsel-86 [fixed]
css3-modsel-88 [fixed]
The text was updated successfully, but these errors were encountered: