Open
Bug 853790
Opened 13 years ago
Updated 5 years ago
Editor should not deal with insignificant text nodes
Categories
(Core :: DOM: Editor, defect, P5)
Core
DOM: Editor
Tracking
()
NEW
People
(Reporter: glazou, Unassigned)
Details
(Keywords: regression, testcase)
Attachments
(2 files, 2 obsolete files)
|
2.32 KB,
text/html
|
Details | |
|
3.37 KB,
patch
|
ehsan.akhgari
:
review+
|
Details | Diff | Splinter Review |
This is another regression making the markup created
by the editor invalid: the editor now applies changes to some
insignificant text nodes like CRs between two elements.
This was reported to me by a BlueGriffon user and I narrowed
the issue to the attached test case.
Open test case and click on the link.
| Reporter | ||
Comment 1•13 years ago
|
||
Showstopper bug for BlueGriffon 1.7...
| Reporter | ||
Comment 2•13 years ago
|
||
Investigated a bit and found the guilty code.
In his patches for bug 612128, Ehsan introduced nsHTMLEditor::IsEditable that did not exist previously and that method does not check if text nodes are significant text nodes or not. So insignificant text nodes end up in the list of nodes to be styled by nsHTMLEditor::SetInlineProperty...
| Reporter | ||
Comment 3•13 years ago
|
||
Attachment #728250 -
Flags: review?(ehsan)
Comment 4•13 years ago
|
||
Comment on attachment 728250 [details] [diff] [review]
fix
Review of attachment 728250 [details] [diff] [review]:
-----------------------------------------------------------------
r=me with the comment below. Can you also convert this testcase into a mochitest and add it to the patch as well?
::: editor/libeditor/html/nsHTMLEditor.cpp
@@ +5432,5 @@
> }
> + // We might be dealing with a text node for example, which we consider
> + // to be editable if it's a significant text node
> + if (IsTextNode(aNode)) {
> + nsCOMPtr<nsIContent> content = do_QueryInterface(aNode);
aNode is already an nsIContent*. Please get rid of the QI here.
Attachment #728250 -
Flags: review?(ehsan) → review+
| Reporter | ||
Comment 5•13 years ago
|
||
(In reply to :Ehsan Akhgari (needinfo? me!) from comment #4)
> aNode is already an nsIContent*. Please get rid of the QI here.
How to be fooled by a variable's name when you're in a hurry.
Sure, will do. Will write the mochitest too.
| Reporter | ||
Comment 6•13 years ago
|
||
in answer to ehsan's comments.
Attachment #728327 -
Flags: review?(ehsan)
| Reporter | ||
Comment 7•13 years ago
|
||
better error message in mochitest
Attachment #728250 -
Attachment is obsolete: true
Attachment #728327 -
Attachment is obsolete: true
Attachment #728327 -
Flags: review?(ehsan)
Attachment #728328 -
Flags: review?(ehsan)
Updated•13 years ago
|
Attachment #728328 -
Flags: review?(ehsan) → review+
Comment 9•5 years ago
|
||
Bulk-downgrade of unassigned, >=3 years untouched DOM/Storage bug's priority.
If you have reason to believe this is wrong, please write a comment and ni :jstutte.
Severity: major → S4
Priority: -- → P5
You need to log in
before you can comment on or make changes to this bug.
Description
•