Closed
Bug 180034
Opened 22 years ago
Closed 22 years ago
we need selection and rules code respect the select_all style
Categories
(Core :: DOM: Selection, defect)
Core
DOM: Selection
Tracking
()
RESOLVED
FIXED
M1
People
(Reporter: mjudge, Assigned: mozeditor)
References
Details
(Whiteboard: moose; fixinhand)
Attachments
(3 files)
482 bytes,
text/html
|
Details | |
23.34 KB,
patch
|
mozeditor
:
review+
kinmoz
:
superreview+
|
Details | Diff | Splinter Review |
7.91 KB,
patch
|
cmanske
:
review+
kinmoz
:
superreview+
|
Details | Diff | Splinter Review |
this needs to simulate one atomic selection item. if this style reaches across multiple nodes this needs to still work.
ok joe gimme some editor rules love ;-)
Status: NEW → ASSIGNED
Assignee | ||
Comment 4•22 years ago
|
||
assigning to me for the moment so I will see it in my queries.
Assignee: mjudge → jfrancis
Status: ASSIGNED → NEW
Whiteboard: moose
Target Milestone: --- → M1
Assignee | ||
Comment 5•22 years ago
|
||
patch to editor. I'll post a blurb explaining it later today.
Assignee | ||
Updated•22 years ago
|
Whiteboard: moose → moose; fixinhand
Assignee | ||
Updated•22 years ago
|
Attachment #107304 -
Flags: superreview?(kin)
Attachment #107304 -
Flags: review?(cmanske)
Assignee | ||
Comment 6•22 years ago
|
||
I tried to take a simple approach for this. There are a few ways to break this down. First, consider: collapsed selection vs ranged selection I made no changes to anything in editor for the ranges selection case. The reson is that I am counting on the selection code to always select the whole object if it has this style, so the editor should never need to check. Next consider: deletion vs everything else I only changed deletion. Everything else is unchanged. There will be some known bugs having to do with not preservring attribute across certain editor actions. For instance, if you have the special attribute on a paragraph, and you use the editor to change it to a heading, the attribute will disappear. And when nodes are joined, the right node is kept. So if you have the attribute on a list item, and you use backspace to join the list item after it, the resulting list item won't have the attribute. But these are known issues that occur for any attribute, so they are really out of the scope of this bug. For the collapsed selection deletion case, I relied on the fact that almost all of our deletion code eventually funnels through either DeleteText() or DeleteNode(). The one place where it didn't I changed. That change is where WillDeleteSelection() used to let the default editor deletion code handle simple text deletion. The default editor code uses DeleteRange(), which would have been complicated to change. So instead I just changed it to not use the default code, and go through DelteText(). Given that, it was a simpel matter to make nsHTMLEditor versions of DeleteText() and DelteNode() that examine the node and it's ancestors for the special {-moz-user-select: all} attribute/value pair, and if found delete the highest node that has such style.
Comment on attachment 107304 [details] [diff] [review] patch to libeditor ==== Since you are always returning immediately, there's no need for the |else| in both |DeleteNode()| and |DeleteText()|. + if (selectAllNode) + { + return ... + } + else + { + return ... + } ==== I'm assuming there's no perf penalty for complex edits due to the added call to |FindUserSelectAllNode()| in DeleteNode() and DeleteText(), right?
Attachment #107304 -
Flags: superreview?(kin) → superreview+
Updated•22 years ago
|
Attachment #107304 -
Flags: review?(cmanske) → review+
Comment on attachment 106171 [details] [diff] [review] patch from the layout\html\base\src directory sr=kin@netscape.com
Attachment #106171 -
Flags: superreview+
Assignee | ||
Comment 9•22 years ago
|
||
Comment on attachment 106171 [details] [diff] [review] patch from the layout\html\base\src directory i dont really grok how this works, but i dont see any problems.
Attachment #106171 -
Flags: review+
Comment 10•22 years ago
|
||
Comment on attachment 106171 [details] [diff] [review] patch from the layout\html\base\src directory r=brade but don't indent the #ifdefs or this line: + TryNextFrame:
Assignee | ||
Comment 11•22 years ago
|
||
both sets of patches landed on trunk
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Comment 12•22 years ago
|
||
Is there a patch to make this style flag also affect deleting the enclosed text via the Backspace or Del keys? It seems that even with this patch in place, I can still Backspace-delete the contained text one character at a time.
Comment 13•22 years ago
|
||
The example in this bug seems to work for me on the trunk.
You need to log in
before you can comment on or make changes to this bug.
Description
•