CSS setting float to left or right affects default display property

RESOLVED DUPLICATE of bug 237891

Status

()

Core
CSS Parsing and Computation
RESOLVED DUPLICATE of bug 237891
13 years ago
13 years ago

People

(Reporter: Marcus Eggenberger, Assigned: dbaron)

Tracking

Trunk
mozilla1.8alpha2
x86
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [patch], URL)

Attachments

(2 attachments)

(Reporter)

Description

13 years ago
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040213 Firefox/0.8
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040213 Firefox/0.8

setting the float property for the img tag by default to left or right,
changes the display property wich is inherited to specific classes:

img {
    float:right;
}

img.nofloat {
    float:none;
}

images without a class are now floating to the left.
images with class 'nofloat' are no longer floating,
but the display property is no block and no longer inline.

I created a test website to demonstrate this bug.

Reproducible: Always
Steps to Reproduce:
nothin special to be done
Actual Results:  
text line is not displayed inline

Expected Results:  
text line shoud be drawn inline

I tried this with latest Firefox and with the Mozilla nightly.
(Assignee)

Comment 1

13 years ago
Created attachment 150145 [details]
testcase
(Assignee)

Comment 2

13 years ago
Created attachment 150146 [details] [diff] [review]
patch
(Assignee)

Updated

13 years ago
Assignee: nobody → dbaron
Status: UNCONFIRMED → NEW
Component: Layout: Floats → Style System (CSS)
Ever confirmed: true
QA Contact: core.layout.floats → ian
Whiteboard: [patch]
Target Milestone: --- → mozilla1.8alpha2
(Assignee)

Comment 3

13 years ago
Comment on attachment 150146 [details] [diff] [review]
patch

I can't think of any better solution...
Attachment #150146 - Flags: superreview?(bzbarsky)
Attachment #150146 - Flags: review?(bzbarsky)
(Assignee)

Comment 4

13 years ago

*** This bug has been marked as a duplicate of 237891 ***
Status: NEW → RESOLVED
Last Resolved: 13 years ago
Resolution: --- → DUPLICATE
Comment on attachment 150146 [details] [diff] [review]
patch

>Index: nsRuleNode.cpp

>+    } else if (nsCSSPseudoElements::firstLetter == pseudoTag) {
>       // a non-floating first-letter must be inline
>       // XXX this fix can go away once bug 103189 is fixed correctly
>       display->mDisplay = NS_STYLE_DISPLAY_INLINE;
>+      
>+      // We can't cache the data in the rule tree since if a more specific
>+      // rule has 'float: none' we'll end up with the wrong 'display'
>+      // property.

This should be talking about "'float: right' or 'float: left'", since this _is_
the 'float: none' branch.

r+sr=bzbarsky with that comment change.
Attachment #150146 - Flags: superreview?(bzbarsky)
Attachment #150146 - Flags: superreview+
Attachment #150146 - Flags: review?(bzbarsky)
Attachment #150146 - Flags: review+
(Assignee)

Comment 6

13 years ago
*** Bug 290319 has been marked as a duplicate of this bug. ***
You need to log in before you can comment on or make changes to this bug.