Skip to content
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

"nth-child" CSS selector broken on CentOS #1441

Closed
hakimio opened this issue Apr 28, 2017 · 8 comments
Closed

"nth-child" CSS selector broken on CentOS #1441

hakimio opened this issue Apr 28, 2017 · 8 comments
Milestone

Comments

@hakimio
Copy link

hakimio commented Apr 28, 2017

Following two CSS rules produce different results on CentOS even they work exactly the same on Windows. "nth-child" applies the specified background to the whole table while "nth-of-type" correctly applies the background to "even" rows.

<style>
.dataTable tr:nth-child(even) {
        background-color: #F9F9F9;
    }
</style>
<style>
.dataTable tr:nth-of-type(even) {
        background-color: #F9F9F9;
    }
</style>
<table class="dataTable">
<tr><td>a</td></tr>
<tr><td>b</td></tr>
<tr><td>c</td></tr>
<tr><td>d</td></tr>
</table>

Could it be because CentOS uses old version of libxml?

EDIT: Extra info:
PHP: 7.1.4 (from Remi RPM repository)
CentOS: centos-release-7-3.1611.el7.centos.x86_64 (CentOS 7 on MS Azure)

@hakimio
Copy link
Author

hakimio commented Apr 28, 2017

Must be a CentOS 7 issue. The sh#tty distro still uses libxml 2.9.1 which has a major bug. More info:
http://stackoverflow.com/questions/39899632/same-xpath-returns-different-values-on-centos-ubuntu/39956501#39956501

@hakimio
Copy link
Author

hakimio commented Apr 28, 2017

We'll just say it's CentOS bug.

@hakimio hakimio closed this as completed Apr 28, 2017
@bsweeney
Copy link
Member

Thank ... goodness (?). But that's a bummer.

@bsweeney
Copy link
Member

This would be good for a "known issues" document. Re-opening until I have a chance to work through documentation updates related to the 0.8.0 release.

@bsweeney bsweeney reopened this May 13, 2017
@bsweeney bsweeney added this to the 0.8.0 milestone May 13, 2017
@T0miii
Copy link

T0miii commented Oct 3, 2018

is there a wokaround for this?

@hakimio
Copy link
Author

hakimio commented Oct 3, 2018

@T0miii Either use "nth-of-type" instead of "nth-child" or switch to another linux distro. CentOS 7.5 still uses buggy version of libxml2.

@T0miii
Copy link

T0miii commented Oct 3, 2018

@hakimio nth-of-type helped, thx a lot. We are planing to switch to ubuntu early next year.

@bsweeney
Copy link
Member

bsweeney commented Oct 4, 2018

Started a wiki page for known compatibility issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants