Delay reading 'sandbox' attribute - #10045
Conversation
|
Can you do a review for other calls to |
|
|
||
| /** @override */ | ||
| buildCallback() { | ||
| this.isSandbox_ = !!this.element.hasAttribute('sandbox'); |
There was a problem hiding this comment.
why do we need the coercion?
|
@jridgewell Good Point. Can I merge this PR first? I can add the presubmit check in another PR. BTW How should I prevent function in constructor only? |
|
Sure. You'll have to write an ESLint plugin, or a closure one. /cc @erwinmombay |
|
|
||
| /** @private {!boolean} */ | ||
| this.isSandbox_ = element.hasAttribute('sandbox'); | ||
| this.isSandbox_ = false; |
There was a problem hiding this comment.
What does sandbox actually do here?
Should we assume true until we know otherwise?
There was a problem hiding this comment.
Determine if we want to scope selector inside parentElement, support all url variables and so...
I agree it's safer to initialize it to true. But it won't be used after buildCallback, so I think it does not matter so much.
I was testing my other PR. Then I found reading
element.hasAttribute('sandbox')too early (constructor) could lead to false result. Delay tobuildCallback