   createdCallback: ->
     @attached = false
     @subscriptions = new CompositeDisposable
+    @inlineDisplayStyles = new WeakMap
+
     @initializeContent()
     @subscribeToDOMEvents()
     @createSpacePenShim()

{CompositeDisposable} = require 'event-kit'
{$} = require './space-pen-extensions'
PaneView = require './pane-view'

class PaneElement extends HTMLElement

  activeItemChanged: (item) ->
    return unless item?

    hasFocus = @hasFocus()
    itemView = @model.getView(item)

    for child in @itemViews.children
      if child is itemView
        @showItemView(child) if @attached
      else
        @hideItemView(child)

    unless @itemViews.contains(itemView)
      @itemViews.appendChild(itemView)
      callAttachHooks(itemView)

    itemView.focus() if hasFocus

  showItemView: (itemView) ->
    inlineDisplayStyle = @inlineDisplayStyles.get(itemView)
    if inlineDisplayStyle?
      itemView.style.display = inlineDisplayStyle
    else
      itemView.style.display = ''

  hideItemView: (itemView) ->
    inlineDisplayStyle = itemView.style.display
    @inlineDisplayStyles.set(itemView, inlineDisplayStyle) if inlineDisplayStyle?
    itemView.style.display = 'none'

  itemRemoved: ({item, index, destroyed}) ->
    if item instanceof $
