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 viewport stuffs for window #1718 #6875

Closed
wants to merge 25 commits into from

Conversation

farodin91
Copy link
Contributor

Review on Reviewable

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Jul 31, 2015
@highfive
Copy link

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

@farodin91
Copy link
Contributor Author

Current Problem i get

thread 'ScriptTask PipelineId(0)' has overflowed its stack
Servo exited with return value -4

if window.scroll(0,0) is excuted

@jdm
Copy link
Member

jdm commented Jul 31, 2015

It should become clear what the problem is if you run ./mach run --debugger tests/html/viewport.html and look at the backtrace when the crash occurs.

console.log("ScrollX: "+ window.scrollX);
}
function scroll(){
window.scroll(0,0);
Copy link
Member

Choose a reason for hiding this comment

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

Oh, you're overwriting window.scroll with this new function :P

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ups

@farodin91 farodin91 force-pushed the window branch 2 times, most recently from f589e8c to a9df5f2 Compare August 2, 2015 12:06
@farodin91
Copy link
Contributor Author

Minimal support of Scroll working.
How do I get the height/width of the entire window/document?

@jdm
Copy link
Member

jdm commented Aug 2, 2015

We can use getBoundingClientRect on the document's root element for that, as mentioned on IRC.

Also, instead of merging changes from master into your branch, could you rebase your changes instead? It makes it much easier to follow your changes when reviewing the code.

@farodin91 farodin91 force-pushed the window branch 2 times, most recently from 11c09e6 to 160802d Compare August 2, 2015 16:44
@farodin91
Copy link
Contributor Author

getBoundingClientRect doesn't work correct for me. Return (0,0)
glutin

  • get_position() isn't updating, is my code correct !!!
  • get_outer_size() isn't updating and some as get_inner_size()
  • resize isn't implemented
  • set_position should be easy to implement

@farodin91
Copy link
Contributor Author

I'm working on Linux

@jdm
Copy link
Member

jdm commented Aug 2, 2015

What if you use getBoundingClientRect on the document's body element instead?

@farodin91 farodin91 changed the title [WIP] Implement viewport stuffs for window #1718 Implement viewport stuffs for window #1718 Aug 2, 2015
@farodin91
Copy link
Contributor Author

Current status the most work. if glutin implement this stuff

@jdm
Copy link
Member

jdm commented Aug 2, 2015

Thanks for doing this! I'll give it a proper review sometime in the next couple days.

@jdm jdm self-assigned this Aug 2, 2015
@bors-servo
Copy link
Contributor

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

Conflicts:
	components/compositing/compositor.rs
	components/msg/compositor_msg.rs
	components/script/dom/webidls/Window.webidl
	components/script/dom/window.rs
	components/script/script_task.rs
	tests/html/viewport.html
@farodin91
Copy link
Contributor Author

Will Squash at the end

Conflicts:
	components/script/dom/window.rs
@highfive highfive added S-needs-rebase There are merge conflict errors. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Aug 20, 2015
Conflicts:
	components/compositing/compositor.rs
	components/msg/compositor_msg.rs
@jdm jdm removed the S-needs-rebase There are merge conflict errors. label Aug 24, 2015
@jdm
Copy link
Member

jdm commented Aug 24, 2015

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


Reviewed 1 of 9 files at r14, 11 of 11 files at r16.
Review status: all files reviewed at latest revision, 2 unresolved discussions, all commit checks successful.


components/compositing/compositor_task.rs, line 69 [r16] (raw file):
We should send the smooth value here too.


Comments from the review on Reviewable.io

@jdm jdm added S-needs-code-changes Changes have not yet been made that were requested by a reviewer. and removed S-awaiting-review There is new code that needs to be reviewed. labels Aug 24, 2015
@bors-servo
Copy link
Contributor

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

@highfive highfive added S-needs-rebase There are merge conflict errors. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Aug 27, 2015
Conflicts:
	components/script/dom/window.rs
@highfive highfive added S-awaiting-review There is new code that needs to be reviewed. and removed S-needs-code-changes Changes have not yet been made that were requested by a reviewer. labels Aug 27, 2015

// https://drafts.csswg.org/cssom-view/#dom-window-devicepixelratio
fn DevicePixelRatio(self) -> Finite<f64> {
let dpr = self.window_size.get()
Copy link
Contributor

Choose a reason for hiding this comment

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

This will return the wrong DPR if we are running with an option specifiying DPR. (See device_pixels_per_screen_px in compositor.rs: http://mxr.mozilla.org/servo/source/components/compositing/compositor.rs#1139)
Not sure how much we care though.

Copy link
Member

Choose a reason for hiding this comment

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

This value comes from http://mxr.mozilla.org/servo/source/components/compositing/compositor.rs#779 which is derived from device_pixels_per_screen_px. Why is this wrong?

Copy link
Contributor

Choose a reason for hiding this comment

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

Aaah I'm having trouble reading. Ignore me and carry on.

@jdm
Copy link
Member

jdm commented Aug 27, 2015

Time to squash! Thanks!
-S-needs-rebase -S-needs-rebase +S-needs-squash


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


Comments from the review on Reviewable.io

@jdm jdm added S-needs-squash Some (or all) of the commits in the PR should be combined. and removed S-needs-rebase There are merge conflict errors. labels Aug 27, 2015
@bors-servo
Copy link
Contributor

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

@highfive highfive added S-needs-rebase There are merge conflict errors. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Aug 28, 2015
@jdm jdm removed the S-awaiting-review There is new code that needs to be reviewed. label Aug 28, 2015
Conflicts:
	components/compositing/headless.rs
	components/script/dom/window.rs
@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Sep 1, 2015
@farodin91 farodin91 closed this Sep 1, 2015
@farodin91 farodin91 deleted the window branch September 1, 2015 20:16
bors-servo pushed a commit that referenced this pull request Sep 1, 2015
Implement viewport functions for window #1718

@jdm r?
closes #6875

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7500)
<!-- Reviewable:end -->
bors-servo pushed a commit that referenced this pull request Sep 1, 2015
Implement viewport functions for window #1718

@jdm r?
closes #6875

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7500)
<!-- Reviewable:end -->
bors-servo pushed a commit that referenced this pull request Sep 2, 2015
Implement viewport functions for window #1718

@jdm r?
closes #6875

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7500)
<!-- Reviewable:end -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-awaiting-review There is new code that needs to be reviewed. S-needs-rebase There are merge conflict errors. S-needs-squash Some (or all) of the commits in the PR should be combined.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants