Closed
Bug 460568
Opened 16 years ago
Closed 16 years ago
removeAttribute('contenteditable') doesn't work fine
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
People
(Reporter: masayuki, Assigned: masayuki)
References
Details
Attachments
(2 files, 1 obsolete file)
813 bytes,
text/html
|
Details | |
4.94 KB,
patch
|
masayuki
:
review+
masayuki
:
superreview+
|
Details | Diff | Splinter Review |
removeAttribute('contenteditable') doesn't work fine. The editable element should be changed to normal contents, however, the inner elements are not reset the editable state. See the attached testcase, you cannot focus to the anchor even if the contenteditable attribute was removed.
Assignee | ||
Comment 1•16 years ago
|
||
ChangeEditableState should not be called before nsGenericHTMLElementBase::UnsetAttr. Because it's looking the attr value for its result. But it will be updated by nsGenericHTMLElementBase::UnsetAttr.
Attachment #343704 -
Flags: superreview?(peterv)
Attachment #343704 -
Flags: review?(peterv)
Comment 2•16 years ago
|
||
Comment on attachment 343704 [details] [diff] [review] Patch v1.0 I'd do: PRBool contentEditable = PR_FALSE; PRInt32 contentEditableChange; // Check for event handlers if (aNameSpaceID == kNameSpaceID_None) { if (aAttribute == nsGkAtoms::contenteditable) { contentEditable = PR_TRUE; contentEditableChange = GetContentEditableValue() == eTrue ? -1 : 0; } else if (nsContentUtils::IsEventAttributeName(aAttribute, EventNameType_HTML)) { nsCOMPtr<nsIEventListenerManager> manager; GetListenerManager(PR_FALSE, getter_AddRefs(manager)); if (manager) { manager->RemoveScriptEventListener(aAttribute); } } } nsresult rv = nsGenericHTMLElementBase::UnsetAttr(aNameSpaceID, aAttribute, aNotify); NS_ENSURE_SUCCESS(rv, rv); if (contentEditable) { ChangeEditableState(contentEditableChange); } return NS_OK; With that, r/sr=me.
Attachment #343704 -
Flags: superreview?(peterv)
Attachment #343704 -
Flags: superreview+
Attachment #343704 -
Flags: review?(peterv)
Attachment #343704 -
Flags: review+
Assignee | ||
Comment 3•16 years ago
|
||
Attachment #343704 -
Attachment is obsolete: true
Attachment #344749 -
Flags: superreview+
Attachment #344749 -
Flags: review+
Assignee | ||
Comment 4•16 years ago
|
||
checked-in.
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Updated•5 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•