Skip to content

Commit 4cdc04a

Browse files
committed
Drop stringification. Closes #7.
1 parent 2f8e443 commit 4cdc04a

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ One way of approaching this gap would be to define an `Origin` object which repr
1313

1414
### An `Origin` Object
1515

16-
Let's consider a minimal `Origin` object that can be constructed from a string representing a serialized origin, and that offers two methods (`isSameOrigin()` and `isSameSite()`) along with a stringifier named `toJSON()`:
16+
Let's consider a minimal `Origin` object that can be constructed from a string representing a serialized origin, and that offers two methods (`isSameOrigin()` and `isSameSite()`).
1717

1818
```javascript
1919
// Tuple Origins
@@ -151,7 +151,7 @@ Idunno. Let's find out if it's already been widely stomped upon? If not, surely
151151

152152
### What about existing `.origin` getters?
153153

154-
It seems ideal to me for us to find ways to vend `Origin` objects rather than serialized origins whenever possible. It would likely be difficult to change the types of existing `.origin` attributes (though some use cases might be solved through the magic of stringification) though, and could create some confusing situations if older APIs rely on serialized origins while newer APIs vend `Origin` objects.
154+
It seems ideal to me for us to find ways to vend `Origin` objects rather than serialized origins whenever possible. It would likely be difficult to change the types of existing `.origin` attributes (though some use cases could be solved through the magic of stringification if we added it) though, and could create some confusing situations if older APIs rely on serialized origins while newer APIs vend `Origin` objects.
155155

156156
Still, working with `Origin` objects would make it possible to reason about opaque origins in ways which are impossible today. Since every opaque origin serializes as `"null"`, it's quite difficult to distinguish one from the other. While it would be nice to [mitigate that underlying issue](https://github.com/whatwg/html/issues/3585), opaque `Origin` objects the browser minted would at least allow for `isSameOrigin()` comparisons that developers could use to establish a sender's consistency over time, and more clarity around `postMessage()` targeting.
157157

@@ -181,8 +181,6 @@ interface Origin {
181181
static Origin? parse(USVString serializedOrigin);
182182
static Origin? fromURL(USVString serializedURL);
183183
184-
stringifier USVString toJSON();
185-
186184
boolean isSameOrigin(Origin other);
187185
boolean isSameSite(Origin other);
188186
};

index.bs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ interface Origin {
4040

4141
boolean isSameOrigin(Origin other);
4242
boolean isSameSite(Origin other);
43-
44-
stringifier USVString toJSON();
4543
};
4644
</pre>
4745

@@ -147,8 +145,6 @@ if [=this=]'s {{Origin/[[origin]]}} is [=same site=] with <var ignore>other</var
147145
Note: This is a [=same site=], not [=schemelessly same site=], comparison.
148146
</div><!-- isSameSite(other) -->
149147

150-
The <dfn for="Origin" stringifier>`toJSON()`</dfn> method steps are to return the
151-
[=ASCII serialization of an origin|serialization=] of [=this=]'s {{Origin/[[origin]]}}.
152148

153149
Security Considerations {#security}
154150
=======================

0 commit comments

Comments
 (0)