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

Partial ShadowDOM support #22743

Merged
merged 83 commits into from
Apr 29, 2019
Merged

Partial ShadowDOM support #22743

merged 83 commits into from
Apr 29, 2019

Conversation

ferjm
Copy link
Contributor

@ferjm ferjm commented Jan 22, 2019

This is just an early WIP, not to take it very seriously yet.


This change is Reviewable

@highfive
Copy link

Heads up! This PR modifies the following files:

  • @asajeffrey: components/script/dom/document.rs, components/script/dom/shadowroot.rs, components/script/dom/macros.rs, components/script/dom/node.rs, components/script/dom/element.rs and 9 more
  • @KiChjang: components/script/dom/document.rs, components/script/dom/shadowroot.rs, components/script/dom/macros.rs, components/script/dom/node.rs, components/script/dom/element.rs and 9 more

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Jan 22, 2019
@highfive
Copy link

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!

@ferjm ferjm removed the S-awaiting-review There is new code that needs to be reviewed. label Jan 22, 2019
@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Jan 23, 2019
let x = *x as f32;
let y = *y as f32;
let point = &Point2D::new(x, y);
let viewport = self.window.window_size().initial_viewport;
Copy link
Member

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.

components/script/dom/htmlcollection.rs Outdated Show resolved Hide resolved
@emilio
Copy link
Member

emilio commented Jan 24, 2019

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

@ferjm ferjm changed the title [WIP] Partial ShadowDOM support: ShadowRoot [WIP] Partial ShadowDOM support Jan 24, 2019
@ferjm
Copy link
Contributor Author

ferjm commented Jan 25, 2019

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

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.

@emilio
Copy link
Member

emilio commented Jan 25, 2019

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.

components/script/dom/node.rs Outdated Show resolved Hide resolved
components/script/dom/node.rs Outdated Show resolved Hide resolved
components/script/dom/node.rs Show resolved Hide resolved
@ferjm
Copy link
Contributor Author

ferjm commented Feb 13, 2019

The shadow tree is now rendered and styled. Shadow tree styles still affect the document though.

screenshot 2019-02-13 at 16 44 45

@ferjm
Copy link
Contributor Author

ferjm commented Feb 13, 2019

The last commit fixes the fact that shadow tree styles were applied to the document.

screenshot 2019-02-13 at 18 24 10

@ferjm ferjm force-pushed the shadowdom branch 2 times, most recently from 4da558b to a85b958 Compare February 15, 2019 13:56
@ferjm
Copy link
Contributor Author

ferjm commented Feb 18, 2019

@bors-servo try=wpt

@bors-servo
Copy link
Contributor

⌛ Trying commit 6809f58 with merge 819191c...

bors-servo pushed a commit that referenced this pull request Feb 18, 2019
[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 -->
@bors-servo
Copy link
Contributor

💔 Test failed - linux-rel-css

@highfive highfive added S-tests-failed The changes caused existing tests to fail. and removed S-tests-failed The changes caused existing tests to fail. labels Feb 18, 2019
@ferjm
Copy link
Contributor Author

ferjm commented Feb 19, 2019

@bors-servo try=wpt

bors-servo pushed a commit that referenced this pull request Feb 19, 2019
[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 -->
@bors-servo
Copy link
Contributor

⌛ Trying commit cc1fdf8 with merge 9d8d0df...

@ferjm
Copy link
Contributor Author

ferjm commented Apr 29, 2019

Thanks for bearing with me, and sorry it took quite long :)

Thank you for your mentoring and patient :)

@ferjm
Copy link
Contributor Author

ferjm commented Apr 29, 2019

@bors-servo r=emilio

@bors-servo
Copy link
Contributor

📌 Commit 37e88e7 has been approved by emilio

@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 Apr 29, 2019
@bors-servo
Copy link
Contributor

⌛ Testing commit 37e88e7 with merge 30ded91...

bors-servo pushed a commit that referenced this pull request Apr 29, 2019
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 -->
@bors-servo
Copy link
Contributor

💔 Test failed - linux-rel-css

@highfive highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Apr 29, 2019
@ferjm
Copy link
Contributor Author

ferjm commented Apr 29, 2019

@bors-servo retry

@bors-servo
Copy link
Contributor

💣 Failed to start rebuilding: Unknown error

@bors-servo
Copy link
Contributor

⌛ Testing commit 37e88e7 with merge 799490a...

bors-servo pushed a commit that referenced this pull request Apr 29, 2019
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 -->
@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-tests-failed The changes caused existing tests to fail. labels Apr 29, 2019
@bors-servo
Copy link
Contributor

☀️ 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
Approved by: emilio
Pushing 799490a to master...

@bors-servo bors-servo merged commit 37e88e7 into servo:master Apr 29, 2019
@highfive highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Apr 29, 2019
@ferjm ferjm deleted the shadowdom branch April 30, 2019 13:29
bors-servo pushed a commit that referenced this pull request May 13, 2019
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 -->
bors-servo pushed a commit that referenced this pull request May 14, 2019
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 -->
bors-servo pushed a commit that referenced this pull request May 14, 2019
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 -->
@ferjm ferjm mentioned this pull request Jun 18, 2019
bors-servo pushed a commit that referenced this pull request Jul 23, 2019
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 -->
bors-servo pushed a commit that referenced this pull request Jul 23, 2019
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 -->
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.

Implement partial Shadow DOM support (for User Agent UI widgets)
7 participants