Closed Bug 1115999 Opened 9 years ago Closed 9 years ago

Table cells slide offscreen

Categories

(Core :: Layout, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla37
Tracking Status
firefox36 --- unaffected
firefox37 + fixed

People

(Reporter: evilpie, Assigned: dbaron)

References

()

Details

(Keywords: regression)

Attachments

(4 files)

When moving the mouse on the page http://kangax.github.io/compat-table/es6/, table cells just slide around to the left and right. Must be recentish regression in Nightly.
Attached image screenshot
Does this also happen on any other browsers?  (Probably most interested in Chrome and IE -- and maybe multiple versions of IE.)
Note that I'm presuming that this is happening because the page is using relative positioning and expecting it to do nothing, and we just landed a patch to make it work.
I see no problems with Chrome 41.
If open Web Console, It seems the problem does not occur....
Bug 35168 comment 45 and bug 35168 comment 48 say that both Chrome and IE support relative positioning moving table cells, but do not support movement of other table parts.  (I think older versions of IE did support relative positioning moving table rows, though.)

If we see compatibility problems outside of content for audiences other than the Web development and Web standards communities, I'd be more inclined to disable the feature.  But this alone isn't enough evidence to make me disable it, particularly given that I recall it working on older IE versions (e.g., from bug 845837, which I believe has content designed around relative positioning of table rows working).
Er, the first sentence of the second paragraph of comment 8 had too many negatives:

I mean:  I'd be more inclined to disable the feature if we see compatibility problems in content for audiences other than the Web development and Web standards communities.
(In reply to Alice0775 White from comment #7)
> If open Web Console, It seems the problem does not occur....

s/Web Console/Inspector/
Though I don't see anything in the CSS that's doing relative positioning on rows or rowgroups, which makes it a little more surprising that we'd get a behavior that's not present in Chrome or IE.  So maybe there's a bug in our new handling of relative positioning on cells.
OK, now that I see the bug, it looks like there's something broken on our side.
I'm suspicious of this code in nsTableRowFrame.cpp:

        // We didn't reflow. To take relative positioning into account,
        // translate the new position by the vector from the previous 'normal'
        // position to the previous position.
        // XXX(seth): This doesn't work for 'position: sticky'.
        kidPosition += kidRect.TopLeft() - origKidNormalPosition;

not updating the normal position property.  Ideally, we'd just call ApplyRelativePositioning somehow.
https://hg.mozilla.org/users/dbaron_mozilla.com/patches/raw-file/5ccce7541d8f/apply-rel-pos-better fixes this; I still need to figure out how to write a test.
Assignee: nobody → dbaron
Status: NEW → ASSIGNED
The more I remove, the less reliably reproducable the bug becomes.

This is the smallest I've gotten it; I can still reproduce a decent fraction of the time by starting the mouse pointer below the first column of the table and then moving the mouse up.
Managed to build a testcase from scratch without too much trouble, though.
I confirmed that the reftest passes with the patch and fails without the
patch.
Attachment #8541969 - Flags: review?(roc)
I should perhaps clarify;

This is the crazy codepath where nsTableRowFrame sets doReflowChild to true, and then tests some additional conditions, and based on those conditions decides to do part (but not all) of the work of reflowing the child.  This is making relative and sticky positioning work correctly in that case, which we should really just get rid of, but which I don't want to deal with now.
https://hg.mozilla.org/mozilla-central/rev/c7dde66a57bb
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla37
Flags: in-testsuite+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: