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

Check if HTMLImageElement.naturalWidth/naturalHeight respect the device pixel ratio #6769

Closed
jdm opened this issue Jul 25, 2015 · 3 comments
Closed
Labels

Comments

@jdm
Copy link
Member

@jdm jdm commented Jul 25, 2015

This should be easy to figure out by using the "device-pixels-ratio" commandline argument: http://mxr.mozilla.org/servo/source/components/util/opts.rs#278 . If the values for a fully loaded image are not different using two different DPRs, we don't support it yet.

@jdm jdm added the E-easy label Jul 25, 2015
@jdm
Copy link
Member Author

@jdm jdm commented Jul 25, 2015

Specifically, this requires creating a webpage that contains an image, waiting until the image is loaded and using JS to display the values of the naturalWidth/naturalHeight properties of that image element.

@notriddle
Copy link
Contributor

@notriddle notriddle commented Jul 25, 2015

Should this go into the test suite, or do you just want an informational report?

@jdm
Copy link
Member Author

@jdm jdm commented Jul 25, 2015

I don't believe there's a convenient way to test this automatically, since the DPR is not something that can be set programmatically in a cross-browser fashion (which is what the web-platform-tests are designed to be).

bors-servo pushed a commit that referenced this issue Jul 27, 2015
bors-servo
Check if naturalWidth / naturalHeight works w/ DPR

    $ ./mach run --device-pixel-ratio=1 tests/html/get-natural-height.html
    ALERT: width: 600, height: 254
    $ ./mach run --device-pixel-ratio=2 tests/html/get-natural-height.html
    ALERT: width: 600, height: 254
    $ ./mach run --device-pixel-ratio=.5 tests/html/get-natural-height.html
    ALERT: width: 600, height: 254

It doesn't. Answers #6769.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6774)
<!-- Reviewable:end -->
aweinstock314 added a commit to aweinstock314/servo that referenced this issue Jul 28, 2015
    $ ./mach run --device-pixel-ratio=1 tests/html/get-natural-height.html
    ALERT: width: 600, height: 254
    $ ./mach run --device-pixel-ratio=2 tests/html/get-natural-height.html
    ALERT: width: 600, height: 254
    $ ./mach run --device-pixel-ratio=.5 tests/html/get-natural-height.html
    ALERT: width: 600, height: 254

It doesn't. Answers servo#6769.
huonw added a commit to huonw/servo that referenced this issue Jul 30, 2015
    $ ./mach run --device-pixel-ratio=1 tests/html/get-natural-height.html
    ALERT: width: 600, height: 254
    $ ./mach run --device-pixel-ratio=2 tests/html/get-natural-height.html
    ALERT: width: 600, height: 254
    $ ./mach run --device-pixel-ratio=.5 tests/html/get-natural-height.html
    ALERT: width: 600, height: 254

It doesn't. Answers servo#6769.
@jdm jdm closed this Jul 31, 2015
josiahdaniels added a commit to josiahdaniels/servo that referenced this issue Sep 28, 2015
    $ ./mach run --device-pixel-ratio=1 tests/html/get-natural-height.html
    ALERT: width: 600, height: 254
    $ ./mach run --device-pixel-ratio=2 tests/html/get-natural-height.html
    ALERT: width: 600, height: 254
    $ ./mach run --device-pixel-ratio=.5 tests/html/get-natural-height.html
    ALERT: width: 600, height: 254

It doesn't. Answers servo#6769.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.