Closed Bug 507131 Opened 13 years ago Closed 12 years ago

CSS property inherited even if re-defined


(Firefox :: General, defect)

Windows XP
Not set





(Reporter: andrea.giammarchi, Unassigned)


User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20090715 Firefox/3.5.1
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20090715 Firefox/3.5.1

as is for any other CSS property, I would expect that a node inside another one with -moz-user-select property assigned can re-assign the property itself as is for color, background, and others. Unfortunately, this does not happen even inline or with !important flag.

Reproducible: Always

Steps to Reproduce:
<div style="-moz-user-select:none;">
    <div style="-moz-user-select:text !important;">
        abc def
Actual Results:  
It is not possible to select the text. To make it possible it is necessary find each parent, verify if it has the property -moz-user-select set as no then change it and go on up to documentElement.

Expected Results:  
redefined property should have more relevance than parent one as is for color, font, background, border, width, etc etc 

Specially with third parts framework, this problem could be a massive waist of time/resources because as soon as a container has this property for labels, tabs, other purposes, every nested element will be affected without possibility to simply select a text (createRange works as expected though)
Sorry guys, I just realized that the property value I was looking for is -moz-none

I am not sure about this choice but it seems to work without problems.

<div style="-moz-user-select:-moz-none;">
    <div style="-moz-user-select:text;">
        abc def

Thanks Juryi for the quick tip (I am sure I tried before, but in a different wrong way)

Closed: 12 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.