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

Load a placeholder when a url to an image is broken. #5366

Merged
merged 1 commit into from Mar 30, 2015

Conversation

@Adenilson
Copy link
Contributor

Adenilson commented Mar 25, 2015

I decided to use the old Netscape broken image link icon (later we may
replace the image asset for something more trendier).

@Adenilson
Copy link
Contributor Author

Adenilson commented Mar 25, 2015

See #5330 .

@jdm jdm closed this Mar 25, 2015
@jdm jdm reopened this Mar 25, 2015
@jdm jdm closed this Mar 25, 2015
@jdm jdm reopened this Mar 25, 2015
placeholder_url.push("rippy.jpg");
let image = load_image_data(Url::from_file_path(&*placeholder_url).unwrap(), resource_task, &self.placeholder_data);

if image != Err(()) {

This comment has been minimized.

@frewsxcv

frewsxcv Mar 25, 2015

Member

This should probably be a match so you don't have to manually unwrap below

@pcwalton pcwalton force-pushed the servo:master branch from 7f587f6 to b1a35f5 Mar 25, 2015
@jgraham jgraham closed this Mar 25, 2015
@jgraham jgraham reopened this Mar 25, 2015
@hoppipolla-critic-bot
Copy link

hoppipolla-critic-bot commented Mar 25, 2015

Critic review: https://critic.hoppipolla.co.uk/r/4372

This is an external review system which you may optionally use for the code review of your pull request.

In order to help critic track your changes, please do not make in-place history rewrites (e.g. via git rebase -i or git commit --amend) when updating this pull request.

@Adenilson Adenilson force-pushed the Adenilson:loadPlaceholder01 branch from 6b34e88 to cabfa0b Mar 26, 2015
@Adenilson
Copy link
Contributor Author

Adenilson commented Mar 26, 2015

Should I squash it now?

@jdm
Copy link
Member

jdm commented Mar 26, 2015

Yes, go ahead.

@Adenilson Adenilson force-pushed the Adenilson:loadPlaceholder01 branch from e1e72bf to cbdabcc Mar 26, 2015
@Adenilson
Copy link
Contributor Author

Adenilson commented Mar 26, 2015

Going to rebase.

@Adenilson Adenilson force-pushed the Adenilson:loadPlaceholder01 branch from cbdabcc to 534591c Mar 26, 2015
@Adenilson
Copy link
Contributor Author

Adenilson commented Mar 26, 2015

Done.

bors-servo pushed a commit that referenced this pull request Mar 26, 2015
I decided to use the old Netscape broken image link icon (later we may
replace the image asset for something more trendier).
@Adenilson
Copy link
Contributor Author

Adenilson commented Mar 27, 2015

Yep, it triggered regressions on net unit tests. Investigating it now.

@jdm jdm added S-tests-failed and removed S-awaiting-merge labels Mar 27, 2015
@Adenilson
Copy link
Contributor Author

Adenilson commented Mar 27, 2015

I talked with @larsbergstrom and it seems some of the tests expect a request to fail, the issue being that this patch changed the behavior (i.e. we always return a valid image for invalid urls).

It will require to inspect each failing unit test to see if they still make sense given this change on behavior.

@Adenilson
Copy link
Contributor Author

Adenilson commented Mar 27, 2015

Ok, should be fine by now.

@jdm jdm added S-awaiting-merge and removed S-tests-failed labels Mar 27, 2015
bors-servo pushed a commit that referenced this pull request Mar 27, 2015
I decided to use the old Netscape broken image link icon (later we may
replace the image asset for something more trendier).
@jdm
Copy link
Member

jdm commented Mar 28, 2015

src/lib.rs:103:17: 104:75 error: this function takes 4 parameters but 3 parameters were supplied [E0061]
src/lib.rs:103                 ImageCacheTask::new_sync(resource_task.clone(), shared_task_pool,
src/lib.rs:104                                          time_profiler_chan_clone.clone())
src/lib.rs:106:17: 107:70 error: this function takes 4 parameters but 3 parameters were supplied [E0061]
src/lib.rs:106                 ImageCacheTask::new(resource_task.clone(), shared_task_pool,
src/lib.rs:107                                     time_profiler_chan_clone.clone())
error: aborting due to 2 previous errors
Could not compile `b2s`.
@Adenilson
Copy link
Contributor Author

Adenilson commented Mar 28, 2015

Gonk should be ok now.

@jdm
Copy link
Member

jdm commented Mar 28, 2015

Squash these, please.

@Adenilson Adenilson force-pushed the Adenilson:loadPlaceholder01 branch from e7afefb to 41e0203 Mar 28, 2015
@Adenilson
Copy link
Contributor Author

Adenilson commented Mar 28, 2015

Squashed.

bors-servo pushed a commit that referenced this pull request Mar 29, 2015
I decided to use the old Netscape broken image link icon (later we may
replace the image asset for something more trendier).
@Adenilson Adenilson force-pushed the Adenilson:loadPlaceholder01 branch from afc26fb to ae1d40f Mar 29, 2015
@Ms2ger
Copy link
Contributor

Ms2ger commented Mar 30, 2015

@Adenilson: and now a rebase, please

I decided to use the old Netscape broken image link icon (later we may
replace the image asset for something more trendier). The ref test will
expect that a failed load should display the rippy image.

ImageCacheTask users can define if a placeholder image should be loaded
at start up or not. This enables both the new behavior (e.g. always
return an image even for broken urls) as also the previous one.
@Adenilson Adenilson force-pushed the Adenilson:loadPlaceholder01 branch from ae1d40f to cdebb3c Mar 30, 2015
@Adenilson
Copy link
Contributor Author

Adenilson commented Mar 30, 2015

Rebased.

@jdm

This comment has been minimized.

Copy link

jdm commented on cdebb3c Mar 30, 2015

r+

@bors-servo

This comment has been minimized.

Copy link
Contributor

bors-servo commented on cdebb3c Mar 30, 2015

saw approval from jdm
at Adenilson@cdebb3c

This comment has been minimized.

Copy link
Contributor

bors-servo replied Mar 30, 2015

merging Adenilson/servo/loadPlaceholder01 = cdebb3c into auto

This comment has been minimized.

Copy link
Contributor

bors-servo replied Mar 30, 2015

Adenilson/servo/loadPlaceholder01 = cdebb3c merged ok, testing candidate = 1e282d5

This comment has been minimized.

Copy link
Contributor

bors-servo replied Mar 30, 2015

fast-forwarding master to auto = 1e282d5

bors-servo pushed a commit that referenced this pull request Mar 30, 2015
I decided to use the old Netscape broken image link icon (later we may
replace the image asset for something more trendier).
@bors-servo bors-servo closed this Mar 30, 2015
@bors-servo bors-servo merged commit cdebb3c into servo:master Mar 30, 2015
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
default all tests passed
mseri added a commit to mseri/crowbot that referenced this pull request Feb 27, 2016
The previous version would have ignored a message like:
`I'm talking about servo/servo#5366 here`

Also could have ignored some issues.
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

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