Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upFix Issue 12343: Add pref-gated methods and test for activatable element #12703
Conversation
| [NoInterfaceObject] | ||
| interface ActivatableElement { | ||
| [Pref="dom.testing.element.activation.enabled"] | ||
| void enter_formal_activation_state(); |
This comment has been minimized.
This comment has been minimized.
izgzhen
Aug 3, 2016
Contributor
I suppose enterFormalActivationState conforms to the convention better?
|
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. |
|
In case you are not aware, you can use @jdm I am not sure if we should run the |
|
@izgzhen I don't think it's worth it, since it's not a quick operation like test-tidy. |
|
r? @Manishearth |
|
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 |
|
One suggestion I have - what if the ActivatableElement mixin only applied to Element, since the implementation of the methods calls as_element() anyways? |
|
Oh, that works. Not so well for future activation tests, but I can probably manage with the existing methods |
|
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 |
|
@bors-servo r+ thanks! |
|
|
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 -->
|
|
|
|
|
Looks like |
…states
|
@bors-servo: r=Manishearth |
|
|
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 -->
|
Sorry this got neglected! |
|
|
|
@bors-servo: retry |
|
|
|
|
sjmelia commentedAug 2, 2016
•
edited
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 -ddoes not report any errors./mach test-tidydoes not report any errors…states
This change is