[Webkit-unassigned] [Bug 112081] Printing to PDF should produce internal links when HTML has internal links

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Mar 12 23:27:44 PDT 2013


https://bugs.webkit.org/show_bug.cgi?id=112081





--- Comment #13 from David Lattimore <dml+webkit at google.com>  2013-03-12 23:30:09 PST ---
(From update of attachment 192865)
View in context: https://bugs.webkit.org/attachment.cgi?id=192865&action=review

>> Source/WebCore/rendering/RenderObject.cpp:1124
>> +            document()->addUsedAnchor(name, element);
> 
> Would it work if we just called addDestinationAtPoint here? The same destination could be added several times, but I don't see any reason why that would be a problem. We are just using an intermediate map instead of one in PDF context.

Unfortunately not. GraphicsContext::addDestinationAtPoint needs to be called on the GraphicsContext for the page containing the destination. If we called it here, the link would only work if the destination was on the same page as the link. It's currently being called for all pages and then dropped when the point falls outside the bounds of the page (i.e. all but the correct page). I'll have a look and see if I can find another way of structuring it without storing stuff on Document. If you have any ideas, let me know.

>> Source/WebCore/rendering/RenderObject.cpp:1129
>> +    context->setURLForRect(url, pixelSnappedIntRect(rect));
> 
> Unsure if it's meaningful to add a same-document URL if anchor couldn't be found. Perhaps the early return should be outside "if (element)"?

The patch as it currently stands puts out a regular link - i.e. falls back to the old behavior. I'll move the return, which will mean same-document URLs that are broken will become non-links.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list