6/21/2023 0 Comments Command tab plus alternativestrong for strongly read text (or "bold", is deprecated).em for emphasis (or "italics", is deprecated).In place of inconsistent code generated by using execCommand() from different browsers (often setting inline styling which would complicate your site's CSS if not outright negating it) you should stick to using the following elements which you not only can have control over though are compatible with screen readers: window.getSelection().getRangeAt(0).commonAncestorContainer.document.createRange().surroundContents().Your primary focus JavaScript wise should be on the following: Ultimately it's a harsh though achievable endeavor though if you intend to build an HTML/XML editor like I did you should plan for at least six months if you plan to not only do it properly though test it to the point of hating cake to then only have someone come along and point out yet another bug. That required four months to conquer and there are other bugs too. Unfortunately the primary issue for me was that browsers use a lot of different code to generate those styles which are not recognized by screen readers used by those who are blind or nearly so.Īdditionally the most expensive time bug I ever had to conquer was a Gecko/Presto bug where the visual and technical selections (why they aren't the same thing, don't ask me) would result in part of the DOM being changed that the user did not intend and this would come down to the fact that the pixel count per character is low so if the Rich Editor did not honor visual selections a user would very quickly walk away. I would not say that document.execCommand() is completely dead because some parts of it still work fine. I created the Rich Editor for my platform's XML (HTML5 + XHTML) editing purposes.
0 Comments
Leave a Reply. |