NodeData returns null values for all the font properties for the following declaration p { font: 200 italic 120%/120% "Times New Roman" }
Update:
String css = "p {font: 400 italic 40px/1 \"Times New Roman\";}"; String html = "<html><head><style>" + css + "</style></head><body><p>Hello</p></body></html> "; InputStream is = new ByteArrayInputStream(html.getBytes()); DocumentSource docSrc = new StreamDocumentSource(is, new URL("http://localhost"), "text/html"); DOMSource domSrc = new DefaultDOMSource(docSrc); Document doc = domSrc.parse(); Element pElem = doc.createElement("p"); StyleSheet styleSheet = CSSFactory.parse(css); DirectAnalyzer directAnalyser = new DirectAnalyzer(styleSheet); NodeData firstNodeData = directAnalyser.getElementStyle(pElem, null, "screen"); final NodeData secondNodeData = directAnalyser.getElementStyle(pElem, null, "screen"); System.out.println("First run: " + firstNodeData); System.out.println("Second run: " + secondNodeData);
if the above snippet is run, the value of secondNodeData is null. Basically after the first call the value returned is always null.
secondNodeData
null
And if we remove /1 (line-height) form the font declaration, everything works fine.
/1 (line-height)
font
Anonymous
You seem to have CSS turned off. Please don't fill out this field.
This bug is fixed by PR
Tested and verified.
Closed in 1.19
Update:
if the above snippet is run, the value of
secondNodeData
isnull
. Basically after the first call the value returned is alwaysnull
.And if we remove
/1 (line-height)
form thefont
declaration, everything works fine.This bug is fixed by PR
Last edit: Chetan Kothari 2014-09-26
Tested and verified.
Closed in 1.19