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

Prefix `on` for function name of inline events #26480

Merged
merged 1 commit into from Jun 4, 2020
Merged

Conversation

@CYBAI
Copy link
Collaborator

CYBAI commented May 10, 2020

While checking what needs to be done for the spec-update, I've noticed the logic of checking is window-reflecting element (e.g. body and frameset) is already handled by the is casting function.

However, we still failed to pass the tests because we're missing on prefix for inline functions.

I'm not sure if this patch is good enough (or maybe at least I need to add a comment for why adding on prefix?).

Besides, I checked how Gecko handles and looks like they also just pass the atom directly.
But, the generated atom is prefixed with on which is correct to just pass it into the CompileFunction.


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes fix #26479
  • There are tests for these changes
@highfive
Copy link

highfive commented May 10, 2020

Heads up! This PR modifies the following files:

@highfive
Copy link

highfive commented May 10, 2020

warning Warning warning

  • These commits modify script code, but no tests are modified. Please consider adding a test!
@CYBAI
Copy link
Collaborator Author

CYBAI commented May 10, 2020

@bors-servo try=wpt

  • this will need to wait for next WPT sync for the tests but I'd like to see if this breaks any other tests 👀
@bors-servo
Copy link
Contributor

bors-servo commented May 10, 2020

Trying commit 9b33c15 with merge d840b3b...

bors-servo added a commit that referenced this pull request May 10, 2020
Prefix `on` for function name of inline events

While checking what needs to be done for the spec-update, I've noticed the logic of checking `is window-reflecting element (e.g. body and frameset)` is already handled by the `is` casting function.

However, we still failed to pass the tests because we're missing `on` prefix for inline functions.

I'm not sure if this patch is good enough (or maybe at least I need to add a comment for why adding `on` prefix?).

Besides, I checked [how Gecko handles](https://searchfox.org/mozilla-central/rev/8bc4e35c9bb47c1fe3131e6155d9f482e1efef9a/dom/events/EventListenerManager.cpp#1012-1022) and looks like they also just pass the atom directly.
But, the [generated atom](https://searchfox.org/mozilla-central/source/__GENERATED__/xpcom/ds/nsGkAtomList.h#775) is prefixed with `on` which is correct to just pass it into the `CompileFunction`.

---
<!-- 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 #26479
- [x] There are tests for these changes; it's merged upstream but not merged into Servo yet

<!-- 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 May 10, 2020

💔 Test failed - status-taskcluster

@CYBAI
Copy link
Collaborator Author

CYBAI commented May 10, 2020

oh, didn't notice the tests are already in our tree.

@CYBAI CYBAI force-pushed the CYBAI:missing-on branch from 9b33c15 to b4d1f5b May 10, 2020
@CYBAI
Copy link
Collaborator Author

CYBAI commented Jun 4, 2020

also ping for review 👀 cc @jdm or @Manishearth

@jdm
Copy link
Member

jdm commented Jun 4, 2020

@bors-servo r+
I love small patches that fix tests.

@bors-servo
Copy link
Contributor

bors-servo commented Jun 4, 2020

📌 Commit b4d1f5b has been approved by jdm

@highfive highfive assigned jdm and unassigned Manishearth Jun 4, 2020
@bors-servo
Copy link
Contributor

bors-servo commented Jun 4, 2020

Testing commit b4d1f5b with merge eae5dbf...

bors-servo added a commit that referenced this pull request Jun 4, 2020
Prefix `on` for function name of inline events

While checking what needs to be done for the spec-update, I've noticed the logic of checking `is window-reflecting element (e.g. body and frameset)` is already handled by the `is` casting function.

However, we still failed to pass the tests because we're missing `on` prefix for inline functions.

I'm not sure if this patch is good enough (or maybe at least I need to add a comment for why adding `on` prefix?).

Besides, I checked [how Gecko handles](https://searchfox.org/mozilla-central/rev/8bc4e35c9bb47c1fe3131e6155d9f482e1efef9a/dom/events/EventListenerManager.cpp#1012-1022) and looks like they also just pass the atom directly.
But, the [generated atom](https://searchfox.org/mozilla-central/source/__GENERATED__/xpcom/ds/nsGkAtomList.h#775) is prefixed with `on` which is correct to just pass it into the `CompileFunction`.

---
<!-- 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 #26479
- [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 Jun 4, 2020

💔 Test failed - status-taskcluster

@jdm
Copy link
Member

jdm commented Jun 4, 2020

@bors-servo
Copy link
Contributor

bors-servo commented Jun 4, 2020

Testing commit b4d1f5b with merge 30aba38...

bors-servo added a commit that referenced this pull request Jun 4, 2020
Prefix `on` for function name of inline events

While checking what needs to be done for the spec-update, I've noticed the logic of checking `is window-reflecting element (e.g. body and frameset)` is already handled by the `is` casting function.

However, we still failed to pass the tests because we're missing `on` prefix for inline functions.

I'm not sure if this patch is good enough (or maybe at least I need to add a comment for why adding `on` prefix?).

Besides, I checked [how Gecko handles](https://searchfox.org/mozilla-central/rev/8bc4e35c9bb47c1fe3131e6155d9f482e1efef9a/dom/events/EventListenerManager.cpp#1012-1022) and looks like they also just pass the atom directly.
But, the [generated atom](https://searchfox.org/mozilla-central/source/__GENERATED__/xpcom/ds/nsGkAtomList.h#775) is prefixed with `on` which is correct to just pass it into the `CompileFunction`.

---
<!-- 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 #26479
- [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 Jun 4, 2020

💔 Test failed - status-taskcluster

@jdm
Copy link
Member

jdm commented Jun 4, 2020

@bors-servo
Copy link
Contributor

bors-servo commented Jun 4, 2020

Testing commit b4d1f5b with merge e2d980a...

@bors-servo
Copy link
Contributor

bors-servo commented Jun 4, 2020

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

@bors-servo bors-servo merged commit e2d980a into servo:master Jun 4, 2020
2 checks passed
2 checks passed
Community-TC (pull_request) TaskGroup: success
Details
homu Test successful
Details
@CYBAI CYBAI deleted the CYBAI:missing-on branch Jun 5, 2020
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.

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