See https://w3c-test.org/css/cssom/selectorSerialize.html - a should be omitted if a is 1 or -1.
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/17768ebe63c708c4ae6d2cc68dfda81b3a2b2dda commit 17768ebe63c708c4ae6d2cc68dfda81b3a2b2dda Author: Chris Nardi <cnardi@chromium.org> Date: Mon Mar 05 15:51:45 2018 [cssom] Correct serialization of an+b selectors According to https://drafts.csswg.org/css-syntax/#serializing-anb, if a is 1 or -1 the number should be omitted. We did not follow this, causing us to fail parts of external/wpt/css/cssom/selectorSerialize.html. Change our behavior to match the spec and the test. Bug: 818475 Change-Id: Ie0f44e2a3fb51069aad492096138020b67359982 Reviewed-on: https://chromium-review.googlesource.com/948066 Reviewed-by: Rune Lillesveen <futhark@chromium.org> Commit-Queue: Chris Nardi <cnardi@chromium.org> Cr-Commit-Position: refs/heads/master@{#540827} [modify] https://crrev.com/17768ebe63c708c4ae6d2cc68dfda81b3a2b2dda/third_party/WebKit/LayoutTests/css3/parsing-css3-nthchild-expected.txt [modify] https://crrev.com/17768ebe63c708c4ae6d2cc68dfda81b3a2b2dda/third_party/WebKit/LayoutTests/css3/parsing-css3-nthchild.html [delete] https://crrev.com/6562397ff8ed6ee54bbc5162d14223570b3027e1/third_party/WebKit/LayoutTests/external/wpt/css/cssom/selectorSerialize-expected.txt [modify] https://crrev.com/17768ebe63c708c4ae6d2cc68dfda81b3a2b2dda/third_party/WebKit/LayoutTests/fast/css/parsing-css-nth-child-expected.txt [modify] https://crrev.com/17768ebe63c708c4ae6d2cc68dfda81b3a2b2dda/third_party/WebKit/LayoutTests/fast/css/parsing-css-nth-child.html [modify] https://crrev.com/17768ebe63c708c4ae6d2cc68dfda81b3a2b2dda/third_party/WebKit/LayoutTests/fast/dom/css-selectorText-expected.txt [modify] https://crrev.com/17768ebe63c708c4ae6d2cc68dfda81b3a2b2dda/third_party/WebKit/Source/core/css/CSSSelector.cpp
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/b75f549cf188246bac632090d99ec55516ddc927 commit b75f549cf188246bac632090d99ec55516ddc927 Author: Chris Nardi <cnardi@chromium.org> Date: Thu Mar 08 12:11:39 2018 Upstream CSS selectors tests to WPT Remove already existing duplicate tests, and upstream a unified version of currently existing an + b selector parsing tests. Bug: 818475 Change-Id: Id889175e0d4df27037ee335d23020c213c148b44 Reviewed-on: https://chromium-review.googlesource.com/952078 Reviewed-by: Rune Lillesveen <futhark@chromium.org> Commit-Queue: Chris Nardi <cnardi@chromium.org> Cr-Commit-Position: refs/heads/master@{#541774} [delete] https://crrev.com/d67b93276f6f9b177470c20ea33aa60bca87de9f/third_party/WebKit/LayoutTests/css3/parsing-css3-nthchild-expected.txt [delete] https://crrev.com/d67b93276f6f9b177470c20ea33aa60bca87de9f/third_party/WebKit/LayoutTests/css3/parsing-css3-nthchild.html [add] https://crrev.com/b75f549cf188246bac632090d99ec55516ddc927/third_party/WebKit/LayoutTests/external/wpt/css/selectors/anplusb-selector-parsing.html [delete] https://crrev.com/d67b93276f6f9b177470c20ea33aa60bca87de9f/third_party/WebKit/LayoutTests/fast/css/parsing-css-nth-child-expected.txt [delete] https://crrev.com/d67b93276f6f9b177470c20ea33aa60bca87de9f/third_party/WebKit/LayoutTests/fast/css/parsing-css-nth-child.html [modify] https://crrev.com/b75f549cf188246bac632090d99ec55516ddc927/third_party/WebKit/LayoutTests/fast/dom/css-selectorText-expected.txt [modify] https://crrev.com/b75f549cf188246bac632090d99ec55516ddc927/third_party/WebKit/LayoutTests/fast/dom/css-selectorText.html
Comment 1 by bugdroid1@chromium.org
, Mar 5 2018