When I add CSS with a :first-letter pseudo-element (even w/o declaration), Firefox 34.0 shows scrollbars.

RESOLVED FIXED in Firefox 37

Status

()

RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: k.daskalov.911, Assigned: dbaron)

Tracking

({regression, testcase})

34 Branch
mozilla38
regression, testcase
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(firefox35 wontfix, firefox36 wontfix, firefox37 fixed, firefox38 fixed)

Details

Attachments

(3 attachments)

(Reporter)

Description

4 years ago
Created attachment 8531215 [details]
This is a zip archive. It contains simple HTML example and 2 PNG screenshots.

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:34.0) Gecko/20100101 Firefox/34.0
Build ID: 20141125180439

Steps to reproduce:

I add CSS for first-letter selector, as shown into attached example.


Actual results:

Firefox 34.0 shows scrollbars.


Expected results:

None of the other major browsers, even the previous version of Firefox do not show scrollbars in this situation.

Comment 1

4 years ago
The scrollbar does not disappear if I empty the div.content:first-letter ruleset.

It appears only if the content font-size is at least 10pt.  Apparently the selector with :first-letter makes something at least seem bigger to Firefox.

FWIW, MDN page about the pseudo-element: https://developer.mozilla.org/en-US/docs/Web/CSS/::first-letter
QA Whiteboard: [bugday-20141208]
Component: Untriaged → Layout
Product: Firefox → Core
Summary: When I add CSS for first-letter selector, Firefox 34.0 shows scrollbars. → When I add CSS with a :first-letter pseudo-element (even w/o declaration), Firefox 34.0 shows scrollbars.
(Reporter)

Comment 2

4 years ago
Yes, it does not depend on the div.content:first-letter ruleset.

Definitely it does not depend directly on the font-size.
If you use a smaller font-size, but also use a smaller container, scrollbars appear again.

Probably this means that Firefox 34.0 can not calculate correctly the size of the content, when first-letter selector is mentioned in CSS.
(Reporter)

Comment 3

4 years ago
This problem is still not resolved in Firefox 35.0
Version: 34 Branch → 35 Branch
Created attachment 8556820 [details]
Reporter's testcase
The testcase works in Firefox 33, but fails in 34.
Status: UNCONFIRMED → NEW
Component: Layout → Layout: Block and Inline
Ever confirmed: true
Keywords: regression, regressionwindow-wanted, testcase
OS: Windows 7 → All
Hardware: x86_64 → All
Version: 35 Branch → 34 Branch

Comment 6

4 years ago
Pushlog:
https://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=156f1bee4139&tochange=e0a077aace0c

Regressed by: Bug 1055865
Blocks: 1055865
Flags: needinfo?(dbaron)

Comment 7

4 years ago
In local build
Last Good: 1e5f9b3a220e
First Bad: a25d5be62042

Triggered by: a25d5be62042	L. David Baron β€” Bug 1055865 patch 4 - Remove bits of code that nsLineLayout takes care of. r=jfkthame
Created attachment 8557424 [details] [diff] [review]
Make more overflow area computation code apply only to floating ::first-letter

In inline layout there's no need to do anything with overflow areas
since RelativePositionFrames handles it.  Apparently doing some of the
work messes things up somehow, so the easy fix is to make the inline
::first-letter codepath behave more like nsInlineFrame and not do any
messing with overflow areas.  So this moves the rest of the overflow
code in nsFirstLetterFrame::Reflow into the float-only codepath.  There
don't appear to be any ordering issues with the movement, since the code
that the FinishAndStoreOverflow call is moved across deals with creating
and destroying continuations of the child.

All the added tests pass with the patch, but without the patch
overflow-inline-nooverflow.html fails.
Attachment #8557424 - Flags: review?(jfkthame)
Assignee: nobody → dbaron
Status: NEW → ASSIGNED
Flags: needinfo?(dbaron)
status-firefox35: --- → affected
status-firefox36: --- → affected
status-firefox37: --- → affected
status-firefox38: --- → affected
Keywords: regressionwindow-wanted
Comment on attachment 8557424 [details] [diff] [review]
Make more overflow area computation code apply only to floating ::first-letter

Review of attachment 8557424 [details] [diff] [review]:
-----------------------------------------------------------------

Looks reasonable to me. Let's nominate this for uplift, too, as soon as it's safely landed.
Attachment #8557424 - Flags: review?(jfkthame) → review+
Comment on attachment 8557424 [details] [diff] [review]
Make more overflow area computation code apply only to floating ::first-letter

Approval Request Comment
[Feature/regressing bug #]: bug 1055865
[User impact if declined]: incorrect scrollbar extents around content with a ::first-letter pseudo-element
[Describe test coverage new/current, TreeHerder]: landed on inbound; wrote some new test coverage to test some additional related cases that didn't regress
[Risks and why]: moderate risk to ::first-letter, which is not a very widely used feature; no risk outside of ::first-letter
[String/UUID change made/needed]: no
Attachment #8557424 - Flags: approval-mozilla-beta?
Attachment #8557424 - Flags: approval-mozilla-aurora?
https://hg.mozilla.org/mozilla-central/rev/c469b23c542e
Status: ASSIGNED → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla38
Comment on attachment 8557424 [details] [diff] [review]
Make more overflow area computation code apply only to floating ::first-letter

We have this bug for a few releases and since it is not a widely used feature, let it ride the train from aurora if that it is ok with you.
Attachment #8557424 - Flags: approval-mozilla-beta?
Attachment #8557424 - Flags: approval-mozilla-beta-
Attachment #8557424 - Flags: approval-mozilla-aurora?
Attachment #8557424 - Flags: approval-mozilla-aurora+
https://hg.mozilla.org/releases/mozilla-aurora/rev/a8df201deeea
status-firefox35: affected → wontfix
status-firefox36: affected → wontfix
status-firefox37: affected → fixed
status-firefox38: affected → fixed
Flags: in-testsuite+
You need to log in before you can comment on or make changes to this bug.