Skip to content

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

Merged
bors-servo merged 1 commit into
servo:masterfrom
mbrubeck:quotes-036
Mar 11, 2016
Merged

bors-servo merged 1 commit into
servo:masterfrom
mbrubeck:quotes-036

Conversation

@mbrubeck

Copy link
Copy Markdown
Contributor

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 servo#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.
@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Mar 11, 2016
@metajack

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
Contributor Author

@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

Ms2ger commented Mar 11, 2016

Copy link
Copy Markdown
Contributor

\o/

@pcwalton

Copy link
Copy Markdown
Contributor

@bors-servo: r+

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit 5104d82 has been approved by pcwalton

@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 Mar 11, 2016
@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit 5104d82 with merge 71b1122...

bors-servo pushed 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
Copy Markdown
Contributor

☀️ Test successful - android, gonk, linux-dev, linux-rel, mac-dev-unit, mac-rel-css, mac-rel-wpt, status-appveyor

@bors-servo
bors-servo merged commit 5104d82 into servo:master Mar 11, 2016
@mbrubeck
mbrubeck deleted the quotes-036 branch May 17, 2016 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Intermittent pass in css21_dev/html4/quotes-036.htm

6 participants