示例#1
0
        public static void OnPostedContentChange()
        {
            in_content_change = false;

            SciterValue sv = App.AppHost.EvalScript("View.omnidata.dom_tree_disable");

            if (sv.Get(false) == false)
            {
                DOMTree.Rebuild();
            }

            if (g_el_inspected != null)
            {
                // element might have been removed, so restore selection to its closest parent from its parent stack (g_parentstack)
                SciterElement el_sel = null;
                if (g_parentstack != null)
                {
                    foreach (var item in g_parentstack)
                    {
                        IntPtr hwnd;
                        if (SciterX.API.SciterGetElementHwnd(item._he, out hwnd, true) == SciterXDom.SCDOM_RESULT.SCDOM_OK)
                        {
                            el_sel = item;
                            break;
                        }
                    }
                }
                if (el_sel != null)
                {
                    //if(el_sel==g_el_inspected)
                    //	PageElemHighlight(el_sel);// something to test out, it is anoying
                    PageElemInspect(el_sel, true);
                }
            }
        }
示例#2
0
        public static void Rebuild()
        {
            Stopwatch sw = new Stopwatch();;

            sw.Start();

            Clear();

            if (State.g_el_frameroot.ChildrenCount == 0)
            {
                return;                // you removed the <html> element bastard
            }
            Inspecting.g_dom_count_elem = 0;
            Inspecting.g_dom_count_node = 0;

            SciterElement origin_el_root = State.g_el_frameroot[0];

            Debug.Assert(origin_el_root != null);
            origin_el_root.SetAttribute("omni", "");

            AddElement(el_tree, origin_el_root);

            sw.Stop();

            SciterValue sv = App.AppHost.EvalScript("View.omnidata.show_tree_timing");

            if (sv.Get(false))
            {
                Host._sdh.InternalOutput($"[Omni internal] DOM-tree Rebuild time: {sw.ElapsedMilliseconds}ms");
            }
        }
示例#3
0
        public static void UserPageElemInspect(SciterElement el)
        {
            App.AppHost.CallFunction("Inspector.ShowInspector", new SciterValue(0));

            // tree not constructed?
            SciterValue sv = App.AppHost.EvalScript("View.omnidata.dom_tree_disable");

            if (sv.Get(false) == true)
            {
                DOMTree.Rebuild();
            }

            /*wstring tag = el.get_tagname(); - why I had this? commented...
             * if(tag=="text")
             * {
             *      if(cast(int) el.parent)
             *              el = el.parent;
             *      else
             *              return;
             * }*/

            PageElemInspect(el, true);
            PageElemHighlight(el);
        }