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

Inline reconstruct#12602 #12981

Merged
merged 4 commits into from Aug 23, 2016
Merged

Conversation

splav
Copy link
Contributor

@splav splav commented Aug 22, 2016

This PR fixes two different issues:

  1. In non-incremental layout mode if the inline node hasn't changes - the style pass was skipped, that leads to the corresponding ConstructionResult was not produced. When the parent was rebuilt, the child without the ConstructionResult was omited.
  2. When the opacity was changed (or other style change, causing only repaint) for image (and others, producing only ConstructionItem) the damage is calculated only from children's flows, not from individual fragments. So for now, let's pretend we've newly constructed the ConstructionItem and thus need to rebuild the parent's flow.

  • There are tests for these changes OR
  • These changes do not require tests because _____

This change is Reviewable

@highfive
Copy link

Heads up! This PR modifies the following files:

  • @bholley: components/style/traversal.rs
  • @KiChjang: components/script_layout_interface/restyle_damage.rs

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Aug 22, 2016
@highfive
Copy link

warning Warning warning

  • These commits modify style and layout code, but no tests are modified. Please consider adding a test!

@splav
Copy link
Contributor Author

splav commented Aug 22, 2016

Tests are missing for now as there are some difficulties to reproduce hover correctly.
The ultimate fix, causing the only reconstructed fragment to be replaced is not so straightforward as it is hard to distinguish the fragments in current implementation.

@notriddle notriddle assigned notriddle and unassigned glennw Aug 22, 2016
@notriddle
Copy link
Contributor

Protip: anyone reading these commits should use ?w=1 at the end of the URL.

properties::modify_style_for_replaced_content(&mut style);
}
fragment.repair_style(&style);
set_has_newly_constructed_flow_flag = true;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why can't you just add the flag here? Why do you need to set the boolean to have it add the flag outside the match statement?

@notriddle
Copy link
Contributor

Other than that, it looks good to me.

@splav
Copy link
Contributor Author

splav commented Aug 23, 2016

@notriddle somewhere in

let mut style = node.style(self.style_context()).clone();
let mut data = node.mutate_layout_data().unwrap();

we get a MutRef on the internal struct. To modify flag we also need a MutRef, so I was getting a panic in runtime and decided o move the first to its own scope.

@notriddle
Copy link
Contributor

@bors-servo r+

@bors-servo
Copy link
Contributor

📌 Commit 4bb9de4 has been approved by notriddle

@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. labels Aug 23, 2016
@bors-servo
Copy link
Contributor

⌛ Testing commit 4bb9de4 with merge d591303...

bors-servo pushed a commit that referenced this pull request Aug 23, 2016
Inline reconstruct#12602

<!-- Please describe your changes on the following line: -->
This PR fixes two different issues:
1) In non-incremental layout mode if the inline node hasn't changes - the style pass was skipped, that leads to the corresponding ConstructionResult was not produced. When the parent was rebuilt, the child without the ConstructionResult was omited.
2) When the opacity was changed (or other style change, causing only repaint) for image (and others, producing only ConstructionItem) the damage is calculated only from children's flows, not from individual fragments. So for now, let's pretend we've newly constructed the ConstructionItem and thus need to rebuild the parent's flow.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #12602 (github issue number if applicable).

<!-- Either: -->
- [x] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

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

☀️ Test successful - arm32, arm64, linux-dev, linux-rel, mac-dev-unit, mac-rel-css, mac-rel-wpt, windows-dev

@bors-servo bors-servo merged commit 4bb9de4 into servo:master Aug 23, 2016
@highfive highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Aug 23, 2016
@splav splav deleted the inline_reconstruct#12602 branch August 31, 2016 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Image opacity on hover not changing
5 participants