Skip to content

Allow window elements as well as iframes to the the target of mozbrowser events - #12426

Merged
bors-servo merged 1 commit into
servo:masterfrom
asajeffrey:mozbrowser-event-targets
Jul 20, 2016
Merged

bors-servo merged 1 commit into
servo:masterfrom
asajeffrey:mozbrowser-event-targets

Conversation

@asajeffrey

@asajeffrey asajeffrey commented Jul 13, 2016 •

Copy link
Copy Markdown
Contributor

Allow mozbrowser events, in particular mozbrowsererror events, to target a window. Needed for browserhtml/browserhtml#1182



This change is Reviewable

@highfive

Copy link
Copy Markdown

Heads up! This PR modifies the following files:

  • @KiChjang: components/script/dom/htmliframeelement.rs, components/script/dom/document.rs, components/script_traits/script_msg.rs, components/script_traits/script_msg.rs, components/script/script_thread.rs, components/script/dom/window.rs, components/script_traits/lib.rs, components/script_traits/lib.rs

@highfive

Copy link
Copy Markdown

warning Warning warning

  • These commits modify unsafe code. Please review it carefully!
  • These commits modify script code, but no tests are modified. Please consider adding a test!

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Jul 13, 2016
@asajeffrey

Copy link
Copy Markdown
Contributor Author

cc @Ms2ger @Gozala @paulrouget

cx: *mut JSContext,
rval: MutableHandleValue);
#[allow(unsafe_code)]
pub unsafe fn build_mozbrowser_custom_event(window: Root<Window>, event: MozBrowserEvent) -> Root<CustomEvent> {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function provides a safe abstraction; it should just have an internal unsafe {} block.

Also, arguments should never be Root<T>; use &Window.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@bors-servo

Copy link
Copy Markdown
Contributor

☔ The latest upstream changes (presumably #11841) made this pull request unmergeable. Please resolve the merge conflicts.

@highfive highfive added the S-needs-rebase There are merge conflict errors. label Jul 15, 2016
@asajeffrey
asajeffrey force-pushed the mozbrowser-event-targets branch from 0ee5ae2 to 72aa4f2 Compare July 18, 2016 16:23
@asajeffrey

Copy link
Copy Markdown
Contributor Author

Rebased.

@asajeffrey asajeffrey removed the S-needs-rebase There are merge conflict errors. label Jul 18, 2016
@SimonSapin

Copy link
Copy Markdown
Member

@bors-servo r+


Reviewed 8 of 8 files at r3.
Review status: all files reviewed at latest revision, 2 unresolved discussions.


Comments from Reviewable

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit 72aa4f2 has been approved by SimonSapin

@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 20, 2016
@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit 72aa4f2 with merge b6c0ed9...

bors-servo pushed a commit that referenced this pull request Jul 20, 2016
Allow window elements as well as iframes to the the target of mozbrowser events

<!-- Please describe your changes on the following line: -->
Allow mozbrowser events, in particular mozbrowsererror events, to target a window. Needed for browserhtml/browserhtml#1182

---
<!-- 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 #12420
- [X] These changes do not require tests because we're not testing our issue reporting system, which this is intended for.

<!-- 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/12426)
<!-- Reviewable:end -->
@bors-servo

Copy link
Copy Markdown
Contributor

☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel, mac-dev-unit, mac-rel-css, mac-rel-wpt, windows-dev

@bors-servo
bors-servo merged commit 72aa4f2 into servo:master Jul 20, 2016
@highfive highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Jul 20, 2016
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.

Allow mozbrowser events to be targeted at the window

5 participants