forked from AuroraMiddleware/gtk
Merge branch 'wip/otte/for-main' into 'main'
cssnode: Don't crash the inspector See merge request GNOME/gtk!5595
This commit is contained in:
commit
0fa1e71ef0
@ -507,9 +507,6 @@ gtk_css_node_real_node_removed (GtkCssNode *parent,
|
||||
node->previous_sibling = NULL;
|
||||
node->next_sibling = NULL;
|
||||
node->parent = NULL;
|
||||
|
||||
if (parent->children_observer)
|
||||
gtk_list_list_model_item_removed (parent->children_observer, previous);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -715,6 +712,8 @@ gtk_css_node_reposition (GtkCssNode *node,
|
||||
if (old_parent != NULL)
|
||||
{
|
||||
GTK_CSS_NODE_GET_CLASS (old_parent)->node_removed (old_parent, node, node->previous_sibling);
|
||||
if (old_parent->children_observer && old_parent != new_parent)
|
||||
gtk_list_list_model_item_removed (old_parent->children_observer, previous);
|
||||
if (old_parent->first_child && node->visible)
|
||||
gtk_css_node_invalidate (old_parent->first_child, GTK_CSS_CHANGE_NTH_LAST_CHILD);
|
||||
}
|
||||
@ -784,7 +783,7 @@ gtk_css_node_reposition (GtkCssNode *node,
|
||||
|
||||
if (new_parent && new_parent->children_observer)
|
||||
{
|
||||
if (old_previous)
|
||||
if (old_previous && old_parent == new_parent)
|
||||
gtk_list_list_model_item_moved (new_parent->children_observer, node, old_previous);
|
||||
else
|
||||
gtk_list_list_model_item_added (new_parent->children_observer, node);
|
||||
|
@ -142,6 +142,9 @@ endforeach
|
||||
|
||||
node_parser_tests = [
|
||||
'blend.node',
|
||||
'blend-unknown-mode.errors',
|
||||
'blend-unknown-mode.node',
|
||||
'blend-unknown-mode.ref.node',
|
||||
'border.node',
|
||||
'color.node',
|
||||
'conic-gradient.node',
|
||||
@ -201,6 +204,8 @@ node_parser_tests = [
|
||||
'empty-text.ref.node',
|
||||
'empty-texture.node',
|
||||
'empty-texture.ref.node',
|
||||
'empty-texture-scale.node',
|
||||
'empty-texture-scale.ref.node',
|
||||
'empty-transform.node',
|
||||
'empty-transform.ref.node',
|
||||
'glshader.node',
|
||||
@ -229,6 +234,9 @@ node_parser_tests = [
|
||||
'texture-fail.node',
|
||||
'texture-fail.ref.node',
|
||||
'texture-fail.ref.errors',
|
||||
'texture-scale-unknown-filter.errors',
|
||||
'texture-scale-unknown-filter.node',
|
||||
'texture-scale-unknown-filter.ref.node',
|
||||
'transform-fail.node',
|
||||
'transform-fail.ref.node',
|
||||
'transform-fail.errors',
|
||||
|
1
testsuite/gsk/nodeparser/blend-unknown-mode.errors
Normal file
1
testsuite/gsk/nodeparser/blend-unknown-mode.errors
Normal file
@ -0,0 +1 @@
|
||||
<data>:2:9-13: error: GTK_CSS_PARSER_ERROR_SYNTAX
|
3
testsuite/gsk/nodeparser/blend-unknown-mode.node
Normal file
3
testsuite/gsk/nodeparser/blend-unknown-mode.node
Normal file
@ -0,0 +1,3 @@
|
||||
blend {
|
||||
mode: diff;
|
||||
}
|
10
testsuite/gsk/nodeparser/blend-unknown-mode.ref.node
Normal file
10
testsuite/gsk/nodeparser/blend-unknown-mode.ref.node
Normal file
@ -0,0 +1,10 @@
|
||||
blend {
|
||||
bottom: color {
|
||||
bounds: 0 0 50 50;
|
||||
color: rgb(170,255,0);
|
||||
}
|
||||
top: color {
|
||||
bounds: 0 0 50 50;
|
||||
color: rgb(255,0,204);
|
||||
}
|
||||
}
|
2
testsuite/gsk/nodeparser/empty-texture-scale.node
Normal file
2
testsuite/gsk/nodeparser/empty-texture-scale.node
Normal file
@ -0,0 +1,2 @@
|
||||
texture-scale {
|
||||
}
|
6
testsuite/gsk/nodeparser/empty-texture-scale.ref.node
Normal file
6
testsuite/gsk/nodeparser/empty-texture-scale.ref.node
Normal file
@ -0,0 +1,6 @@
|
||||
texture-scale {
|
||||
bounds: 0 0 50 50;
|
||||
texture: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAKUlEQVQYlWP8z3DmPwMaYGQwYUQX\
|
||||
Y0IXwAUGUCGGoxkYGBiweXAoeAYAz44F3e3U1xUAAAAASUVORK5CYII=\
|
||||
");
|
||||
}
|
@ -0,0 +1 @@
|
||||
<data>:2:11-29: error: GTK_CSS_PARSER_ERROR_SYNTAX
|
@ -0,0 +1,3 @@
|
||||
texture-scale {
|
||||
filter: guess-i-dont-exist;
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
texture-scale {
|
||||
bounds: 0 0 50 50;
|
||||
texture: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAKUlEQVQYlWP8z3DmPwMaYGQwYUQX\
|
||||
Y0IXwAUGUCGGoxkYGBiweXAoeAYAz44F3e3U1xUAAAAASUVORK5CYII=\
|
||||
");
|
||||
}
|
Loading…
Reference in New Issue
Block a user