Closed
Bug 672709
Opened 13 years ago
Closed 13 years ago
Adding elements to contenteditable DOM in designMode will cause the -moz-read-write state not to update properly
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
VERIFIED
FIXED
mozilla8
People
(Reporter: ehsan.akhgari, Assigned: ehsan.akhgari)
References
Details
(Keywords: regression)
Attachments
(2 files, 1 obsolete file)
428 bytes,
text/html
|
Details | |
5.07 KB,
patch
|
bzbarsky
:
review+
johnath
:
approval-mozilla-aurora+
|
Details | Diff | Splinter Review |
See the attached testcase. This is a regression from http://hg.mozilla.org/mozilla-central/rev/5ad2fcf8d9ed I believe. This is the code responsible: http://hg.mozilla.org/mozilla-central/annotate/aa2de73abc19/content/base/src/nsGenericElement.cpp#l1236 Boris, what was the reason for this optimization? This has the potential of breaking editor operations _very_ badly (such as pressing backspace at the end of a paragraph deleting the whole paragraph because it's treated as a contenteditable=false section.)
Comment 1•13 years ago
|
||
The reason for the optimization is that calling UpdateState on a link is astronomically expensive. I have a proposal to maybe fix that at http://groups.google.com/group/mozilla.dev.platform/browse_thread/thread/eb0a9472df8c0593/30fd10ec83f48a2a but it hasn't happened yet. That said, what's breaking in this case? Let me take a look.
Comment 2•13 years ago
|
||
In particular, I see us enter this function with aNotify == false, oldEditable != newEditable, and newEditable == true, so we remove the READONLY state and add the READWRITE state. If I remove the "skip calling UpdateState if !aNotify" optimization, the bug remains. If I remove the "skip messing with state if oldEditable != newEditable" optimization then the bug remains.....
Comment 3•13 years ago
|
||
And in fact, what's happening in that testcase is that the <body> is readonly, so gets styled with a red color and there are no other color styles around, so the red inherits into everything...
Updated•13 years ago
|
OS: Mac OS X → All
Hardware: x86 → All
Assignee | ||
Comment 4•13 years ago
|
||
Sorry, I uploaded the wrong version of the testcase (setting designMode to "true" doesn't work). The bug happens because of the comparison of oldEditable and newEditable. In this scenario, oldEditable is true because the document has the NODE_IS_EDITABLE flag, and newEditable is true because the node has the NODE_IS_EDITABLE flag. But we think that we can skip updating the readonly/readwrite intrinsic states, so we end up with the p being readonly, which causes the editor to treat it as a contenteditable=false block, which leads to very bad results.
Assignee: nobody → ehsan
Status: NEW → ASSIGNED
Assignee | ||
Updated•13 years ago
|
Attachment #546961 -
Attachment is obsolete: true
Assignee | ||
Comment 6•13 years ago
|
||
Attachment #547162 -
Flags: review?(bzbarsky)
Comment 7•13 years ago
|
||
Comment on attachment 547162 [details] [diff] [review] Patch (v1) r=me
Attachment #547162 -
Flags: review?(bzbarsky) → review+
Assignee | ||
Comment 8•13 years ago
|
||
Comment on attachment 547162 [details] [diff] [review] Patch (v1) This patch is rather low-risk here. We definitely want this on Aurora, otherwise the HTML editor might be broken in unexpected and major ways.
Attachment #547162 -
Flags: approval-mozilla-aurora?
Comment 9•13 years ago
|
||
http://hg.mozilla.org/mozilla-central/rev/579944e7e8f7
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla8
Assignee | ||
Updated•13 years ago
|
status-firefox7:
--- → affected
Assignee | ||
Updated•13 years ago
|
Flags: in-testsuite+
Comment 10•13 years ago
|
||
Comment on attachment 547162 [details] [diff] [review] Patch (v1) a=me for aurora, but this is a regression from what looks like a pretty large landing - if we see more regressions coming from that, we're going to want to look at backing out the original offender on aurora instead of chasing clean up fixes.
Attachment #547162 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Assignee | ||
Comment 11•13 years ago
|
||
http://hg.mozilla.org/releases/mozilla-aurora/rev/8d1b66d7fb5b
Comment 12•13 years ago
|
||
Mozilla/5.0 (Windows NT 6.1; rv:7.0) Gecko/20100101 Firefox/7.0 Mozilla/5.0 (Windows NT 6.1; rv:9.0a1) Gecko/20110818 Firefox/9.0a1 I cannot reproduce the issue. Was it Fixed? Thanks!
Assignee | ||
Comment 13•13 years ago
|
||
Yes, this has been fixed in Firefox 7 and above.
Updated•13 years ago
|
Status: RESOLVED → VERIFIED
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
•