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

HtmlUnitDriver does not evaluate CSS3 pseudo class :target correctly #46

Closed
lklonowski opened this Issue Mar 17, 2017 · 1 comment

Comments

2 participants
@lklonowski

lklonowski commented Mar 17, 2017

When accessing a website with an anchor, CSS styles for a matching :target do not apply as expected.

Minimal test site:

<!DOCTYPE html>
<html>
<head>
<style>
.tab div {
    display: none;
}

.tab div:target {
    display: block;
}
</style>
</head>
<body>
<div class="tab">
<a id="link" href="#anchor">Link</a>   
<div id="anchor">
  <p>Content</p>
</div>
</div>
</body>
</html>

Minimal Java test code:

getWebDriver().get(TEST_URL);
getWebDriver().findElement(By.id("link")).click();
System.out.println(getWebDriver().findElement(By.id("anchor")).isDisplayed());
getWebDriver().get(TEST_URL + "#anchor");
System.out.println(getWebDriver().findElement(By.id("anchor")).isDisplayed());

Result:
Both times 'false' ist printed.

@asashour asashour self-assigned this Mar 17, 2017

@asashour asashour added the bug label Mar 17, 2017

@asashour asashour added this to In Progress in HtmlUnit Mar 17, 2017

@asashour asashour added this to the 2.26 milestone Mar 17, 2017

@asashour

This comment has been minimized.

Show comment
Hide comment
@asashour

asashour Mar 17, 2017

Collaborator

Thanks for reporting, fixed in HtmlUnit.

Collaborator

asashour commented Mar 17, 2017

Thanks for reporting, fixed in HtmlUnit.

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