[webkit-reviews] review requested: [Bug 10216] PDF created by printing should have live hyperlinks : [Attachment 10954] Adding links to pdf documents.

bugzilla-request-daemon at macosforge.org bugzilla-request-daemon at macosforge.org
Fri Oct 6 16:03:45 PDT 2006


Ken Kraisler <kraisler at apple.com> has asked Dave Hyatt <hyatt at apple.com> for
review:
Bug 10216: PDF created by printing should have live hyperlinks
http://bugs.webkit.org/show_bug.cgi?id=10216

Attachment 10954: Adding links to pdf documents.
http://bugs.webkit.org/attachment.cgi?id=10954&action=edit

------- Additional Comments from Ken Kraisler <kraisler at apple.com>
In regards to RenderObject,  RenderFlow, InlineFlowBox and most of RenderBlock,
I've implemented Dave''s suggestions above hopefully 100% accurately.

However, continuations() continue to be a problem.  As a result, I added code
to RenderBlock to handle continuations() using similar methods to my previous
patches.  One difference being that my specialized code resides only in
RenderBlock and RenderObject.

Note this snippet of printf's from InlineFlowBox when run against my two sample
documents:

void InlineFlowBox::paint(RenderObject::PaintInfo& i, int tx, int ty)
{
    int xPos = tx + m_x - object()->maximalOutlineSize(i.phase);
    int w = width() + 2 * object()->maximalOutlineSize(i.phase);
    bool intersectsDamageRect = xPos < i.r.right() && xPos + w > i.r.x();
    
    if (intersectsDamageRect && i.phase != PaintPhaseChildOutlines) {
        if (i.phase == PaintPhaseOutline || i.phase == PaintPhaseSelfOutline) {

            // Add ourselves to the paint info struct's list of inlines that
need to paint their
            // outlines.
            if (object()->style()->visibility() == VISIBLE &&
object()->style()->hasOutline() &&
                !object()->isInlineContinuation() && !isRootInlineBox()) {
                i.outlineObjects->add(flowObject());
            }
            if (object()->style()->hasOutline())
                printf( "This prints out for most types of links.  THIS NEVER
PRINTS OUT for my two sample documents containing continuation()s.  Note that
these continuations are RenderInline's" );
            if (object()->continuation() &&
object()->continuation()->style()->hasOutline())
                printf( "This never prints out." );
        }
        else {
            // 1. Paint our background and border.
            paintBackgroundAndBorder(i, tx, ty);
            
            // 2. Paint our underline and overline.
            paintDecorations(i, tx, ty, false);
        }
    }

    PaintPhase paintPhase = i.phase == PaintPhaseChildOutlines ?
PaintPhaseOutline : i.phase;
    RenderObject::PaintInfo childInfo(i);
    childInfo.phase = paintPhase;

    // 3. Paint our children.
    if (paintPhase != PaintPhaseSelfOutline) {
        for (InlineBox* curr = firstChild(); curr; curr = curr->nextOnLine()) {

            if (!curr->object()->layer())
                curr->paint(childInfo, tx, ty);
        }
    }

    // 4. Paint our strike-through
    if (intersectsDamageRect && (i.phase == PaintPhaseForeground || i.phase ==
PaintPhaseSelection))
        paintDecorations(i, tx, ty, true);
}



More information about the webkit-reviews mailing list