New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 616983 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner:
Last visit > 30 days ago
Closed: Aug 2016
Cc:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Feature



Sign in to add a comment

Attribute to give link[rel=import] JS files access to the DOM

Reported by seandenn...@gmail.com, Jun 3 2016

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.19 Safari/537.36

Steps to reproduce the problem:
Not particularly a problem.

What is the expected behavior?

What went wrong?
Javascript files inside a link[rel=import] html file return undefined when they try to access document.body.

link[rel=import] is a great way for libraries to transport many components over in a single file, but currently lack access to the main DOM.

Did this work before? N/A 

Chrome version: 52.0.2743.19  Channel: dev
OS Version: 10.0
Flash Version: Shockwave Flash 22.0 r0

Whether this would be enabled behind an attribute or by default, it would greatly increase the portability of large libraries that have many subcomponents.

Allowing developers to package their libraries into a single import with many internal imports would be an amazing feature, especially with the adaptation of http/2

However, as it stands right now, JS files do not have access to the DOM
 
Components: -Blink Blink>JavaScript
Labels: -Type-Bug Type-Feature
Status: Untriaged (was: Unconfirmed)
Marking the above issue as Untriaged as this is a feature request.

Thank you!
Cc: jochen@chromium.org mkwst@chromium.org
Components: -Blink>JavaScript Blink
Summary: Attribute to give link[rel=import] JS files access to the DOM (was: [FeatureRequest] attribute to give link[rel=import] JS files access to the DOM)
Not V8 related and likely something intentional regarding security.
Cc: dominicc@chromium.org
Components: -Blink Blink>HTML
can you provide a repro? Is this maybe because the link is in the head and the body just doesn't exist yet?
@jochen, that fixed it, but that changes the question to whether or not link will get a defer attribute?
I don't think we're going to add any more features to html imports, but html modules (which use the script tag) will solve this.
I only ask about links getting a defer because I was packaging CSS together with the script and making an easily digestable way to add libraries without having to make users worry about dependency files

Comment 9 by tkent@chromium.org, Jun 24 2016

Components: -Blink>HTML Blink>WebComponents

Comment 10 by tkent@chromium.org, Jul 29 2016

Owner: hayato@chromium.org
Assign hayato@ for triage

Cc: hayato@chromium.org
Owner: kochi@chromium.org
Status: Assigned (was: Untriaged)
HTML Imports -> kochi@
Labels: html-imports
seandenny77@, as esprehn@ commented on #7, we don't add any new feature
on the current HTML Imports.  Could you file a bug at
https://github.com/w3c/webcomponents/issues
so other vendors can take part in designing html modules?

At GitHub we can continue discussing about details of how it behaves
when "defer" attribute is specified.
I think the original question was resolved by jochen@'s comment on #5.

Comment 15 by kochi@chromium.org, Aug 17 2016

Let me close this.

seandenny77@, feel free to file any issue at github (URL in comment #13).

Comment 16 by kochi@chromium.org, Aug 17 2016

Status: WontFix (was: Assigned)

Sign in to add a comment