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

Make name content attributes consistently atoms and put them in rare_data for fast access #25572

Merged
merged 1 commit into from Feb 13, 2020

Conversation

@pshaughn
Copy link
Member

pshaughn commented Jan 22, 2020

All codepaths setting the name content attribute now use an atom, which is also stored in rare_data for direct lookup by a get_name method.

Paralleling the get_name method, I added a get_id method, which makes some internal id-lookup cases nicer.

A new test tests for a name setter on every HTML element type. In addition to its overt and upstreamable purpose of checking IDL property reflection semantics, for us this test also hits some Servo assertions that make sure the name is an atom in every case. If the test doesn't crash, even a failed test case still has the attribute as an atom rather than some other type. The failed cases are for elements that we have unimplemented or completely stubbed; I added a few missing name IDL properties to otherwise implemented elements.


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes fix #25570 and make progress on #25057
  • There are tests for these changes
@highfive
Copy link

highfive commented Jan 22, 2020

Heads up! This PR modifies the following files:

  • @asajeffrey: components/script/dom/htmltextareaelement.rs, components/script/dom/htmlcollection.rs, components/script/dom/htmlmetaelement.rs, components/script/dom/htmlselectelement.rs, components/script/dom/webidls/HTMLOutputElement.webidl and 18 more
  • @KiChjang: components/script/dom/htmltextareaelement.rs, components/script/dom/htmlcollection.rs, components/script/dom/htmlmetaelement.rs, components/script/dom/htmlselectelement.rs, components/script/dom/webidls/HTMLOutputElement.webidl and 18 more
@servo-wpt-sync
Copy link
Collaborator

servo-wpt-sync commented Jan 22, 2020

Opened new PR for upstreamable changes.

Completed upstream sync of web-platform-test changes at web-platform-tests/wpt#21332.

@pshaughn
Copy link
Member Author

pshaughn commented Jan 22, 2020

I am sure this will have some idlharness test result changes, and I wouldn't be surprised if filling in the name setter has had other effects.
@bors-servo try=wpt

@bors-servo
Copy link
Contributor

bors-servo commented Jan 22, 2020

Trying commit 8112cea with merge 513b937...

bors-servo added a commit that referenced this pull request Jan 22, 2020
Make name content attributes consistently atoms and put them in rare_data for fast access

<!-- Please describe your changes on the following line: -->
All codepaths setting the name content attribute now use an atom, which is also stored in rare_data for direct lookup by a get_name method.

Paralleling the get_name method, I added a get_id method, which makes some internal id-lookup cases nicer.

A new test tests for a name setter on every HTML element type. In addition to its overt and upstreamable purpose of checking IDL property reflection semantics, for us this test also hits some Servo assertions that make sure the name is an atom in every case. If the test doesn't crash, even a failed test case still has the attribute as an atom rather than some other type. The failed cases are for elements that we have unimplemented or completely stubbed; I added a few missing name IDL properties to otherwise implemented elements.

I also made a _mozilla copy of the working part of an existing but not-working test, as I explain in #25057 (comment)

---
<!-- 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 #25570 and make progress on #25057

<!-- Either: -->
- [X] There are tests for these changes

<!-- 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. -->
@bors-servo
Copy link
Contributor

bors-servo commented Jan 22, 2020

💔 Test failed - status-taskcluster

@pshaughn
Copy link
Member Author

pshaughn commented Jan 22, 2020

That one /css/css-transforms/animation/perspective-interpolation.html crash looks scary. Other new failures are probably because we were only "accidentally" passing before, but of course I'll have to look through them all to be sure.

@pshaughn
Copy link
Member Author

pshaughn commented Jan 22, 2020

Oh, I was reading upwards from the bottom and missed the known-intermittents header, that one test already has an intermittency issue filed for it. Now to look at all the real new failures...

@pshaughn
Copy link
Member Author

pshaughn commented Jan 22, 2020

Once I was reading the right part of the results, it was all new passes and completely consistent with what I changed. I notice the CI test harness does a better job of extracting results from a timed-out test than I get running on the command line; the _mozilla test I added is not actually necessary for CI purposes.

@pshaughn pshaughn force-pushed the pshaughn:atomnames branch from 8112cea to b721b6c Jan 22, 2020
@pshaughn
Copy link
Member Author

