PaneAttributes attributes) {
// If there is a style attribute for the pane and the device supports
// style sheets then surround the output with a div element unless
// an enclosing table cell can be used instead
if (supportsInlineStyles || supportsExternalStyleSheets) {
PaneInstance paneInstance = (PaneInstance)
context.getDeviceLayoutContext().
getCurrentFormatInstance(attributes.getPane());
PaneRendering rendering;
rendering = determinePaneRendering(dom, attributes);
// Record the rendering used
// in the PaneInstance for use in closePane.
paneInstance.setRendering(rendering);
if (rendering == PaneRendering.USE_ENCLOSING_TABLE_CELL) {
Element parent = dom.getCurrentElement();
addCoreAttributes(parent, attributes);