[Webkit-unassigned] [Bug 25398] New: throw error on document.createElement("plaintext")

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Apr 25 16:04:45 PDT 2009


https://bugs.webkit.org/show_bug.cgi?id=25398

           Summary: throw error on document.createElement("plaintext")
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: PC
        OS/Version: All
            Status: UNCONFIRMED
          Severity: Minor
          Priority: P5
         Component: HTML DOM
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: bugzilla at eligrey.com


I recommend that an error be thrown when document.createElement("plaintext") is
run. It is impossible to append a <plaintext> tag into a document without
messing up everything. Firefox actually ends it and puts a </plaintext> tag at
the end (this will do nothing if you made it with innerHTML) which should just
add the content, "</plaintext>", to the tag's text and not end it, as the end
of the document is a <plaintext>'s "ending tag".

I have never seen any scripts that progmatically create plaintext tags so it
would be best to throw an error. Under the unlikely chance that there is an
important website that actually does this, then just remove the ending tag from
the output and make it's textContent be everything after it. Appending more
elements to the documentElement should then just add to the plaintext element's
textContent.

Every other browser does the same but that doesn't mean that it makes any sense
to do so.

Reproducible: Always

Steps to Reproduce:
1. document.documentElement.appendChild(document.createElement("plaintext"))
2.
document.documentElement.appendChild(document.createElement("div")).innerHTML =
"<em>This shouldn't have emphasis (but it does).</em>"



Workaround: Use <pre> or <blockcode> (only use <blockcode> in XHTML2).


-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.


More information about the webkit-unassigned mailing list