question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Intent to implement: partially drop restriction on `style` attributes

See original GitHub issue

Some restrictions have to be preserved, but most can be dropped at this time, I believe.

Some considerations:

  1. !important should be prohibited as with stylesheets (should be done already for SVG).
  2. url() values (e.g. for background-image, etc) should be rewritable by cache (should be done already for SVG).
  3. The only allowed values of position are static, relative (and absolute?).
  4. Based on some future optimizations we want to do, we should probably also disallow top:X, left:X, right:X, bottom:X. Though we may be able to remove this restriction.
  5. SSR should be able to work with publisher-authored style attributes.

The only real restrictions comparing to the current state of things are position and top/bottom/etc restrictions. The question is whether, given these restrictions, this is still a good idea to implement.

/cc @Gregable @honeybadgerdontcare @jpettitt

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:70 (53 by maintainers)

github_iconTop GitHub Comments

2reactions
aghassemicommented, May 10, 2018

@jridgewell @nainar @dvoytenko I did a quick test and my conclusion is it does not block rendering for the whole document which is the big difference vs CSS in head. Chrome seems to progressively render and paint as document is streamed. In the following example, the first box is rendered immediately, the second box has a huge inline CSS that takes a bit to arrive, so that one and the next one are blocked.

untitled

https://storage.googleapis.com/ampconf-76504.appspot.com/test.html

Maybe we should put limit per element instead of an overall limit.

1reaction
Gregablecommented, Jun 5, 2018

The “for now” decision is simply just to move forward with implementation. It should probably not be construed as a decision on the limit we wish to have.

Read more comments on GitHub >

github_iconTop Results From Across the Web

<input>: The Input (Form Input) element - HTML
The <input> HTML element is used to create interactive controls for web-based forms in order to accept data from the user; a wide...
Read more >
15.00 - Restriction on Partial Coverage of Outer Join Queries by ...
FROM cust LEFT OUTER JOIN ordertbl ON custkey=o_custkey;. The Optimizer does not use this join index to partially cover the following request because...
Read more >
CSS Cascading and Inheritance Level 5 - W3C
This CSS module describes how to collate style rules and assign values to all properties on all elements. By way of cascading and ......
Read more >
Create an advanced widget - Android Developers
This page explains recommended practices for creating a more advanced widget that has a better user experience. Optimizations for updating widget content.
Read more >
Question and Test Interoperability (QTI): Implementation Guide
The main purpose of the QTI specification is to define an information model and associated binding that can be used to represent and ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found