Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Storage::SupportedPropertyNames #7693

Merged
merged 1 commit into from Oct 4, 2015

Conversation

@ddrmanxbxfr
Copy link
Contributor

ddrmanxbxfr commented Sep 21, 2015

Hi guys,

This is a rough draft for issue #7670 .

It includes :

  • SupportedPropertyNames implementation
  • WPT with Object.supportedpropertynames with Local Storage and Session Storage.

The following link help me understood the issue :
http://www.w3.org/TR/webstorage/#the-storage-interface
https://html.spec.whatwg.org/multipage/infrastructure.html#supported-property-names

Thanks for looking into it.

Review on Reviewable

@nox nox added the A-content/dom label Sep 21, 2015
@nox nox self-assigned this Sep 21, 2015
@nox
Copy link
Member

nox commented Sep 21, 2015

Reviewed 5 of 5 files at r1.
Review status: all files reviewed at latest revision, 1 unresolved discussion, all commit checks successful.


components/net/storage_task.rs, line 113 [r1] (raw file):
Why do you send Option<Vec<DOMString>> and not just a Vec<DOMString>?


Comments from the review on Reviewable.io

@ddrmanxbxfr
Copy link
Contributor Author

ddrmanxbxfr commented Sep 22, 2015

Review status: all files reviewed at latest revision, 1 unresolved discussion, all commit checks successful.


components/net/storage_task.rs, line 113 [r1] (raw file):
I wanted to stay consistent with the current interface in storage task.

All the empty elements are handled using Options types instead of casting them to empty string or vec![].

It kinda make sense as we have pattern matching available in rust and it's explicit.


Comments from the review on Reviewable.io

@Ms2ger
Copy link
Contributor

Ms2ger commented Sep 23, 2015

Review status: all files reviewed at latest revision, 2 unresolved discussions, all commit checks successful.


components/net/storage_task.rs, line 122 [r1] (raw file):
Align the .unwrap() with .send(


Comments from the review on Reviewable.io

@nox
Copy link
Member

nox commented Sep 23, 2015

-S-awaiting-answer +S-needs-code-changes


Review status: all files reviewed at latest revision, 2 unresolved discussions, all commit checks successful.


components/net/storage_task.rs, line 113 [r1] (raw file):
I'm not convinced, see length() two methods above.


Comments from the review on Reviewable.io

@ddrmanxbxfr
Copy link
Contributor Author

ddrmanxbxfr commented Sep 26, 2015

Review status: all files reviewed at latest revision, 1 unresolved discussion, all commit checks successful.


components/net/storage_task.rs, line 113 [r1] (raw file):
https://github.com/ddrmanxbxfr/servo/blob/StorageSupportedAttributes/components/net_traits/storage_task.rs#L22

Length indeed provides a default value. However, key, setitem, getitem, removeitem all provides Option response as empty elements.

If we move to a Vec when we have a empty element from IPCSender shall we send vec![] as default value ?

If yes, i'll unwrap the ipc object and provide a default value.

Thanks.


Comments from the review on Reviewable.io

@nox
Copy link
Member

nox commented Sep 26, 2015

Review status: all files reviewed at latest revision, 1 unresolved discussion, all commit checks successful.


components/net/storage_task.rs, line 113 [r1] (raw file):
vec![] doesn't allocate anything, so you can just use IpcSender<Vec<DOMString>> and it will be fine.


Comments from the review on Reviewable.io

@ddrmanxbxfr ddrmanxbxfr force-pushed the ddrmanxbxfr:StorageSupportedAttributes branch from a10f4d3 to 026467b Sep 27, 2015
@ddrmanxbxfr
Copy link
Contributor Author

ddrmanxbxfr commented Sep 27, 2015

Review status: :shipit: all files reviewed at latest revision, all discussions resolved, all commit checks successful.


components/net/storage_task.rs, line 113 [r1] (raw file):
It's cool, removing the option thing :).


Comments from the review on Reviewable.io

@ddrmanxbxfr
Copy link
Contributor Author

ddrmanxbxfr commented Oct 2, 2015

@nox ping?

@nox
Copy link
Member

nox commented Oct 2, 2015

-S-awaiting-review +S-needs-code-changes


Reviewed 3 of 3 files at r2.
Review status: all files reviewed at latest revision, 2 unresolved discussions, all commit checks successful.


components/net/storage_task.rs, line 122 [r2] (raw file):
You shouldn't be unwrapping here, but using:

data.get(&origin).map_or(vec![], |entry| entry.keys().cloned().collect()))

