Bug 137199

Summary: Use the new is<>() / downcast<>() for ShadowRoot and StyledElement
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: DOMAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 137056    
Bug Blocks:    
Attachments:
Description Flags
Patch none

Description Chris Dumez 2014-09-28 16:11:15 PDT
Use the new is<>() / downcast<>() for ShadowRoot and StyledElement.
Comment 1 Chris Dumez 2014-09-28 16:26:18 PDT
Created attachment 238830 [details]
Patch
Comment 2 Darin Adler 2014-09-28 17:56:47 PDT
Comment on attachment 238830 [details]
Patch

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

> Source/WebCore/css/StyleResolver.cpp:391
> +    m_styledElement = element && is<StyledElement>(element) ? downcast<StyledElement>(element) : nullptr;

I’m not going to comment on every one, since this is the same issue as in other patches. There is no need for the null check here since the is<StyledElement> function works fine on null, returning false. And the downcast should be done on *element, with a & before downcast. This pattern repeats throughout this patch in variants.
Comment 3 WebKit Commit Bot 2014-09-29 10:35:34 PDT
Comment on attachment 238830 [details]
Patch

Clearing flags on attachment: 238830

Committed r174069: <http://trac.webkit.org/changeset/174069>
Comment 4 WebKit Commit Bot 2014-09-29 10:35:38 PDT
All reviewed patches have been landed.  Closing bug.