[gtk+/wip/alexl/broadway4: 60/62] broadway: Add div for container nodes



commit e6a68e42c33ae21138ab9c34d5b6b1b9f64a88b7
Author: Alexander Larsson <alexl redhat com>
Date:   Wed Nov 29 19:31:54 2017 +0100

    broadway: Add div for container nodes
    
    We need this so that all nodes have divs, otherwise diffing is going
    to be very hard.

 gdk/broadway/broadway.js |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/gdk/broadway/broadway.js b/gdk/broadway/broadway.js
index acbd80d..0f85c7a 100644
--- a/gdk/broadway/broadway.js
+++ b/gdk/broadway/broadway.js
@@ -459,10 +459,12 @@ SwapNodes.prototype.handle_node = function(parent, offset_x, offset_y)
 
     case 1: // CONTAINER
         {
+            var div = document.createElement('div');
             var len = this.decode_uint32();
             for (var i = 0; i < len; i++) {
-                this.handle_node(parent, offset_x, offset_y);
+                this.handle_node(div, offset_x, offset_y);
             }
+            parent.appendChild(div);
         }
         break;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]