-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
script: Make a Layout-safe version of Element::each_custom_state
#40743
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
Conversation
b1edd5d to
e711d84
Compare
each_custom_stateElement::each_custom_state
|
🔨 Triggering try run (#19510341024) for Linux (WPT) |
|
|
|
The failure here looks like an infrastructure issue. |
|
🔨 Triggering try run (#19512422264) for Linux (WPT) |
e711d84 to
63730cc
Compare
|
Test results for linux-wpt from try job (#19512422264): Flaky unexpected result (50)
Stable unexpected results that are known to be intermittent (16)
|
|
✨ Try run (#19512422264) succeeded. |
63730cc to
cbd5a2a
Compare
|
🔨 Triggering try run (#19513363598) for Linux (WPT) |
|
Test results for linux-wpt from try job (#19513363598): Flaky unexpected result (43)
Stable unexpected results that are known to be intermittent (26)
|
|
✨ Try run (#19513363598) succeeded. |
|
|
||
| pub(crate) fn custom_states(&self) -> Option<DomRoot<CustomStateSet>> { | ||
| self.states.get() | ||
| pub(crate) fn custom_states(&self) -> &MutNullableDom<CustomStateSet> { |
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 prefer not to return types that callers can mutate, when possible. I think I would prefer to leave this method and add a custom_states_for_layout that calls .get_inner_as_layout() instead.
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 makes total sense. I've done that.
cbd5a2a to
868965f
Compare
`Element::each_custom_state` is called from Layout, but it creates `DomRef` types on the stack, which can only be done on the main script thread. Since layout might be doing styling and element consultation on workers threads, expose a Layout-safe version of this change, which doesn't have this issue. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
868965f to
6a36d38
Compare
…40743) `Element::each_custom_state` is called from Layout, but it creates `DomRef` types on the stack, which can only be done on the main script thread. Since layout might be doing styling and element consultation on workers threads, expose a Layout-safe version of this change, which doesn't have this issue. Testing: This fixes two panics encountered during WPT tests. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Element::each_custom_stateis called from Layout, but it createsDomReftypes on the stack, which can only be done on the main scriptthread. Since layout might be doing styling and element consultation on
workers threads, expose a Layout-safe version of this change, which
doesn't have this issue.
Testing: This fixes two panics encountered during WPT tests.