Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

pseudo-class CHECKED and general sibling ~ combinator #186

Open
Xiirs opened this issue Mar 25, 2018 · 4 comments
Open

pseudo-class CHECKED and general sibling ~ combinator #186

Xiirs opened this issue Mar 25, 2018 · 4 comments

Comments

@Xiirs
Copy link

Xiirs commented Mar 25, 2018

Hi,
can you implemented pseudo-class checked? I think it could be like that:

private static class CheckedCondition extends Condition {
		CheckedCondition() {
		}
		@Override
		boolean matches(Object e, AttributeResolver attRes, TreeResolver treeRes) {
			String result = attRes.getAttributeValue(e, "checked");
			return result != null;
		}
	}

But I really dont know how implemented general sibling combinator (~ tilde)...

@danfickle
Copy link
Owner

Hi @Xiirs

Thanks for the code, but I'm a little bit wary of implementing :checked as it implies that it will change on the value of the checkbox being selected. It is also the same as the attribute-exists condition:
input[checked]

As for the general sibling combinator, I agree it would be highly desirable. I have to re-generate the lexer to incorporate the ~ token, so can you think of any other CSS changes that are desirable that could be done at the same time?

@Xiirs
Copy link
Author

Xiirs commented Mar 29, 2018

@danfickle
Copy link
Owner

Are you aware of the -fs-checkbox-style property?

Adding completely custom checkbox appearances would be difficult (but not impossible) and are overridden in many PDF viewers any way I believe.

@Xiirs
Copy link
Author

Xiirs commented Mar 29, 2018

Yeah I do. But you wanted to a example for ~ .

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants