Skip to content

Quad from int -> float64#1

Open
fjmk wants to merge 1 commit into
masterfrom
fjmk-patch-1
Open

Quad from int -> float64#1
fjmk wants to merge 1 commit into
masterfrom
fjmk-patch-1

Conversation

@fjmk
Copy link
Copy Markdown
Owner

@fjmk fjmk commented May 2, 2018

dom.GetBoxModel returns floats sometimes
Error: json: cannot unmarshal number 1143.96875 into Go struct field BoxModel.content of type int

Some code to test is (added to your screenshot example):

			// Get document nodeID
			var nodeID, elementID dom.NodeID
			if node := <-tab.DOM().GetDocument(&dom.GetDocumentParams{-1, false}); node.Err != nil {
				panic(node.Err)
			} else {
				nodeID = node.Root.NodeID
			}
			// get elementID
			if element := <-tab.DOM().QuerySelector(&dom.QuerySelectorParams{nodeID, "#fsr"}); element.Err != nil && element.NodeID != 0 {
				panic(element.Err)
			} else {
				elementID = element.NodeID
			}
			
			var model *dom.BoxModel
			if boxModel := <-tab.DOM().GetBoxModel(&dom.GetBoxModelParams{elementID, 0, ""}); boxModel.Err != nil {
				panic(boxModel.Err)
			} else {
				model = boxModel.Model
			}

I am not sure if this affects other code and/or tests in this library.

dom.GetBoxModel returns floats sometimes
Error: json: cannot unmarshal number 683.96875 into Go struct field BoxModel.content of type int
@fjmk fjmk closed this May 2, 2018
@fjmk fjmk reopened this May 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant