Closed Bug 242466 Opened 20 years ago Closed 17 years ago

CSS Defined on html Element (or Toplevel Element in XML) Causes Autoscroll Icon to Exhibit Undesirable Effects

Categories

(Firefox :: General, defect)

defect
Not set
minor

Tracking

()

RESOLVED FIXED

People

(Reporter: robert, Unassigned)

References

()

Details

(Keywords: polish, Whiteboard: Probably depends on Bug 242621 to be fixed)

Attachments

(3 files)

On http://webperso.easyconnect.fr/danielglazman/weblog/index.php/ the autoscroll
icon displays to the upper-left of the cursor when autoscroll is invoked.

Note this is not a dupe of Bug 238815.  It still exists after the fix for that
bug was checked in.
Status: NEW → ASSIGNED
Summary: CSS Causes Autoscroll Icon to Display to the Upper-left of Mouse Cursor → CSS Causes Autoscroll Icon to Display to the Upper-left of Mouse Cursor
Target Milestone: --- → Firefox0.9
QA Contact: mconnor
Attached file Minimal Testcase
The problem with this is that the margin style is applied to the html object,
and no styles that are applied to the autoscroll icon will override it.  That
is why adding el.style.margin = "0" has no effect.

However, with that said, we should still go ahead and checkin this patch,
because it will solve any problems with CSS that applies a non-zero margin to
the IMG attribute.
Comment on attachment 147572 [details] [diff] [review]
Partial Patch (Fixes CSS applied to objects other than HTML)

Mike, we should probably go ahead and check this in, because even though it
doesn't solve the problem in the bug, it will help pages that apply a margin to
the BODY or IMG elements.
Attachment #147572 - Flags: review?(mconners)
Attachment #147572 - Flags: review?(mconners) → review?(mconnor)
Blocks: 212273
We really need to get the autoscroll image to be an overlay or something instead
of an element in the DOM.  It causes too many problems.
Summary: CSS Causes Autoscroll Icon to Display to the Upper-left of Mouse Cursor → CSS Defined on html Element Causes Autoscroll Icon to Exhibit Undesirable Effects
Attachment #147572 - Flags: review?(mconnor) → review+
partial patch checked in 2004-05-06 18:02 on branch and trunk
This may require Bug 242621 to be fixed, because as long as the autoscroll icon
is in the DOM, there doesn't seem to be a way to not pick up the CSS attributes
from the html element (which matters in the case of margins & padding).
Status: ASSIGNED → NEW
Depends on: 242621
Whiteboard: Probably depends on Bug 242621 to be fixed
Target Milestone: Firefox0.9 → ---
Also occurs on http://aebrahim.blogspot.com/atom.xml , but not 100% sure if the
cause is the same.

Using: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8a) Gecko/20040515
Firefox/0.8.0+
(In reply to comment #7)
> Also occurs on http://aebrahim.blogspot.com/atom.xml , but not 100% sure if the
> cause is the same.
> 
> Using: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8a) Gecko/20040515
> Firefox/0.8.0+

From a quick glance, it doesn't appear to be related.  I'll try to trace its
cause later on, although I may end up spinning it off into a separate bug.
Tweaking summary to include variant in comment #7.  It is the same issue, except
in an XML file instead of a HTML file.
Summary: CSS Defined on html Element Causes Autoscroll Icon to Exhibit Undesirable Effects → CSS Defined on html Element (or Toplevel Element in XML) Causes Autoscroll Icon to Exhibit Undesirable Effects
I noticed this yesterday while looking through the Sun.com blog roller.  Seems a
few of the bloggers have a nice default template that causes some weirdness for
the autoscroll icon.

For example, on http://blogs.sun.com/roller/page/moazam middle-clicking in
Firefox to bring up the Autoscroll shows the autoscroll icon, but it has a
square border around it.

Checking the css at http://blogs.sun.com/roller/themes/sotto/styles/default.css
reveals this:
img {
  border: 1px solid #BAB5AB;
}

Sure enough, the autoscroll icon grabs a border from that CSS.  Change the
border to 10px solid #FF0000 and you get a huge red border around the autoscroll
icon.  Ick!
Comment #10, that was fixed a long time ago with the checkin for Bug 215825.  It
will be in Firefox 0.9.
*** Bug 242551 has been marked as a duplicate of this bug. ***
*** Bug 253674 has been marked as a duplicate of this bug. ***
*** Bug 262928 has been marked as a duplicate of this bug. ***
Yet another example of this problem:
http://ln.hixie.ch/

Offending CSS:
/* Joke on the Firefox users */
html > img { width: 400px ! important; height: 400px ! important; background:
url(/resources/images/astrophy/48) no-repeat ! important; cursor: pointer !
important; }
*** Bug 279147 has been marked as a duplicate of this bug. ***
So long as the IMG is in the DOM, the page will be able to screw with it. For
example, by removing it.
*** Bug 282710 has been marked as a duplicate of this bug. ***
*** Bug 297664 has been marked as a duplicate of this bug. ***
Attached patch patchSplinter Review
Well, since these style properties are set, they might just as easily be made
important, I guess, so those properties can't be changed with external css.
I also added display inline, it's not really necessary, but currently the
options help (prefs.xhtml) doesn't show an autoscroll image, because of an img
{display:none} rule.
Attachment #187248 - Flags: review?(mconnor)
Assignee: rparenton → nobody
QA Contact: mconnor → general
Attachment #187248 - Flags: review?(mconnor)
This should be fixed with my checkin for bug 242621.
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: