}
private Element createOrUpdateLineElement(final Line line, final int lineNumber,
int createOffset) {
int top = buffer.calculateLineTop(lineNumber);
Element element = getLineElement(line);
boolean isCreatingElement = element == null;
if (isCreatingElement) {
element = Elements.createDivElement();
element.getStyle().setPosition(CSSStyleDeclaration.Position.ABSOLUTE);
lineRendererController.renderLine(line, lineNumber, element, true);
line.putTag(LINE_TAG_LINE_ELEMENT, element);
}
new DebugAttributeSetter().add("lineNum", Integer.toString(lineNumber)).on(element);
if (!buffer.hasLineElement(element)) {
element.getStyle().setTop(top + createOffset, CSSStyleDeclaration.Unit.PX);
buffer.addLineElement(element);
if (createOffset != 0) {
/*
* TODO: When enabling editor animations, reinvestigate
* need for below
*/
// Force a browser layout so CSS3 animations transition properly.
//element.getClientWidth();
element.getStyle().setTop(top, CSSStyleDeclaration.Unit.PX);
}
handleLineEnteredViewport(line, lineNumber, element);
} else {
element.getStyle().setTop(top, CSSStyleDeclaration.Unit.PX);
}
if (isCreatingElement) {
lineLifecycleListenerManager.dispatch(new Dispatcher<Renderer.LineLifecycleListener>() {
@Override