pshaughn commented Jan 22, 2020

I believe this is ready to roll out.
@bors-servo try

@servo-wpt-sync
Copy link
Collaborator

servo-wpt-sync commented Jan 22, 2020

Transplanted upstreamable changes to existing PR.

Completed upstream sync of web-platform-test changes at web-platform-tests/wpt#21332.

@bors-servo
Copy link
Contributor

bors-servo commented Jan 22, 2020

Trying commit b721b6c with merge 040cf69...

bors-servo added a commit that referenced this pull request Jan 22, 2020
Make name content attributes consistently atoms and put them in rare_data for fast access

<!-- Please describe your changes on the following line: -->
All codepaths setting the name content attribute now use an atom, which is also stored in rare_data for direct lookup by a get_name method.

Paralleling the get_name method, I added a get_id method, which makes some internal id-lookup cases nicer.

A new test tests for a name setter on every HTML element type. In addition to its overt and upstreamable purpose of checking IDL property reflection semantics, for us this test also hits some Servo assertions that make sure the name is an atom in every case. If the test doesn't crash, even a failed test case still has the attribute as an atom rather than some other type. The failed cases are for elements that we have unimplemented or completely stubbed; I added a few missing name IDL properties to otherwise implemented elements.

I also made a _mozilla copy of the working part of an existing but not-working test, as I explain in #25057 (comment)

---
<!-- 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 #25570 and make progress on #25057

<!-- Either: -->
- [X] There are tests for these changes

<!-- 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. -->
@bors-servo
Copy link
Contributor

bors-servo commented Jan 22, 2020

💔 Test failed - status-taskcluster

@jdm
Copy link
Member

jdm commented Jan 22, 2020

That's #23290.

bors-servo added a commit that referenced this pull request Jan 22, 2020
Add SupportedPropertyNames to Document (also fix iframe getting)

Existing test of named-getting an iframe now succeeds. I added a new test for Object.getOwnPropertyNames(document) based on my understanding of the spec; that test could use a second opinion.

UPDATE: This was trying to do too many things in one PR as originally submitted. It is now using #25572 as a base, and I suggest reviewing that PR before this one to avoid duplicating review effort.

---
<!-- 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 #7273 for all implemented named getters, fix #25146, and fix the iframe case only of #25145.

<!-- Either: -->
- [X] There are tests for these changes

<!-- 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. -->
@jdm
jdm approved these changes Feb 12, 2020
Copy link
Member

jdm left a comment

Thanks for doing this work! I'm impressed by how many places ended up needing to be modified.

components/script/dom/element.rs Show resolved Hide resolved
@jdm
Copy link
Member

jdm commented Feb 13, 2020

This needs a mach fmt.

@pshaughn pshaughn force-pushed the pshaughn:atomnames branch from 52d6661 to 02a3e59 Feb 13, 2020
@servo-wpt-sync
Copy link
Collaborator

servo-wpt-sync commented Feb 13, 2020

Transplanted upstreamable changes to existing PR.

Completed upstream sync of web-platform-test changes at web-platform-tests/wpt#21332.

@jdm
Copy link
Member

jdm commented Feb 13, 2020

@bors-servo
Copy link
Contributor

bors-servo commented Feb 13, 2020

📌 Commit 02a3e59 has been approved by jdm

@bors-servo
Copy link
Contributor

bors-servo commented Feb 13, 2020

Testing commit 02a3e59 with merge 2b2b3ea...

bors-servo added a commit that referenced this pull request Feb 13, 2020
Make name content attributes consistently atoms and put them in rare_data for fast access

<!-- Please describe your changes on the following line: -->
All codepaths setting the name content attribute now use an atom, which is also stored in rare_data for direct lookup by a get_name method.

Paralleling the get_name method, I added a get_id method, which makes some internal id-lookup cases nicer.

A new test tests for a name setter on every HTML element type. In addition to its overt and upstreamable purpose of checking IDL property reflection semantics, for us this test also hits some Servo assertions that make sure the name is an atom in every case. If the test doesn't crash, even a failed test case still has the attribute as an atom rather than some other type. The failed cases are for elements that we have unimplemented or completely stubbed; I added a few missing name IDL properties to otherwise implemented elements.

---
<!-- 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 #25570 and make progress on #25057

