Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upImplement extended filtering for language matching #15746
Comments
|
Do you think this is an |
|
Could be! |
|
Hi! If you have any questions regarding this issue, feel free to make a comment here, or ask it in the If you intend to work on this issue, then add |
|
It is https://drafts.csswg.org/selectors/#the-lang-pseudo (currently at "Level 4") that specified complex BCP 47 matching. An easy intermediate step is to implement Level 3 of the spec: https://drafts.csswg.org/selectors-3/#lang-pseudo
|
|
I would like to give it a shot. This will be my first @highfive: assign me |
|
Hey @sendilkumarn! Thanks for your interest in working on this issue. It's now assigned to you! |
ext. filtering for lang matching <!-- Please describe your changes on the following line: --> This adds the extended algorithm to check the lang. This is my very first encounter with`rust`. Open to learn. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #15746 <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/15797) <!-- Reviewable:end -->
ext. filtering for lang matching <!-- Please describe your changes on the following line: --> This adds the extended algorithm to check the lang. This is my very first encounter with`rust`. Open to learn. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #15746 <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/15797) <!-- Reviewable:end -->
ext. filtering for lang matching <!-- Please describe your changes on the following line: --> This adds the extended algorithm to check the lang. This is my very first encounter with`rust`. Open to learn. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #15746 <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/15797) <!-- Reviewable:end -->
#15464 added support for the lang pseudo-class, but it is using an equality comparison to check the language of the element with the languages specified in
:lang(). We should instead use the algorithm specified here for matching languages.Spec: https://tools.ietf.org/html/rfc4647#section-3.3.2
Files:
components/script/dom/element.rs,components/script/layout_wrapper.rsTests:
tests/wpt/web-platform-tests/dom/nodes/Element-matches.html,tests/wpt/css-tests/selectors-3_dev/,tests/wpt/web-platform-tests/html/dom/elements/global-attributes/(use./mach test-wptwith the appropriate file path to run the tests)