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

<link rel="stylesheet"> and <style> with inline stylesheet applied in wrong order #3346

Closed
mbrubeck opened this issue Sep 15, 2014 · 2 comments
Closed
Assignees

Comments

@mbrubeck
Copy link
Contributor

@mbrubeck mbrubeck commented Sep 15, 2014

The following testcase has a red background, but should have a green background:

<!DOCTYPE html>
<html>
  <head>
    <link rel="stylesheet" href="data:text/css,body{background:red;}">
    <style>body { background: green; }</style>
  </head>
  <body>
  </body>
</html>
@brson brson mentioned this issue Sep 15, 2014
42 of 56 tasks complete
@jdm
Copy link
Member

@jdm jdm commented Sep 15, 2014

Unsurprisingly, http://mxr.mozilla.org/servo/source/components/script/dom/htmlstyleelement.rs#49 immediately grabs the layout channel and sends the inline contents, while http://mxr.mozilla.org/servo/source/components/script/html/hubbub_html_parser.rs#461 sends a message to the CSS discovery task which waits until all parsing is complete to send a message to the script task to forward the stylesheets to the layout task.

@jdm
Copy link
Member

@jdm jdm commented Sep 15, 2014

The parser code that looks for link elements should probably move to HTMLLinkElement and send a message directly to layout. We don't have any need for the CSS discovery task, as far as I can tell.

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.

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