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

compositing/script: Do not dispatch the resize event when initially l… #10654

Merged
merged 1 commit into from Apr 22, 2016

Conversation

@notriddle
Copy link
Contributor

notriddle commented Apr 16, 2016

…oading.

No bug report corresponds to this, but I noticed it while trying to
reduce #10593


This change is Reviewable

@highfive
Copy link

highfive commented Apr 16, 2016

Heads up! This PR modifies the following files:

  • @KiChjang: components/script/script_thread.rs, components/script_traits/lib.rs, components/script_traits/lib.rs
@Ms2ger
Copy link
Contributor

Ms2ger commented Apr 16, 2016

Do you have a spec to back this up?

@pcwalton
Copy link
Contributor

pcwalton commented Apr 16, 2016

I don't think we need a spec cite for this, because it makes us stop doing something that the spec does not require us to do and that is nonsensical to begin with. (That is, this essentially corrects a pre-existing spec violation.)

@notriddle
Copy link
Contributor Author

notriddle commented Apr 16, 2016

You're only supposed to fire the event if the window size has changed since the last time the run the resize steps algorithm has been run. This is clearly false the first time the algorithm runs; it has not changed because it did not exist at all.

@pcwalton
Copy link
Contributor

pcwalton commented Apr 17, 2016

compositing changes look fine to me.

@notriddle
Copy link
Contributor Author

notriddle commented Apr 18, 2016

Is there something wrong with the script part?

@asajeffrey
Copy link
Member

asajeffrey commented Apr 18, 2016

A probably dumb question... why have the compositor send a window size message with type Initial, rather than just have the window track whether it's had its initial size set? It seems like the code would be simpler if we just had script keep track of this.


Review status: 0 of 8 files reviewed at latest revision, all discussions resolved.


Comments from Reviewable

@notriddle
Copy link
Contributor Author

notriddle commented Apr 19, 2016

The compositor knows how the message is supposed to be treated; it would be bad if the script were silently out of sync with that expectation. I admit it's just a heuristic "explicit is better than implicit" choice.

I can change it, if you would prefer it the other way.


Comments from Reviewable

@asajeffrey
Copy link
Member

asajeffrey commented Apr 19, 2016

It's just a question of who keeps track of that bit of state -- the compositor (as you have it) or script (by keeping track of an optional size). Personally I prefer the latter, but this is just taste.

@notriddle would you like me to finish doing the code review?

@bors-servo
Copy link
Contributor

bors-servo commented Apr 19, 2016

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

@notriddle
Copy link
Contributor Author

notriddle commented Apr 19, 2016

I'd say yeah, finish the code review.

@asajeffrey
Copy link
Member

asajeffrey commented Apr 19, 2016

OK, looks good. If we're going to go with the compositor rather than script deciding which is the initial size, then this seems a good implementation. r=me if so.


Reviewed 1 of 8 files at r1, 1 of 1 files at r2, 5 of 6 files at r3.
Review status: 7 of 8 files reviewed at latest revision, all discussions resolved.


Comments from Reviewable

@asajeffrey
Copy link
Member

asajeffrey commented Apr 19, 2016

Reviewed 1 of 6 files at r3.
Review status: all files reviewed at latest revision, all discussions resolved.


Comments from Reviewable

@notriddle
Copy link
Contributor Author

notriddle commented Apr 20, 2016

Still awaiting answer?

@asajeffrey
Copy link
Member

asajeffrey commented Apr 20, 2016

@bors-servo
Copy link
Contributor

bors-servo commented Apr 20, 2016

📌 Commit 419633c has been approved by asajeffrey

@bors-servo
Copy link
Contributor

bors-servo commented Apr 20, 2016

Testing commit 419633c with merge 577239f...

bors-servo added a commit that referenced this pull request Apr 20, 2016
compositing/script: Do not dispatch the resize event when initially l…

…oading.

No bug report corresponds to this, but I noticed it while trying to
reduce #10593

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10654)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Apr 20, 2016

💔 Test failed - linux-rel

@notriddle
Copy link
Contributor Author

notriddle commented Apr 21, 2016

@bors-servo
Copy link
Contributor

bors-servo commented Apr 21, 2016

Trying commit 3e18116 with merge 3859d44...

bors-servo added a commit that referenced this pull request Apr 21, 2016
compositing/script: Do not dispatch the resize event when initially l…

…oading.

No bug report corresponds to this, but I noticed it while trying to
reduce #10593

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10654)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Apr 21, 2016

💔 Test failed - mac-rel-wpt

@notriddle
Copy link
Contributor Author

notriddle commented Apr 21, 2016

@notriddle
Copy link
Contributor Author

notriddle commented Apr 22, 2016

Pinging @asajeffrey

@asajeffrey
Copy link
Member

asajeffrey commented Apr 22, 2016

Oops. Minor nit below.


Reviewed 3 of 3 files at r4, 2 of 2 files at r5.
Review status: all files reviewed at latest revision, 1 unresolved discussion, some commit checks broke.


components/script/script_thread.rs, line 1032 [r5] (raw file):
Does this reflow happen in the Resize case too? Should the force_reflow be moved out of the if? The code reads a bit oddly, like the reflow is only happening on initial sizing, not on resizing.


Comments from Reviewable

@notriddle
Copy link
Contributor Author

notriddle commented Apr 22, 2016

…oading.

No bug report corresponds to this, but I noticed it while trying to
reduce #10593
@notriddle
Copy link
Contributor Author

notriddle commented Apr 22, 2016

@asajeffrey
Copy link
Member

asajeffrey commented Apr 22, 2016

:lgtm:

@bors-servo r+


Reviewed 5 of 5 files at r6.
Review status: all files reviewed at latest revision, all discussions resolved.


Comments from Reviewable

@bors-servo
Copy link
Contributor

bors-servo commented Apr 22, 2016

📌 Commit 7940b22 has been approved by asajeffrey

@bors-servo
Copy link
Contributor

bors-servo commented Apr 22, 2016

Testing commit 7940b22 with merge 47a0f58...

bors-servo added a commit that referenced this pull request Apr 22, 2016
compositing/script: Do not dispatch the resize event when initially l…

…oading.

No bug report corresponds to this, but I noticed it while trying to
reduce #10593

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10654)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Apr 22, 2016

@bors-servo bors-servo merged commit 7940b22 into servo:master Apr 22, 2016
3 checks passed
3 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
This was referenced Apr 22, 2016
@notriddle notriddle deleted the notriddle:no_resize_on_initial_load branch Apr 23, 2016
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.