use of org.loboevolution.html.dom.HTMLDocument in project LoboEvolution by LoboEvolution.
the class PositionedRenderable method getSome.
private Point getSome() {
final RCollection rparent = renderable.getParent();
if (!isFixed && rparent.getModelNode() instanceof HTMLDocument) {
Renderable htmlRenderable = renderable.findHtmlRenderable(rparent);
if (htmlRenderable instanceof PositionedRenderable) {
final PositionedRenderable htmlPR = (PositionedRenderable) htmlRenderable;
htmlRenderable = htmlPR.renderable;
}
if (htmlRenderable instanceof RBlock) {
final RBlock htmlBlock = ((RBlock) htmlRenderable);
final Point htmlOffset = htmlBlock.bodyLayout.getOrigin();
final Insets htmlInsets = htmlBlock.getInsetsMarginBorder(htmlBlock.hasHScrollBar, htmlBlock.hasVScrollBar);
return new Point((int) htmlOffset.getX() - htmlInsets.left, (int) htmlOffset.getY() - htmlInsets.top);
}
}
return null;
}
use of org.loboevolution.html.dom.HTMLDocument in project LoboEvolution by LoboEvolution.
the class HTMLDocumentTest method testCloneDocumentNode.
@Test
public void testCloneDocumentNode() {
HTMLDocument doc = (HTMLDocument) document.cloneNode(false);
assertNull(doc.getDoctype());
assertNull(doc.getDocumentElement());
assertSame(document.getImplementation(), doc.getImplementation());
}
use of org.loboevolution.html.dom.HTMLDocument in project LoboEvolution by LoboEvolution.
the class DelayedPair method helperGetPixelSize.
private Integer helperGetPixelSize(final String spec, final RenderState rs, final int errorValue, final int avail) {
if (spec != null) {
Window window = null;
ModelNode node = getModelNode();
if (node instanceof HTMLDocument) {
HTMLDocumentImpl doc = (HTMLDocumentImpl) node;
window = doc.getDefaultView();
}
return "auto".equals(spec) ? null : HtmlValues.getPixelSize(spec, rs, window, errorValue, avail);
} else {
return null;
}
}
use of org.loboevolution.html.dom.HTMLDocument in project LoboEvolution by LoboEvolution.
the class LinkRenderState method linkColor.
private Color linkColor() {
if (rcontext != null) {
boolean visited = rcontext.isVisitedLink(element);
String vlink = null;
String link = null;
HTMLDocument doc = (HTMLDocument) element.getDocumentNode();
if (doc != null) {
HTMLBodyElement body = (HTMLBodyElement) doc.getBody();
if (body != null) {
vlink = body.getVLink();
link = body.getLink();
}
}
vlink = (vlink == null) ? COLOR_VISITED : vlink;
link = (link == null) ? DEFAULT_COLOR : link;
String colorText = visited ? vlink : link;
AbstractCSSProperties props = this.getCssProperties();
String color = props == null ? null : props.getColor();
return ColorFactory.getInstance().getColor(color == null ? colorText : color);
}
return Color.BLUE;
}
Aggregations