Changeset 48063 in webkit
- Timestamp:
- Sep 4, 2009 10:53:00 AM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r48059 r48063 1 2009-09-04 Yael Aharon <yael.aharon@nokia.com> 2 3 Reviewed by Darin Adler. 4 5 hostname and host are mixed up when manipulating anchor elements. 6 https://bugs.webkit.org/show_bug.cgi?id=28954 7 8 * fast/dom/Element/hostname-host-expected.txt: Added. 9 * fast/dom/Element/hostname-host.html: Added. 10 1 11 2009-09-04 Dimitri Glazkov <dglazkov@chromium.org> 2 12 -
trunk/WebCore/ChangeLog
r48062 r48063 1 2009-09-04 Yael Aharon <yael.aharon@nokia.com> 2 3 Reviewed by Darin Adler. 4 5 hostname and host are mixed up when manipulating anchor elements. 6 https://bugs.webkit.org/show_bug.cgi?id=28954 7 8 Swapped the implementation of host and hostname, and made sure not to return 9 the port number if it is default for the given protocol. 10 FireFox also avoids returning the protocol number if it is default. 11 12 Test: fast/dom/Element/hostname-host.html 13 14 * html/HTMLAnchorElement.cpp: 15 (WebCore::HTMLAnchorElement::host): 16 (WebCore::HTMLAnchorElement::hostname): 17 * page/SecurityOrigin.cpp: 18 (WebCore::SecurityOrigin::isDefaultPortForProtocol): 19 * page/SecurityOrigin.h: 20 1 21 2009-09-04 Anders Carlsson <andersca@apple.com> 2 22 -
trunk/WebCore/html/HTMLAnchorElement.cpp
r47688 r48063 353 353 String HTMLAnchorElement::host() const 354 354 { 355 return href().host();356 }357 358 String HTMLAnchorElement::hostname() const359 {360 355 const KURL& url = href(); 361 356 if (url.port() == 0) 362 357 return url.host(); 358 if (SecurityOrigin::isDefaultPortForProtocol(url.port(), url.protocol())) 359 return url.host(); 363 360 return url.host() + ":" + String::number(url.port()); 361 } 362 363 String HTMLAnchorElement::hostname() const 364 { 365 return href().host(); 364 366 } 365 367 -
trunk/WebCore/page/SecurityOrigin.cpp
r47548 r48063 74 74 } 75 75 76 static boolisDefaultPortForProtocol(unsigned short port, const String& protocol)76 bool SecurityOrigin::isDefaultPortForProtocol(unsigned short port, const String& protocol) 77 77 { 78 78 if (protocol.isEmpty()) -
trunk/WebCore/page/SecurityOrigin.h
r47548 r48063 145 145 static void resetOriginAccessWhiteLists(); 146 146 147 static bool isDefaultPortForProtocol(unsigned short port, const String& protocol); 148 147 149 private: 148 150 explicit SecurityOrigin(const KURL&);
Note: See TracChangeset
for help on using the changeset viewer.