See the similar piece of code in length().


Comments from the review on Reviewable.io

@ddrmanxbxfr ddrmanxbxfr force-pushed the ddrmanxbxfr:StorageSupportedAttributes branch from 026467b to 080f76a Oct 4, 2015
@ddrmanxbxfr
Copy link
Contributor Author

ddrmanxbxfr commented Oct 4, 2015

Review status: 4 of 5 files reviewed at latest revision, 1 unresolved discussion, all commit checks successful.


components/net/storage_task.rs, line 122 [r2] (raw file):
Indeed. Avoids to panic. Fixed.


Comments from the review on Reviewable.io

@nox
Copy link
Member

nox commented Oct 4, 2015

@bors-servo r+


Reviewed 1 of 1 files at r3.
Review status: :shipit: all files reviewed at latest revision, all discussions resolved, all commit checks successful.


Comments from the review on Reviewable.io

@bors-servo
Copy link
Contributor

bors-servo commented Oct 4, 2015

📌 Commit 080f76a has been approved by nox

@bors-servo
Copy link
Contributor

bors-servo commented Oct 4, 2015

Testing commit 080f76a with merge 21658f8...

bors-servo pushed a commit that referenced this pull request Oct 4, 2015
Implement Storage::SupportedPropertyNames

Hi guys,

This is a rough draft for issue #7670 .

It includes :
   - SupportedPropertyNames implementation
   - WPT with Object.supportedpropertynames with Local Storage and Session Storage.

The following link help me understood the issue :
http://www.w3.org/TR/webstorage/#the-storage-interface
https://html.spec.whatwg.org/multipage/infrastructure.html#supported-property-names

Thanks for looking into it.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7693)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Oct 4, 2015

💔 Test failed - mac-dev-ref-unit

@ddrmanxbxfr
Copy link
Contributor Author

ddrmanxbxfr commented Oct 4, 2015

I'll rebase against master and see if test ref still fails on my desktop.

@ddrmanxbxfr ddrmanxbxfr force-pushed the ddrmanxbxfr:StorageSupportedAttributes branch from 080f76a to e7a3220 Oct 4, 2015
@jdm
Copy link
Member

jdm commented Oct 4, 2015

@bors-servo: r+
Don't worry, that was just #7730.

@bors-servo
Copy link
Contributor

bors-servo commented Oct 4, 2015

📌 Commit e7a3220 has been approved by jdm

@bors-servo
Copy link
Contributor

bors-servo commented Oct 4, 2015

Testing commit e7a3220 with merge 02da3a1...

bors-servo pushed a commit that referenced this pull request Oct 4, 2015
Implement Storage::SupportedPropertyNames

Hi guys,

This is a rough draft for issue #7670 .

It includes :
   - SupportedPropertyNames implementation
   - WPT with Object.supportedpropertynames with Local Storage and Session Storage.

The following link help me understood the issue :
http://www.w3.org/TR/webstorage/#the-storage-interface
https://html.spec.whatwg.org/multipage/infrastructure.html#supported-property-names

Thanks for looking into it.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7693)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Oct 4, 2015

@bors-servo bors-servo merged commit e7a3220 into servo:master Oct 4, 2015
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

6 participants
You can’t perform that action at this time.