Handle floating children of Ruby frames

RESOLVED FIXED in mozilla37

Status

()

Core
Layout: Floats
RESOLVED FIXED
4 years ago
3 years ago

People

(Reporter: sgbowen, Assigned: xidorn)

Tracking

Trunk
mozilla37
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment)

(Reporter)

Description

4 years ago
We should make sure that children of ruby frames which are floats are laid out reasonably and that this behavior is documented in the spec.
The spec might not need to say much, if anything.  But the the trick code-wise is making sure that the floats behave as though all of the ruby markup is like inlines and none of it is like blocks (even though we're implementing ruby-text-container as a block); they should behave as floats anchored within inline content do.

It might be sufficient to just ensure the ruby-text-container is a block without NS_BLOCK_FLOAT_MGR set.
Component: CSS Parsing and Computation → Layout: Floats
(Assignee)

Updated

3 years ago
Depends on: 1107721
(Assignee)

Comment 2

3 years ago
I guess spec need to specify the equivalent inline anchor position of floats in ruby annotation. I don't think we need to worry about it now, though.
(Assignee)

Comment 3

3 years ago
Created attachment 8534129 [details] [diff] [review]
patch
Assignee: sgbowen8 → quanxunzhen
Attachment #8534129 - Flags: review?(dbaron)
What behavior does this implement?
Flags: needinfo?(quanxunzhen)
(Assignee)

Comment 5

3 years ago
The anchor position is the current position in the base line layout. Since an annotation is always reflowed before its base, any float in the annotation is positioned as if it is at the begining of the ruby pair (or ruby segment for spans).

e.g.

  <rb>hello world</rb><rt>hello<float/> world</rt>

would be identical to

  <float/><rb>hello world</rb><rt>hello world</rt>
Flags: needinfo?(quanxunzhen)
Comment on attachment 8534129 [details] [diff] [review]
patch

As long as the float gets pushed down if its anchor point gets pushed down (which I think it should), that sounds fine.

It might be good to have a reftest in addition to the crashtest that you have.
Attachment #8534129 - Flags: review?(dbaron) → review+
(Assignee)

Comment 7

3 years ago
This behavior is not stable yet. I have a plan to reflow ruby base before its ruby text for implementing ruby-merge: auto. (not decide, just thinking) In that way, the behavior here will change. As the exact behavior has not been specified by the spec, I'd prefer not to have a reftest at this point. Does it sound good?
I don't think that should make a difference for simple cases -- the only ways it influences the position are:
 (1) ensuring the float is on the same line
 (2) relative positions when there are multiple floats in the same line

so I think you should be able to test cases where there's only one float in the line.
https://hg.mozilla.org/mozilla-central/rev/c10540d36073
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla37
You need to log in before you can comment on or make changes to this bug.