Bug 137015 - Add support for is<HTML*Element>() for type checking
Summary: Add support for is<HTML*Element>() for type checking
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords:
Depends on: 136839
Blocks: 137058 137068 137103
  Show dependency treegraph
 
Reported: 2014-09-22 16:37 PDT by Chris Dumez
Modified: 2014-09-24 20:31 PDT (History)
9 users (show)

See Also:


Attachments
Patch (15.59 KB, patch)
2014-09-22 17:39 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (17.41 KB, patch)
2014-09-22 18:17 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (18.22 KB, patch)
2014-09-22 18:21 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (18.24 KB, patch)
2014-09-22 20:26 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (18.25 KB, patch)
2014-09-23 19:48 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2014-09-22 16:37:16 PDT
Add support for is<HTML*Element>() for casting, while supporting the legacy toHTML*Element() form until the code base is fully ported to the new type checking helper.
Comment 1 Chris Dumez 2014-09-22 17:39:14 PDT
Created attachment 238507 [details]
Patch
Comment 2 Chris Dumez 2014-09-22 18:17:30 PDT
Created attachment 238509 [details]
Patch
Comment 3 Chris Dumez 2014-09-22 18:21:07 PDT
Created attachment 238510 [details]
Patch
Comment 4 Chris Dumez 2014-09-22 20:26:28 PDT
Created attachment 238513 [details]
Patch
Comment 5 Benjamin Poulain 2014-09-23 18:56:41 PDT
Comment on attachment 238513 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=238513&action=review

rs=me

> Source/WebCore/dom/Element.h:679
> +// Type checking function for Elements, to use before casting
> +// with downcast<>().

This should be on a one line.

> Source/WebCore/dom/make_names.pl:647
> +    static bool checkTagName(const HTMLElement& element) { return !element.isHTMLUnknownElement() && element.hasTagName($parameters{namespace}Names::${name}Tag); }

It's really a shame we need isHTMLUnknownElement(). It'd be nice if you find a way to remove it.
Comment 6 Chris Dumez 2014-09-23 19:48:50 PDT
Created attachment 238580 [details]
Patch
Comment 7 WebKit Commit Bot 2014-09-23 20:31:55 PDT
Comment on attachment 238580 [details]
Patch

Clearing flags on attachment: 238580

Committed r173907: <http://trac.webkit.org/changeset/173907>
Comment 8 WebKit Commit Bot 2014-09-23 20:32:01 PDT
All reviewed patches have been landed.  Closing bug.