Skip to content
  • commit-queue@webkit.org's avatar
    The "port" property of an <a> whose href does not specify a port returns the wrong value · b3745700
    commit-queue@webkit.org authored
    https://bugs.webkit.org/show_bug.cgi?id=66081
    
    Source/WebCore:
    
    HTMLAnchorElement now returns "" instead of "0" for unset port
    Fixed KURLGoogle.cpp to have same behavior as KURL.cpp when setting port 0
    Fixed Location.cpp to have same behavior as KURL.cpp when setting port 0
    
    Patch by Rachel Blum <groby@chromium.org> on 2011-08-30
    Reviewed by Adam Barth.
    
    Tests: fast/dom/HTMLAnchorElement/get-href-attribute-port.html
           fast/dom/HTMLAnchorElement/set-href-attribute-port.html
           fast/loader/location-port.html
           fast/url/segments-from-data-url.html
           fast/url/segments.html
           fast/url/trivial-segments.html
           platform/chromium/fast/dom/HTMLAnchorElement/set-href-attribute-port.html
    
    * html/HTMLAnchorElement.cpp:
    (WebCore::HTMLAnchorElement::port):
    * page/Location.cpp:
    (WebCore::Location::host):
    (WebCore::Location::port):
    (WebCore::Location::setPort):
    * platform/KURLGoogle.cpp:
    (WebCore::KURL::setPort):
    
    LayoutTests:
    
    Updated tests to reflect behavior change around invalid port strings.
    Updated chromium location-port test to reflect chromium issues
    
    Patch by Rachel Blum <groby@chromium.org> on 2011-08-30
    Reviewed by Adam Barth.
    
    * fast/dom/HTMLAnchorElement/get-href-attribute-port-expected.txt: Added.
    * fast/dom/HTMLAnchorElement/get-href-attribute-port.html: Added.
    * fast/dom/HTMLAnchorElement/script-tests/get-href-attribute-port.js: Added.
    * fast/loader/location-port-expected.txt:
    * fast/loader/location-port.html:
    * fast/url/script-tests/segments-from-data-url.js:
    * fast/url/script-tests/segments.js:
    * fast/url/script-tests/trivial-segments.js:
    * fast/url/segments-expected.txt:
    * fast/url/segments-from-data-url-expected.txt:
    * fast/url/trivial-segments-expected.txt:
    * platform/chromium-cg-mac/fast/loader/location-port-expected.txt:
    * platform/chromium-win/fast/loader/location-port-expected.txt:
    * platform/chromium/fast/dom/HTMLAnchorElement/set-href-attribute-port-expected.txt:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@94132 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    b3745700