simple layouts
Hi, I can't get any page to render (using Go 1.6 on FC23 x86_64)
Maybe some simple tests would help understand where the browser is at.
I also suggest a simple cli snaphot option so that the rendering can be saved to a png file and compared over time.
Thanks for this interesting project.
P.S: Have you decided on which JS engine will use use ?
Gob t.html
XGB: conn.go:47: Could not get authority info: EOF XGB: conn.go:48: Trying connection without authority info... 2016/06/27 20:14:30 x11driver: xproto.WaitForEvent: BadAccess {NiceName: Access, Sequence: 17, BadValue: 29360132, MinorOpcode: 1, MajorOpcode: 130} 2016/06/27 20:14:30 x11driver: xproto.WaitForEvent: BadBadSeg {NiceName: BadSeg, Sequence: 18, BadValue: 29360133, MinorOpcode: 3, MajorOpcode: 130}
There should already be tests for the parts that are testable (ie. css parsing, the parts that check if an element matches a style, etc), but the rendering is harder to write tests for since "does this look correct?" is mostly subjective.
Here are two test files I use that render correctly for me. (One is just a couple divs with stylesheets, the other is version of my website at https://driusan.github.io with the css inlined to make it easier to test, though I just checked and accessing it through ./Gob https://driusan.github.io doesn't seem to work correctly, so there must be a problem loading external stylesheets that I need to look into...)
If you email me your t.html file I can see if there's something obvious and simple. You also might want to try loading it from $GOPATH/src/github.com/driusan/Gob . The useragent.css file is loaded from the filesystem, even though it should probably be compiled in so that it doesn't matter where you run it from..
simplifieddriusan.html.txt test.html.txt
(you'll have to rename the files from .txt to .html, GitHub wouldn't let me upload html files directly.)
But things are still a long way from useable. The biggest bottlenecks are that floats don't work properly, and tables aren't implemented at all.
my test file was
hello! your test files also result in an empty screen, below is the tail of the log [....] Token: S (line: 40, column: 19): " " Token: DIMENSION (line: 40, column: 20): "10px" Token: CHAR (line: 40, column: 24): ";" Token: S (line: 40, column: 25): "\n\n" Token: CHAR (line: 42, column: 1): "}" Token: S (line: 42, column: 2): "\n\n" XGB: conn.go:47: Could not get authority info: EOF XGB: conn.go:48: Trying connection without authority info... 2016/06/28 11:44:01 x11driver: xproto.WaitForEvent: BadAccess {NiceName: Access, Sequence: 18, BadValue: 27262980, MinorOpcode: 1, MajorOpcode: 130} 2016/06/28 11:44:01 x11driver: xproto.WaitForEvent: BadBadSeg {NiceName: BadSeg, Sequence: 19, BadValue: 27262981, MinorOpcode: 3, MajorOpcode: 130}I haven't had time yet to look at the code. Thanks
Sorry! The html doesn't show. My test file was basically an html and body tag with an string (the simplest posible file)
go test
github.com/driusan/Gob
./main_test.go:112: not enough arguments in call to parsedhtml.Content.LayoutPass ./main_test.go:118: not enough arguments in call to parsedhtml.Content.LayoutPass FAIL github.com/driusan/Gob [build failed]
Sorry! The html doesn't show.
@jojo05 You should place it, as well as console output, inside a fenced code block for better readability. See https://guides.github.com/features/mastering-markdown/#GitHub-flavored-markdown for details.
thanks
@jojo05 there was some benchmark tests which didn't have the arguments updated when a function changed its signature. It should be fixed now.
I'm not sure why you'd get a blank screen. Can you run any shiny programs? (ie. the basic example in $GOPATH/src/golang.org/x/exp/shiny/example/basic?)
I get a blank screen with the basic example too
go run main.go
XGB: conn.go:47: Could not get authority info: EOF XGB: conn.go:48: Trying connection without authority info... 2016/07/05 16:22:14 x11driver: xproto.WaitForEvent: BadAccess {NiceName: Access, Sequence: 17, BadValue: 25165828, MinorOpcode: 1, MajorOpcode: 130} 2016/07/05 16:22:14 x11driver: xproto.WaitForEvent: BadBadSeg {NiceName: BadSeg, Sequence: 22, BadValue: 25165827, MinorOpcode: 3, MajorOpcode: 130}