Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Implement CSSStyleRule.selectorText. #17538

Merged
merged 1 commit into from Jul 12, 2017
Merged

Conversation

jyc
Copy link
Contributor

@jyc jyc commented Jun 27, 2017

We parse when assigning using the namespaces of the stylesheet. It isn't
clear if the spec says to do that (Firefox doesn't support the setter at
all, Chrome does, Safari doesn't); the spec issue is here:
w3c/csswg-drafts#1511

Also fix ToCss implementation of AttrSelectorOperator to not pad with
spaces, to conform with CSSOM. This means we have to update some unit
tests that expect operators with spaces around them in attribute
selectors to roundtrip.

See the "attribute selector" section of "Serializing Selectors" here:
https://drafts.csswg.org/cssom/#serializing-selectors

CSSStyleRule.selectorText is specified here:
https://drafts.csswg.org/cssom/#dom-cssstylerule-selectortext


I am running this to identify what tests will fail; as the other PRs in the series are merged, I believe the tests that pass will change as well.

  • There are tests for these changes OR
  • These changes do not require tests because _____

This change is Reviewable

@highfive
Copy link

Heads up! This PR modifies the following files:

  • @fitzgen: components/script/dom/cssstyledeclaration.rs, components/script/dom/cssstylerule.rs, components/script/dom/webidls/CSSStyleRule.webidl
  • @KiChjang: components/script/dom/cssstyledeclaration.rs, components/script/dom/cssstylerule.rs, components/script/dom/webidls/CSSStyleRule.webidl

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Jun 27, 2017
@jyc
Copy link
Contributor Author

jyc commented Jun 30, 2017

Oh, the tests are those from #17203 . Will wait for that.

@ferjm ferjm requested review from cbrewster and removed request for cbrewster June 30, 2017 06:56
@jyc jyc force-pushed the selectorText branch 3 times, most recently from 7822dd4 to 42ec33e Compare July 5, 2017 23:19
@jyc
Copy link
Contributor Author

jyc commented Jul 6, 2017

Neat! So I believe that once is this landed we should start seeing changes on results in

agh.. this is hard to organize. Wish GitHub had some way to make Pull Requests composed of Pull Requests.

@jyc jyc changed the title [WIP] Implement CSSStyleRule.selectorText. Implement CSSStyleRule.selectorText. Jul 11, 2017
@jyc
Copy link
Contributor Author

jyc commented Jul 11, 2017

@Manishearth if you could review this when you have time, that would be cool! (then could land the other parts). But I think we were still waiting on the other patch to remove spacing around operators in selectors; I've included those changes so that the checks pass here because it looked like that received a 'r-', but I can remove them easily as well.

@Manishearth
Copy link
Member

Yeah, just include that patch in your PR and fix it up.

@jyc
Copy link
Contributor Author

jyc commented Jul 11, 2017

@Manishearth cool! It is done!

@Manishearth
Copy link
Member

@bors-servo r+

@bors-servo
Copy link
Contributor

📌 Commit 42ec33e has been approved by Manishearth

@bors-servo
Copy link
Contributor

🌲 The tree is currently closed for pull requests below priority 9000, this pull request will be tested once the tree is reopened

@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. labels Jul 11, 2017
@bors-servo
Copy link
Contributor

⌛ Testing commit 42ec33e with merge a9414a2...

bors-servo pushed a commit that referenced this pull request Jul 12, 2017
Implement CSSStyleRule.selectorText.

We parse when assigning using the namespaces of the stylesheet. It isn't
clear if the spec says to do that (Firefox doesn't support the setter at
all, Chrome does, Safari doesn't); the spec issue is here:
w3c/csswg-drafts#1511

Also fix ToCss implementation of AttrSelectorOperator to not pad with
spaces, to conform with CSSOM. This means we have to update some unit
tests that expect operators with spaces around them in attribute
selectors to roundtrip.

See the "attribute selector" section of "Serializing Selectors" here:
https://drafts.csswg.org/cssom/#serializing-selectors

CSSStyleRule.selectorText is specified here:
https://drafts.csswg.org/cssom/#dom-cssstylerule-selectortext

<!-- 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 am running this to identify what tests will fail; as the other PRs in the series are merged, I believe the tests that pass will change as well.

- [ ] 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/17538)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

💔 Test failed - linux-rel-wpt

@highfive highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Jul 12, 2017
@jyc
Copy link
Contributor Author

jyc commented Jul 12, 2017

Aggh! I remember this error from when this was one PR:

{"status": "FAIL", "group": "default", "message": "sheet.cssRules[(sheet.cssRules.length - 1)] is undefined", "stack": "assert_selector_serializes_to@http://web-platform.test:8000/cssom/serialize-namespaced-type-selectors.html:24:17\n@http://web-platform.test:8000/cssom/serialize-namespaced-type-selectors.html:27:17\nTest.prototype.step@http://web-platform.test:8000/resources/testharness.js:1406:20\ntest@http://web-platform.test:8000/resources/testharness.js:497:9\n@http://web-platform.test:8000/cssom/serialize-namespaced-type-selectors.html:26:13\n", "subtest": "Simple type selector", "test": "/cssom/serialize-namespaced-type-selectors.html", "line": 103522, "action": "test_result", "expected": "PASS"}
{"status": "FAIL", "group": "default", "message": "sheet.cssRules[(sheet.cssRules.length - 1)] is undefined", "stack": "assert_selector_serializes_to@http://web-platform.test:8000/cssom/serialize-namespaced-type-selectors.html:24:17\n@http://web-platform.test:8000/cssom/serialize-namespaced-type-selectors.html:219:17\nTest.prototype.step@http://web-platform.test:8000/resources/testharness.js:1406:20\ntest@http://web-platform.test:8000/resources/testharness.js:497:9\n@http://web-platform.test:8000/cssom/serialize-namespaced-type-selectors.html:218:13\n", "subtest": "Type selector with namespace equal to default namespace", "test": "/cssom/serialize-namespaced-type-selectors.html", "line": 103570, "action": "test_result", "expected": "PASS"}

I think that depends on #17501 . The test should actually not be passing right now, seeing as selectorText is unimplemented.

I will update the additional unexpected passes and maybe we can update the expectations to bec orrect for the unexpected fail when it should actually be passing, after merging #17501.

@highfive highfive added S-awaiting-review There is new code that needs to be reviewed. and removed S-tests-failed The changes caused existing tests to fail. labels Jul 12, 2017
@jyc
Copy link
Contributor Author

jyc commented Jul 12, 2017

@bors-servo: try

@bors-servo
Copy link
Contributor

💔 Test failed - mac-rel-css2

@highfive highfive added the S-tests-failed The changes caused existing tests to fail. label Jul 12, 2017
@highfive highfive removed the S-tests-failed The changes caused existing tests to fail. label Jul 12, 2017
@jyc
Copy link
Contributor Author

jyc commented Jul 12, 2017

@bors-servo: try

@bors-servo
Copy link
Contributor

⌛ Trying commit a830021 with merge 2926ff6...

bors-servo pushed a commit that referenced this pull request Jul 12, 2017
Implement CSSStyleRule.selectorText.

We parse when assigning using the namespaces of the stylesheet. It isn't
clear if the spec says to do that (Firefox doesn't support the setter at
all, Chrome does, Safari doesn't); the spec issue is here:
w3c/csswg-drafts#1511

Also fix ToCss implementation of AttrSelectorOperator to not pad with
spaces, to conform with CSSOM. This means we have to update some unit
tests that expect operators with spaces around them in attribute
selectors to roundtrip.

See the "attribute selector" section of "Serializing Selectors" here:
https://drafts.csswg.org/cssom/#serializing-selectors

CSSStyleRule.selectorText is specified here:
https://drafts.csswg.org/cssom/#dom-cssstylerule-selectortext

<!-- 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 am running this to identify what tests will fail; as the other PRs in the series are merged, I believe the tests that pass will change as well.

- [ ] 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/17538)
<!-- Reviewable:end -->
We parse when assigning using the namespaces of the stylesheet. It isn't
clear if the spec says to do that (Firefox doesn't support the setter at
all, Chrome does, Safari doesn't); the spec issue is here:
w3c/csswg-drafts#1511

Also fix ToCss implementation of AttrSelectorOperator to not pad with
spaces, to conform with CSSOM. This means we have to update some unit
tests that expect operators with spaces around them in attribute
selectors to roundtrip.

See the "attribute selector" section of "Serializing Selectors" here:
https://drafts.csswg.org/cssom/#serializing-selectors

CSSStyleRule.selectorText is specified here:
https://drafts.csswg.org/cssom/#dom-cssstylerule-selectortext
@jyc
Copy link
Contributor Author

jyc commented Jul 12, 2017

@bors-servo: try

@bors-servo
Copy link
Contributor

⌛ Trying commit 92ec8f1 with merge a3bbbca...

bors-servo pushed a commit that referenced this pull request Jul 12, 2017
Implement CSSStyleRule.selectorText.

We parse when assigning using the namespaces of the stylesheet. It isn't
clear if the spec says to do that (Firefox doesn't support the setter at
all, Chrome does, Safari doesn't); the spec issue is here:
w3c/csswg-drafts#1511

Also fix ToCss implementation of AttrSelectorOperator to not pad with
spaces, to conform with CSSOM. This means we have to update some unit
tests that expect operators with spaces around them in attribute
selectors to roundtrip.

See the "attribute selector" section of "Serializing Selectors" here:
https://drafts.csswg.org/cssom/#serializing-selectors

CSSStyleRule.selectorText is specified here:
https://drafts.csswg.org/cssom/#dom-cssstylerule-selectortext

<!-- 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 am running this to identify what tests will fail; as the other PRs in the series are merged, I believe the tests that pass will change as well.

- [ ] 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/17538)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

@jyc
Copy link
Contributor Author

jyc commented Jul 12, 2017

@bors-servo r=Manishearth

@bors-servo
Copy link
Contributor

@jyc: 🔑 Insufficient privileges: Not in reviewers

@canova
Copy link
Contributor

canova commented Jul 12, 2017

@bors-servo r=Manishearth

@bors-servo
Copy link
Contributor

📌 Commit 92ec8f1 has been approved by Manishearth

@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. labels Jul 12, 2017
@bors-servo
Copy link
Contributor

⌛ Testing commit 92ec8f1 with merge 4b6e793...

bors-servo pushed a commit that referenced this pull request Jul 12, 2017
Implement CSSStyleRule.selectorText.

We parse when assigning using the namespaces of the stylesheet. It isn't
clear if the spec says to do that (Firefox doesn't support the setter at
all, Chrome does, Safari doesn't); the spec issue is here:
w3c/csswg-drafts#1511

Also fix ToCss implementation of AttrSelectorOperator to not pad with
spaces, to conform with CSSOM. This means we have to update some unit
tests that expect operators with spaces around them in attribute
selectors to roundtrip.

See the "attribute selector" section of "Serializing Selectors" here:
https://drafts.csswg.org/cssom/#serializing-selectors

CSSStyleRule.selectorText is specified here:
https://drafts.csswg.org/cssom/#dom-cssstylerule-selectortext

<!-- 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 am running this to identify what tests will fail; as the other PRs in the series are merged, I believe the tests that pass will change as well.

- [ ] 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/17538)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel-css, linux-rel-wpt, mac-dev-unit, mac-rel-css1, mac-rel-css2, mac-rel-wpt1, mac-rel-wpt2, mac-rel-wpt3, mac-rel-wpt4, windows-msvc-dev
Approved by: Manishearth
Pushing 4b6e793 to master...

@bors-servo bors-servo merged commit 92ec8f1 into servo:master Jul 12, 2017
@highfive highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Jul 12, 2017
jdm pushed a commit to web-platform-tests/wpt that referenced this pull request Oct 6, 2017
We parse when assigning using the namespaces of the stylesheet. It isn't
clear if the spec says to do that (Firefox doesn't support the setter at
all, Chrome does, Safari doesn't); the spec issue is here:
w3c/csswg-drafts#1511

Also fix ToCss implementation of AttrSelectorOperator to not pad with
spaces, to conform with CSSOM. This means we have to update some unit
tests that expect operators with spaces around them in attribute
selectors to roundtrip.

See the "attribute selector" section of "Serializing Selectors" here:
https://drafts.csswg.org/cssom/#serializing-selectors

CSSStyleRule.selectorText is specified here:
https://drafts.csswg.org/cssom/#dom-cssstylerule-selectortext

Upstreamed from servo/servo#17538 [ci skip]
jdm pushed a commit to web-platform-tests/wpt that referenced this pull request Oct 12, 2017
We parse when assigning using the namespaces of the stylesheet. It isn't
clear if the spec says to do that (Firefox doesn't support the setter at
all, Chrome does, Safari doesn't); the spec issue is here:
w3c/csswg-drafts#1511

Also fix ToCss implementation of AttrSelectorOperator to not pad with
spaces, to conform with CSSOM. This means we have to update some unit
tests that expect operators with spaces around them in attribute
selectors to roundtrip.

See the "attribute selector" section of "Serializing Selectors" here:
https://drafts.csswg.org/cssom/#serializing-selectors

CSSStyleRule.selectorText is specified here:
https://drafts.csswg.org/cssom/#dom-cssstylerule-selectortext

Upstreamed from servo/servo#17538 [ci skip]
jakearchibald pushed a commit to jakearchibald/web-platform-tests that referenced this pull request Nov 16, 2017
We parse when assigning using the namespaces of the stylesheet. It isn't
clear if the spec says to do that (Firefox doesn't support the setter at
all, Chrome does, Safari doesn't); the spec issue is here:
w3c/csswg-drafts#1511

Also fix ToCss implementation of AttrSelectorOperator to not pad with
spaces, to conform with CSSOM. This means we have to update some unit
tests that expect operators with spaces around them in attribute
selectors to roundtrip.

See the "attribute selector" section of "Serializing Selectors" here:
https://drafts.csswg.org/cssom/#serializing-selectors

CSSStyleRule.selectorText is specified here:
https://drafts.csswg.org/cssom/#dom-cssstylerule-selectortext

Upstreamed from servo/servo#17538 [ci skip]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Simplify an+b when serializing
5 participants