 
     # Check the current bounds to make sure we do not resize <webview>
     # outside of current constraints.
-    if node.hasAttribute(webViewConstants.ATTRIBUTE_MAXWIDTH) and
-       node[webViewConstants.ATTRIBUTE_MAXWIDTH]
-      maxWidth = node[webViewConstants.ATTRIBUTE_MAXWIDTH]
-    else
-      maxWidth = width
-
-    if node.hasAttribute(webViewConstants.ATTRIBUTE_MINWIDTH) and
-       node[webViewConstants.ATTRIBUTE_MINWIDTH]
-      minWidth = node[webViewConstants.ATTRIBUTE_MINWIDTH]
-    else
-      minWidth = width
-    minWidth = maxWidth if minWidth > maxWidth
-
-    if node.hasAttribute(webViewConstants.ATTRIBUTE_MAXHEIGHT) and
-       node[webViewConstants.ATTRIBUTE_MAXHEIGHT]
-      maxHeight = node[webViewConstants.ATTRIBUTE_MAXHEIGHT]
-    else
-      maxHeight = height
-
-    if node.hasAttribute(webViewConstants.ATTRIBUTE_MINHEIGHT) and
-       node[webViewConstants.ATTRIBUTE_MINHEIGHT]
-      minHeight = node[webViewConstants.ATTRIBUTE_MINHEIGHT]
-    else
-      minHeight = height
-    minHeight = maxHeight if minHeight > maxHeight
+    maxWidth = @attributes[webViewConstants.ATTRIBUTE_MAXWIDTH].getValue() | width
+    maxHeight = @attributes[webViewConstants.ATTRIBUTE_MAXHEIGHT].getValue() | width
+    minWidth = @attributes[webViewConstants.ATTRIBUTE_MINWIDTH].getValue() | width
+    minHeight = @attributes[webViewConstants.ATTRIBUTE_MINHEIGHT].getValue() | width
 
     if not @attributes[webViewConstants.ATTRIBUTE_AUTOSIZE].getValue() or
        (newWidth >= minWidth and

      # Blur the BrowserPlugin when the <webview> loses focus.
      @browserPluginNode.blur()

  # Validation helper function for executeScript() and insertCSS().
  validateExecuteCodeCall: ->
    throw new Error(webViewConstants.ERROR_MSG_CANNOT_INJECT_SCRIPT) unless @guestInstanceId

  setupWebviewNodeProperties: ->
    # We cannot use {writable: true} property descriptor because we want a
    # dynamic getter value.

    browserPluginNode = new WebViewImpl.BrowserPlugin()
    v8Util.setHiddenValue browserPluginNode, 'internal', this
    browserPluginNode

  # Resets some state upon reattaching <webview> element to the DOM.
  reset: ->
