Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upImplement Custom Elements #9372
Comments
|
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. |
|
Yeh, I'm pretty sure Custom Elements are already in Gecko behind a pref - HTML imports is an entirely different matter :). |
|
Either way, it's not quite clear to me whether we should accept a PR for this if we got one. |
|
Is the feeling that Servo should only implement recommended/non-draft specs? |
|
Only specs where there's rough consensus among browser vendors that the spec is going in the right direction. |
|
+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. |
|
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. |
|
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? |
|
@elcritch What do you mean by custom tags? Any unrecognized HTML element turns into an HTMLUnknownElement in the DOM. |
|
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 . |
|
This is the issue about Custom Elements :) |
|
Why would you need custom elements specifically in embedded?
|
|
@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. |
|
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. |
|
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. |
|
I will be working on this as apart of GSoC 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 -->
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 -->
Implement Custom Elements in Servo
https://w3c.github.io/webcomponents/spec/custom/
Related to #9370