Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upOpaque DOMString #8477
Opaque DOMString #8477
Conversation
highfive
commented
Nov 12, 2015
|
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 |
|
|
|
Rebased, and updated the unit tests. |
|
@bors-servo: r+ Reviewed 1 of 1 files at r15. Comments from the review on Reviewable.io |
|
|
|
@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 -->
|
|
|
@bors-servo: retry |
|
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("...").
….".to_owned()).
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.
|
@bors-servo: r+ |
|
|
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 -->
|
|
|
@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 -->
|
|
asajeffrey commentedNov 12, 2015
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.