Skip to content
  • commit-queue@webkit.org's avatar
    View source doesn't interpret escape characters in hrefs. · 5c7bb0f3
    commit-queue@webkit.org authored
    https://bugs.webkit.org/show_bug.cgi?id=94216
    
    Patch by Anthony Berent <aberent@chromium.org> on 2012-08-17
    Reviewed by Adam Barth.
    
    Source/WebCore:
    
    The cause was that HTMLViewSourceDocument was passing the unparsed content of the href attribute to the DOM as the URL for the link.
    The fix is to pass the parsed content of the href attribute to the DOM.
    
    Test: fast/forms/frames/viewsource-link-on-href-value.html extended to test this case.
    
    * html/HTMLViewSourceDocument.cpp:
    (WebCore::HTMLViewSourceDocument::processTagToken): Pass parsed URL to AddRange.
    (WebCore::HTMLViewSourceDocument::addRange):Added argument for parsed URL, and used this instead of text, to create link.
    * html/HTMLViewSourceDocument.h:
    (HTMLViewSourceDocument): Add new link argument to addRange for parsed URL, defaulting to "".
    
    LayoutTests:
    
    Extra href added to test containing escape characters
    
    * fast/frames/resources/viewsource-frame-3.html: Added href containing escape characters to test
    * fast/frames/resources/viewsource-frame-4.html: Added href containing escape characters to test
    * fast/frames/viewsource-link-on-href-value.html: Check escape characters are correctly interpreted in href.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125878 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    5c7bb0f3