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

Don't re-resolve already-resolved generated content #9969

Merged
merged 1 commit into from Mar 11, 2016

Conversation

@mbrubeck
Copy link
Contributor

mbrubeck commented Mar 11, 2016

This fixes #7846, a failure in the "quotes-036.htm" test. Servo lays out this test correctly in its initial layout, but then messes it up in any relayout (whether it's an incremental or full layout).

The problem is that the ResolveGeneratedContent traversal is not safe to run more than once on the same flow. It mutates some GeneratedContent fragments into ScannedText fragments, but leaves others unmodified (in particular, those that generate empty content). The next time layout runs, these remaining GeneratedContent fragments are processed again but with an incorrect correct quote nesting level (because some of the surrounding GeneratedContent fragments are gone).

This patch ensures that each GeneratedContent fragment is resolved only once.

r? @pcwalton


This change is Review on Reviewable

This fixes #7846, a failure in the "quotes-036.htm" test. Servo lays out this
test correctly in its initial layout, but then messes it up in any relayout
(whether it's an incremental or full layout).

The problem is that the ResolveGeneratedContent traversal is not safe to run
more than once on the same flow. It mutates some GeneratedContent fragments
into ScannedText fragments, but leaves others unmodified (in particular,
those that generate empty content). The next time layout runs, these remaining
GeneratedContent fragments are processed *again* but with an incorrect correct
quote nesting level (because some of the surrounding GeneratedContent
fragments are gone).

This patch ensures that each GeneratedContent fragment is resolved only once.
@metajack
Copy link
Contributor

metajack commented Mar 11, 2016

Is there a case where we might need to rerun this even if the flow isn't recreated? Or is it always the case that this needs to be run only once, and any damage will damage its flow?

@mbrubeck
Copy link
Contributor Author

mbrubeck commented Mar 11, 2016

@jack:

Is there a case where we might need to rerun this even if the flow isn't recreated? Or is it always the case that this needs to be run only once, and any damage will damage its flow?

Any damage to generated content or text fragments causes us to fail incremental layout for the containing flow and instead reconstruct the flow from scratch. So I believe incremental changes to flows containing generated content are handled correctly (though slowly).

It's possible that there are cases where changes to one flow affect the quote nesting level of its sibling flows. We might need to use a flag similar to HAS_COUNTER_AFFECTING_CHILDREN to cause siblings to be dirtied correctly in those cases. That would be a separate, pre-existing bug, though.

@Ms2ger
Copy link
Contributor

Ms2ger commented Mar 11, 2016

\o/

@pcwalton
Copy link
Contributor

pcwalton commented Mar 11, 2016

@bors-servo
Copy link
Contributor

bors-servo commented Mar 11, 2016

📌 Commit 5104d82 has been approved by pcwalton

@bors-servo
Copy link
Contributor

bors-servo commented Mar 11, 2016

Testing commit 5104d82 with merge 71b1122...

bors-servo added a commit that referenced this pull request Mar 11, 2016
Don't re-resolve already-resolved generated content

This fixes #7846, a failure in the "quotes-036.htm" test. Servo lays out this test correctly in its initial layout, but then messes it up in any relayout (whether it's an incremental or full layout).

The problem is that the ResolveGeneratedContent traversal is not safe to run more than once on the same flow. It mutates some GeneratedContent fragments into ScannedText fragments, but leaves others unmodified (in particular, those that generate empty content). The next time layout runs, these remaining GeneratedContent fragments are processed *again* but with an incorrect correct quote nesting level (because some of the surrounding GeneratedContent fragments are gone).

This patch ensures that each GeneratedContent fragment is resolved only once.

r? @pcwalton

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

bors-servo commented Mar 11, 2016

@bors-servo bors-servo merged commit 5104d82 into servo:master Mar 11, 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
@mbrubeck mbrubeck deleted the mbrubeck:quotes-036 branch May 17, 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.

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