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

RESOLVED FIXED in Firefox 37



4 years ago
4 years ago


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


({regression, testcase})

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

Firefox Tracking Flags

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



(3 attachments)



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.

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.

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.
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

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
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?
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+
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.