Auto merge of #17537 - jyc:default-namespace-serialization, r=emilio

Some fixes to selector serialization re: namespaces and universal selector

- Fix eliding default namespace when serializing
- Fix shortest serialization property when namespace prefix is `*|` and there is no default namespace
- Omit universal selector when serializing to match `cssom/serialize-namespaced-type-selectors` (again so we get the shortest serialization)

<!-- Please describe your changes on the following line: -->

---
<!-- 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 is part of a series to fix #17182

<!-- Either: -->

I'd like to land #17501 first, because it allows some tests for this to work.

- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- 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/17537)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-07-17 16:26:37 -07:00 committed by GitHub
commit 97023f18f3
3 changed files with 171 additions and 196 deletions

View file

@ -1,89 +0,0 @@
[serialize-namespaced-type-selectors.html]
type: testharness
[Type selector with any namespace]
expected: FAIL
[Universal selector in any namespace]
expected: FAIL
[Type selector with any namespace followed by class]
expected: FAIL
[Type selector with any namespace followed by id]
expected: FAIL
[Type selector with any namespace followed by pseudo class]
expected: FAIL
[Type selector with any namespace followed by pseudo element]
expected: FAIL
[Type selector with any namespace followed by attribute selector]
expected: FAIL
[Universal selector followed by class]
expected: FAIL
[Universal selector followed by id]
expected: FAIL
[Universal selector followed by pseudo class]
expected: FAIL
[Universal selector followed by pseudo element]
expected: FAIL
[Universal selector followed by attribute selector]
expected: FAIL
[Universal selector in any namespace followed by class]
expected: FAIL
[Universal selector in any namespace followed by id]
expected: FAIL
[Universal selector in any namespace followed by pseudo class]
expected: FAIL
[Universal selector in any namespace followed by pseudo element]
expected: FAIL
[Universal selector in any namespace followed by attribute selector]
expected: FAIL
[Type selector with namespace equal to default namespace]
expected: FAIL
[Universal selector with namespace equal to default namespace]
expected: FAIL
[Type selector with namespace equal to default namespace followed by class]
expected: FAIL
[Type selector with namespace equal to default namespace followed by id]
expected: FAIL
[Type selector with namespace equal to default namespace followed by pseudo class]
expected: FAIL
[Type selector with namespace equal to default namespace followed by pseudo element]
expected: FAIL
[Type selector with namespace equal to default namespace followed by attribute selector]
expected: FAIL
[Universal selector with namespace equal to default namespace followed by class]
expected: FAIL
[Universal selector with namespace equal to default namespace followed by id]
expected: FAIL
[Universal selector with namespace equal to default namespace followed by pseudo class]
expected: FAIL
[Universal selector with namespace equal to default namespace followed by pseudo element]
expected: FAIL
[Universal selector with namespace equal to default namespace followed by attribute selector]
expected: FAIL