| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008, 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2008, 2009 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 513 | 513 |
| 514 bool KURL::hasRef() const | 514 bool KURL::hasRef() const |
| 515 { | 515 { |
| 516 // Note: KURL.cpp unescapes here. | 516 // Note: KURL.cpp unescapes here. |
| 517 // FIXME determine if KURL.cpp agrees about an empty ref | 517 // FIXME determine if KURL.cpp agrees about an empty ref |
| 518 return m_url.m_parsed.ref.len >= 0; | 518 return m_url.m_parsed.ref.len >= 0; |
| 519 } | 519 } |
| 520 | 520 |
| 521 String KURL::query() const | 521 String KURL::query() const |
| 522 { | 522 { |
| 523 if (m_url.m_parsed.query.len >= 0) { | 523 if (m_url.m_parsed.query.len >= 0) |
| 524 // KURL's query() includes the question mark, even though the reference | 524 return m_url.componentString(m_url.m_parsed.query); |
| 525 // doesn't. Move the query component backwards one to account for it | |
| 526 // (our library doesn't count the question mark). | |
| 527 url_parse::Component queryComp = m_url.m_parsed.query; | |
| 528 queryComp.begin--; | |
| 529 queryComp.len++; | |
| 530 return m_url.componentString(queryComp); | |
| 531 } | |
| 532 | 525 |
| 533 // Bug: https://bugs.webkit.org/show_bug.cgi?id=21015 this function returns | 526 // Bug: https://bugs.webkit.org/show_bug.cgi?id=21015 this function returns |
| 534 // an empty string when the query is empty rather than a null (not sure | 527 // an empty string when the query is empty rather than a null (not sure |
| 535 // which is right). | 528 // which is right). |
| 536 return String("", 0); | 529 return String("", 0); |
| 537 } | 530 } |
| 538 | 531 |
| 539 String KURL::path() const | 532 String KURL::path() const |
| 540 { | 533 { |
| 541 // Note: KURL.cpp unescapes here. | 534 // Note: KURL.cpp unescapes here. |
| (...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 939 } | 932 } |
| 940 | 933 |
| 941 inline bool KURL::protocolIs(const String& string, const char* protocol) | 934 inline bool KURL::protocolIs(const String& string, const char* protocol) |
| 942 { | 935 { |
| 943 return WebCore::protocolIs(string, protocol); | 936 return WebCore::protocolIs(string, protocol); |
| 944 } | 937 } |
| 945 | 938 |
| 946 } // namespace WebCore | 939 } // namespace WebCore |
| 947 | 940 |
| 948 #endif // USE(GOOGLEURL) | 941 #endif // USE(GOOGLEURL) |
| OLD | NEW |