code: public static final int getW(Element e) {
          int ret = e.getOffsetWidth();
          ret -= MiscUtils.getComputedStyleInt(e, "paddingLeft");
          ret -= MiscUtils.getComputedStyleInt(e, "paddingRight");
          ret -= MiscUtils.getComputedStyleInt(e, "borderLeftWidth");
          ret -= MiscUtils.getComputedStyleInt(e, "borderRightWidth");
          return Math.max(ret, 0);
      }
docs: Updated to factor in border and padding