Title: [204954] trunk
- Revision
- 204954
- Author
- [email protected]
- Date
- 2016-08-24 23:07:44 -0700 (Wed, 24 Aug 2016)
Log Message
WorkerLocation.prototype.toString() should be enumerable
https://bugs.webkit.org/show_bug.cgi?id=161183
Reviewed by Ryosuke Niwa.
Source/WebCore:
WorkerLocation.prototype.toString() should be enumerable:
- https://html.spec.whatwg.org/#workerlocation
- http://heycam.github.io/webidl/#es-stringifier
No new tests, updated existing test.
* workers/WorkerLocation.h:
(WebCore::WorkerLocation::toString): Deleted.
* workers/WorkerLocation.idl:
Also use USVString string type instead of DOMString to match the
specification. There is no behavior change because those attributes
are readonly.
LayoutTests:
Add layout test coverage.
* fast/workers/resources/worker-location.js:
* fast/workers/worker-location-expected.txt:
Modified Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (204953 => 204954)
--- trunk/LayoutTests/ChangeLog 2016-08-25 03:06:50 UTC (rev 204953)
+++ trunk/LayoutTests/ChangeLog 2016-08-25 06:07:44 UTC (rev 204954)
@@ -1,5 +1,17 @@
2016-08-24 Chris Dumez <[email protected]>
+ WorkerLocation.prototype.toString() should be enumerable
+ https://bugs.webkit.org/show_bug.cgi?id=161183
+
+ Reviewed by Ryosuke Niwa.
+
+ Add layout test coverage.
+
+ * fast/workers/resources/worker-location.js:
+ * fast/workers/worker-location-expected.txt:
+
+2016-08-24 Chris Dumez <[email protected]>
+
Location.toString() should be enumerable
https://bugs.webkit.org/show_bug.cgi?id=161179
Modified: trunk/LayoutTests/fast/workers/resources/worker-location.js (204953 => 204954)
--- trunk/LayoutTests/fast/workers/resources/worker-location.js 2016-08-25 03:06:50 UTC (rev 204953)
+++ trunk/LayoutTests/fast/workers/resources/worker-location.js 2016-08-25 06:07:44 UTC (rev 204954)
@@ -23,6 +23,7 @@
worker.postMessage("eval typeof location");
worker.postMessage("eval location");
worker.postMessage("eval location.href");
+worker.postMessage("eval location.href ="" location.toString()");
worker.postMessage("eval location.protocol");
worker.postMessage("eval location.host");
worker.postMessage("eval location.hostname");
@@ -31,6 +32,9 @@
worker.postMessage("eval location.search");
worker.postMessage("eval location.hash");
worker.postMessage("eval location.origin");
+worker.postMessage("eval Object.getOwnPropertyDescriptor(location.__proto__, 'toString').writable === true");
+worker.postMessage("eval Object.getOwnPropertyDescriptor(location.__proto__, 'toString').enumerable === true");
+worker.postMessage("eval Object.getOwnPropertyDescriptor(location.__proto__, 'toString').configurable === true");
worker.postMessage("eval foo//bar");
worker._onmessage_ = function(evt) {
Modified: trunk/LayoutTests/fast/workers/worker-location-expected.txt (204953 => 204954)
--- trunk/LayoutTests/fast/workers/worker-location-expected.txt 2016-08-25 03:06:50 UTC (rev 204953)
+++ trunk/LayoutTests/fast/workers/worker-location-expected.txt 2016-08-25 06:07:44 UTC (rev 204954)
@@ -4,6 +4,7 @@
typeof location: object
location: file:<...>/fast/workers/resources/worker-common.js
location.href: file:<...>/fast/workers/resources/worker-common.js
+location.href ="" location.toString(): true
location.protocol: file:
location.host:
location.hostname:
@@ -12,5 +13,8 @@
location.search:
location.hash:
location.origin: file://
+Object.getOwnPropertyDescriptor(location.__proto__, 'toString').writable === true: true
+Object.getOwnPropertyDescriptor(location.__proto__, 'toString').enumerable === true: true
+Object.getOwnPropertyDescriptor(location.__proto__, 'toString').configurable === true: true
DONE
Modified: trunk/Source/WebCore/ChangeLog (204953 => 204954)
--- trunk/Source/WebCore/ChangeLog 2016-08-25 03:06:50 UTC (rev 204953)
+++ trunk/Source/WebCore/ChangeLog 2016-08-25 06:07:44 UTC (rev 204954)
@@ -1,5 +1,25 @@
2016-08-24 Chris Dumez <[email protected]>
+ WorkerLocation.prototype.toString() should be enumerable
+ https://bugs.webkit.org/show_bug.cgi?id=161183
+
+ Reviewed by Ryosuke Niwa.
+
+ WorkerLocation.prototype.toString() should be enumerable:
+ - https://html.spec.whatwg.org/#workerlocation
+ - http://heycam.github.io/webidl/#es-stringifier
+
+ No new tests, updated existing test.
+
+ * workers/WorkerLocation.h:
+ (WebCore::WorkerLocation::toString): Deleted.
+ * workers/WorkerLocation.idl:
+ Also use USVString string type instead of DOMString to match the
+ specification. There is no behavior change because those attributes
+ are readonly.
+
+2016-08-24 Chris Dumez <[email protected]>
+
Location.toString() should be enumerable
https://bugs.webkit.org/show_bug.cgi?id=161179
Modified: trunk/Source/WebCore/workers/WorkerLocation.h (204953 => 204954)
--- trunk/Source/WebCore/workers/WorkerLocation.h 2016-08-25 03:06:50 UTC (rev 204953)
+++ trunk/Source/WebCore/workers/WorkerLocation.h 2016-08-25 06:07:44 UTC (rev 204954)
@@ -55,8 +55,6 @@
String hash() const;
String origin() const;
- String toString() const { return href(); }
-
private:
explicit WorkerLocation(const URL& url) : m_url(url) { }
Modified: trunk/Source/WebCore/workers/WorkerLocation.idl (204953 => 204954)
--- trunk/Source/WebCore/workers/WorkerLocation.idl 2016-08-25 03:06:50 UTC (rev 204953)
+++ trunk/Source/WebCore/workers/WorkerLocation.idl 2016-08-25 06:07:44 UTC (rev 204954)
@@ -31,16 +31,14 @@
GenerateIsReachable=Impl,
ImplementationLacksVTable,
] interface WorkerLocation {
- readonly attribute DOMString href;
- 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;
- readonly attribute DOMString origin;
-
- [NotEnumerable] DOMString toString();
+ stringifier readonly attribute USVString href;
+ readonly attribute USVString protocol;
+ readonly attribute USVString host;
+ readonly attribute USVString hostname;
+ readonly attribute USVString port;
+ readonly attribute USVString pathname;
+ readonly attribute USVString search;
+ readonly attribute USVString hash;
+ readonly attribute USVString origin;
};
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes