execCommand problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • drhowarddrfine
    Recognized Expert Expert
    • Sep 2006
    • 7434

    #16
    Originally posted by deuce789
    In regards to wysiwyg browsing and how uncompliant the code is
    Not to nitpick but, again, the browser has nothing to do with whether code is compliant. The code is compliant or not and the browser has nothing to do with it.
    This is actually a browser problem, because execCommand does whatever the browser is up for doing
    You can see here that Firefox is more up to "doing" than IE is.
    Any wysiwyg editor made that uses execCommand cannot be told to output clean code directly because this function is interpreted almost entirely by the web browsers interpretation of the original microsoft integration... So the editor itself is not directly to blame for crappy markup.
    One of a bazillion reasons not to use these automatic code generators.
    There is a flaw in one browser (that happens to still be the most dominant browser and therefore majority of users will be using that browser).
    A list of flaws in browsers.
    put in the attribute and make everyone and everything happy?
    Is there a workaround that can be used instead? In html/css, there are so many things IE does wrong, or not at all, but rather than catering to it with invalid markup, we can introduce 'hacks' and, now, "conditiona l statements" without tripping up modern browsers. Some, not me, would use proprietary elements because there is just no other way around the problem but I have never found that case myself.

    In the new book "Transcendi ng CSS", written and edited by some of the top web designers, they advocate using all the current working tools available in html/css/javascript, whether they work in all browsers or not (specifically mentioning IE). When IE fails to perform, then so be it, excepting functionality, of course, but all other browsers benefit from the modern feature/technique.

    And now I forgot what point I was trying to make with that paragraph. Must get second cup of coffee.

    Comment

    • deuce789
      New Member
      • Aug 2007
      • 31

      #17
      I understand where you are coming from dont get me wrong, but how compliant the outputted code from a wysiwyg editor is directly related to what browser the user is using and although internet explorer is the worst, all of the other browsers that support wysiwyg may be better with their output code, they are still far from perfect as far as following w3c standards 100%. God help us if a simple attribute can break a whole web page in the future.

      The way ALL wysiwyg editors using the browser behaviours need to use hacks in order to work properly in all web browsers, if your suggesting this can be done with all standard code id like to see :). Ive been involved in the development of two wysiwyg editors and have provided several bug fixes to other wysiwyg vendors and can say with certainty that it is impossible to make an editor that uses the default browser commands for wysiwyg editing be 100% compliant in everything yet still retain full functionality in all browsers, there are too many unknown variables.

      This topic has gone way off topic anyway... The point is the author never made any mention to any of the nitty gritty and quite frankly if he/she cared, they wouldnt be trying to work out a solution using execCommand and the code they provided would have been W3C compliant (which it was not and was obvisouly made with IE in mind [telltale signs, caps tag names, javascript mixed with html, etc etc]). They wanted a fix, i provided a fix, all you have done is tried to argue a point (which is a reasonable point, but in this case a mute point). To bother about a simple attribute when the editor itself will output much worse "w3c standard" html (yes even firefox) seems totally irrelevant, and considering the fact its been 10+ years since it was introduced in ie4, and to this date, has never caused any issues in any web browsers at all, it makes it even less irrelevant. Sometimes you have to draw a line, if your bothered about a simple "invalid attribute" what about dealing with all the unclosed tags, and deprecated tags that ALL of the browsers incorporate into their basic default interpretation of execCommand, for a simple WYSIWYG it seems far out of scope of the authors original post and request for help.

      //End Rant

      Comment

      • drhowarddrfine
        Recognized Expert Expert
        • Sep 2006
        • 7434

        #18
        I can't speak for editor or even execCommand. I can only say that editors are going to have to learn to follow the rules just like we web developers do. And anyone who can't get a web site to be 100% valid doesn't know what they are doing or isn't trying. If MSN.com can be 100% valid, so can everyone else. (And, yes, all my web sites, from static through e-commerce, are, too).

        Comment

        • acoder
          Recognized Expert MVP
          • Nov 2006
          • 16032

          #19
          Originally posted by drhowarddrfine
          You can see here that Firefox is more up to "doing" than IE is.
          Opera is surprisingly bad (almost as bad as IE), but all browsers need to improve. That will probably come over time.

          Comment

          • acoder
            Recognized Expert MVP
            • Nov 2006
            • 16032

            #20
            Originally posted by drhowarddrfine
            I can't speak for editor or even execCommand. I can only say that editors are going to have to learn to follow the rules just like we web developers do.
            Unfortunately, deuce789 is correct when it comes to the output produced by browsers. See the test link.

            Comment

            • acoder
              Recognized Expert MVP
              • Nov 2006
              • 16032

              #21
              Originally posted by deuce789
              That adding in a little attribute to fix an IE bug, that in no way affects any browsers in a bad way really isnt a big deal at all.
              I haven't really worked with execCommand and WYSIWYG much. Do you know if this attribute can be set using JavaScript?

              Comment

              • deuce789
                New Member
                • Aug 2007
                • 31

                #22
                Yes, it can (with setAttribute) anyway :-)

                Comment

                • acoder
                  Recognized Expert MVP
                  • Nov 2006
                  • 16032

                  #23
                  Originally posted by deuce789
                  Yes, it can (with setAttribute) anyway :-)
                  Thanks! Maybe that would be better to keep everyone happy.

                  Comment

                  • drhowarddrfine
                    Recognized Expert Expert
                    • Sep 2006
                    • 7434

                    #24
                    I have a feeling deuce and I were not quite talking about the same thing. Since I'm more of the html/css guy, I spoke more of that type of validation than anything to do with javascript.

                    Comment

                    Working...