The "port" property of an <a> whose href does not specify a port returns the wrong...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 31 Aug 2011 00:13:20 +0000 (00:13 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 31 Aug 2011 00:13:20 +0000 (00:13 +0000)
commit71777828e01ab017d0eb9efd8a3ecb0fb32c939f
tree1ea9b5c31db328c5898de55d1d652f9d4870ba72
parent7c483f7eb9377e2cd8e2e0b58a85cbbe8beb680d
The "port" property of an <a> whose href does not specify a port returns the wrong value
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: https://svn.webkit.org/repository/webkit/trunk@94132 268f45cc-cd09-0410-ab3c-d52691b4dbfc
19 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/dom/HTMLAnchorElement/get-href-attribute-port-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/HTMLAnchorElement/get-href-attribute-port.html [new file with mode: 0644]
LayoutTests/fast/dom/HTMLAnchorElement/script-tests/get-href-attribute-port.js [new file with mode: 0644]
LayoutTests/fast/loader/location-port-expected.txt
LayoutTests/fast/loader/location-port.html
LayoutTests/fast/url/script-tests/segments-from-data-url.js
LayoutTests/fast/url/script-tests/segments.js
LayoutTests/fast/url/script-tests/trivial-segments.js
LayoutTests/fast/url/segments-expected.txt
LayoutTests/fast/url/segments-from-data-url-expected.txt
LayoutTests/fast/url/trivial-segments-expected.txt
LayoutTests/platform/chromium-cg-mac/fast/loader/location-port-expected.txt
LayoutTests/platform/chromium-win/fast/loader/location-port-expected.txt
LayoutTests/platform/chromium/fast/dom/HTMLAnchorElement/set-href-attribute-port-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLAnchorElement.cpp
Source/WebCore/page/Location.cpp
Source/WebCore/platform/KURLGoogle.cpp