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 Named constructors and the Image constructor for HTMLImageElement #6110

Merged
merged 2 commits into from Jun 25, 2015

Conversation

@klusark
Copy link
Contributor

klusark commented May 18, 2015

I'm not sure if I like how I mostly just duplicated the code in CodegenRust.py, so that might need to be refactored.

Instead of just calling it Image, we might want to call it ConstructorImage, to make it clear that it's a constructor. Anyone have an opinion on that?

There seems to be a bug in the HTMLImageElement getter/setter as the value is 0 regardless of what I do. This seems to be unrelated to my commits, so I'll investigate that separately.

Review on Reviewable

@highfive
Copy link

highfive commented May 18, 2015

Thanks for the pull request, and welcome! The Servo team is excited to review your changes, and you should hear from @metajack (or someone else) soon.

@Manishearth
Copy link
Member

Manishearth commented May 18, 2015

The width IDL attribute is a reflector, and there are additional constraints on the width content attr, which is what's happening here. The internal implementation works with the bounding box.

https://html.spec.whatwg.org/multipage/embedded-content.html#attr-dim-width

There still may be a mistake here though, we should look closely.

@Manishearth
Copy link
Member

Manishearth commented May 18, 2015

Scratch that, our implementation is correct.

https://html.spec.whatwg.org/multipage/embedded-content.html#dom-img-width

That's what I get for clicking the wrong link and not noticing that img wasn't mentioned

@Manishearth
Copy link
Member

Manishearth commented May 18, 2015

r? @Ms2ger

@KiChjang
Copy link
Member

KiChjang commented May 18, 2015

Remember to close #2540 along the way

@Ms2ger Ms2ger closed this May 19, 2015
@Ms2ger Ms2ger reopened this May 19, 2015
@hoppipolla-critic-bot
Copy link

hoppipolla-critic-bot commented May 19, 2015

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

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.

@Ms2ger
Copy link
Contributor

Ms2ger commented May 19, 2015

Reviewed on critic

@Ms2ger Ms2ger self-assigned this May 19, 2015
@klusark
Copy link
Contributor Author

klusark commented May 23, 2015

I'm not sure about the test I added. Is it comprehensive enough? I'm not really sure what else I could add to it.

@bors-servo
Copy link
Contributor

bors-servo commented May 25, 2015

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

@klusark klusark force-pushed the klusark:NamedConstructor branch from 88e36bd to 34bb155 May 25, 2015
@frewsxcv
Copy link
Member

frewsxcv commented May 25, 2015

It looks like one of the lines is beyond 120 characters

https://travis-ci.org/servo/servo/builds/63910947

@klusark klusark force-pushed the klusark:NamedConstructor branch from 34bb155 to 3432ac7 May 30, 2015
@Ms2ger
Copy link
Contributor

Ms2ger commented May 31, 2015

Sorry I've been dragging my feet. I've added more comments on critic.

@bors-servo
Copy link
Contributor

bors-servo commented Jun 19, 2015

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

@Ms2ger
Copy link
Contributor

Ms2ger commented Jun 20, 2015

Please rebase on master.

@klusark klusark force-pushed the klusark:NamedConstructor branch from 3432ac7 to a9043db Jun 20, 2015
@klusark
Copy link
Contributor Author

klusark commented Jun 20, 2015

I rebased it, but I haven't addressed the review comments yet.

@klusark klusark force-pushed the klusark:NamedConstructor branch from a9043db to bbaa6c7 Jun 22, 2015
@klusark
Copy link
Contributor Author

klusark commented Jun 22, 2015

That should resolve all the comments now. If it's good now I'll squash it into two commits. One for NamedConstructor support and one for adding the named constructor to Image

@Ms2ger
Copy link
Contributor

Ms2ger commented Jun 22, 2015

+S-needs-code-changes
Thanks! I'm afraid I have a few more comments still, but it's looking pretty good!


Reviewed 1 of 2 files at r2, 3 of 5 files at r7, 1 of 2 files at r8, 1 of 1 files at r9.
Review status: 6 of 7 files reviewed at latest revision, 6 unresolved discussions, all commit checks successful.


components/script/dom/bindings/utils.rs, line 203 [r9] (raw file):
I don't think we need the Option<> around the entries here.


components/script/dom/bindings/utils.rs, line 218 [r9] (raw file):
This code is here twice now


components/script/dom/bindings/utils.rs, line 228 [r9] (raw file):
Also translate

      if (!JS_DefineProperty(cx, namedConstructor, "prototype",
                             proto,
                             JSPROP_PERMANENT | JSPROP_READONLY,
                             JS_STUBGETTER, JS_STUBSETTER)) {
        return nullptr;
      }

components/script/dom/bindings/utils.rs, line 274 [r9] (raw file):
Please move this back to its original place


components/script/dom/htmlimageelement.rs, line 13 [r9] (raw file):
Nit: no {}s


tests/wpt/metadata/html/dom/interfaces.html.ini, line 9024 [r9] (raw file):
Why does this fail?


Comments from the review on Reviewable.io

@klusark
Copy link
Contributor Author

klusark commented Jun 22, 2015

Review status: 6 of 7 files reviewed at latest revision, 5 unresolved discussions, all commit checks successful.


tests/wpt/metadata/html/dom/interfaces.html.ini, line 9024 [r9] (raw file):
I'm trying to verify if this still fails, but now around half the web platform tests are failing for me, even on master...


Comments from the review on Reviewable.io

@Ms2ger
Copy link
Contributor

Ms2ger commented Jun 24, 2015

Reviewed 4 of 4 files at r10, 1 of 1 files at r11.
Review status: all files reviewed at latest revision, 6 unresolved discussions, all commit checks successful.


components/script/dom/bindings/codegen/CodegenRust.py, line 4565 [r11] (raw file):
I don't think this override is necessary


Comments from the review on Reviewable.io

@Ms2ger
Copy link
Contributor

Ms2ger commented Jun 24, 2015

-S-awaiting-review +S-needs-code-changes
Nearly there! Thank you so much.


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


Comments from the review on Reviewable.io

@Ms2ger
Copy link
Contributor

Ms2ger commented Jun 24, 2015

-S-awaiting-review +S-needs-squash

\o/


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


Comments from the review on Reviewable.io

@klusark klusark force-pushed the klusark:NamedConstructor branch from 0eaf281 to d335791 Jun 24, 2015
@Ms2ger
Copy link
Contributor

Ms2ger commented Jun 25, 2015

@bors-servo
Copy link
Contributor

bors-servo commented Jun 25, 2015

📌 Commit d335791 has been approved by Ms2ger

@bors-servo
Copy link
Contributor

bors-servo commented Jun 25, 2015

Testing commit d335791 with merge 57cc84b...

bors-servo pushed a commit that referenced this pull request Jun 25, 2015
Implement Named constructors and the Image constructor for HTMLImageElement

I'm not sure if I like how I mostly just duplicated the code in CodegenRust.py, so that might need to be refactored.

Instead of just calling it Image, we might want to call it ConstructorImage, to make it clear that it's a constructor. Anyone have an opinion on that?

There seems to be a bug in the HTMLImageElement getter/setter as the value is 0 regardless of what I do. This seems to be unrelated to my commits, so I'll investigate that separately.

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

bors-servo commented Jun 25, 2015

☀️ Test successful - android, gonk, linux1, linux2, linux3, mac1, mac2, mac3

@bors-servo bors-servo merged commit d335791 into servo:master Jun 25, 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

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