Diff
Modified: trunk/LayoutTests/ChangeLog (163298 => 163299)
--- trunk/LayoutTests/ChangeLog 2014-02-03 10:05:06 UTC (rev 163298)
+++ trunk/LayoutTests/ChangeLog 2014-02-03 11:13:17 UTC (rev 163299)
@@ -1,3 +1,22 @@
+2014-02-02 Maciej Stachowiak <[email protected]>
+
+ Adopt URLUtils interface and template in HTMLAnchorElement and HTMLAreaElement
+ https://bugs.webkit.org/show_bug.cgi?id=128067
+
+ Reviewed by Antti Koivisto.
+
+ New tests for the newly added attributes.
+ * fast/dom/HTMLAnchorElement/anchor-password-expected.txt: Added.
+ * fast/dom/HTMLAnchorElement/anchor-password.html: Added.
+ * fast/dom/HTMLAnchorElement/anchor-username-expected.txt: Added.
+ * fast/dom/HTMLAnchorElement/anchor-username.html: Added.
+ * fast/dom/HTMLAreaElement/area-password.html: Added.
+ * fast/dom/HTMLAreaElement/area-username.html: Added.
+
+ Update a test to handle the new anchor properties.
+ * js/dom/dom-static-property-for-in-iteration-expected.txt:
+ * js/dom/dom-static-property-for-in-iteration.html:
+
2014-02-03 Krzysztof Czech <[email protected]>
[ATK] Expose aria-controls through ATK_RELATION_CONTROLLER_FOR
Added: trunk/LayoutTests/fast/dom/HTMLAnchorElement/anchor-password-expected.txt (0 => 163299)
--- trunk/LayoutTests/fast/dom/HTMLAnchorElement/anchor-password-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/dom/HTMLAnchorElement/anchor-password-expected.txt 2014-02-03 11:13:17 UTC (rev 163299)
@@ -0,0 +1,21 @@
+Test getting the password attribute of an 'a' element.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Default password is empty
+PASS a.password is ''
+Unspecified password should return empty string
+PASS a.password is ''
+Empty password should be empty
+PASS a.password is ''
+Regular passowrd retrieval
+PASS a.password is 'abc123'
+Password with empty username
+PASS a.password is 'def456'
+Setting password
+PASS a.href is 'http://:[email protected]/'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/fast/dom/HTMLAnchorElement/anchor-password.html (0 => 163299)
--- trunk/LayoutTests/fast/dom/HTMLAnchorElement/anchor-password.html (rev 0)
+++ trunk/LayoutTests/fast/dom/HTMLAnchorElement/anchor-password.html 2014-02-03 11:13:17 UTC (rev 163299)
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<script src=""
+</head>
+<body>
+<script>
+
+description("Test getting the password attribute of an 'a' element.");
+
+var a = document.createElement("a");
+
+debug("Default password is empty");
+shouldBe("a.password", "''");
+
+debug("Unspecified password should return empty string");
+a.href = ""
+shouldBe("a.password", "''");
+
+debug("Empty password should be empty");
+a.href = ""
+shouldBe("a.password", "''");
+
+debug("Regular passowrd retrieval");
+a.href = ""
+shouldBe("a.password", "'abc123'");
+
+debug("Password with empty username");
+a.href = ""
+shouldBe("a.password", "'def456'");
+
+debug("Setting password");
+a.href = ""
+a.password = "xyzzy";
+shouldBe("a.href", "'http://:[email protected]/'");
+
+</script>
+<script src=""
+</body>
+</html>
Added: trunk/LayoutTests/fast/dom/HTMLAnchorElement/anchor-username-expected.txt (0 => 163299)
--- trunk/LayoutTests/fast/dom/HTMLAnchorElement/anchor-username-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/dom/HTMLAnchorElement/anchor-username-expected.txt 2014-02-03 11:13:17 UTC (rev 163299)
@@ -0,0 +1,23 @@
+Test getting the username attribute of an 'a' element.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Default username is empty
+PASS a.username is ''
+Unspecified username should return empty string
+PASS a.username is ''
+Empty username should be empty
+PASS a.username is ''
+Regular username retrieval
+PASS a.username is 'joebob1'
+Username with empty password
+PASS a.username is 'joebob2'
+Username with non-empty password
+PASS a.username is 'joebob3'
+Setting username
+PASS a.href is 'http://[email protected]/'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/fast/dom/HTMLAnchorElement/anchor-username.html (0 => 163299)
--- trunk/LayoutTests/fast/dom/HTMLAnchorElement/anchor-username.html (rev 0)
+++ trunk/LayoutTests/fast/dom/HTMLAnchorElement/anchor-username.html 2014-02-03 11:13:17 UTC (rev 163299)
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<script src=""
+</head>
+<body>
+<script>
+
+description("Test getting the username attribute of an 'a' element.");
+
+var a = document.createElement("a");
+
+debug("Default username is empty");
+shouldBe("a.username", "''");
+
+debug("Unspecified username should return empty string");
+a.href = ""
+shouldBe("a.username", "''");
+
+debug("Empty username should be empty");
+a.href = ""
+shouldBe("a.username", "''");
+
+debug("Regular username retrieval");
+a.href = ""
+shouldBe("a.username", "'joebob1'");
+
+debug("Username with empty password");
+a.href = ""
+shouldBe("a.username", "'joebob2'");
+
+debug("Username with non-empty password");
+a.href = ""
+shouldBe("a.username", "'joebob3'");
+
+debug("Setting username");
+a.href = ""
+a.username = "joebob4";
+shouldBe("a.href", "'http://[email protected]/'");
+
+</script>
+<script src=""
+</body>
+</html>
Added: trunk/LayoutTests/fast/dom/HTMLAreaElement/area-password.html (0 => 163299)
--- trunk/LayoutTests/fast/dom/HTMLAreaElement/area-password.html (rev 0)
+++ trunk/LayoutTests/fast/dom/HTMLAreaElement/area-password.html 2014-02-03 11:13:17 UTC (rev 163299)
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<script src=""
+</head>
+<body>
+<script>
+
+description("Test getting the password attribute of an 'area' element.");
+
+var a = document.createElement("area");
+
+debug("Default password is empty");
+shouldBe("a.password", "''");
+
+debug("Unspecified password should return empty string");
+a.href = ""
+shouldBe("a.password", "''");
+
+debug("Empty password should be empty");
+a.href = ""
+shouldBe("a.password", "''");
+
+debug("Regular passowrd retrieval");
+a.href = ""
+shouldBe("a.password", "'abc123'");
+
+debug("Password with empty username");
+a.href = ""
+shouldBe("a.password", "'def456'");
+
+debug("Setting password");
+a.href = ""
+a.password = "xyzzy";
+shouldBe("a.href", "'http://:[email protected]/'");
+
+</script>
+<script src=""
+</body>
+</html>
Added: trunk/LayoutTests/fast/dom/HTMLAreaElement/area-username.html (0 => 163299)
--- trunk/LayoutTests/fast/dom/HTMLAreaElement/area-username.html (rev 0)
+++ trunk/LayoutTests/fast/dom/HTMLAreaElement/area-username.html 2014-02-03 11:13:17 UTC (rev 163299)
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<script src=""
+</head>
+<body>
+<script>
+
+description("Test getting the username attribute of an 'area' element.");
+
+var a = document.createElement("area");
+
+debug("Default username is empty");
+shouldBe("a.username", "''");
+
+debug("Unspecified username should return empty string");
+a.href = ""
+shouldBe("a.username", "''");
+
+debug("Empty username should be empty");
+a.href = ""
+shouldBe("a.username", "''");
+
+debug("Regular username retrieval");
+a.href = ""
+shouldBe("a.username", "'joebob1'");
+
+debug("Username with empty password");
+a.href = ""
+shouldBe("a.username", "'joebob2'");
+
+debug("Username with non-empty password");
+a.href = ""
+shouldBe("a.username", "'joebob3'");
+
+debug("Setting username");
+a.href = ""
+a.username = "joebob4";
+shouldBe("a.href", "'http://[email protected]/'");
+
+</script>
+<script src=""
+</body>
+</html>
Modified: trunk/LayoutTests/js/dom/dom-static-property-for-in-iteration-expected.txt (163298 => 163299)
--- trunk/LayoutTests/js/dom/dom-static-property-for-in-iteration-expected.txt 2014-02-03 10:05:06 UTC (rev 163298)
+++ trunk/LayoutTests/js/dom/dom-static-property-for-in-iteration-expected.txt 2014-02-03 11:13:17 UTC (rev 163299)
@@ -1,3 +1,4 @@
+nerget
Checks that get_by_pname doesn't get confused about which properties go where when it comes to stacic properties.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
@@ -16,17 +17,19 @@
PASS a["hostname"] is
PASS a["rel"] is
PASS a["hreflang"] is
+PASS a["password"] is
PASS a["ping"] is
PASS a["rev"] is
PASS a["host"] is
PASS a["charset"] is
+PASS a["username"] is
PASS a["target"] is
PASS a["type"] is
PASS a["coords"] is
PASS a["name"] is
PASS a["shape"] is
+PASS a["protocol"] is file:
PASS a["port"] is
-PASS a["protocol"] is file:
PASS a["outerHTML"] is <a id="foo" href=""
PASS a["spellcheck"] is true
PASS a["webkitdropzone"] is
@@ -59,9 +62,9 @@
PASS a["clientTop"] is 0
PASS a["lastElementChild"] is null
PASS a["offsetParent"] is [object HTMLBodyElement]
-PASS a["nextElementSibling"] is [object HTMLScriptElement]
+PASS a["nextElementSibling"] is [object HTMLParagraphElement]
PASS a["tagName"] is A
-PASS a["previousElementSibling"] is [object HTMLDivElement]
+PASS a["previousElementSibling"] is null
PASS a["childElementCount"] is 0
PASS a["scrollLeft"] is 0
PASS a["firstElementChild"] is null
@@ -69,7 +72,7 @@
PASS a["clientLeft"] is 0
PASS a["offsetHeight"] is 18
PASS a["clientHeight"] is 0
-PASS a["offsetTop"] is 1074
+PASS a["offsetTop"] is 8
PASS a["scrollTop"] is 0
PASS a["scrollHeight"] is 0
PASS a["previousSibling"] is [object Text]
@@ -108,4 +111,4 @@
PASS successfullyParsed is true
TEST COMPLETE
-nerget
+
Modified: trunk/LayoutTests/js/dom/dom-static-property-for-in-iteration.html (163298 => 163299)
--- trunk/LayoutTests/js/dom/dom-static-property-for-in-iteration.html 2014-02-03 10:05:06 UTC (rev 163298)
+++ trunk/LayoutTests/js/dom/dom-static-property-for-in-iteration.html 2014-02-03 11:13:17 UTC (rev 163299)
@@ -6,6 +6,7 @@
</head>
<body>
<a id="foo" href=""
+ <div id="console"></div>
<script>
var realShouldBe = function(expectedValue, actualString, actualValue) {
if (expectedValue === actualValue)
Modified: trunk/Source/WebCore/ChangeLog (163298 => 163299)
--- trunk/Source/WebCore/ChangeLog 2014-02-03 10:05:06 UTC (rev 163298)
+++ trunk/Source/WebCore/ChangeLog 2014-02-03 11:13:17 UTC (rev 163299)
@@ -1,3 +1,25 @@
+2014-02-02 Maciej Stachowiak <[email protected]>
+
+ Adopt URLUtils interface and template in HTMLAnchorElement and HTMLAreaElement
+ https://bugs.webkit.org/show_bug.cgi?id=128067
+
+ Reviewed by Antti Koivisto.
+
+ Tests: fast/dom/HTMLAnchorElement/anchor-password.html
+ fast/dom/HTMLAnchorElement/anchor-username.html
+ fast/dom/HTMLAreaElement/area-password.html
+ fast/dom/HTMLAreaElement/area-username.html
+
+ * html/HTMLAnchorElement.cpp:
+ * html/HTMLAnchorElement.h:
+ (WebCore::HTMLAnchorElement::setHref): Add version that takes
+ (and ignores) ExceptionCode. This is needed because the URLUtil
+ base interface is used for URL, which can throw an exception,
+ and HTMLAnchorElement, which cannot.
+ * html/HTMLAnchorElement.idl: implement URLUtils
+ * html/HTMLAreaElement.idl: implement URLUtils
+ * html/URLUtils.idl: Treat null as empty string for href
+
2014-02-03 Krzysztof Czech <[email protected]>
[ATK] Expose aria-controls through ATK_RELATION_CONTROLLER_FOR
Modified: trunk/Source/WebCore/html/HTMLAnchorElement.cpp (163298 => 163299)
--- trunk/Source/WebCore/html/HTMLAnchorElement.cpp 2014-02-03 10:05:06 UTC (rev 163298)
+++ trunk/Source/WebCore/html/HTMLAnchorElement.cpp 2014-02-03 11:13:17 UTC (rev 163299)
@@ -75,15 +75,6 @@
clearRootEditableElementForSelectionOnMouseDown();
}
-// This function does not allow leading spaces before the port number.
-static unsigned parsePortFromStringPosition(const String& value, unsigned portStart, unsigned& portEnd)
-{
- portEnd = portStart;
- while (isASCIIDigit(value[portEnd]))
- ++portEnd;
- return value.substring(portStart, portEnd - portStart).toUInt();
-}
-
bool HTMLAnchorElement::supportsFocus() const
{
if (hasEditableStyle())
@@ -330,180 +321,11 @@
return getAttribute(targetAttr);
}
-String HTMLAnchorElement::hash() const
-{
- String fragmentIdentifier = href().fragmentIdentifier();
- if (fragmentIdentifier.isEmpty())
- return emptyString();
- return AtomicString(String("#" + fragmentIdentifier));
-}
-
-void HTMLAnchorElement::setHash(const String& value)
-{
- URL url = ""
- if (value[0] == '#')
- url.setFragmentIdentifier(value.substring(1));
- else
- url.setFragmentIdentifier(value);
- setHref(url.string());
-}
-
-String HTMLAnchorElement::host() const
-{
- const URL& url = ""
- if (url.hostEnd() == url.pathStart())
- return url.host();
- if (isDefaultPortForProtocol(url.port(), url.protocol()))
- return url.host();
- return url.host() + ":" + String::number(url.port());
-}
-
-void HTMLAnchorElement::setHost(const String& value)
-{
- if (value.isEmpty())
- return;
- URL url = ""
- if (!url.canSetHostOrPort())
- return;
-
- size_t separator = value.find(':');
- if (!separator)
- return;
-
- if (separator == notFound)
- url.setHostAndPort(value);
- else {
- unsigned portEnd;
- unsigned port = parsePortFromStringPosition(value, separator + 1, portEnd);
- if (!port) {
- // http://dev.w3.org/html5/spec/infrastructure.html#url-decomposition-idl-attributes
- // specifically goes against RFC 3986 (p3.2) and
- // requires setting the port to "0" if it is set to empty string.
- url.setHostAndPort(value.substring(0, separator + 1) + "0");
- } else {
- if (isDefaultPortForProtocol(port, url.protocol()))
- url.setHostAndPort(value.substring(0, separator));
- else
- url.setHostAndPort(value.substring(0, portEnd));
- }
- }
- setHref(url.string());
-}
-
-String HTMLAnchorElement::hostname() const
-{
- return href().host();
-}
-
-void HTMLAnchorElement::setHostname(const String& value)
-{
- // Before setting new value:
- // Remove all leading U+002F SOLIDUS ("/") characters.
- unsigned i = 0;
- unsigned hostLength = value.length();
- while (value[i] == '/')
- i++;
-
- if (i == hostLength)
- return;
-
- URL url = ""
- if (!url.canSetHostOrPort())
- return;
-
- url.setHost(value.substring(i));
- setHref(url.string());
-}
-
-String HTMLAnchorElement::pathname() const
-{
- return href().path();
-}
-
-void HTMLAnchorElement::setPathname(const String& value)
-{
- URL url = ""
- if (!url.canSetPathname())
- return;
-
- if (value[0] == '/')
- url.setPath(value);
- else
- url.setPath("/" + value);
-
- setHref(url.string());
-}
-
-String HTMLAnchorElement::port() const
-{
- if (href().hasPort())
- return String::number(href().port());
-
- return emptyString();
-}
-
-void HTMLAnchorElement::setPort(const String& value)
-{
- URL url = ""
- if (!url.canSetHostOrPort())
- return;
-
- // http://dev.w3.org/html5/spec/infrastructure.html#url-decomposition-idl-attributes
- // specifically goes against RFC 3986 (p3.2) and
- // requires setting the port to "0" if it is set to empty string.
- unsigned port = value.toUInt();
- if (isDefaultPortForProtocol(port, url.protocol()))
- url.removePort();
- else
- url.setPort(port);
-
- setHref(url.string());
-}
-
-String HTMLAnchorElement::protocol() const
-{
- return href().protocol() + ":";
-}
-
-void HTMLAnchorElement::setProtocol(const String& value)
-{
- URL url = ""
- url.setProtocol(value);
- setHref(url.string());
-}
-
-String HTMLAnchorElement::search() const
-{
- String query = href().query();
- return query.isEmpty() ? emptyString() : "?" + query;
-}
-
-String HTMLAnchorElement::origin() const
-{
- RefPtr<SecurityOrigin> origin = SecurityOrigin::create(href());
- return origin->toString();
-}
-
-void HTMLAnchorElement::setSearch(const String& value)
-{
- URL url = ""
- String newSearch = (value[0] == '?') ? value.substring(1) : value;
- // Make sure that '#' in the query does not leak to the hash.
- url.setQuery(newSearch.replaceWithLiteral('#', "%23"));
-
- setHref(url.string());
-}
-
String HTMLAnchorElement::text()
{
return innerText();
}
-String HTMLAnchorElement::toString() const
-{
- return href().string();
-}
-
bool HTMLAnchorElement::isLiveLink() const
{
return isLink() && treatLinkAsLiveForEventType(m_wasShiftKeyDownOnMouseDown ? MouseEventWithShiftKey : MouseEventWithoutShiftKey);
Modified: trunk/Source/WebCore/html/HTMLAnchorElement.h (163298 => 163299)
--- trunk/Source/WebCore/html/HTMLAnchorElement.h 2014-02-03 10:05:06 UTC (rev 163298)
+++ trunk/Source/WebCore/html/HTMLAnchorElement.h 2014-02-03 11:13:17 UTC (rev 163299)
@@ -27,6 +27,7 @@
#include "HTMLElement.h"
#include "HTMLNames.h"
#include "LinkHash.h"
+#include "URLUtils.h"
namespace WebCore {
@@ -53,7 +54,7 @@
// RelationUp = 0x00020000,
};
-class HTMLAnchorElement : public HTMLElement {
+class HTMLAnchorElement : public HTMLElement, public URLUtils<HTMLAnchorElement> {
public:
static PassRefPtr<HTMLAnchorElement> create(Document&);
static PassRefPtr<HTMLAnchorElement> create(const QualifiedName&, Document&);
@@ -62,36 +63,12 @@
URL href() const;
void setHref(const AtomicString&);
+ void setHref(const AtomicString& value, ExceptionCode&) { setHref(value); }
const AtomicString& name() const;
- String hash() const;
- void setHash(const String&);
-
- String host() const;
- void setHost(const String&);
-
- String hostname() const;
- void setHostname(const String&);
-
- String pathname() const;
- void setPathname(const String&);
-
- String port() const;
- void setPort(const String&);
-
- String protocol() const;
- void setProtocol(const String&);
-
- String search() const;
- void setSearch(const String&);
-
- String origin() const;
-
String text();
- String toString() const;
-
bool isLiveLink() const;
virtual bool willRespondToMouseClickEvents() override;
Modified: trunk/Source/WebCore/html/HTMLAnchorElement.idl (163298 => 163299)
--- trunk/Source/WebCore/html/HTMLAnchorElement.idl 2014-02-03 10:05:06 UTC (rev 163298)
+++ trunk/Source/WebCore/html/HTMLAnchorElement.idl 2014-02-03 11:13:17 UTC (rev 163299)
@@ -22,7 +22,6 @@
[Reflect] attribute DOMString charset;
[Reflect] attribute DOMString coords;
[Conditional=DOWNLOAD_ATTRIBUTE, Reflect] attribute DOMString download;
- [Reflect, URL] attribute DOMString href;
[Reflect] attribute DOMString hreflang;
[Reflect] attribute DOMString name;
[Reflect] attribute DOMString ping;
@@ -36,35 +35,12 @@
[Reflect] attribute DOMString accessKey;
#endif
-#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
- readonly attribute DOMString hash;
- readonly attribute DOMString host;
- readonly attribute DOMString hostname;
- readonly attribute DOMString pathname;
- readonly attribute DOMString port;
- readonly attribute DOMString protocol;
- readonly attribute DOMString search;
-#else
- [TreatNullAs=NullString] attribute DOMString hash;
- [TreatNullAs=NullString] attribute DOMString host;
- [TreatNullAs=NullString] attribute DOMString hostname;
- [TreatNullAs=NullString] attribute DOMString pathname;
- [TreatNullAs=NullString] attribute DOMString port;
- [TreatNullAs=NullString] attribute DOMString protocol;
- [TreatNullAs=NullString] attribute DOMString search;
-
- [TreatNullAs=NullString] readonly attribute DOMString origin;
-#endif
-
readonly attribute DOMString text;
-#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
- [NotEnumerable] DOMString toString();
-#endif
-
#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
// Objective-C extension:
readonly attribute URL absoluteLinkURL;
#endif
};
+HTMLAnchorElement implements URLUtils;
\ No newline at end of file
Modified: trunk/Source/WebCore/html/HTMLAreaElement.idl (163298 => 163299)
--- trunk/Source/WebCore/html/HTMLAreaElement.idl 2014-02-03 10:05:06 UTC (rev 163298)
+++ trunk/Source/WebCore/html/HTMLAreaElement.idl 2014-02-03 11:13:17 UTC (rev 163299)
@@ -21,7 +21,6 @@
interface HTMLAreaElement : HTMLElement {
[Reflect] attribute DOMString alt;
[Reflect] attribute DOMString coords;
- [Reflect, URL] attribute DOMString href;
[Reflect] attribute boolean noHref;
[Reflect] attribute DOMString ping;
[Reflect] attribute DOMString shape;
@@ -30,14 +29,6 @@
#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
[Reflect] attribute DOMString accessKey;
#endif
- // IE Extensions
- readonly attribute DOMString hash;
- readonly attribute DOMString host;
- readonly attribute DOMString hostname;
- readonly attribute DOMString pathname;
- readonly attribute DOMString port;
- readonly attribute DOMString protocol;
- readonly attribute DOMString search;
#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
// Objective-C extension:
@@ -45,3 +36,4 @@
#endif
};
+HTMLAreaElement implements URLUtils;
Modified: trunk/Source/WebCore/html/URLUtils.idl (163298 => 163299)
--- trunk/Source/WebCore/html/URLUtils.idl 2014-02-03 10:05:06 UTC (rev 163298)
+++ trunk/Source/WebCore/html/URLUtils.idl 2014-02-03 11:13:17 UTC (rev 163299)
@@ -25,13 +25,22 @@
[NoInterfaceObject]
interface URLUtils {
- [SetterRaisesException, URL] attribute DOMString href;
+ [SetterRaisesException, TreatNullAs=NullString, URL] attribute DOMString href;
#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
[NotEnumerable] DOMString toString();
#endif
readonly attribute DOMString origin;
+#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
+ readonly attribute DOMString protocol;
+ readonly attribute DOMString host;
+ readonly attribute DOMString hostname;
+ readonly attribute DOMString port;
+ readonly attribute DOMString pathname;
+ readonly attribute DOMString search;
+ readonly attribute DOMString hash;
+#else
[TreatNullAs=NullString] attribute DOMString protocol;
[TreatNullAs=NullString] attribute DOMString username;
[TreatNullAs=NullString] attribute DOMString password;
@@ -42,4 +51,6 @@
[TreatNullAs=NullString] attribute DOMString search;
// attribute URLSearchParams? searchParams;
[TreatNullAs=NullString] attribute DOMString hash;
+#endif
+
};