-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Partial ShadowDOM support #22743
Partial ShadowDOM support #22743
Conversation
Heads up! This PR modifies the following files:
|
components/script/dom/macros.rs
Outdated
let x = *x as f32; | ||
let y = *y as f32; | ||
let point = &Point2D::new(x, y); | ||
let viewport = self.window.window_size().initial_viewport; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to retarget nodes in shadow trees and such... Rather than having these implementations duplicated I would have them just in DocumentOrShadowRoot, which also avoids having to implement dummy ShadowRoot::GetBody & co.
Also, I'm pretty sure you need a flag to know when a node is connected, and replace a bunch of uses of IS_IN_DOCUMENT by that. Also you need to audit all the callers that propagate flags around the tree like the layout dirty flags and change them so they not only look at parent_node but at parent_node_crossing_shadow_root or something |
I ended up setting the IS_IN_DOC flag if the node is connected, which I think is essentially the same thing and saves us from replacing some of the uses of IS_IN_DOC by IS_CONNECTED. |
I'd rather not do that, there are some legit uses of IS_IN_DOC / is_in_doc that need to know whether you're on a document or not. Gecko used to do that and we had to rewrite it because there were too many bugs. |
4da558b
to
a85b958
Compare
@bors-servo try=wpt |
[WIP] Partial ShadowDOM support This is just an early WIP, not to take it very seriously yet. - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [ ] These changes fix #___ (GitHub issue number if applicable) - [ ] There are tests for these changes <!-- 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/22743) <!-- Reviewable:end -->
💔 Test failed - linux-rel-css |
@bors-servo try=wpt |
[WIP] Partial ShadowDOM support This is just an early WIP, not to take it very seriously yet. - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [ ] These changes fix #___ (GitHub issue number if applicable) - [ ] There are tests for these changes <!-- 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/22743) <!-- Reviewable:end -->
Thank you for your mentoring and patient :) |
@bors-servo r=emilio |
📌 Commit 37e88e7 has been approved by |
Partial ShadowDOM support This is just an early WIP, not to take it very seriously yet. - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [x] These changes fix #22719 - [x] There are tests for these changes <!-- 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/22743) <!-- Reviewable:end -->
💔 Test failed - linux-rel-css |
@bors-servo retry |
💣 Failed to start rebuilding: |
Partial ShadowDOM support This is just an early WIP, not to take it very seriously yet. - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [x] These changes fix #22719 - [x] There are tests for these changes <!-- 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/22743) <!-- Reviewable:end -->
☀️ Test successful - android-mac, arm32, arm64, linux-rel-css, linux-rel-wpt, mac-rel-css1, mac-rel-css2, mac-rel-wpt1, mac-rel-wpt2, mac-rel-wpt3, mac-rel-wpt4, magicleap, status-taskcluster |
Media controls <strike>This is still highly WIP. It depends on #22743 and so it is based on top of it. The basic controls functionality is there, but the layout is highly broken. There is a hack to at least make the controls render on top of the video, but it is not correctly positioned. The controls' div container ends up as sibbling of the media element in the flow tree while IIUC it should end up as a child.</strike> - [X] `./mach build -d` does not report any errors - [ ] `./mach test-tidy` does not report any errors - [X] These changes fix #22721 and #22720 There is at least an extra dependency to improve the functionality and visual aspect: #22728. <!-- 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/23208) <!-- Reviewable:end -->
Media controls <strike>This is still highly WIP. It depends on #22743 and so it is based on top of it. The basic controls functionality is there, but the layout is highly broken. There is a hack to at least make the controls render on top of the video, but it is not correctly positioned. The controls' div container ends up as sibbling of the media element in the flow tree while IIUC it should end up as a child.</strike> - [X] `./mach build -d` does not report any errors - [ ] `./mach test-tidy` does not report any errors - [X] These changes fix #22721 and #22720 There is at least an extra dependency to improve the functionality and visual aspect: #22728. <!-- 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/23208) <!-- Reviewable:end -->
Media controls <strike>This is still highly WIP. It depends on #22743 and so it is based on top of it. The basic controls functionality is there, but the layout is highly broken. There is a hack to at least make the controls render on top of the video, but it is not correctly positioned. The controls' div container ends up as sibbling of the media element in the flow tree while IIUC it should end up as a child.</strike> - [X] `./mach build -d` does not report any errors - [ ] `./mach test-tidy` does not report any errors - [X] These changes fix #22721 and #22720 There is at least an extra dependency to improve the functionality and visual aspect: #22728. <!-- 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/23208) <!-- Reviewable:end -->
Media controls <strike>This is still highly WIP. It depends on #22743 and so it is based on top of it. The basic controls functionality is there, but the layout is highly broken. There is a hack to at least make the controls render on top of the video, but it is not correctly positioned. The controls' div container ends up as sibbling of the media element in the flow tree while IIUC it should end up as a child.</strike> - [X] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [X] These changes fix #22721 and fix #22720 There is at least an extra dependency to improve the functionality and visual aspect: #22728. <!-- 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/23208) <!-- Reviewable:end -->
Media controls <strike>This is still highly WIP. It depends on #22743 and so it is based on top of it. The basic controls functionality is there, but the layout is highly broken. There is a hack to at least make the controls render on top of the video, but it is not correctly positioned. The controls' div container ends up as sibbling of the media element in the flow tree while IIUC it should end up as a child.</strike> - [X] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [X] These changes fix #22721 and fix #22720 There is at least an extra dependency to improve the functionality and visual aspect: #22728. <!-- 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/23208) <!-- Reviewable:end -->
This is just an early WIP, not to take it very seriously yet.
./mach build -d
does not report any errors./mach test-tidy
does not report any errorsThis change is