Re: context css-menu within a table

Le 2015-07-23 16:39, Tab Atkins Jr. a écrit :
> On Thu, Jul 23, 2015 at 6:20 AM, Sebastian Zartner
> <sebastianzartner@gmail.com> wrote:
>> On 19 July 2015 at 08:06, Rafal Pietrak <rafal@ztk-rp.eu> wrote:
>>> Hello All,
>>> 
>>> My first shot at implementation of "a certain" context menu, which 
>>> shows
>>> up in a table when mouse ":hover" over its row (or ".click()" on that
>>> row for mobile devices) is here: 
>>> (https://jsfiddle.net/fexp/pd6ygatx/7/).
>>> 
>>> Unfortunately it is rendered differently on chromium, and on
>>> icewheasel(mozilla) and on www-browser (all that on 
>>> debian-8.1/jessie).
>>> 
>>> My goal is to have the context menu look like the imeplementation
>>> icewheasle presents, that is "follow the mouse". But:
>>> 
>>> 1. I'm not quite sure which one is actually following the semantics 
>>> of
>>> CSS specs. Pls advice is icewheasle/mozilla have it right (and thus 
>>> will
>>> stay and will proliferate to others)
>>> 2. and since only one of them can be right, the others are wrong ... 
>>> so
>>> I'd like to notify respective develoers here (google, mozilla, etc;
>>> which I understand frequent this list) of this bug in their
>>> implementations; although I con't actually know which one is wrong.
>> 
>> Here's a simplified version of Rafał's example:
>> 
>> https://jsfiddle.net/g9zp6psj/1/
>> 
>> So it looks like Gecko considers relative positioning of table rows
>> while Blink and Trident don't.
> 
> Both behaviors are allowed by CSS 2.1, unfortunately.
> 
> ~TJ

Tab,

Allowed maybe, but certainly not recommended/recommendable:

"
The effect of 'position:relative' on table-row-group, 
table-header-group, table-footer-group, table-row, table-column-group, 
table-column, table-cell, and table-caption elements is undefined.
"
CSS2.1, section 9.3.1 Choosing a positioning scheme: 'position' property
http://www.w3.org/TR/CSS21/visuren.html#choose-position

Earlier versions of CSS2.x were more discouraging or formally 
discouraging relative positioning of sub-table elements.

I glance at Rafal Pietrak's code ( https://jsfiddle.net/fexp/pd6ygatx/7/ 
) and I am convinced there are ways to achieve his context menu with 
less rules, with less declarations and with less z-index declarations.

Gérard

Received on Friday, 24 July 2015 00:08:34 UTC