Bug 80229

Summary: WebKit needs toHTMLUnknownElement and isUnknown() for sanity check.
Product: WebKit Reporter: Hajime Morrita <morrita>
Component: DOMAssignee: Hajime Morrita <morrita>
Status: RESOLVED FIXED    
Severity: Normal CC: webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 79935    
Attachments:
Description Flags
Patch
none
Patch
none
Patch for landing none

Hajime Morrita
Reported 2012-03-04 17:07:14 PST
Sometimes WebCore cast elements to HTMLUnknownElement. But it can cause a trouble which is hard to diagnose. We can add some mechanism to detect such wrong usages.
Attachments
Patch (4.31 KB, patch)
2012-03-04 17:38 PST, Hajime Morrita
no flags
Patch (4.33 KB, patch)
2012-03-04 17:52 PST, Hajime Morrita
no flags
Patch for landing (4.32 KB, patch)
2012-03-04 19:00 PST, Hajime Morrita
no flags
Hajime Morrita
Comment 1 2012-03-04 17:38:38 PST
Kent Tamura
Comment 2 2012-03-04 17:45:31 PST
Comment on attachment 130037 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=130037&action=review > Source/WebCore/html/HTMLUnknownElement.h:57 > + ASSERT(!element || element->isHTMLUnknownElement()); Why this function accept element==0 though toMathMLElement() and toSVGElement() don't?
Hajime Morrita
Comment 3 2012-03-04 17:52:27 PST
Hajime Morrita
Comment 4 2012-03-04 17:54:09 PST
Comment on attachment 130037 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=130037&action=review Kent-san, thanks for the quick response! Could you taker another look? I updated it. >> Source/WebCore/html/HTMLUnknownElement.h:57 >> + ASSERT(!element || element->isHTMLUnknownElement()); > > Why this function accept element==0 though toMathMLElement() and toSVGElement() don't? Good catch! Actually this one is correct. We want to allow null to be casted.
Kent Tamura
Comment 5 2012-03-04 17:56:19 PST
Comment on attachment 130039 [details] Patch ok
Hajime Morrita
Comment 6 2012-03-04 19:00:34 PST
Created attachment 130042 [details] Patch for landing
WebKit Review Bot
Comment 7 2012-03-04 20:09:55 PST
Comment on attachment 130042 [details] Patch for landing Clearing flags on attachment: 130042 Committed r109702: <http://trac.webkit.org/changeset/109702>
WebKit Review Bot
Comment 8 2012-03-04 20:10:00 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.