Closed
Bug 407127
Opened 17 years ago
Closed 14 years ago
ContentEditable Iframe Content gets uneditable if iframe is position style is changed
Categories
(Core :: DOM: Editor, defect)
Tracking
()
RESOLVED
FIXED
mozilla5
People
(Reporter: u295173, Assigned: ehsan.akhgari)
References
()
Details
(Keywords: dev-doc-complete, testcase)
Attachments
(7 files, 1 obsolete file)
294 bytes,
text/html
|
Details | |
19.22 KB,
patch
|
roc
:
review+
|
Details | Diff | Splinter Review |
10.56 KB,
patch
|
roc
:
review+
|
Details | Diff | Splinter Review |
5.72 KB,
patch
|
roc
:
review+
|
Details | Diff | Splinter Review |
3.13 KB,
patch
|
roc
:
review+
|
Details | Diff | Splinter Review |
7.29 KB,
patch
|
roc
:
review+
|
Details | Diff | Splinter Review |
12.92 KB,
patch
|
roc
:
review+
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9b1) Gecko/2007110904 Firefox/3.0b1
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9b1) Gecko/2007110904 Firefox/3.0b1
Iframe with ContentDitale=true in the content.
If the Container of the Iframe is set to position: absolute, the iframes content gets unebditable.
Reproducible: Always
Steps to Reproduce:
1. test it with the file in the url
Actual Results:
the iframes content isnt editable anymore.
contentEditable = true wont make it editable.
only
contentEditable = false
contentEditable = true
will do the job
Expected Results:
the iframes content should stay editable
Comment 1•17 years ago
|
||
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9b2pre) Gecko/2007120609 Minefield/3.0b2pre
There is some improvement since Firefox 2.
It still shows no caret, you can add letters but not on the place you want, "backspace" does something but not "delete". So "editing" is still a too big word.
Comment 2•16 years ago
|
||
This is confirmed.
Almost one year after the bug report, this still remains an issue and is easily reproducable by adding position: absolute to an iframe.
Taking popular frameworks like ExtJS into account, this can become quite a straining bug (at least it is to us).
Somebody take the afford of adding a simple style rule to an iframe, and fix this bug please.
Some one remove the testcase I field please. I mistakenly attached it to the wrong bug!
Assignee | ||
Updated•14 years ago
|
Attachment #457795 -
Attachment is obsolete: true
Assignee | ||
Comment 5•14 years ago
|
||
Assignee | ||
Comment 6•14 years ago
|
||
This happens because the GetCaret call in nsEditor::InitializeSelection fails: <
Assignee: nobody → ehsan
Assignee | ||
Comment 7•14 years ago
|
||
(In reply to comment #6)
> This happens because the GetCaret call in nsEditor::InitializeSelection fails:
> <
http://mxr.mozilla.org/mozilla-central/source/editor/libeditor/base/nsEditor.cpp#5169
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Whiteboard: [post-2.0]
Assignee | ||
Comment 8•14 years ago
|
||
And... here's why this happens.
Upon initializing the editor, we go ahead and store a weak pointer to the presshell in mPresShellWeak, and assume that the presshell is alive as long as we can grab a strong reference off of the weak pointer.
But that assumption is false. What happens in reality is that we get a pointer to a presshell which is Destroy()'ed, but still exists in memory, and we try to use it, which leads to bad things happening.
This is very broken. We need to stop caching the presshell pointer, and just read it off of the document when we need to. Patches coming up.
Assignee | ||
Comment 9•14 years ago
|
||
This is a refactoring change to make the main fix in this bug more elegant.
Attachment #518204 -
Flags: review?(roc)
Comment on attachment 518204 [details] [diff] [review]
Part 1: Stop using mPresShellWeak directly everywhere
GetPresShell needs to be deCOMtaminated!
Attachment #518204 -
Flags: review?(roc) → review+
Assignee | ||
Comment 11•14 years ago
|
||
(In reply to comment #10)
> Comment on attachment 518204 [details] [diff] [review]
> Part 1: Stop using mPresShellWeak directly everywhere
>
> GetPresShell needs to be deCOMtaminated!
Yes, in a follow-up though! :-)
Assignee | ||
Comment 12•14 years ago
|
||
And for that matter, much of the editor code needs to be deCOMtaminated!
Assignee | ||
Comment 13•14 years ago
|
||
After some more investigation, there seems to be a lot more going on here. mSelConWeak will point to the old presshell for HTML editors (text editors have their own selection controller implementation), so this patch refactors the editor to prepare it for not using that member variable directly.
Attachment #518410 -
Flags: review?(roc)
Assignee | ||
Comment 14•14 years ago
|
||
Attachment #518425 -
Flags: review?(roc)
Attachment #518410 -
Flags: review?(roc) → review+
Attachment #518425 -
Flags: review?(roc) → review+
Assignee | ||
Comment 15•14 years ago
|
||
Some places in the editor code use the presshell just to get the document. This is wrong, because that would fail if the document doesn't have a presshell, which causes things like <http://mxr.mozilla.org/mozilla-central/source/layout/forms/test/test_bug287446.html?force=1> to fail.
Attachment #518606 -
Flags: review?(roc)
Assignee | ||
Comment 16•14 years ago
|
||
Here is the main fix and the test.
Attachment #518607 -
Flags: review?(roc)
Assignee | ||
Comment 17•14 years ago
|
||
Attachment #518620 -
Flags: review?(roc)
Attachment #518606 -
Flags: review?(roc) → review+
Attachment #518607 -
Flags: review?(roc) → review+
Attachment #518620 -
Flags: review?(roc) → review+
Assignee | ||
Comment 19•14 years ago
|
||
http://hg.mozilla.org/mozilla-central/rev/5e5a0939aa37
http://hg.mozilla.org/mozilla-central/rev/5f4b45bf77e2
http://hg.mozilla.org/mozilla-central/rev/b8f7b7bfb440
http://hg.mozilla.org/mozilla-central/rev/81c3902d4e78
http://hg.mozilla.org/mozilla-central/rev/1d37d515d433
http://hg.mozilla.org/mozilla-central/rev/820c0e4e88db
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
No longer depends on: post2.0
Flags: in-testsuite+
Keywords: dev-doc-needed
Resolution: --- → FIXED
Whiteboard: [post-2.0]
Target Milestone: --- → mozilla2.2
Comment 21•14 years ago
|
||
Updated documentation:
https://developer.mozilla.org/en/XPCOM_Interface_Reference/NsIEditor
(note that this article in general needs tons of work, but this particular issue has been addressed).
Also mentioned on Firefox 5 for developers.
Keywords: dev-doc-needed → dev-doc-complete
Assignee | ||
Comment 22•14 years ago
|
||
(In reply to comment #21)
> Also mentioned on Firefox 5 for developers.
Do you object to me removing that entry from that page? nsIEditor is not really a useful thing for external code to rely on, and I don't want to draw needless attention to it. :)
Comment 23•14 years ago
|
||
Oh, yeah, go ahead if you like.
Assignee | ||
Comment 24•14 years ago
|
||
(In reply to comment #23)
> Oh, yeah, go ahead if you like.
Done, thanks!
You need to log in
before you can comment on or make changes to this bug.
Description
•