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
Closed

Conversation

@farodin91
Copy link
Contributor

farodin91 commented Jul 31, 2015

Review on Reviewable

@highfive
Copy link

highfive commented Jul 31, 2015

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

farodin91 commented Jul 31, 2015

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);

This comment has been minimized.

@jdm

jdm Jul 31, 2015

Member

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

This comment has been minimized.

@farodin91

farodin91 Aug 2, 2015

Author Contributor

ups

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

farodin91 commented Aug 2, 2015

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 farodin91:window branch 2 times, most recently from 11c09e6 to 160802d Aug 2, 2015
@farodin91
Copy link
Contributor Author

farodin91 commented Aug 2, 2015

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

farodin91 commented Aug 2, 2015

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 force-pushed the farodin91:window branch from 160802d to 43d6d5e Aug 2, 2015
@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

farodin91 commented Aug 2, 2015

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

bors-servo commented Aug 4, 2015

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

farodin91 added 3 commits Aug 4, 2015
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

farodin91 commented Aug 4, 2015

Will Squash at the end

Conflicts:
	components/script/dom/window.rs
Conflicts:
	components/compositing/compositor.rs
	components/msg/compositor_msg.rs
@jdm jdm removed the S-needs-rebase 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

@bors-servo
Copy link
Contributor

bors-servo commented Aug 27, 2015

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

Conflicts:
	components/script/dom/window.rs

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

This comment has been minimized.

@dzbarsky

dzbarsky Aug 27, 2015

Member

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.

This comment has been minimized.

@jdm

jdm Aug 27, 2015

Member

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?

This comment has been minimized.

@dzbarsky

dzbarsky Aug 27, 2015

Member

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 and removed S-needs-rebase labels Aug 27, 2015
@bors-servo
Copy link
Contributor

bors-servo commented Aug 28, 2015

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

Conflicts:
	components/compositing/headless.rs
	components/script/dom/window.rs
@farodin91 farodin91 closed this Sep 1, 2015
@farodin91 farodin91 deleted the farodin91:window branch Sep 1, 2015
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
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

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