Skip to content

Commit

Permalink
Use less-invasive stylo change for u64 opaque element
Browse files Browse the repository at this point in the history
Signed-off-by: Nico Burns <[email protected]>
  • Loading branch information
nicoburns committed Dec 31, 2024
1 parent 0bdd7ab commit 64df87c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ license = "MIT OR Apache-2.0"

[workspace.dependencies]
# Servo dependencies
style = { git = "https://github.com/nicoburns/stylo", rev = "61c02a463", package = "style" } # u64-opaque-element
style_config = { git = "https://github.com/nicoburns/stylo", rev = "61c02a463", package = "style_config" } # u64-opaque-element
style_traits = { git = "https://github.com/nicoburns/stylo", rev = "61c02a463", package = "style_traits" } # u64-opaque-element
style_dom = { git = "https://github.com/nicoburns/stylo", rev = "61c02a463", package = "dom" } # u64-opaque-element
selectors = { git = "https://github.com/nicoburns/stylo", rev = "61c02a463", package = "selectors" } # u64-opaque-element
style = { git = "https://github.com/nicoburns/stylo", rev = "3c123bb834b2b3", package = "style" } # u64-opaque-element
style_config = { git = "https://github.com/nicoburns/stylo", rev = "3c123bb834b2b3", package = "style_config" } # u64-opaque-element
style_traits = { git = "https://github.com/nicoburns/stylo", rev = "3c123bb834b2b3", package = "style_traits" } # u64-opaque-element
style_dom = { git = "https://github.com/nicoburns/stylo", rev = "3c123bb834b2b3", package = "dom" } # u64-opaque-element
selectors = { git = "https://github.com/nicoburns/stylo", rev = "3c123bb834b2b3", package = "selectors" } # u64-opaque-element
markup5ever = "0.14" # needs to match stylo markup5ever version
html5ever = "0.29" # needs to match stylo markup5ever version
xml5ever = "0.20" # needs to match stylo markup5ever version
Expand Down
4 changes: 3 additions & 1 deletion packages/blitz-dom/src/stylo.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//! Enable the dom to participate in styling by servo
//!
use std::ptr::NonNull;
use std::sync::atomic::Ordering;

use crate::node::BackgroundImageData;
Expand Down Expand Up @@ -351,7 +352,8 @@ impl selectors::Element for BlitzNode<'_> {
fn opaque(&self) -> selectors::OpaqueElement {
// FIXME: this is wrong in the case where pushing new elements casuses reallocations.
// We should see if selectors will accept a PR that allows creation from a usize
OpaqueElement::new(self.id as u64)
let non_null = NonNull::new((self.id + 1) as *mut ()).unwrap();
OpaqueElement::from_non_null_ptr(non_null)
}

fn parent_element(&self) -> Option<Self> {
Expand Down

0 comments on commit 64df87c

Please sign in to comment.