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
Member

@ferjm ferjm commented Jan 22, 2019

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 errors
  • These changes fix #22719
  • There are tests for these changes

This change is Reviewable

@highfive
Copy link

@highfive highfive commented Jan 22, 2019

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
Copy link

@highfive highfive commented Jan 22, 2019

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!
let x = *x as f32;
let y = *y as f32;
let point = &Point2D::new(x, y);
let viewport = self.window.window_size().initial_viewport;

This comment has been minimized.

@emilio

emilio Jan 24, 2019
Member

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 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 force-pushed the ferjm:shadowdom branch from f2857c7 to 950c2e3 Jan 24, 2019
@ferjm ferjm changed the title [WIP] Partial ShadowDOM support: ShadowRoot [WIP] Partial ShadowDOM support Jan 24, 2019
@ferjm
Copy link
Member Author

@ferjm 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 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 ferjm force-pushed the ferjm:shadowdom branch from 53a0414 to ec5eee9 Feb 1, 2019
@ferjm
Copy link
Member Author

@ferjm 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
Member Author

@ferjm 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 ferjm:shadowdom branch 2 times, most recently from 4da558b to a85b958 Feb 14, 2019
@ferjm
Copy link
Member Author

@ferjm ferjm commented Feb 18, 2019

@bors-servo try=wpt

@bors-servo
Copy link
Contributor

@bors-servo bors-servo commented Feb 18, 2019

Trying commit 6809f58 with merge 819191c...

bors-servo added 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

@bors-servo bors-servo commented Feb 18, 2019

💔 Test failed - linux-rel-css

@ferjm
Copy link
Member Author

@ferjm ferjm commented Feb 19, 2019

@bors-servo try=wpt

bors-servo added 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

@bors-servo bors-servo commented Feb 19, 2019

Trying commit cc1fdf8 with merge 9d8d0df...

@ferjm
Copy link
Member Author

@ferjm 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
Member Author

@ferjm ferjm commented Apr 29, 2019

@bors-servo r=emilio

@bors-servo
Copy link
Contributor

@bors-servo bors-servo commented Apr 29, 2019

📌 Commit 37e88e7 has been approved by emilio

@bors-servo
Copy link
Contributor

@bors-servo bors-servo commented Apr 29, 2019

Testing commit 37e88e7 with merge 30ded91...

bors-servo added 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

@bors-servo bors-servo commented Apr 29, 2019

💔 Test failed - linux-rel-css

@ferjm
Copy link
Member Author

@ferjm ferjm commented Apr 29, 2019

@bors-servo retry

@bors-servo
Copy link
Contributor

@bors-servo bors-servo commented Apr 29, 2019

💣 Failed to start rebuilding: Unknown error

@bors-servo
Copy link
Contributor

@bors-servo bors-servo commented Apr 29, 2019

Testing commit 37e88e7 with merge 799490a...

bors-servo added 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

@bors-servo bors-servo commented Apr 29, 2019

☀️ 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
4 checks passed
4 checks passed
Taskcluster (pull_request) TaskGroup: success
Details
@travis-ci
Travis CI - Pull Request Build Passed
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
@bors-servo
homu Test successful
Details
@ferjm ferjm deleted the ferjm:shadowdom branch Apr 30, 2019
bors-servo added 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 added 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 added 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 added 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 added 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
Linked issues

Successfully merging this pull request may close these issues.

7 participants