Repository navigation
Opaque DOMString - #8477
Opaque DOMString#8477
Conversation
|
Neat! |
|
Thanks for splitting the commits up this way! Reviewed 1 of 1 files at r1, 4 of 4 files at r2, 2 of 2 files at r3, 1 of 1 files at r4, 3 of 3 files at r5, 1 of 1 files at r6, 1 of 1 files at r7, 63 of 63 files at r8, 1 of 1 files at r9, 5 of 5 files at r10, 1 of 1 files at r11. components/devtools/actors/inspector.rs, line 209 [r2] (raw file): components/script/dom/create.rs, line 85 [r8] (raw file): components/script/dom/htmlinputelement.rs, line 579 [r10] (raw file): components/script/dom/storage.rs, line 131 [r5] (raw file): components/script/script_task.rs, line 1705 [r3] (raw file): components/util/mem.rs, line 106 [r7] (raw file): Comments from the review on Reviewable.io |
|
I'm getting better at rewriting my git history :) Review status: all files reviewed at latest revision, 1 unresolved discussion. components/util/mem.rs, line 106 [r7] (raw file): Comments from the review on Reviewable.io |
|
@bors-servo: delegate+ Reviewed 1 of 1 files at r12, 1 of 1 files at r13, 1 of 1 files at r14. Comments from the review on Reviewable.io |
|
✌️ @asajeffrey can now approve this pull request |
1341a4b to
0816dda
Compare
0816dda to
99c8a37
Compare
|
Rebased, and updated the unit tests. |
|
@bors-servo: r+ Reviewed 1 of 1 files at r15. Comments from the review on Reviewable.io |
|
📌 Commit 99c8a37 has been approved by |
|
@bors-servo: p=1 |
Opaque DOMString This patch makes DOMString an opaque wrapper round String (currently it's a transparent wrapper). The changes are: * Replacing DOMString(foo) by DOMString::from(foo). * Replacing foo.0 by String::from(foo). * Adding functions clear, push_str and extend for in-place mutation of DOMStrings. * Replacing DOMString by String in other threads (devtools, storage and filereader). * Making DOMString implement !Send. * Removing the pub attribute from the contents of DOMString. This enables experimenting with other string representations in the DOM. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8477) <!-- Reviewable:end -->
|
💔 Test failed - gonk |
|
Ah the trying-to-land-a-patch dance, how I love it. Rebased again. |
Implemented From<String> and From<&str> for DOMString, and From<DOMString> for String.
This change makes DOMStrings only accessible from the main JS thread.
We have to do this by hand because DOMString is defined in util.
Replaced DOMString(...) by DOMString::from(...).
Replaced ....0 by String::from(...).
Removed any uses of .to_owner() in DOMString::from("...").
The methods which are currently implemented are the ones on String that are currently being used: string.push_str(...), string.clear() and string.extend(...). We may want to revisit this API.
Removed the "pub" attribute from the String field of DOMString. This enables experimenting with other string representations.
2dadea7 to
0da1623
Compare
|
@bors-servo: r+ |
|
📌 Commit 0da1623 has been approved by |
Opaque DOMString This patch makes DOMString an opaque wrapper round String (currently it's a transparent wrapper). The changes are: * Replacing DOMString(foo) by DOMString::from(foo). * Replacing foo.0 by String::from(foo). * Adding functions clear, push_str and extend for in-place mutation of DOMStrings. * Replacing DOMString by String in other threads (devtools, storage and filereader). * Making DOMString implement !Send. * Removing the pub attribute from the contents of DOMString. This enables experimenting with other string representations in the DOM. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8477) <!-- Reviewable:end -->
|
💔 Test failed - linux-rel |
|
@bors-servo retry #8487 |
Opaque DOMString This patch makes DOMString an opaque wrapper round String (currently it's a transparent wrapper). The changes are: * Replacing DOMString(foo) by DOMString::from(foo). * Replacing foo.0 by String::from(foo). * Adding functions clear, push_str and extend for in-place mutation of DOMStrings. * Replacing DOMString by String in other threads (devtools, storage and filereader). * Making DOMString implement !Send. * Removing the pub attribute from the contents of DOMString. This enables experimenting with other string representations in the DOM. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8477) <!-- Reviewable:end -->
|
☀️ Test successful - android, gonk, linux-dev, linux-rel, mac-dev-ref-unit, mac-rel-css, mac-rel-wpt |
This patch makes DOMString an opaque wrapper round String (currently it's a transparent wrapper).
The changes are:
This enables experimenting with other string representations in the DOM.