Bug 80229 - WebKit needs toHTMLUnknownElement and isUnknown() for sanity check.
Summary: WebKit needs toHTMLUnknownElement and isUnknown() for sanity check.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Hajime Morrita
URL:
Keywords:
Depends on:
Blocks: 79935
  Show dependency treegraph
 
Reported: 2012-03-04 17:07 PST by Hajime Morrita
Modified: 2012-03-04 20:10 PST (History)
1 user (show)

See Also:


Attachments
Patch (4.31 KB, patch)
2012-03-04 17:38 PST, Hajime Morrita
no flags Details | Formatted Diff | Diff
Patch (4.33 KB, patch)
2012-03-04 17:52 PST, Hajime Morrita
no flags Details | Formatted Diff | Diff
Patch for landing (4.32 KB, patch)
2012-03-04 19:00 PST, Hajime Morrita
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Hajime Morrita 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.
Comment 1 Hajime Morrita 2012-03-04 17:38:38 PST
Created attachment 130037 [details]
Patch
Comment 2 Kent Tamura 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?
Comment 3 Hajime Morrita 2012-03-04 17:52:27 PST
Created attachment 130039 [details]
Patch
Comment 4 Hajime Morrita 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.
Comment 5 Kent Tamura 2012-03-04 17:56:19 PST
Comment on attachment 130039 [details]
Patch

ok
Comment 6 Hajime Morrita 2012-03-04 19:00:34 PST
Created attachment 130042 [details]
Patch for landing
Comment 7 WebKit Review Bot 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>
Comment 8 WebKit Review Bot 2012-03-04 20:10:00 PST
All reviewed patches have been landed.  Closing bug.