Omit serializing the universal selector when possible.

If omitting the universal selector in the serialization is possible, we
should do it so we obtain a shorter serialization (to match the behavior
asserted in cssom/serialize-namespaced-type-selectors.html).

For example, if someone writes *|*::before and there is no default
namespace, we should serialize to ::before; however, if there is a
default namespace, we should serialize to *|*::before.
(This is the test case "Universal selector in any namespace followed by
pseudo element).

This matches the behavior implemented by WebKit; that one case in
particular isn't implemented by Gecko, but other cases where the
universal selector should be elided are implemented by Gecko but were not
previously by Servo.
This commit is contained in:
Jonathan Chan 2017-07-15 01:12:28 -07:00
parent 989b707623
commit 1301bcdf10
3 changed files with 77 additions and 97 deletions

View file

@ -1,47 +0,0 @@
[serialize-namespaced-type-selectors.htm]
type: testharness
[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
[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