<!-- Either: -->
- [X] There are tests for these changes

<!-- 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. -->
@pshaughn
Copy link
Member Author

pshaughn commented Feb 13, 2020

The spec sometimes explicitly excludes the empty-string from being a possible name and sometimes doesn't; there aren't WPT tests on the subject so I don't know what browsers do in various name="" cases, and empty-string handling here might not be great.

@bors-servo
Copy link
Contributor

bors-servo commented Feb 13, 2020

☀️ Test successful - status-taskcluster
Approved by: jdm
Pushing 2b2b3ea to master...

@bors-servo
Copy link
Contributor

bors-servo commented Feb 13, 2020

👀 Test was successful, but fast-forwarding failed: 422 Update is not a fast forward

@pshaughn
Copy link
Member Author

pshaughn commented Feb 13, 2020

I don't know what that means but it sounds like something a rebase might fix.

@pshaughn pshaughn force-pushed the pshaughn:atomnames branch from 02a3e59 to f29e22f Feb 13, 2020
@servo-wpt-sync
Copy link
Collaborator

servo-wpt-sync commented Feb 13, 2020

Transplanted upstreamable changes to existing PR.

Completed upstream sync of web-platform-test changes at web-platform-tests/wpt#21332.

@jdm
Copy link
Member

jdm commented Feb 13, 2020

@bors-servo r+
Yeah, those failures are mysterious :(

@bors-servo
Copy link
Contributor

bors-servo commented Feb 13, 2020

📌 Commit f29e22f has been approved by jdm

@bors-servo
Copy link
Contributor

bors-servo commented Feb 13, 2020

Testing commit f29e22f with merge 9c135f0...

bors-servo added a commit that referenced this pull request Feb 13, 2020
Make name content attributes consistently atoms and put them in rare_data for fast access

<!-- Please describe your changes on the following line: -->
All codepaths setting the name content attribute now use an atom, which is also stored in rare_data for direct lookup by a get_name method.

Paralleling the get_name method, I added a get_id method, which makes some internal id-lookup cases nicer.

A new test tests for a name setter on every HTML element type. In addition to its overt and upstreamable purpose of checking IDL property reflection semantics, for us this test also hits some Servo assertions that make sure the name is an atom in every case. If the test doesn't crash, even a failed test case still has the attribute as an atom rather than some other type. The failed cases are for elements that we have unimplemented or completely stubbed; I added a few missing name IDL properties to otherwise implemented elements.

---
<!-- 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 #25570 and make progress on #25057

<!-- Either: -->
- [X] There are tests for these changes

<!-- 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. -->
@bors-servo
Copy link
Contributor

bors-servo commented Feb 13, 2020

☀️ Test successful - status-taskcluster
Approved by: jdm
Pushing 9c135f0 to master...

@bors-servo bors-servo merged commit f29e22f into servo:master Feb 13, 2020
2 checks passed
2 checks passed
Community-TC (pull_request) TaskGroup: success
Details
homu Test successful
Details
bors-servo added a commit that referenced this pull request Feb 13, 2020
Add SupportedPropertyNames to Document (also fix iframe getting)

Existing test of named-getting an iframe now succeeds. I added a new test for Object.getOwnPropertyNames(document) based on my understanding of the spec; that test could use a second opinion.

UPDATE: This was trying to do too many things in one PR as originally submitted. It is now using #25572 as a base, and I suggest reviewing that PR before this one to avoid duplicating review effort.

---
<!-- 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 #7273 for all implemented named getters, fix #25146, and fix the iframe case only of #25145.

<!-- Either: -->
- [X] There are tests for these changes

<!-- 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. -->
bors-servo added a commit that referenced this pull request Feb 14, 2020
Add SupportedPropertyNames to Document (also fix iframe getting)

Existing test of named-getting an iframe now succeeds. I added a new test for Object.getOwnPropertyNames(document) based on my understanding of the spec; that test could use a second opinion.

UPDATE: This was trying to do too many things in one PR as originally submitted. It is now using #25572 as a base, and I suggest reviewing that PR before this one to avoid duplicating review effort.

---
<!-- 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 #7273 for all implemented named getters, fix #25146, and fix the iframe case only of #25145.

<!-- Either: -->
- [X] There are tests for these changes

<!-- 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. -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

6 participants
You can’t perform that action at this time.