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

Restyle hint on an element with text content causes whole documented to be reflowed #11024

Open
mbrubeck opened this issue May 5, 2016 · 0 comments

Comments

@mbrubeck
Copy link
Contributor

@mbrubeck mbrubeck commented May 5, 2016

The test case at #10499 (comment) hits a performance problem, in addition to the text layout issue that it is demonstrating.

The issue is:

  1. When the node is hovered, the :hover selector on the <a> element causes style::dom::TElement::note_restyle_hint to dirty the element and its descendants when it's hovered.
  2. Because it is dirty, the flow constructor tries to process the text node inside the <a> element.
  3. repair_if_possible tries to repair the text node but fails because its construction result contains unscanned text fragments, which we can't repair properly (#7821).
  4. Because it can't be repaired, the text node is reconstructed. The newly constructed node has REFLOW damage. compute_layout_damage propagates this damage up and down the flow tree, causing a bunch of stuff to be reflowed.

An ideal fix for this would be a way to repair scanned text fragments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.