diff --git a/lib/gcli/ui/view.js b/lib/gcli/ui/view.js
index <HASH>..<HASH> 100644
--- a/lib/gcli/ui/view.js
+++ b/lib/gcli/ui/view.js
@@ -77,6 +77,7 @@ exports.createView = function(options) {
  */
 exports.populateWithOutputData = function(outputData, element) {
   util.clearElement(element);
+  var document = element.ownerDocument;
 
   var output = outputData.output;
   if (output == null) {
@@ -88,16 +89,16 @@ exports.populateWithOutputData = function(outputData, element) {
     node = output;
   }
   else if (output.isView) {
-    node = output.toDom(element.ownerDocument);
+    node = output.toDom(document);
   }
   else {
     if (outputData.command.returnType === 'terminal') {
-      node = util.createElement(element.ownerDocument, 'textarea');
+      node = util.createElement(document, 'textarea');
       node.classList.add('gcli-row-terminal');
       node.readOnly = true;
     }
     else {
-      node = util.createElement(element.ownerDocument, 'p');
+      node = util.createElement(document, 'p');
     }
 
     util.setContents(node, output.toString());
Bug <I> (intro): Don't lookup element.ownerDocument repeatedly