Last Comment Bug 245715 - CSS setting float to left or right affects default display property
: CSS setting float to left or right affects default display property
Status: RESOLVED DUPLICATE of bug 237891
[patch]
:
Product: Core
Classification: Components
Component: CSS Parsing and Computation (show other bugs)
: Trunk
: x86 Linux
: -- normal (vote)
: mozilla1.8alpha2
Assigned To: David Baron :dbaron: ⌚️UTC-7 (review requests must explain patch)
: Hixie (not reading bugmail)
Mentors:
http://dignified.de/css-test.xhtml
: 290319 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2004-06-06 07:58 PDT by Marcus Eggenberger
Modified: 2005-04-14 10:29 PDT (History)
1 user (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
testcase (515 bytes, text/html; charset=UTF-8)
2004-06-06 10:06 PDT, David Baron :dbaron: ⌚️UTC-7 (review requests must explain patch)
no flags Details
patch (3.38 KB, patch)
2004-06-06 10:18 PDT, David Baron :dbaron: ⌚️UTC-7 (review requests must explain patch)
bzbarsky: review+
bzbarsky: superreview+
Details | Diff | Review

Description Marcus Eggenberger 2004-06-06 07:58:55 PDT
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.
Comment 1 David Baron :dbaron: ⌚️UTC-7 (review requests must explain patch) 2004-06-06 10:06:18 PDT
Created attachment 150145 [details]
testcase
Comment 2 David Baron :dbaron: ⌚️UTC-7 (review requests must explain patch) 2004-06-06 10:18:44 PDT
Created attachment 150146 [details] [diff] [review]
patch
Comment 3 David Baron :dbaron: ⌚️UTC-7 (review requests must explain patch) 2004-06-06 10:21:16 PDT
Comment on attachment 150146 [details] [diff] [review]
patch

I can't think of any better solution...
Comment 4 David Baron :dbaron: ⌚️UTC-7 (review requests must explain patch) 2004-06-06 10:22:45 PDT

*** This bug has been marked as a duplicate of 237891 ***
Comment 5 Boris Zbarsky [:bz] 2004-07-14 20:30:31 PDT
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.
Comment 6 David Baron :dbaron: ⌚️UTC-7 (review requests must explain patch) 2005-04-14 10:29:39 PDT
*** Bug 290319 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.