-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Iframe: calc compat styles once per page load #57798
Conversation
Size Change: +7 B (0%) Total Size: 1.69 MB
ℹ️ View Unchanged
|
Flaky tests detected in 71f1811. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/7514492174
|
b4c60a4
to
71f1811
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense.
function matchFromRules( _cssRules ) { | ||
return Array.from( _cssRules ).find( | ||
( { | ||
selectorText, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ellatrix On WP.com, I'm seeing an error being thrown on this line:
Error: Permission denied to access property "selectorText"
Any idea what could it be? It happens in Firefox, Chrome seems to be fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This didn't happen previously? I didn't really change anything here, I just moved the code to a new file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know, it just started happening randomly on a draft post. And after closing and opening the same post in a new tab the error disappeared again, so I don't really have any steps to reproduce.
But I'm wondering what "Permission denied to access property" even means. It's like the stylesheet object was from a cross-origin iframe, and therefore behind some security boundary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's why there's a try/catch for accessing styleSheet.cssRules
, normally it fails there for cross origin stylesheets
What?
Currently we calculate the compatibility styles for every iframe separately. These styles don't change after load, so they can be reused.
Why?
First run: -10% (load patterns)
Second run also -10%
How?
Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast