fix rendering
This commit is contained in:
1 parent
628638b9af
commit
3b06059834
11 files changed
+509
-65
No files matched your search
@@ -29,6 +29,8 @@
|
||||
- [ ] pub aspect_ratio: Number,
|
||||
*/
|
||||
|
||||
// align-content,align-items,align-self,animation,animation-delay,animation-direction,animation-duration,animation-fill-mode,animation-iteration-count,animation-name,animation-play-state,animation-timing-function,backface-visibility,border,border-bottom,border-bottom-color,border-bottom-left-radius,border-bottom-right-radius,border-bottom-style,border-bottom-width,border-collapse,border-color,border-image,border-image-outset,border-image-repeat,border-image-slice,border-image-source,border-image-width,border-left,border-left-color,border-left-style,border-left-width,border-radius,border-right,border-right-color,border-right-style,border-right-width,border-spacing,border-style,border-top,border-top-color,border-top-left-radius,border-top-right-radius,border-top-style,border-top-width,border-width,bottom,box-shadow,box-sizing,caption-side,clear,clip,column-count,column-fill,column-gap,column-rule,column-rule-color,column-rule-style,column-rule-width,column-span,column-width,columns,content,counter-increment,counter-reset,cursor,direction,ltr,rtl,display,empty-cells,flex,flex-basis,flex-direction,flex-flow,flex-grow,flex-shrink,flex-wrap,float,height,justify-content,flex-start,flex-end,center,space-between,space-around,space-evenly,left,letter-spacing,line-height,list-style,list-style-image,list-style-position,list-style-type,margin,margin-bottom,margin-left,margin-right,margin-top,max-height,max-width,min-height,min-width,opacity,order,outline,outline-color,outline-offset,outline-style,outline-width,overflow,overflow-x,overflow-y,padding,padding-bottom,padding-left,padding-right,padding-top,page-break-after,page-break-before,page-break-inside,perspective,perspective-origin,position,static,relative,fixed,absolute,sticky,pointer-events,quotes,resize,right,tab-size,table-layout,top,transform,transform-origin,transform-style,transition,transition-delay,transition-duration,transition-property,transition-timing-function,vertical-align,visibility,white-space,width,word-break,word-spacing,word-wrap,z-index
|
||||
|
||||
use stretch2::{prelude::*, style::PositionType};
|
||||
|
||||
/// applies the entire html namespace defined in dioxus-html
|
||||
|
||||
@@ -301,7 +301,7 @@ impl<S: State> RealDom<S> {
|
||||
for ty in ids {
|
||||
let node = &mut self[node_ref.id];
|
||||
let vnode = node.element(vdom);
|
||||
changed |= node.state.update_node_dep_state(ty, vnode, &ctx);
|
||||
changed |= node.state.update_node_dep_state(ty, vnode, vdom, &ctx);
|
||||
}
|
||||
if changed {
|
||||
to_rerender.insert(node_ref.id);
|
||||
@@ -328,7 +328,7 @@ impl<S: State> RealDom<S> {
|
||||
let vnode = node.element(vdom);
|
||||
if node
|
||||
.state
|
||||
.update_child_dep_state(ty, vnode, &children_state, &ctx)
|
||||
.update_child_dep_state(ty, vnode, vdom, &children_state, &ctx)
|
||||
{
|
||||
changed.push(ty);
|
||||
}
|
||||
@@ -387,6 +387,7 @@ impl<S: State> RealDom<S> {
|
||||
if state.update_parent_dep_state(
|
||||
ty,
|
||||
vnode,
|
||||
vdom,
|
||||
parent.filter(|n| n.id.0 != 0).map(|n| &n.state),
|
||||
&ctx,
|
||||
) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use std::{any::TypeId, fmt::Debug};
|
||||
|
||||
use anymap::AnyMap;
|
||||
use dioxus_core::{Attribute, ElementId, VElement, VNode, VText};
|
||||
use dioxus_core::{Attribute, ElementId, VElement, VNode, VText, VirtualDom};
|
||||
|
||||
pub(crate) fn union_ordered_iter<T: Ord + Debug>(
|
||||
s_iter: impl Iterator<Item = T>,
|
||||
@@ -40,7 +40,11 @@ pub struct NodeView<'a> {
|
||||
mask: NodeMask,
|
||||
}
|
||||
impl<'a> NodeView<'a> {
|
||||
pub fn new(vnode: &'a VNode<'a>, view: NodeMask) -> Self {
|
||||
pub fn new(mut vnode: &'a VNode<'a>, view: NodeMask, vdom: &'a VirtualDom) -> Self {
|
||||
if let VNode::Component(sc) = vnode {
|
||||
let scope = vdom.get_scope(sc.scope.get().unwrap()).unwrap();
|
||||
vnode = scope.root_node();
|
||||
}
|
||||
Self {
|
||||
inner: vnode,
|
||||
mask: view,
|
||||
@@ -284,6 +288,7 @@ pub trait State: Default + Clone {
|
||||
&'a mut self,
|
||||
ty: TypeId,
|
||||
node: &'a VNode<'a>,
|
||||
vdom: &'a dioxus_core::VirtualDom,
|
||||
ctx: &AnyMap,
|
||||
) -> bool;
|
||||
/// This must be a valid resolution order. (no nodes updated before a state they rely on)
|
||||
@@ -293,6 +298,7 @@ pub trait State: Default + Clone {
|
||||
&'a mut self,
|
||||
ty: TypeId,
|
||||
node: &'a VNode<'a>,
|
||||
vdom: &'a dioxus_core::VirtualDom,
|
||||
parent: Option<&Self>,
|
||||
ctx: &AnyMap,
|
||||
) -> bool;
|
||||
@@ -303,6 +309,7 @@ pub trait State: Default + Clone {
|
||||
&'a mut self,
|
||||
ty: TypeId,
|
||||
node: &'a VNode<'a>,
|
||||
vdom: &'a dioxus_core::VirtualDom,
|
||||
children: &[&Self],
|
||||
ctx: &AnyMap,
|
||||
) -> bool;
|
||||
|
||||
Reference in new issue
Block a user