michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0:
michael@0: //-----------------------------------------------------------------------------
michael@0: var BUGNUMBER = 464862;
michael@0: var summary = 'Do not assert: ( int32_t(delta) == uint8_t(delta) )';
michael@0: var actual = '';
michael@0: var expect = '';
michael@0:
michael@0: printBugNumber(BUGNUMBER);
michael@0: printStatus (summary);
michael@0:
michael@0: function ygTreeView(id) {
michael@0: this.init(id);
michael@0: }
michael@0:
michael@0: ygTreeView.prototype.init = function (id) {this.root = new ygRootNode(this);};
michael@0:
michael@0: function ygNode() {}
michael@0:
michael@0: ygNode.prototype.nextSibling = null;
michael@0:
michael@0: ygNode.prototype.init = function (_32, _33, _34) {
michael@0: this.children = [];
michael@0: this.expanded = _34;
michael@0: if (_33) {
michael@0: this.tree = _33.tree;
michael@0: this.depth = _33.depth + 1;
michael@0: _33.appendChild(this);
michael@0: }
michael@0: };
michael@0:
michael@0: ygNode.prototype.appendChild = function (_35) {
michael@0: if (this.hasChildren()) {
michael@0: var sib = this.children[this.children.length - 1];
michael@0: }
michael@0: this.children[this.children.length] = _35;
michael@0: };
michael@0:
michael@0: ygNode.prototype.getElId = function () {};
michael@0:
michael@0: ygNode.prototype.getNodeHtml = function () {};
michael@0:
michael@0: ygNode.prototype.getToggleElId = function () {};
michael@0:
michael@0: ygNode.prototype.getStyle = function () {
michael@0: var loc = this.nextSibling ? "t" : "l";
michael@0: var _39 = "n";
michael@0: if (this.hasChildren(true)) {}
michael@0: };
michael@0:
michael@0: ygNode.prototype.hasChildren = function () {return this.children.length > 0;};
michael@0:
michael@0: ygNode.prototype.getHtml = function () {
michael@0: var sb = [];
michael@0: sb[sb.length] = "
";
michael@0: sb[sb.length] = this.getNodeHtml();
michael@0: sb[sb.length] = this.getChildrenHtml();
michael@0: };
michael@0:
michael@0: ygNode.prototype.getChildrenHtml = function () {
michael@0: var sb = [];
michael@0: if (this.hasChildren(true) && this.expanded) {
michael@0: sb[sb.length] = this.renderChildren();
michael@0: }
michael@0: };
michael@0:
michael@0: ygNode.prototype.renderChildren = function () {return this.completeRender();};
michael@0:
michael@0: ygNode.prototype.completeRender = function () {
michael@0: var sb = [];
michael@0: for (var i = 0; i < this.children.length; ++i) {
michael@0: sb[sb.length] = this.children[i].getHtml();
michael@0: }
michael@0: };
michael@0:
michael@0: ygRootNode.prototype = new ygNode;
michael@0:
michael@0: function ygRootNode(_48) {
michael@0: this.init(null, null, true);
michael@0: }
michael@0:
michael@0: ygTextNode.prototype = new ygNode;
michael@0:
michael@0: function ygTextNode(_49, _50, _51) {
michael@0: this.init(_49, _50, _51);
michael@0: this.setUpLabel(_49);
michael@0: }
michael@0:
michael@0: ygTextNode.prototype.setUpLabel = function (_52) {
michael@0: if (typeof _52 == "string") {}
michael@0: if (_52.target) {}
michael@0: this.labelElId = "ygtvlabelel" + this.index;
michael@0: };
michael@0:
michael@0: ygTextNode.prototype.getNodeHtml = function () {
michael@0: var sb = new Array;
michael@0: sb[sb.length] = "
";
michael@0: sb[sb.length] = "";
michael@0: for (i = 0; i < this.depth; ++i) {}
michael@0: sb[sb.length] = " id=\"" + this.getToggleElId() + "\"";
michael@0: sb[sb.length] = " class=\"" + this.getStyle() + "\"";
michael@0: if (this.hasChildren(true)) {}
michael@0: sb[sb.length] = " id=\"" + this.labelElId + "\"";
michael@0: };
michael@0:
michael@0: function buildUserTree() {
michael@0: userTree = new ygTreeView("userTree");
michael@0: addMenuNode(userTree, "N", "navheader");
michael@0: addMenuNode(userTree, "R", "navheader");
michael@0: addMenuNode(userTree, "S", "navheader");
michael@0: }
michael@0:
michael@0: function addMenuNode(tree, label, styleClass) {
michael@0: new ygTextNode({}, tree.root, false);
michael@0: }
michael@0:
michael@0: buildUserTree();
michael@0: userTree.root.getHtml();
michael@0:
michael@0: reportCompare(expect, actual, summary);