Closed Bug 1039009 Opened 10 years ago Closed 9 years ago

Handle floating children of Ruby frames

Categories

(Core :: Layout: Floats, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla37

People

(Reporter: sgbowen8, Assigned: xidorn)

References

()

Details

Attachments

(1 file)

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
Depends on: 1107721
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.
Attached patch patchSplinter Review
Assignee: sgbowen8 → quanxunzhen
Attachment #8534129 - Flags: review?(dbaron)
What behavior does this implement?
Flags: needinfo?(quanxunzhen)
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+
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
Closed: 9 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.