Bug 137015

Summary: Add support for is<HTML*Element>() for type checking
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: DOMAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: benjamin, cmarcelo, commit-queue, darin, esprehn+autocc, kangil.han, kling, koivisto, rniwa
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 136839    
Bug Blocks: 137058, 137068, 137103    
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch
none
Patch none

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.