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

Fix Issue 12343: Add pref-gated methods and test for activatable element #12703

Merged
merged 1 commit into from Sep 17, 2016

Conversation

@sjmelia
Copy link
Contributor

sjmelia commented Aug 2, 2016

Add methods to activatable elements; gated by a preference, for use in servo-specific WPT tests.

I cargo-culted over the "redundant check" from #12322, I don't really understand the possible exploit.

Obvious flaw is the copypasta for each element. I understand that the webidl codegen will produce a trait for ActivatableElement, but I can't see how I can provide a default implementation for this? I guess otherwise could be an improvement to have each element just delegate to an Enter.../Exit... method on the Activatable trait?


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes fix #12343 (github issue number if applicable).
  • There are tests for these changes OR
  • These changes do not require tests because _____

…states


This change is Reviewable

@sjmelia sjmelia force-pushed the sjmelia:12343_test_activation branch from dc6605f to bdf18df Aug 3, 2016
[NoInterfaceObject]
interface ActivatableElement {
[Pref="dom.testing.element.activation.enabled"]
void enter_formal_activation_state();

This comment has been minimized.

Copy link
@izgzhen

izgzhen Aug 3, 2016

Contributor

I suppose enterFormalActivationState conforms to the convention better?

@izgzhen
Copy link
Contributor

izgzhen commented Aug 3, 2016

I think the check is redundant here since the code just lies in the script side.

But in the file manager case, the code runs in another process (i.e. net), thus whether the script side interface code is generated or not, the file manager interface will always be the same. net has to check pref again to confirm the status of script side.

@izgzhen izgzhen changed the title Issue 12343: Add pref-gated methods and test for activatable element … Fix Issue 12343: Add pref-gated methods and test for activatable element Aug 3, 2016
@izgzhen
Copy link
Contributor

izgzhen commented Aug 3, 2016

In case you are not aware, you can use ./mach update-manifest instead of manually modify the MANIFEST.json to fix the CI failure

@jdm I am not sure if we should run the manifest_changed.sh earlier, I mean, like ./mach test-tidy

@jdm
Copy link
Member

jdm commented Aug 3, 2016

@izgzhen I don't think it's worth it, since it's not a quick operation like test-tidy.

@jdm
Copy link
Member

jdm commented Aug 3, 2016

@Manishearth
Copy link
Member

Manishearth commented Aug 3, 2016

Use a macro (dom/macros.rs) to get rid of the copypasta. This will make it easy to add more pref-gated activation methods in the future too -- I'll want to add more invasive tests for general activation behavior at some point which may need more hooks.

Once the macro change and Zhen's comment are addressed, r=me

@jdm
Copy link
Member

jdm commented Aug 3, 2016

One suggestion I have - what if the ActivatableElement mixin only applied to Element, since the implementation of the methods calls as_element() anyways?

@Manishearth
Copy link
Member

Manishearth commented Aug 3, 2016

Oh, that works. Not so well for future activation tests, but I can probably manage with the existing methods

@sjmelia sjmelia force-pushed the sjmelia:12343_test_activation branch from bdf18df to 35ad586 Aug 7, 2016
@sjmelia
Copy link
Contributor Author

sjmelia commented Aug 7, 2016

I have fixed the naming convention; removed the redundant check; ran manifest-update.

R.e. "ActivatableElement mixin only applied to Element" i've interpreted this as meaning to have element implement the webidl interface (instead of each activatable type) and throw in JS if it's not applicable.

r? @Manishearth

@Manishearth
Copy link
Member

Manishearth commented Aug 8, 2016

@bors-servo r+

thanks!

@bors-servo
Copy link
Contributor

bors-servo commented Aug 8, 2016

📌 Commit 35ad586 has been approved by Manishearth

@bors-servo
Copy link
Contributor

bors-servo commented Aug 8, 2016

Testing commit 35ad586 with merge c794721...

bors-servo added a commit that referenced this pull request Aug 8, 2016
Fix Issue 12343: Add pref-gated methods and test for activatable element

<!-- Please describe your changes on the following line: -->
Add methods to activatable elements; gated by a preference, for use in servo-specific WPT tests.

I cargo-culted over the "redundant check" from #12322, I don't really understand the possible exploit.

Obvious flaw is the copypasta for each element. I understand that the webidl codegen will produce a trait for ActivatableElement, but I can't see how I can provide a default implementation for this? I guess otherwise could be an improvement to have each element just delegate to an Enter.../Exit... method on the Activatable trait?

---
<!-- 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 #12343 (github issue number if applicable).

<!-- Either: -->
- [X] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

…states

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

bors-servo commented Aug 8, 2016

💔 Test failed - linux-rel

@sjmelia sjmelia force-pushed the sjmelia:12343_test_activation branch from 35ad586 to 12de67c Aug 8, 2016
@sjmelia
Copy link
Contributor Author

sjmelia commented Aug 8, 2016

😊 sorry for wasting time, I think I got distracted updating the manifest and forgot to actually make the test pass...

@jdm
Copy link
Member

jdm commented Aug 8, 2016

Looks like test rather than async_test would be appropriate for all of them.

@sjmelia sjmelia force-pushed the sjmelia:12343_test_activation branch from 12de67c to a9de84a Aug 8, 2016
@jdm
Copy link
Member

jdm commented Sep 17, 2016

@bors-servo: r=Manishearth

@bors-servo
Copy link
Contributor

bors-servo commented Sep 17, 2016

📌 Commit a9de84a has been approved by Manishearth

@bors-servo
Copy link
Contributor

bors-servo commented Sep 17, 2016

Testing commit a9de84a with merge 2fb4dd9...

bors-servo added a commit that referenced this pull request Sep 17, 2016
Fix Issue 12343: Add pref-gated methods and test for activatable element

<!-- Please describe your changes on the following line: -->
Add methods to activatable elements; gated by a preference, for use in servo-specific WPT tests.

I cargo-culted over the "redundant check" from #12322, I don't really understand the possible exploit.

Obvious flaw is the copypasta for each element. I understand that the webidl codegen will produce a trait for ActivatableElement, but I can't see how I can provide a default implementation for this? I guess otherwise could be an improvement to have each element just delegate to an Enter.../Exit... method on the Activatable trait?

---
<!-- 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 #12343 (github issue number if applicable).

<!-- Either: -->
- [X] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

…states

<!-- 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/12703)
<!-- Reviewable:end -->
@jdm
Copy link
Member

jdm commented Sep 17, 2016

Sorry this got neglected!

@bors-servo
Copy link
Contributor

bors-servo commented Sep 17, 2016

💔 Test failed - linux-rel

@jdm
Copy link
Member

jdm commented Sep 17, 2016

@bors-servo
Copy link
Contributor

bors-servo commented Sep 17, 2016

Previous build results for arm32, arm64, linux-dev, mac-dev-unit, mac-rel-css, mac-rel-wpt, windows-dev are reusable. Rebuilding only linux-rel...

@bors-servo
Copy link
Contributor

bors-servo commented Sep 17, 2016

@bors-servo bors-servo merged commit a9de84a into servo:master Sep 17, 2016
3 checks passed
3 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
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.