ref: 79b172e05f9ee084714963a6718759dcff0f2c14
parent: 6a5c18f27d9612a4f5e5d0c48f9c3e48fa70f94d
author: Philip Silva <philip.silva@protonmail.com>
date: Mon Mar 15 10:39:41 EDT 2021
remove dead code
--- a/browser/browser.go
+++ b/browser/browser.go
@@ -52,7 +52,7 @@
var browser *Browser // TODO: limit global objects;
// at least put them in separate pkgs
-// with good choiced private/public
+// with well chosen private/public
var Style = style.Map{}
var dui *duit.DUI
var colorCache = make(map[draw.Color]*draw.Image)
@@ -117,7 +117,6 @@
for _, line := range lines {
formatted += strings.TrimSpace(line) + "\n"
}
- log.Printf("formatted=%+v", formatted)
edit.Append([]byte(formatted))
cv.UI = &Box{
Kids: duit.NewKids(edit),
@@ -127,7 +126,6 @@
}
func (cv *CodeView) Mouse(dui *duit.DUI, self *duit.Kid, m draw.Mouse, origM draw.Mouse, orig image.Point) (r duit.Result) {
- //log.Printf("m=%+v",m.Buttons)
if m.Buttons == 8 || m.Buttons == 16 {
//r.Consumed = true
return
--- a/nodes/nodes.go
+++ b/nodes/nodes.go
@@ -31,30 +31,21 @@
//
// First applies the parent style and at the end the local style attribute's style is attached.
func NewNodeTree(doc *html.Node, ps style.Map, nodeMap map[*html.Node]style.Map, parent *Node) (n *Node) {
- //fmt.Printf("<%v %v>\n", doc.Data, doc.Attr)
- //fmt.Printf(" nodeMap=%+v\n", nodeMap)
ncs := style.Map{
Declarations: make(map[string]css.Declaration),
}
- //fmt.Printf(" ps=%+v\n", ps)
ncs = ps.ApplyChildStyle(ncs, false)
- //fmt.Printf(" ncs=%+v\n", ncs)
// add from matching selectors
// (keep only inheriting properties from parent node)
if m, ok := nodeMap[doc]; ok {
- //fmt.Printf(" m=%+v\n", m)
ncs = ncs.ApplyChildStyle(m, false)
- } else {
- //fmt.Printf(" no nodeMap entry\n")
}
- //fmt.Printf(" ncs=%+v\n", ncs)
// add style attribute
// (keep all properties that already match)
styleAttr := style.NewMap(doc)
ncs = ncs.ApplyChildStyle(styleAttr, true)
- //fmt.Printf(" ncs=%+v\n", ncs)
data := doc.Data
if doc.Type == html.ElementNode {
@@ -61,8 +52,6 @@
data = strings.ToLower(data)
}
n = &Node{
- //Data: data,
- //Type: doc.Type,
DomSubtree: doc,
Attrs: doc.Attr,
Map: ncs,
@@ -71,7 +60,6 @@
}
n.Wrappable = doc.Type == html.TextNode || doc.Data == "span" // TODO: probably this list needs to be extended
if doc.Type == html.TextNode {
-
n.Text = filterText(doc.Data)
n.Map = style.Map{
Declarations: make(map[string]css.Declaration),