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

Implement Custom Elements #9372

Closed
samgiles opened this issue Jan 18, 2016 · 16 comments
Closed

Implement Custom Elements #9372

samgiles opened this issue Jan 18, 2016 · 16 comments
Assignees

Comments

@samgiles
Copy link
Contributor

@samgiles samgiles commented Jan 18, 2016

Implement Custom Elements in Servo

https://w3c.github.io/webcomponents/spec/custom/

Related to #9370

@jdm
Copy link
Member

@jdm jdm commented Jan 18, 2016

I don't believe Firefox intends to ship Custom Elements, so I'm not convinced that we should either.

Edit: I confused them for HTML Imports. Carry on.

@jdm jdm added the A-content/dom label Jan 18, 2016
@samgiles
Copy link
Contributor Author

@samgiles samgiles commented Jan 18, 2016

Yeh, I'm pretty sure Custom Elements are already in Gecko behind a pref - HTML imports is an entirely different matter :).

@Ms2ger
Copy link
Contributor

@Ms2ger Ms2ger commented Jan 18, 2016

Either way, it's not quite clear to me whether we should accept a PR for this if we got one.

@samgiles
Copy link
Contributor Author

@samgiles samgiles commented Jan 18, 2016

Is the feeling that Servo should only implement recommended/non-draft specs?

@Ms2ger
Copy link
Contributor

@Ms2ger Ms2ger commented Jan 18, 2016

Only specs where there's rough consensus among browser vendors that the spec is going in the right direction.

@elcritch
Copy link

@elcritch elcritch commented Jan 21, 2016

+1 for this. I'm considering if servo could be used for embedded devices, but the lack of web-components would be a complete show stopper. I find Mozilla's reluctance toward web-components baffling.

@jdm
Copy link
Member

@jdm jdm commented Jan 21, 2016

It's a combination of lack of resources, a huge specification (in terms of scope and required effort), and one that is often not fully thought out. This makes it difficult to actually implement.

@elcritch
Copy link

@elcritch elcritch commented Jan 21, 2016

The lack of resources is a big one, especially for a new project like servo. I just hope to be able to use (ahem abuse) servo for embedded devices in the near future. I’ve read the shadow DOM spec’s (its fairly complex), but which point cause the most contention? Various blogs posts point to the lifetimes/lifecycle of custom elements. I ask so I can be aware, also it’s unclear to me, does servo already support custom tags or does this issue incorporate that spec as well? 

@jdm
Copy link
Member

@jdm jdm commented Jan 21, 2016

@elcritch What do you mean by custom tags? Any unrecognized HTML element turns into an HTMLUnknownElement in the DOM.

@elcritch
Copy link

@elcritch elcritch commented Jan 21, 2016

Oops, technically it’s custom elements (I was thinking of tag names). Exactly, instead of HTMLUnknownElement you can register (certain) custom elements Custom Elements spec . Custom elements allows building very powerful/descriptive framework directly into HTML elements. E.g. the Mozilla related a-frame

@jdm
Copy link
Member

@jdm jdm commented Jan 21, 2016

This is the issue about Custom Elements :)

@nox
Copy link
Member

@nox nox commented Jan 22, 2016

@elcritch
Copy link

@elcritch elcritch commented Jan 25, 2016

@nox Custom elements are very useful for embedding DSLs into a webpage which encodes both a UI and the associated programming logic. Other data formats (JSON/microdata) aren't as expressive for this purpose, and even a half-baked standard provides better specs (life cycles, etc) than many custom libraries/frameworks. We've been working on this for some time, but the approach is gaining traction elsewhere (see the WoT.JS example at Mozilla's WebOfThings). Eventually I'd like to be able to say ship a customized servo based engine for this as working with Rust would be appealing. First step: custom elements.

@nox
Copy link
Member

@nox nox commented Jan 25, 2016

I still don't see what custom elements bring to the table apart from compartmentalisation, which isn't specific to embedded devices at all.

What do you call a customised Servo-based engine? Some sort of subset of HTML? You might be interested in reading #3653.

@elcritch
Copy link

@elcritch elcritch commented Jan 26, 2016

Compartmentalization is key for this usage. Particularly, the binding of a JavaScript code and documented life-cycles provided by custom elements provides a very powerful abstraction mechanism which significantly reduces the effort required to program IoT devices. The benefits aren't specific to embedded devices but solves a host of issues in IoT, IMHO. Hierarchical events in control systems fit well into the Web programming stack (easy visualization, fast events, networking, etc). It takes viewing HTML elements as primary with JS being secondary. E.g. I want to describe data and have the JS be bound to that data, not vise-versa although it's technically possible to do so.

Issue #3653 is very interesting. Thanks! Mainly just compiling a stripped down version of servo. Something like a Rust-embedded DOM engine would be really intriguing. And it'd be great to have an serious alternative to chromium for these purposes.

@cbrewster
Copy link
Member

@cbrewster cbrewster commented May 4, 2017

I will be working on this as apart of GSoC 2017

@cbrewster cbrewster self-assigned this May 5, 2017
@cbrewster cbrewster mentioned this issue Aug 30, 2017
4 of 5 tasks complete
bors-servo added a commit that referenced this issue Aug 31, 2017
Enable Custom Elements by Default

<!-- Please describe your changes on the following line: -->

---
<!-- 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 #9372 (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because enabling pref flag.

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- 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/18317)
<!-- Reviewable:end -->
bors-servo added a commit that referenced this issue Sep 1, 2017
Enable Custom Elements by Default

<!-- Please describe your changes on the following line: -->

---
<!-- 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 #9372 (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because enabling pref flag.

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- 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/18317)
<!-- Reviewable:end -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

6 participants
You can’t perform that action at this time.