Closed Bug 924087 Opened 12 years ago Closed 11 years ago

Links in contentEditable divs are styled as :active on mousedown

Categories

(Core :: DOM: Editor, defect)

24 Branch
x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla38

People

(Reporter: roan.kattouw, Assigned: ehsan.akhgari)

References

(Depends on 1 open bug)

Details

Attachments

(3 files)

Attached image Screenshot of the bug
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:24.0) Gecko/20100101 Firefox/24.0 (Beta/Release) Build ID: 20130911155223 Steps to reproduce: 1. Visit a page with a contentEditable div containing a link (e.g. http://jsfiddle.net/ABSMX/ ) 2. Hold the mouse button down inside the link and drag to select part of the link 3. Release the mouse button Actual results: While the mouse button was held down, the part of the link text that wasn't selected was colored orange (:active color; if the link is styled to be green when :active, the text turns green instead). The part of the link text that was selected turns white, as expected. If the mouse is dragged into another link to select part of its text as well, that link is not affected; only the link that the mouse was initially held down on is affected. If the selection color is overridden with ::selection, the entire link text is affected, including the selected part. That is to say, the :active color overrides the ::selection color. Expected results: The link should not have been styled as :active, because clicking a link in a contentEditable area doesn't do anything (it doesn't follow the link, it just positions the cursor in the link text).
Component: Untriaged → Editor
Product: Firefox → Core
I'll take a look at this...
Flags: needinfo?(ehsan)
Assignee: nobody → ehsan
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Flags: needinfo?(ehsan)
Comment on attachment 8550121 [details] [diff] [review] Do not make editable elements as active, as their default action is disabled This is more like css handling issue and dbaron has dealt with this stuff before, so maybe he has some opinion on the behavior. What do other browsers do? I think the change makes sense (though, technically we should then clear possible active state when something becomes editable.)
Attachment #8550121 - Flags: review?(dbaron)
Attachment #8550121 - Flags: review?(bugs)
Attachment #8550121 - Flags: review+
Chrome, Opera and Safari have the same behavior as us after this patch. IE11 doesn't mark the first link (the one without a matching :active selector as active visually, but it does so for the second link. It seems like IE modifies the UA :active style to match the :link style visually or some such.
Comment on attachment 8550121 [details] [diff] [review] Do not make editable elements as active, as their default action is disabled Wouldn't it make more sense to set aContent to null (so that we have no active content) rather than keeping the active content the way it is? r=dbaron, preferably with that change
Attachment #8550121 - Flags: review?(dbaron) → review+
(In reply to David Baron [:dbaron] (UTC-8) (needinfo? for questions) from comment #6) > Comment on attachment 8550121 [details] [diff] [review] > Do not make editable elements as active, as their default action is disabled > > Wouldn't it make more sense to set aContent to null (so that we have no > active content) rather than keeping the active content the way it is? > > r=dbaron, preferably with that change Yeah, makes sense.
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla38
Depends on: 1168055
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: