[3.0] Theme split (wave 4, part 24) — drop the caret shim and the resizer the editor never had - #9457
Merged
live627 merged 1 commit intoAug 10, 2026
Conversation
Every editor on the forum carried four inline handlers, onselect, onclick, onkeyup and onchange, all calling storeCaret(). That function reads document.selection.createRange(), which is IE's, and guards itself with 'createTextRange' in oTextHandle, so it has done nothing in any browser for years. It cannot even be reached: SCEditor replaces the textarea and leaves it display: none, and the only other user of what it stored, the caretPos branch in replaceText(), is guarded the same way. Nothing else in the tree calls it. The div beside it is in the same state. Nothing styles .richedit_resize and nothing looks up <editor>_resizer, in this theme or in 2.1, so it has always rendered as an empty box of zero height. Signed-off-by: Mathias Albert <mathiaspapealbert@hotmail.com> Signed-off-by: albertlast <mathiaspapealbert@hotmail.com>
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Part of the effort to break #7933 into reviewable pieces. This one takes the posting area's share of the editor markup that does nothing.
Every editor on the forum — posting, personal messages, newsletters, anything using
template_control_richedit()— emits its textarea with four inline handlers:storeCaret()readsdocument.selection.createRange(), which was IE's API, and guards itself with'createTextRange' in oTextHandle. Neither exists in any browser SMF supports, so the function has been a no-op for years. It also cannot be reached at all: SCEditor replaces that textarea and leaves itdisplay: none, so none of the four events ever fire on it. The only other consumer of what it stored, thecaretPosbranch inreplaceText(), is guarded the same way and is equally unreachable. Nothing else in the tree calls it, so the function goes with the handlers.The
<div id="<editor>_resizer" class="richedit_resize">beside it is in the same state: nothing styles.richedit_resizeand nothing looks up that id — not in this theme, and not in 2.1 either, where the same empty div is emitted. It renders as a box of zero height.Both are gone in the #7933 tree, which is where this comes from.
Deliberately left alone
The hidden
<editor>_modefield looks equally dead, and today it is: nothing sets it client-side, andEditor::$rich_activeno longer reads it. But in 2.1 it was read (Subs-Editor.php,!empty($_REQUEST[$editorOptions['id'] . '_mode'])) so that an editor left in WYSIWYG mode came back in WYSIWYG mode after a preview or a failed post. That behaviour is currently lost, and removing the field would foreclose restoring it, so it stays for whoever picks up the editor work.The dead
caretPosbranches insidereplaceText()andsurroundText()stay too, matching the #7933 tree.How this was tested
On a local 3.0 install:
.sceditor-container,.sceditor-toolbar, the button row, the attachments area and the page height are all identical to the pixel. The only difference is that the resizer div is no longer there.sceditor.instance(textarea).val(...)), with all 34 toolbar buttons present and nothing on the console..sceditor-container, with no element left carrying anonselectand no.richedit_resizeanywhere.Issues References (Fixes|Related|Closes)
Related: #7933