Closed Bug 17216 Opened 25 years ago Closed 25 years ago

clicking in page causes page to shift several pixels

Categories

(Core :: Layout, defect, P3)

PowerPC
Mac System 8.5
defect

Tracking

()

VERIFIED DUPLICATE of bug 17518

People

(Reporter: mikepinkerton, Assigned: pierre)

References

()

Details

go to http://www.nhl.com/hockeyu/officials/092299.htm
click on any whitespace.

notice that the content will shift down and then back up again, reflowing the
page twice in the meantime. this is easier to see with paint flashing on.
Assignee: troy → pierre
The shifting is because we end up reflowing the page. That raises two questions:
1. why is the click causing a reflow?
2. why does the incremental reflow of the page cause it to shift and then
repaint as it was?

Let's start with the first issue, because it seems undesirable that we're doing
a reflow.

Below is a stack trace that shows the click is causing a content state change
and that causes the style system to generate a style change reflow command.

I don't understand the style system enough to know why that's happening so I'm
reassigning to Pierre who will know.

PresShell::AppendReflowCommand(PresShell * const 0x01eba8f8, nsIReflowCommand *
0x028e98b8) line 1358
StyleChangeReflow(nsIPresContext * 0x0274d010, nsIFrame * 0x02940a10, nsIAtom *
0x00000000) line 6907
nsCSSFrameConstructor::ProcessRestyledFrames(nsCSSFrameConstructor * const
0x01eba838, nsStyleChangeList & {...}, nsIPresContext * 0x0274d010) line 7003 +
15 bytes
nsCSSFrameConstructor::ContentStatesChanged(nsCSSFrameConstructor * const
0x01eba838, nsIPresContext * 0x0274d010, nsIContent * 0x01df95fc, nsIContent *
0x00000000) line 7125
StyleSetImpl::ContentStatesChanged(StyleSetImpl * const 0x01eba768,
nsIPresContext * 0x0274d010, nsIContent * 0x01df95fc, nsIContent * 0x00000000)
line 980
PresShell::ContentStatesChanged(PresShell * const 0x01eba900, nsIDocument *
0x02906860, nsIContent * 0x01df95fc, nsIContent * 0x00000000) line 1815 + 46
bytes
nsDocument::ContentStatesChanged(nsDocument * const 0x02906860, nsIContent *
0x01df95fc, nsIContent * 0x00000000) line 1506
nsEventStateManager::SetContentState(nsEventStateManager * const 0x028f8b50,
nsIContent * 0x01df95fc, int 1) line 1448
nsEventStateManager::PostHandleEvent(nsEventStateManager * const 0x028f8b50,
nsIPresContext & {...}, nsGUIEvent * 0x0012fb78, nsIFrame * 0x028caa00,
nsEventStatus & nsEventStatus_eIgnore, nsIView * 0x01dda978) line 459
PresShell::HandleEvent(PresShell * const 0x01eba8fc, nsIView * 0x01dda978,
nsGUIEvent * 0x0012fb78, nsEventStatus & nsEventStatus_eIgnore) line 2211 + 43
bytes
nsView::HandleEvent(nsView * const 0x01dda978, nsGUIEvent * 0x0012fb78, unsigned
int 8, nsEventStatus & nsEventStatus_eIgnore, int & 0) line 834
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → DUPLICATE
The problem is caused by an anchor tag that contains the whole page because it is
not terminated. When you click anywhere in the window, it puts the "Officiating"
image in the 'active' state and the following CSS declarations are applied:
  a:active {
    display: inline;
    color: red;
    text-decoration: underline;
    cursor: pointer;
  }

  a:link img, a:visited img, a:active img,
  a:out-of-date img, img[usemap], object[usemap] {
    display: inline;
    border: 2px solid;
    cursor: pointer;
  }


**************
Breaking news
**************
I'm stopping the explanations here: Harishd just reported that it is a duplicate
of bug 17518.


*** This bug has been marked as a duplicate of 17518 ***
Status: RESOLVED → VERIFIED
Agreed. Marking as verified dup of 17518.
You need to log in before you can comment on or make changes to this bug.