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

Convert non-leaf inline boxes into SpacerBox or remove them #105

Closed
burg opened this issue Oct 10, 2012 · 1 comment
Closed

Convert non-leaf inline boxes into SpacerBox or remove them #105

burg opened this issue Oct 10, 2012 · 1 comment

Comments

@burg
Copy link

@burg burg commented Oct 10, 2012

Inline elements such as span with text node children make GenericBoxes, which get put into inline flows' list of inline boxes.

If these generic boxes don't actually induce any content for the purposes of inline flow (i.e., padding/borders left and right), then they should be elided. If they do use up space, then they should be "evolve" into one or two SpacerBoxes that participate in the inline flow.

This conversion could be put into the TextRunScanner, or possibly even earlier during initial box creation. (this would drastically reduce the number of GenericBoxes that are allocated and summarily destroyed)

We'll eventually need to decide how SpacerBoxes can be affected by line breaking relative to the content that they wrap.

Tasks

  • Implement SpacerBox enum variant
  • Complete the method RenderBox::create_inline_spacer_for_side (box.rs)
@dhedlund
Copy link
Contributor

@dhedlund dhedlund commented Dec 9, 2013

This may no longer be relevant. The last reference to SpacerBox was removed in 155befe, as were the function stubs inline_spacers_needed_for_node and make_inline_spacer_for_node_side.

I believe this was replaced with the function build_boxes_for_nonreplaced_inline_content in layout::construct::FlowConstructor, which has a comment that says:

/// Concatenates the boxes of kids, adding in our own borders/padding/margins if necessary.
/// Returns the `InlineBoxesConstructionResult`, if any. There will be no
/// `InlineBoxesConstructionResult` if this node consisted entirely of ignorable whitespace.

That function doesn't handle padding, margins or borders yet but has a TODO comment to implement it. The following issues address the missing functionality:

  • #227 : Calculate and use margins, padding, border in inline flows (closed, please re-open)
  • #857 : Border lines of inline element are not painted now
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
3 participants
You can’t perform that action at this time.