window.innerWidth/innerHeight is no longer evaluated eagerly
Categories
(DevTools :: Console, defect, P3)
Tracking
(firefox-esr102 unaffected, firefox111 wontfix, firefox112 wontfix, firefox113 wontfix, firefox114 fix-optional)
| Tracking | Status | |
|---|---|---|
| firefox-esr102 | --- | unaffected |
| firefox111 | --- | wontfix |
| firefox112 | --- | wontfix |
| firefox113 | --- | wontfix |
| firefox114 | --- | fix-optional |
People
(Reporter: emk, Unassigned)
References
(Regression)
Details
(Keywords: regression)
Steps to reproduce:
- Open Web Console.
- Type
[innerWidth,innerHeight]
Actual result:
innerWidth and innerHeight are not evaluated eagerly.
Expected result:
innerWidth and innerHeight should be evaluated eagerly. Chrome DevTools works as expected and Firefox 110 worked.
Regression range: https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=b6a3b24b90c420472fe71460e387a8dfd31e2d3d&tochange=5c2b32e98bede1e87f5243d8a929de67179d9b83
| Reporter | ||
Comment 1•3 years ago
|
||
Bug 1806598 seems to treat getters on Window interface as safe by default. So I believe this is unexpected. Or do innerWidth and innerHeight getters have an observable side effect?
Comment 2•3 years ago
|
||
Set release status flags based on info from the regressing bug 1806598
:arai, since you are the author of the regressor, bug 1806598, could you take a look? Also, could you set the severity field?
For more information, please visit auto_nag documentation.
Comment 3•3 years ago
|
||
yes, some properties will become not-eagerly-evaluateable after the change.
this is due to many webidl lacks the annotation about side-effect.
we need to add more annotation
Comment 4•3 years ago
|
||
actually, getting innerWidth and innerHeight can flush the pending style calculation, and the operation seems to be visible to JS via transition start time.
so, they're not actually side-effect-free.
If that kind of side-effect is acceptable in the context of eager-evaluation, we would need to add yet-another WebIDL annotation specific to eager-evaluation, and use it everywhere that has no critical side-effect.
Comment 5•3 years ago
|
||
:arai, any idea what the severity might be here?
| Reporter | ||
Comment 6•3 years ago
|
||
(In reply to Tooru Fujisawa [:arai] from comment #4)
If that kind of side-effect is acceptable in the context of eager-evaluation, we would need to add yet-another WebIDL annotation specific to eager-evaluation, and use it everywhere that has no critical side-effect.
How about enabling the new annotation for all DOM getters by default? I don't think allowlisting scales here.
Comment 7•3 years ago
|
||
:nchevobbe, can I have your input here, for severity and how to annotate eagerly-evaluateable getters?
Comment 8•3 years ago
|
||
if we mark all DOM getters "safe for eager evaluation", we'll need a map that contains all DOM getters,
currently there are ~3000 native DOM getters in tree:
https://searchfox.org/mozilla-central/search?q=getterinfo%20%3D%20%7B&path=
then, creating a JS Map with those entries each time doesn't sound efficient, and using the ChromeUtils method way explained in bug 1815381 comment might be better.
(In reply to Tooru Fujisawa [:arai] from bug 1815381 comment #0)
Possible solution I can think of is to create
ChromeUtilsmethod that takes a function and checks if the function is side-effect-free.
That means, move the allowlist creation and check from devtools JS code to nativeChromeUtilsmethod.
Comment 9•3 years ago
|
||
(Priority/Severity is very low, eager evaluation is a comfort feature, the user can still evaluate the expression, even if it might feel slighly longer)
(In reply to Tooru Fujisawa [:arai] from comment #8)
if we mark all DOM getters "safe for eager evaluation", we'll need a map that contains all DOM getters,
currently there are ~3000 native DOM getters in tree:
https://searchfox.org/mozilla-central/search?q=getterinfo%20%3D%20%7B&path=then, creating a JS
Mapwith those entries each time doesn't sound efficient, and using theChromeUtilsmethod way explained in bug 1815381 comment might be better.
I like the idea of having a method in ChromeUtils instead of manually crafting the getter Map in devtools code
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Comment 10•3 years ago
|
||
Fixed bug 1815381 patch.
Description
•