code: public void startElementContents(ElementBox elem)
      {
          if (elem instanceof BlockBox && ((BlockBox) elem).getOverflowX() != BlockBox.OVERFLOW_VISIBLE)
          {
              //for blocks with overflow != visible generate a clipping group
              Rectangle cb = elem.getClippedContentBounds();
              String clip = "cssbox-clip-" + idcounter;
              out.print("<clipPath id=\"" + clip + "\">");
              out.print("<rect x=\"" + cb.x + "\" y=\"" + cb.y + "\" width=\"" + cb.width + "\" height=\"" + cb.height + "\" />");
              out.println("</clipPath>");
              out.println("<g id=\"cssbox-obj-" + idcounter + "\" clip-path=\"url(#" + clip + ")\">");
              idcounter++;
          }
      }
docs: ====================================================================================================