mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 09:47:35 +00:00
LibWeb: Only invalidate stacking context tree for opacity/z-index change
I came across some websites that change an elements CSS "opacity" in their :hover selectors. That caused us to relayout on hover, which we'd like to avoid. With this patch, we now check if a property only affects the stacking context tree, and if nothing layout-affecting has changed, we only invalidate the stacking context tree, causing it to be rebuilt on next paint or hit test. This makes :hover { opacity: ... } rules much faster. :^)
This commit is contained in:
parent
59afdb959f
commit
8c88ee1165
6 changed files with 54 additions and 0 deletions
|
@ -1034,6 +1034,8 @@
|
|||
]
|
||||
},
|
||||
"opacity": {
|
||||
"affects-layout": false,
|
||||
"affects-stacking-context": true,
|
||||
"inherited": false,
|
||||
"initial": "1",
|
||||
"valid-types": [
|
||||
|
@ -1459,6 +1461,8 @@
|
|||
]
|
||||
},
|
||||
"z-index": {
|
||||
"affects-layout": false,
|
||||
"affects-stacking-context": true,
|
||||
"inherited": false,
|
||||
"initial": "auto",
|
||||
"valid-types": [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue