Closed Bug 908706 Opened 8 years ago Closed 2 months ago

Percentage text-indent handled incorrectly in overflow:hidden block

Categories

(Core :: Layout: Block and Inline, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: bzbarsky, Unassigned)

Details

Attachments

(2 files, 1 obsolete file)

Attached file Testcase (obsolete) —
Per spec, percentage text-indent refers to the containing block width.

We do this right usually, but if the block has a scrollframe, we seem to make it refer to the scrollframe width, which is wrong.  In the attached testcase the "CANTSEEME" text should not be visible.
nsLineLayout uses nsHTMLReflowState::GetContainingBlockContentWidth(mBlockReflowState) to compute the percentage basis.... would that return the reflow state for the scrollframe?
Attached file Testcase
It seems <fieldset> is wrong too (and like other cases with anon block wrappers).
Attachment #794719 - Attachment is obsolete: true
Webkit seems to use the table, Presto the <div> as containing
block.  Gecko uses the TableCellFrame maybe?
Attached patch WIPSplinter Review
Fwiw, skipping reflow states for anon pseudo frames fixes the scroll frame and
<fieldset> cases.  Should we skip other types of pseudos too?
Comment 2: s/like/likely/
Things tohink about:
 * can we benefit from nsIFrame::GetContainingBlock()?  (I also keep wanting an IsContainingBlock() function.)
 * should the walking be through parentReflowState or mCBReflowState?
 * is mCBReflowState even being set correctly in this case for other uses of mCBReflowState?  Maybe it's just set wrong here?
Mats, are you still planning to drive this in?
Flags: needinfo?(mats)
Bug 1453298 makes this invalid.

Close per comment 8.

Status: NEW → RESOLVED
Closed: 2 months ago
Flags: needinfo?(mats)
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.