Skip to content

Fixes related to File API - #10873

Merged
bors-servo merged 1 commit into
servo:masterfrom
izgzhen:blob
May 2, 2016
Merged

bors-servo merged 1 commit into
servo:masterfrom
izgzhen:blob

Conversation

@izgzhen

@izgzhen izgzhen commented Apr 27, 2016 •

Copy link
Copy Markdown
Contributor

Fixing problems I met when trying to resolve #10851, but most of changes here are simple fixes.


This change is Reviewable

@highfive

Copy link
Copy Markdown

Heads up! This PR modifies the following files:

  • @KiChjang: components/script/lib.rs, components/script/dom/webidls/HTMLInputElement.webidl, components/script/dom/file.rs, components/script/Cargo.toml, components/script/dom/htmlinputelement.rs, components/script/dom/blob.rs, components/script/dom/filelist.rs

@highfive

Copy link
Copy Markdown

warning Warning warning

  • These commits modify script code, but no tests are modified. Please consider adding a test!

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Apr 27, 2016
@Ms2ger

Ms2ger commented Apr 27, 2016

Copy link
Copy Markdown
Contributor

@bors-servo try

@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Trying commit da3d7ad with merge c0e10a2...

bors-servo pushed a commit that referenced this pull request Apr 27, 2016
Fixing TODOs related to file input and File API

Fixing problems I met when trying to resolve #10851, but most of changes here are simple fixes.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10873)
<!-- Reviewable:end -->
@bors-servo

Copy link
Copy Markdown
Contributor

💔 Test failed - linux-dev

@highfive highfive added the S-tests-failed The changes caused existing tests to fail. label Apr 27, 2016
@izgzhen

izgzhen commented Apr 27, 2016

Copy link
Copy Markdown
Contributor Author

@Ms2ger Looks like the changed Cargo.lock triggered CI failure. How to deal with this?

@Ms2ger

Ms2ger commented Apr 27, 2016

Copy link
Copy Markdown
Contributor

It's not the one you changed, it's the ones you didn't change. ./mach cargo-update -p script should help.

@highfive highfive removed the S-tests-failed The changes caused existing tests to fail. label Apr 27, 2016
@bors-servo

Copy link
Copy Markdown
Contributor

☔ The latest upstream changes (presumably #10895) made this pull request unmergeable. Please resolve the merge conflicts.

@highfive highfive added the S-needs-rebase There are merge conflict errors. label Apr 29, 2016
@jdm jdm removed the S-needs-rebase There are merge conflict errors. label Apr 29, 2016
@bors-servo

Copy link
Copy Markdown
Contributor

☔ The latest upstream changes (presumably #10929) made this pull request unmergeable. Please resolve the merge conflicts.

@highfive highfive added the S-needs-rebase There are merge conflict errors. label Apr 30, 2016
@izgzhen izgzhen changed the title Fixing TODOs related to file input and File API Fixes related to File API May 2, 2016
@izgzhen

izgzhen commented May 2, 2016

Copy link
Copy Markdown
Contributor Author

I simplified the content of this contrib, since my discussion with @Manishearth shows that there are some design decisions to be settled down later.

Welcome review.

Comment thread components/script/dom/file.rs Outdated
impl File {
fn new_inherited(_file_bits: &Blob, name: DOMString) -> File {
fn new_inherited(file_bits: &Blob, name: DOMString) -> File {
let mime_type = guess_mime_type(Path::new(&*name));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we guessing the type here? The spec doesn't mention this, the type is the empty string unless explicitly provided by the user through the FilePropertyBag/BlobPropertyBag.

@izgzhen

izgzhen commented May 2, 2016

Copy link
Copy Markdown
Contributor Author

Review status: 0 of 8 files reviewed at latest revision, 1 unresolved discussion.


components/script/dom/file.rs, line 24 [r6] (raw file):
Good point! There was a "//TODO: get type from the underlying filesystem instead of "".to_string()" left in the initial version and I kind of get mislead by this.

This snippet should be used in the internal initial construction when the files are selected by user.


Comments from Reviewable

@Manishearth

Copy link
Copy Markdown
Member

@bors-servo r+


Reviewed 2 of 12 files at r6, 6 of 6 files at r7.
Review status: all files reviewed at latest revision, 1 unresolved discussion.


components/script/dom/file.rs, line 24 [r6] (raw file):
Yeah, that was wrong 😄


Comments from Reviewable

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit e0f3cda has been approved by Manishearth

@highfive highfive removed the S-awaiting-review There is new code that needs to be reviewed. label May 2, 2016
@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit e0f3cda with merge 1492652...

@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-needs-rebase There are merge conflict errors. labels May 2, 2016
bors-servo pushed a commit that referenced this pull request May 2, 2016
Fixes related to File API

Fixing problems I met when trying to resolve #10851, but most of changes here are simple fixes.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10873)
<!-- Reviewable:end -->
@bors-servo

Copy link
Copy Markdown
Contributor

☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel, mac-dev-unit, mac-rel-css, mac-rel-wpt, windows

@bors-servo
bors-servo merged commit e0f3cda into servo:master May 2, 2016
@highfive highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label May 2, 2016
@izgzhen

izgzhen commented May 11, 2016

Copy link
Copy Markdown
Contributor Author

Ping issue #11131

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add file handling functionality to Blob object

6 participants